Cooling in air : Heat Transfer and Navier-Stokes

General discussion about Elmer
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

Cooling in air : Heat Transfer and Navier-Stokes

Post by Antourloupe82 »

Dear all,

In order to familiarize myself with ELMER, I would like determine the velocity field, the pressure field and the central temperature as a function of the time of a small metallic sphere cooling in a large box filled with air. The metallic sphere of radius R=30cm is made of aluminum (initial temperature : Ti = 400 K) is enclosed in a large cubic box (L=1m) filled with air (initial temperature : T0=300K). The box is supposed thermally isolated (q=0 at the six edges). The sphere is placed at the center of the box (see the attachement) and I need to take into account the natural convection between the sphere and air.

Image

I would like to visualize the convection effects in air like in this nice simulation https://www.youtube.com/watch?v=Zr8WbV8F_5g.

This is my case.sif. The heat Transfer equation is used for the sphere and Navier-Stokes is used for the cube filled with air...Unfortunately, the solution obtained is not consistent ! Also, the examples given by Elmer don't help me...In this system, how to couple the Heat Transfer and Navier-Stokes equation to solve my problem ? By advance, thank you for your help !

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

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

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

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

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

Solver 1
  Equation = Heat Equation
  Procedure = "HeatSolve" "HeatSolver"
  Variable = Temperature
  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
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  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 2
  Equation = Navier-Stokes
  Procedure = "FlowSolve" "FlowSolver"
  Variable = Flow Solution[Velocity:3 Pressure:1]
  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
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "Heat and Flow"
  NS Convect = False
  Active Solvers(2) = 1 2
End

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

Material 1
  Name = "Aluminium (generic)"
  Heat Conductivity = 237.0
  Youngs modulus = 70.0e9
  Mesh Poisson ratio = 0.35
  Heat Capacity = 897.0
  Density = 2700.0
  Poisson ratio = 0.35
  Sound speed = 5000.0
  Heat expansion Coefficient = 23.1e-6
End

Material 2
  Name = "Air (room temperature)"
  Heat Conductivity = 0.0257
  Heat Capacity = 1005.0
  Density = 1.205
  Relative Permittivity = 1.00059
  Viscosity = 1.983e-5
  Sound speed = 343.0
  Heat expansion Coefficient = 3.43e-3
End

Body Force 1
  Name = "Gravity"
  Flow Bodyforce 2 = -9.81
End

Initial Condition 1
  Name = "InitialTemperatureMetal"
  Temperature = 350
End

Initial Condition 2
  Name = "InitialTemperatureAir"
  Temperature = 300
End

Boundary Condition 1
  Target Boundaries(6) = 2 3 4 5 6 7 
  Name = "ThermalIsolation"
  Heat Flux = 0
End

Boundary Condition 2
  Target Boundaries(1) = 1 
  Name = "NoSlip"
  Noslip wall BC = True
End
Attachments
Cooling_sphere.png
Cooling_sphere.png (5.24 KiB) Viewed 10008 times
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by annier »

Hi Antourloupe82,
The coupling of Heat Solver and Navier stokes solvers are given in the test cases of Natural Convection.
https://github.com/ElmerCSC/elmerfem/bl ... n/case.sif
https://github.com/ElmerCSC/elmerfem/bl ... 2/case.sif

After you couple the two solvers in Equation section as:

Code: Select all

Equation 1
Active Solvers(2) = 1 2
End
,the important points in coupling is:
1.)If you need to perform weak coupling between Navier-Stokes and Heat Solver, then in Simulation section:

Code: Select all

Simulation
...
Steady State Max Iterations = 30  !Steady state max iterations between N-S and Heat Solver should be greater than 1
...
End
2.)If you need to perform hierarchial coupling between Heat Solver and Navier-Stokes , then in Simulation section:

Code: Select all

Simulation
...
Steady State Max Iterations = 1  !Steady state max iterations between N-S and Heat Solver should be  1
...
End
For present context, i guess you have to perform weak coupling as weak coupling is stronger than hierarchial coupling.

Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by Antourloupe82 »

Dear Anil,

Sorry for the late reply. Thanks for the advice and the test cases of natural convection. There are six files :

- CMakeLists.txt
- ELMERSOLVER_STARTINFO
- Makefile
- case.sif
- runtest.cmake
- square.grd

I understand case.sif and square.grd...but I'm a bit lost with all other files... what should I do ? I work on windows !

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

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by annier »

Hi Antourloupe82,
I work in Ubuntu 14.04 (Linux) and use ELmer NonGUI. For running test cases in WIndows, Matthias (username =mzenker) can give you the guidance.
For my context, in order to run the test case , the basic three files are used ( case.sif, ELMERSOLVER_STARTINFO, and square.grd).
square.grd = mesh file , and ELMERSOLVER_STARTINFO is the file having the name of solver input file (case.sif) written on it.

Steps for running a test case in Elmer NonGUI
1. Jump into the directory contain the files and convert .grd file into the Mesh folder named square.

Code: Select all

$ElmerGrid 1 2 square.grd -autoclean
2. Perform the ElmerSolver run

Code: Select all

$ElmerSolver
Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by mzenker »

Hi,

I cannot guide you in running the testcases since I have never used them. And I haven't compiled Elmer under Windoze for a loooong time...
I am sure someone from the Elmerteam (Juhani?) will be able to help you.

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

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by annier »

Hi Antourloupe82,
The tests in fem/tests/ dirrectory of Elmer are for Elmer NonGUI version. Anyone working for Elmer NonGUI version in Windows can help you in running them.
Have you tried this way in windows?
NonGUI (I don't know how it can be done exactly):
Go to the cmd prompt and jump into the directory having the files:
a) use ElmerGrid command to convert square.grd into square mesh folder.

Code: Select all

> ElmerGrid 1 2 square.grd -autoclean
b) run ElmerSolver to run the case.sif

Code: Select all

>ElmerSolver
GUI:
a) Run ElmerGUI
b) File -->> Open -->> square.grd
c) Follow all the ElmerGUI processes to make (generate + save) a solver input file (sif file) similar to case.sif (Note: GUI cannot read an external SIF. It has to prepare its own sif)
d) Run the Elmer Solver in GUI.

The other way is to install Elmer through VMWare, where u will be using Elmer( through Linux based virtual machine) in windows.

Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by annier »

Hi Antourloupe82,
A similar example has been discussed in Comsol.
http://www.comsol.com/community/forums/ ... ead/73011/


You can use that physical reasoning to create a test example with Elmer.


Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by annier »

Hi Antourloupe82,
In my guess you need to add a third body instead of wall boundaries and give it the material properties of some thermal insulators. In this insulating body, you can solve the heat equation.Its boundaries will have overall heat transfer coefficient. Also, among the interfaces between body 1 and body 2; and also between body 2 and body 3;try defining non-zero heat flux condition?

For further reference. you can see http://comsol.com/model/download/184997 ... ooling.pdf.


Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by Antourloupe82 »

Dear All,

I used all the advices given in the previous posts to solve my problem. As a reminder, I would like determine the velocity and pressure fields as a function of the time of a small metallic sphere cooling in a large box filled with air. The metallic sphere of radius R=50cm is made of copper (initial temperature : Ti = 400 K) is enclosed in a large cubic box (L=1m) filled with air (initial temperature : T0=293K). The box is supposed thermally isolated (q=0 at the six walls). The sphere is placed at the center of the box and I need to take into account the natural convection between the sphere and air. Also, I need to couple Heat Transfer and Navier-Stokes equations. Unfortunately, the solution does not converge (relative error 1.0e20 according Elmer) and the solution is not acceptable...

Does someone can tell me if there is a problem with my case.sif ? Yet this problem is very simple...This is my case.sif (the geometry cube.msh is in attachement) :

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

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

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

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

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

Solver 1
  Equation = Heat Equation
  Procedure = "HeatSolve" "HeatSolver"
  Variable = Temperature
  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
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  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 2
  Equation = Navier-Stokes
  Procedure = "FlowSolve" "FlowSolver"
  Variable = Flow Solution[Velocity:3 Pressure:1]
  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
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "Natural Convection"
  NS Convect = False
  Active Solvers(2) = 1 2
End

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

Material 1
  Name = "Air (room temperature)"
  Heat Conductivity = 0.0257
  Heat Capacity = 1005.0
  Density = 1.205
  Relative Permittivity = 1.00059
  Viscosity = 1.983e-5
  Sound speed = 343.0
  Heat expansion Coefficient = 3.43e-3
End

Material 2
  Name = "Copper (generic)"
  Heat Conductivity = 401.0
  Youngs modulus = 115.0e9
  Mesh Poisson ratio = 0.34
  Heat Capacity = 385.0
  Density = 8960.0
  Poisson ratio = 0.34
  Sound speed = 3810.0
  Heat expansion Coefficient = 16.5e-6
End

Initial Condition 1
  Name = "InitialTemperatureAir"
  Velocity 2 = 0
  Velocity 1 = 0
  Temperature = 293
  Velocity 3 = 0
End

Initial Condition 2
  Name = "InitialTemperatureCube"
  Temperature = 400
End

Boundary Condition 1
  Target Boundaries(6) = 2 3 4 5 6 7 
  Name = "ThermalIsolation"
  Velocity 3 = 0
  Heat Flux = 0
  Velocity 1 = 0
  Velocity 2 = 0
End
Attachments
cube.msh
(70.75 KiB) Downloaded 416 times
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cooling in air : Heat Transfer and Navier-Stokes

Post by annier »

Hi Antourloupe82,
Also, define the material of the insulating wall (body 3 and material 3 corresponding to body 3), if your box is of finite dimensions.


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