Temperature Controlled Heat Flux

Numerical methods and mathematical models of Elmer
Post Reply
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Temperature Controlled Heat Flux

Post by MrChips »

Apologies for my inexperience. I have a question about setting up a temperature dependent boundary condition. In my simple heat model, I set up a boundary with a known constant heat flux. The temperature of the model rises at different rates given different thermal properties of the material being heated. Now I want to introduce a temperature limit where the heat flux will fluctuate - just an on/off temperature controller.

I was going to set up a simple temperature dependent boundary condition, however, I need the entire boundary to be either on (heat flux > 0) or off (heat flux = 0) instead of just individual nodes on the boundary - assuming I understand how this works correctly. This led me to reading about "Smart Heater", but I am unsure how to implement it properly. I've read in the forums that I need to review the "heatsolve.src" file, but I cannot make heads nor tails of it.

Any nudge in the right direction would be greatly appreciated.

Cheers,
Clayton
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Temperature Controlled Heat Flux

Post by kevinarden »

In the Elmersmodel manual the smart heater is a body force not a boundary condition. http://www.nic.funet.fi/pub/sci/physics/elmer/doc/

I have used MATC to change boundary conditions during a similattion

Boundary Condition 3
Target Boundaries(1) = 2
Name = "load"
Normal Force = Variable Time
Real MATC "if (tx <= .01) (tx/.01)*200.E6; if (tx > .01) 0.0"
End

You can also input values by tables.

Depends on what conditions you want to switch it on and off.
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Re: Temperature Controlled Heat Flux

Post by MrChips »

Thanks Kevinarden,

I was going to do something like this:

Code: Select all

Boundary Condition 1
  Heat Flux = Variable "temperature"
    Real MATC "if (tx <= 923.15) 5100.0; if (tx > 923.15) 0.0"
However, correct me if I am wrong, with the code above I assume I could have some parts of the boundary with a heat flux > 0 and some equal to zero at the same time? Maybe I need to do some more in-depth measurements to confirm this, I just assume this is the case. What I need is If anywhere along the boundary reaches the cutoff temperature, heat flux to the entire boundary is cut off.
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Temperature Controlled Heat Flux

Post by kevinarden »

You are on the right track with that, however I am not familiar enough with the variables to know if "temperature" is the right variable to use. You may have to run some test cases.
ark
Posts: 14
Joined: 02 May 2017, 15:39
Antispam: Yes

Re: Temperature Controlled Heat Flux

Post by ark »

Hi, may be these ideas could be useful: viewtopic.php?t=2216, with 'boundary max' operator and 'Heat Flux = Variable T_max'.
Regards.
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Temperature Controlled Heat Flux

Post by kevinarden »

Thanks,
Also the Elmer Solver Manual has a section on user functions for boundary conditions
18.3.2 User Functions for Boundary Conditions

Kevin
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Re: Temperature Controlled Heat Flux

Post by MrChips »

For the newbies out there like me, here's what I ended up doing:

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 = 30
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 2
  Timestep intervals = 100
  Timestep Sizes = 1800
  Solver Input File = case.sif
  Post File = MediumSand-k1.vtu
  Initialize Dirichlet Conditions = False
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 = "Soil"
  Equation = 1
  Material = 1
  Initial condition = 1
End

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

Body 3
  Target Bodies(1) = 3
  Name = "Casing"
  Equation = 1
  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 = SaveScalars
  Operator 1 = max
  Variable 1 = Temperature
  Procedure = "SaveData" "SaveScalars"
  Target Variable 1 = String maxTemp
  Exec Solver = before timestep
End

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

Material 1
  Name = "CourseSand"
  Heat Conductivity = 1.2
  Heat Capacity = 800
  Density = 1800
End

Material 2
  Name = "MagicGrout"
  !Type 1 Grout - Heat Conductivity = 0.25
  Heat Conductivity = 1
  Heat Capacity = 736.0
  Density = 2010.0
End

Material 3
  Name = "Casing"
  Heat Conductivity = 43
  Heat Capacity = 473
  Density = 7801
End

Initial Condition 1
  Name = "InitialCondition 1"
  Temperature = 293.15
End

Boundary Condition 1
  Target Boundaries(1) = 13 
  Name = "Heater"
  Save Scalars = True
  Heat Flux = Variable maxTemp; Real MATC "if (tx <= 923.15) 5100.0; else 0"
End
Basically, all the temperatures along the boundary in question are recorded, the maximum temperature is then obtained, and then this maxTemp is used to toggle the heat flux. It works reasonably well. The only limitation, and this has more to do with my inexperience, is the resolution on the temperature control. Essentially, if the time-steps are too big you overshoot the maximum temperature. However, this works reasonably well. I think later I will try to build in some kind of time-dependence - i.e. once the maximum set temperature is reached the heat flux is turned off and cannot be re-engaged for a period of time even if it drops below the maximum set temperature.

Thanks all who responded!
ark
Posts: 14
Joined: 02 May 2017, 15:39
Antispam: Yes

Re: Temperature Controlled Heat Flux

Post by ark »

You can also try to control Time Step when maxTemp is close to the threshold value, viewtopic.php?f=3&t=1681. May be Adaptive Timestepping option could be used.
Post Reply