problem in coupling heat equation and Navier-Stockes

Numerical methods and mathematical models of Elmer
Post Reply
julien givernaud
Posts: 86
Joined: 18 Nov 2014, 18:18
Antispam: Yes

problem in coupling heat equation and Navier-Stockes

Post by julien givernaud »

Hi,

I have a problem for coupling heat equation and Navier Stockes equation.

I have 3 body forces
- 1 for exciting a coil in MagnetoDynamics2DHarmonic solver
- 1 for calculate the stiring and joule heating of a metallic liquid charge
- 1 for Joule heating in a solid body

3 equations are used to calculate on different locations physics.
- equation 1 : Induction in bodies 1 and 4 (air and coil)
- equation 2 : Induction + Joule heating in body 2 (solid graphite plate)
- equation 3: Induction + Joule heating + stiring in body 3 (silicon melt): if I turned on Convection = Computed or not in the third equation, it changes nothing!

Code: Select all

Body Force 1
Current Density = 10e6
End

Body Force 2
Joule Heat = Logical True
BMAG = Variable b re 1, b re 2
Real MATC "sqrt(tx(0)^2+tx(1)^2)"
stiring = Variable BMAG, Coordinate 1
Real MATC "-1*(tx(0)^2/(2*4*pi*1e-7*0.003355)*exp(-0.01*(0.1-tx(1))/0.003355))"
Flow Bodyforce 1 = Variable BMAG, Coordinate 1
Real MATC "-1*((tx(0)^2/(2*4*pi*1e-7*0.003355)*exp(-0.01*(0.1-tx(1))/0.003355))/1000)"
End

Body Force 3
Joule Heat = Logical True
End

Body 3
Name = "silicon"
Equation = 3
Material = 2
Body Force = 2
Initial condition = 1
End

Body 2
Name = "Graphite"
Equation = 2
Material = 3
Body Force = 3
Initial condition = 2
End

Body 4
Name = "Coil"
Equation = 1
Material = 1
Body Force = 1
End

Body 1
Name = "Air"
Equation = 1
Material = 1
End

Equation 1
Name = "Induction -> air + coil"
Angular Frequency = 9.424778e4
Active Solvers(3) = 1 2 4
End

Equation 2
Name = "heating -> graphite"
Angular Frequency = 9.424778e4
Active Solvers(4) = 1 2 4 5
End

Equation 3
Name = "volume force + heating -> silicium"
Angular Frequency = 9.424778e4
Convection = Computed
Active Solvers(5) = 1 2 3 4 5
End
My heat and Navier-Stockes solvers look like this:

Code: Select all

Solver 3
  Equation = Navier-Stokes
  Variable = Flow Solution[Velocity:2 Pressure:1]
  Procedure = "FlowSolve" "FlowSolver"
  Calculate Loads = True
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Solver 5
  Equation = Heat Equation
  Procedure = "HeatSolve" "HeatSolver"
  Calculate Loads = True
  Variable = Temperature
  Exec Solver = After Timestep
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Velocities fields are well calculated.
Temperature fields are the same if I have no stiring, the coupling of physics is not good!

Where is my mistake?

Regards

Julien
julien givernaud
Posts: 86
Joined: 18 Nov 2014, 18:18
Antispam: Yes

Re: problem in coupling heat equation and Navier-Stockes

Post by julien givernaud »

See also the Simulation part

Code: Select all

Simulation
Max Output Level = 5
Coordinate System = "Axi Symmetric"
Simulation Type = Steady State
Steady State Max Iterations = 20
End
I have put Steady State Max Iterations > 1, but no coupling occurs....

Some help will be welcome, thank you (Peter?)

Julien
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: problem in coupling heat equation and Navier-Stockes

Post by raback »

Hi, It may be that you need a "NS Convect = True" flag in Equation block to account for the convective heat transfer. Didn't check documentation though. And of course you also need some "Heat Capacity". Don't know how well this is compatible with phase change if your heat capacity is the derivative of enthalpy. -Peter
julien givernaud
Posts: 86
Joined: 18 Nov 2014, 18:18
Antispam: Yes

Re: problem in coupling heat equation and Navier-Stockes

Post by julien givernaud »

Hi,

Ok everything seems all right now, magnetic stirng is exactly the same as comsol, coupling is ok (heat capacity was missing, I didn't know that this data was usefull in stationnary problem...)
I have try to add phase change (the enthalpy method with change in viscosity) and it is works! Only some convergence problems because I am not yet familiar with elmer solvers. Direct solvers make the job.
I attach a comparison between Elmer and Comsol results.

Regards

Julien
Attachments
Elmer_Comsol_melting_stiring_forum.pdf
(720.27 KiB) Downloaded 499 times
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: problem in coupling heat equation and Navier-Stockes

Post by raback »

Hi Julien

I must again applaud you for the diligent comparison in these very nontrivial cases. Your work should really get people interested in Elmer in this field. Maybe there could be a phase change community on the rise...

-Peter
julien givernaud
Posts: 86
Joined: 18 Nov 2014, 18:18
Antispam: Yes

Re: problem in coupling heat equation and Navier-Stockes

Post by julien givernaud »

Thank you Peter,

I hope so. I will try to do it in transient study now and maybe add radiation if I have time.
My final goal is to make this phase change model with ALE in transient and add transport species with an equation at the interface solid-liquid to describe segregation purification process. Lot of work remaining...

Peter, is it possible to plot the convergence error during or after computation without GUI?

Have a nice day

Julien
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: problem in coupling heat equation and Navier-Stockes

Post by raback »

Hi Julien

At least you can plot "coupled iter" and various solver norms etc. with SaveScalars. Reading this content the in Matlab etc. could give you what you need. There might be "nonlin change" as well. Don't remember by heart. Maybe you can check the operators in SaveData / SavaScalars solver.

-Peter
julien givernaud
Posts: 86
Joined: 18 Nov 2014, 18:18
Antispam: Yes

Re: problem in coupling heat equation and Navier-Stockes

Post by julien givernaud »

Ok I will have a look on this.

I think that I have a bigger problem now. Is it possible to make a transient study with MgDyn2DHarmonic solver?
On the manual it seems that yes (p.92 In addition to performing the computations in the time domain the analogous version of the equations may also be solved in the frequency domain), but I found no example on github.
I don't know how to thread my problem. I have to use Joule heating and stiring body force (from harmonic study) in a transient study for heat transfer and NS equations. Comsol can handle this but I don't know exactly how.
Elmer can do something like that?

Regards

Julien
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: problem in coupling heat equation and Navier-Stockes

Post by annier »

julien givernaud wrote: I attach a comparison between Elmer and Comsol results.
Thank you Julien for your admirable efforts.
We are learning a lot from your works.

Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Post Reply