Page 3 of 3

Re: MHD: HARTMANN PROBLEM 2D

Posted: 24 May 2021, 13:58
by raback
Hi

Do you have mesh dense enough to resolve the boundary layers? Your picture looks very coarse. I think Kevin got good results with a fine enough mesh. Isn't this the same problem?

-Peter

Re: MHD: HARTMANN PROBLEM 2D

Posted: 24 May 2021, 15:32
by Andrea_P
raback wrote: 24 May 2021, 13:58 Hi

Do you have mesh dense enough to resolve the boundary layers? Your picture looks very coarse. I think Kevin got good results with a fine enough mesh. Isn't this the same problem?

-Peter
Hi Peter,
Yes, it is the same problem. Actually, the mesh is coarse. Now I am using the last Kevin's mesh and the maximum value of the velocity is always the same.
-Andrea

Re: MHD: HARTMANN PROBLEM 2D

Posted: 02 Jun 2021, 18:05
by raback
Hi,

I had some time to study this interesting problem. Convergence depends quite a bit on the strength of the coupling. It is difficult to get good convergence wit large magnetic fields without some relaxation.

To make the study somewhat faster I use only 2 elements in x-direction + periodic BCs. This way I can iterate a converged solution of the profile in seconds. The price is that the Ha number can only be defined after the simulation. We should add a piece of code to constrain the average velocity, now an offset of pressure is used. Still, this can be used to ensure the correctness of the coupling. I hope it helps.

Plot the output profile with

Code: Select all

load f.dat
plot(f(:,5),f(:,13))


-Peter

Re: MHD: HARTMANN PROBLEM 2D

Posted: 02 Jun 2021, 18:17
by Andrea_P
raback wrote: 02 Jun 2021, 18:05 Hi,

I had some time to study this interesting problem. Convergence depends quite a bit on the strength of the coupling. It is difficult to get good convergence wit large magnetic fields without some relaxation.

To make the study somewhat faster I use only 2 elements in x-direction + periodic BCs. This way I can iterate a converged solution of the profile in seconds. The price is that the Ha number can only be defined after the simulation. We should add a piece of code to constrain the average velocity, now an offset of pressure is used. Still, this can be used to ensure the correctness of the coupling. I hope it helps.

Plot the output profile with

Code: Select all

load f.dat
plot(f(:,5),f(:,13))


-Peter
Hi Peter,
Thanks a lot for your precious time, Peter, I try it right now. Will it be added to the Elmer tests collection on GitHub?
Regards,
Andrea

Re: MHD: HARTMANN PROBLEM 2D

Posted: 02 Jun 2021, 18:21
by raback
It, may be added as a test. Just would like to add a constraint for the total flow before that. -Peter

Re: MHD: HARTMANN PROBLEM 2D

Posted: 02 Jun 2021, 18:28
by Andrea_P
raback wrote: 02 Jun 2021, 18:21 It, may be added as a test. Just would like to add a constraint for the total flow before that. -Peter
That's perfect Peter, I am really happy about this possible publication. Now I am trying to couple the Level set with the Magnetic solver used in this Hartmann problem example.
Regards,
Andrea

Re: MHD: HARTMANN PROBLEM 2D

Posted: 02 Jun 2021, 18:53
by Andrea_P
raback wrote: 02 Jun 2021, 18:05 Hi,

I had some time to study this interesting problem. Convergence depends quite a bit on the strength of the coupling. It is difficult to get good convergence wit large magnetic fields without some relaxation.

To make the study somewhat faster I use only 2 elements in x-direction + periodic BCs. This way I can iterate a converged solution of the profile in seconds. The price is that the Ha number can only be defined after the simulation. We should add a piece of code to constrain the average velocity, now an offset of pressure is used. Still, this can be used to ensure the correctness of the coupling. I hope it helps.

Plot the output profile with

Code: Select all

load f.dat
plot(f(:,5),f(:,13))


-Peter
How do I have to write this code?

Code: Select all

load f.dat
plot(f(:,5),f(:,13))

Can't I use Paraview?
Regards,
Andrea

Re: MHD: HARTMANN PROBLEM 2D

Posted: 15 Jun 2021, 17:31
by raback
Hi

This case inspired me to implement integral constraint for any field. So the idea is that on a given boundary you can define \int f dA = F(t,...). This comes handy in this case as we can set the average inlet velocity to one without knowing the profile. We don't even need long tubes to develop the flow. It can be quite a short piece of tube.

Here is the compute profile with different values of the nondimensional parameter.
HartmannProfile.PNG
HartmannProfile.PNG (68.37 KiB) Viewed 4888 times
The case was just added as a test case here:
https://github.com/ElmerCSC/elmerfem/tr ... ntHartmann

This case can be used to study the severity of the boundary layer challenge and difficulty of relaxation. The larger the external magnetic force the smaller the relaxation factor must be. These observations may be good to study before going into more complicated cases.

-Peter

PS. The code for integral constraint was just committed so you need to recompile or wait for the new builds to appear.

Re: MHD: HARTMANN PROBLEM 2D

Posted: 15 Jun 2021, 17:51
by Andrea_P
raback wrote: 15 Jun 2021, 17:31 Hi

This case inspired me to implement integral constraint for any field. So the idea is that on a given boundary you can define \int f dA = F(t,...). This comes handy in this case as we can set the average inlet velocity to one without knowing the profile. We don't even need long tubes to develop the flow. It can be quite a short piece of tube.

Here is the compute profile with different values of the nondimensional parameter.
HartmannProfile.PNG

The case was just added as a test case here:
https://github.com/ElmerCSC/elmerfem/tr ... ntHartmann

This case can be used to study the severity of the boundary layer challenge and difficulty of relaxation. The larger the external magnetic force the smaller the relaxation factor must be. These observations may be good to study before going into more complicated cases.

-Peter

PS. The code for integral constraint was just committed so you need to recompile or wait for the new builds to appear.
Hi Peter,
Extraordinary work!!! Can the Magnetic solver used for this case deal with function to define the magnetic field? I have tried with a function like this:

Code: Select all

Applied Magnetic Field 1 = Variable Coordinate 2
     Real MATC " B1*exp(-(tx-0.01)^2/(2*(1002)^2))"
Unfortunately, It seems not to work.
Regards,
Andrea

Re: MHD: HARTMANN PROBLEM 2D

Posted: 17 Jun 2021, 17:25
by Andrea_P
raback wrote: 15 Jun 2021, 17:31 Hi

This case inspired me to implement integral constraint for any field. So the idea is that on a given boundary you can define \int f dA = F(t,...). This comes handy in this case as we can set the average inlet velocity to one without knowing the profile. We don't even need long tubes to develop the flow. It can be quite a short piece of tube.

Here is the compute profile with different values of the nondimensional parameter.
HartmannProfile.PNG

The case was just added as a test case here:
https://github.com/ElmerCSC/elmerfem/tr ... ntHartmann

This case can be used to study the severity of the boundary layer challenge and difficulty of relaxation. The larger the external magnetic force the smaller the relaxation factor must be. These observations may be good to study before going into more complicated cases.

-Peter

PS. The code for integral constraint was just committed so you need to recompile or wait for the new builds to appear.
What does integral BC velocity mean?