20 params.addCoupledVar(
"temp",
"Coupled Temperature");
22 params.addParam<Real>(
"thermal_expansion",
"The thermal expansion coefficient.");
23 params.addParam<FunctionName>(
"thermal_expansion_function",
24 "Thermal expansion coefficient as a function of temperature.");
25 params.addParam<Real>(
26 "stress_free_temperature",
27 "The stress-free temperature. If not specified, the initial temperature is used.");
28 params.addParam<Real>(
"thermal_expansion_reference_temperature",
29 "Reference temperature for mean thermal expansion function.");
30 MooseEnum cte_function_type(
"instantaneous mean");
31 params.addParam<MooseEnum>(
"thermal_expansion_function_type",
33 "Type of thermal expansion function. Choices are: " +
34 cte_function_type.getRawNames());
40 : Material(parameters),
41 _has_temp(isCoupled(
"temp")),
42 _temperature(_has_temp ? coupledValue(
"temp") : _zero),
43 _temperature_old(_has_temp ? coupledValueOld(
"temp") : _zero),
44 _alpha(parameters.isParamValid(
"thermal_expansion") ? getParam<Real>(
"thermal_expansion") : 0.),
45 _alpha_function(parameters.isParamValid(
"thermal_expansion_function")
46 ? &getFunction(
"thermal_expansion_function")
48 _has_stress_free_temp(isParamValid(
"stress_free_temperature")),
49 _stress_free_temp(_has_stress_free_temp ? getParam<Real>(
"stress_free_temperature") : 0.0),
51 _step_zero_cm(declareRestartableData<bool>(
"step_zero_cm", true)),
52 _step_one_cm(declareRestartableData<bool>(
"step_one_cm", true))
54 if (parameters.isParamValid(
"thermal_expansion_function_type"))
57 mooseError(
"thermal_expansion_function_type can only be set when thermal_expansion_function "
59 MooseEnum tec = getParam<MooseEnum>(
"thermal_expansion_function_type");
62 else if (tec ==
"instantaneous")
65 mooseError(
"Invalid option for thermal_expansion_function_type");
70 if (parameters.isParamValid(
"thermal_expansion_reference_temperature"))
73 mooseError(
"thermal_expansion_reference_temperature can only be set when "
74 "thermal_expansion_function is used");
76 mooseError(
"thermal_expansion_reference_temperature can only be set when "
77 "thermal_expansion_function_type = mean");
78 _ref_temp = getParam<Real>(
"thermal_expansion_reference_temperature");
81 "Cannot specify thermal_expansion_reference_temperature without coupling to temperature");
84 mooseError(
"Must specify thermal_expansion_reference_temperature if "
85 "thermal_expansion_function_type = mean");
101 stress_new = elasticityTensor * strain_increment;
102 stress_new += stress_old;
116 Real inc_thermal_strain;
117 Real d_thermal_strain_d_temp;
127 Real delta_t = current_temp - old_temp;
142 Real numerator = alpha_current_temp * (current_temp -
_ref_temp) -
145 if (denominator < small)
146 mooseError(
"Denominator too small in thermal strain calculation");
147 inc_thermal_strain = numerator / denominator;
148 d_thermal_strain_d_temp = alpha_current_temp * (current_temp -
_ref_temp);
152 inc_thermal_strain = delta_t * 0.5 * (alpha_current_temp + alpha_old_temp);
153 d_thermal_strain_d_temp = alpha_current_temp;
158 inc_thermal_strain = delta_t * alpha;
159 d_thermal_strain_d_temp = alpha;
162 strain_increment.
addDiag(-inc_thermal_strain);
163 d_strain_dT.
addDiag(-d_thermal_strain_d_temp);
166 bool modified =
true;