13 #include "RankTwoTensor.h"
20 template <ComputeStage compute_stage>
25 params.addClassDescription(
"Computes eigenstrain due to thermal expansion using a function that "
26 "describes the instantaneous thermal expansion as a function of "
28 params.addRequiredParam<FunctionName>(
"thermal_expansion_function",
29 "Function describing the instantaneous thermal expansion "
30 "coefficient as a function of temperature");
34 template <ComputeStage compute_stage>
38 _temperature_old(coupledValueOld(
"temperature")),
39 _thermal_expansion_function(getFunction(
"thermal_expansion_function")),
41 declareADProperty<Real>(
"InstantaneousThermalExpansionFunction_thermal_strain")),
43 getMaterialPropertyOld<Real>(
"InstantaneousThermalExpansionFunction_thermal_strain")),
44 _step_one(declareRestartableData<bool>(
"step_one", true))
48 template <ComputeStage compute_stage>
52 _thermal_strain[_qp] = 0;
55 template <ComputeStage compute_stage>
58 ADReal & thermal_strain)
63 const Real & current_temp = MetaPhysicL::raw_value(_temperature[_qp]);
65 const Real & old_thermal_strain = _thermal_strain_old[_qp];
67 const Real & old_temp =
68 (_step_one ? MetaPhysicL::raw_value(_stress_free_temperature[_qp]) : _temperature_old[_qp]);
69 const Real delta_T = current_temp - old_temp;
72 const Real alpha_current_temp = _thermal_expansion_function.value(current_temp, p);
73 const Real alpha_old_temp = _thermal_expansion_function.value(old_temp, p);
75 thermal_strain = old_thermal_strain + delta_T * 0.5 * (alpha_current_temp + alpha_old_temp);
76 _thermal_strain[_qp] = thermal_strain;