## HARTMANN PROBLEM

Numerical methods and mathematical models of Elmer
kevinarden
Posts: 1171
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: HARTMANN PROBLEM

Although I am not expert in electrical nor magnetic, Solid mechanics is my field. Not entirely certain this is correctly done, but it did solve.
I added two more solvers to create an electrical field and calculate it.
ycase.sif
electrical field.png
raback
Posts: 4147
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: HARTMANN PROBLEM

Hi

I found a reference "Fluid Dynamics and Heat Transfer in a Hartmann Flow" by Timothy Richard DePuy (use google to find the haartman_flow.pdf). I guess it is close what you're trying to achive.

I would approach the problem in two phases:

1) Get realistic magnetic and electric fields using the MagnetoDynamics solver. You can solve for electric potential and magnetic vector potential using the same solver. For me an open question is mainly what kind of BCs to use for the vector potential AV {e}. After solution you should use the postprocessing solver to verify the fields and compute nodal forces.

2) Get the Navier-Stokes equation to work with a realistic body force as the load on the r.h.s. If it converges well then you should be able to get it to converge with the computed load too.

Then after succesfully solving these combine the models in a hierarchical manner into one sif file. Probably the most exotic part will be the nodal forces in style

Code: Select all

``````Body Force 1
Flow Bodyforce 1 = Equals "nodal force 1"
Flow Bodyforce 2 = Equals "nodal force 2"
...
``````
Now you don't have any forcing as far as I can see.

-Peter

PS. With closer inspection I guess the setup may actually be quite close to the desired one. Your BCs seem legit and you have some forcing with external pressure. Also set the tangential velocity components in inlet and outlet to zero. When you get some sensible nodal forces you can strip away the external pressure and replace it with the above expression.
Andrea_P
Posts: 119
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: HARTMANN PROBLEM

Hi,
Thank you so much for your answers. I will try and I will report my results here.
Regards,
Andrea
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
Andrea_P
Posts: 119
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: HARTMANN PROBLEM

Although I am not expert in electrical nor magnetic, Solid mechanics is my field. Not entirely certain this is correctly done, but it did solve.
I added two more solvers to create an electrical field and calculate it.
Hi Kevin,
I have applied your case.sif and I could create the electric field of my interest. Now, the problem requires the application of an external magnetic field. I have put it as in the case.sif, but it does not give me the right value when I open the output in Paraview. Have you got any idea about solving this problem? I have removed the magnetic solvers. After all, I don't want to analyze the problem from a magnetic point of view because my interest is only the effect of this field on the velocity.

Code: Select all

``````Material 1
Name = "zinco"
Electric Conductivity = 1.6e7
Density = 6500
Viscosity = 0.0029
Relative Permeability = 1
Relative Permittivity = 1
Applied Magnetic Field 1 = 0
Applied Magnetic Field 2 = -0.02
Applied Magnetic Field 3 = 0
End
``````
Regards,
Andrea
Attachments
case.sif
beam3d.grd
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
kevinarden
Posts: 1171
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: HARTMANN PROBLEM

When I use your beam3d.grd to generate mesh, the boundary numbers are different than in the sif. I use ElmerGUI to load the mesh to visually verify body numbers and boundary numbers. The sif is set up to flow in the x direction with the charge plates in the y direction
case.sif
kishpishar
Posts: 54
Joined: 17 Jun 2015, 10:04
Antispam: Yes

### Re: HARTMANN PROBLEM

Hi Andrea,

Isn't this a standard Magneto-Hydrodynamics problem which you are trying to solve - where you are only interested in the effect of external magnetic field on the flow in the channel? In that case, Navier-Stokes along with the old "Magnetic field solver" would be perhaps good enough. I once tried an MHD problem of the flow of a magnetic liquid under the application of a steady external magnetic field with this approach and I think the solution was reasonable.

If this is what you are looking for, let me know I can look up the old files.

-Kumar
Andrea_P
Posts: 119
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: HARTMANN PROBLEM

Isn't this a standard Magneto-Hydrodynamics problem which you are trying to solve - where you are only interested in the effect of external magnetic field on the flow in the channel? In that case, Navier-Stokes along with the old "Magnetic field solver" would be perhaps good enough. I once tried an MHD problem of the flow of a magnetic liquid under the application of a steady external magnetic field with this approach and I think the solution was reasonable.
Hi Kumar,
Regards,
Andrea
Last edited by Andrea_P on 12 May 2021, 13:06, edited 1 time in total.
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
Andrea_P
Posts: 119
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: HARTMANN PROBLEM

kevinarden wrote: 12 May 2021, 12:25 When I use your beam3d.grd to generate mesh, the boundary numbers are different than in the sif. I use ElmerGUI to load the mesh to visually verify body numbers and boundary numbers. The sif is set up to flow in the x direction with the charge plates in the y direction

case.sif
Hi Kevin,
The geometry is explained in my first post of this discussion, for this reason, I edited the case.sif.
Regards,
Andrea
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
kishpishar
Posts: 54
Joined: 17 Jun 2015, 10:04
Antispam: Yes

### Re: HARTMANN PROBLEM

Hi Andrea,

Here are the relevant sections in my case that may be applicable to your problem. Please note that I preferred a transient approach for a smoother convergence behavior.

Simulation
Max Output Level = 5
Coordinate System = Cartesian
Coordinate Mapping(3) = 1 2 3
Simulation Type = Transient
Steady State Max Iterations = 1
Output Intervals = 2
Timestepping Method = BDF
BDF Order = 1
Timestep Intervals = 100
Timestep Sizes = 1
Solver Input File = case.sif
Post File = case.vtu
End

Constants

End

Body 1
Target Bodies(1) = 1
Name = "Body 1"
Equation = 1
Material = 1
Body Force = 1
Initial condition = 1
End

Solver 1
Equation = Navier-Stokes
Variable = Flow Solution[Velocity:3 Pressure:1]
Procedure = "FlowSolve" "FlowSolver"
Stabilize = True
Optimize Bandwidth = True
Div Discretization = True
Steady State Convergence Tolerance = 1.0e-3
Nonlinear System Convergence Tolerance = 1.0e-3
Nonlinear System Max Iterations = 1
Nonlinear System Newton After Iterations = 3
Nonlinear System Newton After Tolerance = 0.0
Nonlinear System Relaxation Factor = 0.5
Linear System Solver = Iterative
Linear System Iterative Method = idrs
Linear System Max Iterations = 2000
Linear System Convergence Tolerance = 1.0e-3
Linear System Preconditioning = ILU0
Linear System Abort Not Converged = False
Linear System Residual Output = 1
Linear System Precondition Recompute = 1
End

Solver 2
Equation = "Magnetic field solver"
Variable = Magnetic Field
Procedure = "MagneticSolve" "MagneticSolver"
Variable DOFs = 3
Exported Variable 1 = -dofs 3 lorentz force
Stabilize = True
Optimize Bandwidth = True
Steady State Convergence Tolerance = 1.0e-3
Nonlinear System Convergence Tolerance = 1.0e-4
Nonlinear System Max Iterations = 1
Nonlinear System Newton After Iterations = 3
Nonlinear System Newton After Tolerance = 0.0
Nonlinear System Relaxation Factor = 0.5
Linear System Solver = Iterative
Linear System Iterative Method = idrs
Linear System Max Iterations = 2000
Linear System Convergence Tolerance = 1.0e-4
Linear System Preconditioning = ILU0
Linear System Abort Not Converged = False
Linear System Residual Output = 1
Linear System Precondition Recompute = 1
End

Equation 1
Name = "Equation 1"
Active Solvers(2) = 1 2
End

Body Force 1
Lorentz Force = Logical True
End

Material 1
Name = "LiquidMetal"
! Viscosity Model = K-Epsilon
Viscosity = 0.007
Density = 7000
Magnetic Permeability = 1.2e-6
Electric Conductivity = 3.0e6
Applied Magnetic Field 2 = 0.25
End

Initial Condition 1
Name = "InitialCondition 1"
Velocity 2 = 0
Velocity 1 = 0
Velocity 3 = 0
End

Other than that, I added the following section to every wall boundary (I have neglected the induced mag. field on boundaries):

Magnetic Field 1 = Real 0
Magnetic Field 2 = Real 0
Magnetic Field 3 = Real 0

You can try if the approach works.

-Kumar
Andrea_P
Posts: 119
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

### Re: HARTMANN PROBLEM

kishpishar wrote: 12 May 2021, 14:20 Hi Andrea,

Here are the relevant sections in my case that may be applicable to your problem. Please note that I preferred a transient approach for a smoother convergence behavior.

Simulation
Max Output Level = 5
Coordinate System = Cartesian
Coordinate Mapping(3) = 1 2 3
Simulation Type = Transient
Steady State Max Iterations = 1
Output Intervals = 2
Timestepping Method = BDF
BDF Order = 1
Timestep Intervals = 100
Timestep Sizes = 1
Solver Input File = case.sif
Post File = case.vtu
End

Constants

End

Body 1
Target Bodies(1) = 1
Name = "Body 1"
Equation = 1
Material = 1
Body Force = 1
Initial condition = 1
End

Solver 1
Equation = Navier-Stokes
Variable = Flow Solution[Velocity:3 Pressure:1]
Procedure = "FlowSolve" "FlowSolver"
Stabilize = True
Optimize Bandwidth = True
Div Discretization = True
Steady State Convergence Tolerance = 1.0e-3
Nonlinear System Convergence Tolerance = 1.0e-3
Nonlinear System Max Iterations = 1
Nonlinear System Newton After Iterations = 3
Nonlinear System Newton After Tolerance = 0.0
Nonlinear System Relaxation Factor = 0.5
Linear System Solver = Iterative
Linear System Iterative Method = idrs
Linear System Max Iterations = 2000
Linear System Convergence Tolerance = 1.0e-3
Linear System Preconditioning = ILU0
Linear System Abort Not Converged = False
Linear System Residual Output = 1
Linear System Precondition Recompute = 1
End

Solver 2
Equation = "Magnetic field solver"
Variable = Magnetic Field
Procedure = "MagneticSolve" "MagneticSolver"
Variable DOFs = 3
Exported Variable 1 = -dofs 3 lorentz force
Stabilize = True
Optimize Bandwidth = True
Steady State Convergence Tolerance = 1.0e-3
Nonlinear System Convergence Tolerance = 1.0e-4
Nonlinear System Max Iterations = 1
Nonlinear System Newton After Iterations = 3
Nonlinear System Newton After Tolerance = 0.0
Nonlinear System Relaxation Factor = 0.5
Linear System Solver = Iterative
Linear System Iterative Method = idrs
Linear System Max Iterations = 2000
Linear System Convergence Tolerance = 1.0e-4
Linear System Preconditioning = ILU0
Linear System Abort Not Converged = False
Linear System Residual Output = 1
Linear System Precondition Recompute = 1
End

Equation 1
Name = "Equation 1"
Active Solvers(2) = 1 2
End

Body Force 1
Lorentz Force = Logical True
End

Material 1
Name = "LiquidMetal"
! Viscosity Model = K-Epsilon
Viscosity = 0.007
Density = 7000
Magnetic Permeability = 1.2e-6
Electric Conductivity = 3.0e6
Applied Magnetic Field 2 = 0.25
End

Initial Condition 1
Name = "InitialCondition 1"
Velocity 2 = 0
Velocity 1 = 0
Velocity 3 = 0
End

Other than that, I added the following section to every wall boundary (I have neglected the induced mag. field on boundaries):

Magnetic Field 1 = Real 0
Magnetic Field 2 = Real 0
Magnetic Field 3 = Real 0

You can try if the approach works.

-Kumar
Thanks Kumar. With Mesh did you use?
Regards,
Andrea
Attachments
magnetic_field.png
Unfortunately the magnetic field is still very far from that I have imposed.