Temperature
The Temperature module stores the temperature field used by every module whose physics is temperature-dependent — interface mobility via the Arrhenius law, diffusion coefficients, nucleation trigger windows, elastic misfit in thermo-mechanical coupling, and latent-heat release during phase change. The module supports several modes: a uniform reference temperature T0, a linear gradient imposed relative to a reference point R0 via per-face boundary values TBC*, a temperature-time profile read from a file, a list of control modes that ramp the temperature linearly or with Newtonian cooling between holding plateaus, and an optional latent-heat coupling per phase pair.
Key Classes and Concepts
Temperature: the main class. Owns the scalar temperature field, the reference point, the six per-face gradient values, the latent-heat coefficients, and the list of control-mode records. ControlModes: enum with valuesNone,Linear,Newton. OneTemperatureParametersrecord is stored per user-provided$ControlMode_<n>entry.LatentHeatModes: enum with valuesOff,Local,Global.
Models
The imposed spatial profile around the reference point is linear:
where the nine gradient components follow from the six $TBC* face boundary values.
Control modes
For each $ControlMode_<n>:
LINEAR—T(t)ramps at a constant rate$LinearRate_<n>until it reaches$HoldingTemperature_<n>, then holds.NEWTON—T(t)relaxes toward$HoldingTemperature_<n>at a Newtonian rate$NewtonRate_<n>.NONE/NO/OFF— no time evolution applied.
Each record is activated after $ActivationTime_<n>.
Latent heat
With $LatentHeatMode = LOCAL or GLOBAL, phase-change energy is deposited into the temperature field. The module stores a symmetric volumetric heat capacity per phase and an antisymmetric latent-heat matrix:
Usage
Input
Defined in the @Temperature block. A typical configuration combining an initial temperature, a gradient along X, and a linear cooling ramp:
@Temperature
$ReadfromFile Read temperature-time profile from a file? (Yes/No) : No
$T0 Initial temperature : 1000.0
$R0X Reference point X : 0
$R0Y Reference point Y : 0
$R0Z Reference point Z : 0
$TBC0X Boundary value at X=0 : 0
$TBCNX Boundary value at X=N : 0
$TBC0Y Boundary value at Y=0 : 0
$TBCNY Boundary value at Y=N : 0
$TBC0Z Boundary value at Z=0 : 0
$TBCNZ Boundary value at Z=N : 0
$ControlMode_0 Control mode for block 0 (LINEAR/NEWTON/NONE): LINEAR
$LinearRate_0 Linear cooling rate : -10.0
$HoldingTemperature_0 Target temperature : 500.0
$ActivationTime_0 Activation time : 0.0
$LatentHeatMode Latent heat coupling (OFF/LOCAL/GLOBAL) : OFFWhen $ReadfromFile = Yes the module reads $DataFile and ignores $T0. When $LatentHeatMode is LOCAL or GLOBAL, per-phase $VolumetricHeatCapacity_<n> (alias $HeatCapacity_<n>) and antisymmetric $LatentHeat_<a>_<b> are required.
Output
The module writes the temperature field as part of the VTK output pipeline and supports raw-data restart I/O.
Example
#include "Settings.h"
#include "RunTimeControl.h"
#include "BoundaryConditions.h"
#include "PhaseField.h"
#include "InterfaceProperties.h"
#include "Temperature.h"
using namespace openphase;
int main(int argc, char *argv[])
{
std::string InputFile = (argc > 1) ? argv[1] : "ProjectInput.opi";
Settings OPSettings;
OPSettings.ReadInput(InputFile);
RunTimeControl RTC(OPSettings, InputFile);
BoundaryConditions BC(OPSettings, InputFile);
PhaseField Phi(OPSettings, InputFile);
InterfaceProperties IP(OPSettings, InputFile);
Temperature Tx(OPSettings, InputFile);
for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
IP.Set(Phi, Tx, BC); // Arrhenius mobility uses Tx
// ... rest of the time step ...
}
}Dependencies
- Settings, BoundaryConditions, PhaseField — construction and solve inputs.
- InterfaceProperties — consumes
Temperaturefor Arrhenius mobility. - HeatDiffusion, HeatSources — optional couplings when the temperature field is itself a state variable rather than a prescribed profile.