Cooling in air : Heat Transfer and Navier-Stokes

General discussion about Elmer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

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

Post by mzenker »

Hi,

in your sif, the line

Code: Select all

Timestep Sizes = 8/200
should read

Code: Select all

Timestep Sizes = $ 8/200
You cannot do calculations in the sif, you need to call MATC to do that. This is done by the $ character.

I don't know if that is the cause of you problem, though.

HTH,

Matthias
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

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

Post by Antourloupe82 »

Dear Anier,

I looked at the comsol model proposed in the previous post but I feel that this problem is different from mine. In this model, the walls have a finite thickness (e=30cm) with any thermal transferts between inside and outside room.

In my case, the walls are infinitely thin and I need to impose the thermal insulation condition (q stricly zero).

However, I observe that now the solution converges if I use the heat flux q=0.01 (non strictly zero) but still considering two bodies (the air in the room and the sphere) and walls infinitely thin. I don't know if the solution is acceptable. Also I used "Timestep Sizes = $ 8/200" as suggested by Matthias.

I will try to solve my problem with a third body and walls with a non-zero thickness but I feel that this configuration is slightly different from mine.
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

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

Post by Antourloupe82 »

Hi all,

I have tried to perform the calculation by adding a third body (walls with non zero thickness and materiel defined). The solution converges but unfortunately the final solution is not acceptable...The velocity field around the metallic sphere is not acceptable and the temperature does not vary...This is my case.sif modified by taking into account the different advices of the previous posts. In attachement, the new geometry with a third body...

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 = 2
  Timestep intervals = 10
  Timestep Sizes = $ 1/10
  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 Property 1"
  Equation = 2
  Material = 2
  Initial condition = 2
End

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

Body 3
  Target Bodies(1) = 3
  Name = "Body Property 3"
  Equation = 2
  Material = 3
  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-4
  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-6
  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 = "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

Material 3
  Name = "Polycarbonate (generic)"
  Heat Conductivity = 0.205
  Youngs modulus = 2.2e9
  Mesh Poisson ratio = 0.37
  Heat Capacity = 1250.0
  Density = 1220.0
  Poisson ratio = 0.37
  Heat expansion Coefficient = 67.0e-6
End

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

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

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

Boundary Condition 1
  Target Boundaries(6) = 8 9 10 11 12 13 
  Name = "ThermalInsulation"
  Heat Flux = 0.01
End

Boundary Condition 2
  Target Boundaries(1) = 1 
  Name = "NoSlip"
  Noslip wall BC = True
End

Boundary Condition 3
  Target Boundaries(6) = 2 3 4 5 6 7 
  Name = "ZeroVelocity"
  Velocity 3 = 0
  Velocity 1 = 0
  Velocity 2 = 0
End
Attachments
RoomGeometry.step
(34.63 KiB) Downloaded 348 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 convergence with the use of a third body suggests that there is a non-zero boundary condition (at walls) even if you use two bodies.
This also might be a relevant post for you: viewtopic.php?f=3&t=4001&sid=df8adeec66 ... 4a02082c87
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 »

Velocity-Field.jpg
Velocity-Field.jpg (58.28 KiB) Viewed 6906 times
Dear Anil,

According your advices, I performed the calculation by using a third body (polycarbonate) representing the walls of the room (with thickness = 5mm). The sphere is made of aluminum (Radius = 2.5 cm) and the size of the box is L = 20cm (representing the room). The initial temperature of the sphere is 90°C and the initial temperature of the air inside the box is 25°C. The initial temperature of the walls is 25°C. I impose the "noslip condition" at the surface of the metallic sphere and also at the surface (interior) of the walls in contact with air. To perform the thermal transfert by convection in air, I impose a volumic body force in air (Fx=0, Fy=0, Fz = -9.81) due to the gravity.

In my case file : body 1 = sphere, body 2 = air, body 3 = walls. Unfortunately, the convergence is not acceptable (by using the thermal insulation q=0 or q=0.001 at the exterior surface of the walls). The final solution is not realistic...The temperature does not vary as a function of the time and the velocity field is not acceptable (see the attachement)...A realistic solution is given here : https://www.youtube.com/watch?v=MFr1FrJI0x0

Please, could you ckeck my case file ? Also, concerning the body force (due to the gravity), must I impose Fz = -9.81 or Fz=-9.81*(rho - rho_ref) ?

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 = 2
  Timestep intervals = 10
  Timestep Sizes = $ 1/10
  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 Property 1"
  Equation = 2
  Material = 2
  Initial condition = 2
End

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

Body 3
  Target Bodies(1) = 3
  Name = "Body Property 3"
  Equation = 2
  Material = 3
  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-4
  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-6
  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 = "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

Material 3
  Name = "Polycarbonate (generic)"
  Heat Conductivity = 0.205
  Youngs modulus = 2.2e9
  Mesh Poisson ratio = 0.37
  Heat Capacity = 1250.0
  Density = 1220.0
  Poisson ratio = 0.37
  Heat expansion Coefficient = 67.0e-6
End

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

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

Initial Condition 2
  Name = "InitialTemperatureSphere"
  Temperature = 363
End

Boundary Condition 1
  Target Boundaries(6) = 8 9 10 11 12 13
  Name = "ThermalInsulation"
  Heat Flux = 0.01
End

Boundary Condition 2
  Target Boundaries(1) = 1
  Name = "NoSlip"
  Noslip wall BC = True
End

Boundary Condition 3
  Target Boundaries(6) = 2 3 4 5 6 7
  Name = "ZeroVelocity"
  Velocity 3 = 0
  Velocity 1 = 0
  Velocity 2 = 0
Attachments
Temperature-Field.jpg
Temperature-Field.jpg (37.75 KiB) Viewed 6906 times
Cooling.png
Cooling.png (6.6 KiB) Viewed 6906 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

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

Post by raback »

Hi

In some mesh file you provided there was just some 400 nodes. In 3D I would expect to need easily ~1e5 nodes for an accurate solution. I would advice to start from 2D to get confortable with the meshing requirements and only thereafter continue to 3D (using possibly parallel computing). In 2D you might have some reasonable solution with ~1e4 elements or nodes at least with proper boundary layers.

-Peter
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

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

Post by Antourloupe82 »

MeshFeeCadVSElmer.jpg
MeshFeeCadVSElmer.jpg (82.95 KiB) Viewed 6897 times
Hi Peter,

Thank you for your reply.

In fact, the mesh used is imposed by Elmer...My workflow is quickly :

- geometry and mesh created by using FreeCad
- Save the previous mesh in the format .stl or .msh
- Open .stl in ElmerGUI

The mesh created by using FreeCad has 10^4 elements...but opening this mesh file in ElmerGUI, I obtain a geometry meshed with only 400 elements or less.

In attachement, a sphere meshed by using FreeCad (--> file.stl) and the file created open in ElmerGUI (--->File---->open file.stl). This is probably a problem but I do not have solution to open the full mesh file genered bu using FreeCad.
Last edited by Antourloupe82 on 02 Aug 2015, 23:50, edited 1 time in total.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

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

Post by raback »

Hi

You can pass command-line parameters in ElmerGUI to netgen plugin and thereby control the mesh resolution at least a little. ElmerGUI does not have any interpretation of the physics so the user must make sure that the mesh is proper for the problem at hand.

I think that ElmerGUI CAD interface has limitations when it comes to multiple bodies.

I would try to do the meshing in Gmsh and export in .msh format, or in SALOME using unv format.

-Peter
Antourloupe82
Posts: 19
Joined: 19 Jun 2015, 16:56
Antispam: Yes

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

Post by Antourloupe82 »

Dear Peter,

According your advice, I performed the simulation with a number of element very high for the mesh...The solvers (Heat transfer and Navier-Stokes) converge but the solutions obtained after five hours ares not acceptable :

- Again, the temperature field does not vary as a function of the time...??
- The velocity field is not acceptable...

See the attachements showing the temperature and velocity fields at t=5s and t=9s.

This is incomprehensible because the same calculations also have been performed by using comsol and I have found no problems. Now, I suppose that there are errors in my case.sif...

Have you ever encountered this problem for such a simple system ?
Attachments
Velocity9s.jpg
Velocity9s.jpg (48.95 KiB) Viewed 6895 times
Velocity5s.jpg
Velocity5s.jpg (47.71 KiB) Viewed 6895 times
Temperature9s.jpg
Temperature9s.jpg (34.18 KiB) Viewed 6895 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

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

Post by raback »

Hi

I wonder if you still have problems in your mesh. The inner circle seems to be missing or detached.

-Peter
Post Reply