## MHD: HARTMANN PROBLEM 2D

Numerical methods and mathematical models of Elmer
raback
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: MHD: HARTMANN PROBLEM 2D

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
Andrea_P
Posts: 166
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: MHD: HARTMANN PROBLEM 2D

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
Attachments
beam.grd
velocity.png (14.8 KiB) Viewed 462 times
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
raback
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: MHD: HARTMANN PROBLEM 2D

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
Attachments
ycase.sif
Command file
beam.grd
Mesh file
Andrea_P
Posts: 166
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: MHD: HARTMANN PROBLEM 2D

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
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
raback
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: MHD: HARTMANN PROBLEM 2D

It, may be added as a test. Just would like to add a constraint for the total flow before that. -Peter
Andrea_P
Posts: 166
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: MHD: HARTMANN PROBLEM 2D

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
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
Andrea_P
Posts: 166
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: MHD: HARTMANN PROBLEM 2D

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
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
raback
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: MHD: HARTMANN PROBLEM 2D

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 (68.37 KiB) Viewed 339 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.
Andrea_P
Posts: 166
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: MHD: HARTMANN PROBLEM 2D

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
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
Andrea_P
Posts: 166
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: MHD: HARTMANN PROBLEM 2D

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?
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS