www.mooseframework.org
ComputeInstantaneousThermalExpansionFunctionEigenstrain.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 #include "Function.h"
9 #include "RankTwoTensor.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<ComputeThermalExpansionEigenstrainBase>();
16  params.addClassDescription("Computes eigenstrain due to thermal expansion using a function that "
17  "describes the instantaneous thermal expansion as a function of "
18  "temperature");
19  params.addRequiredParam<FunctionName>("thermal_expansion_function",
20  "Function describing the instantaneous thermal expansion "
21  "coefficient as a function of temperature");
22  params.set<bool>("incremental_form") = true;
23 
24  return params;
25 }
26 
30  _temperature_old(coupledValueOld("temperature")),
31  _thermal_expansion_function(getFunction("thermal_expansion_function")),
32  _thermal_strain(declareProperty<Real>("InstantaneousThermalExpansionFunction_thermal_strain")),
33  _thermal_strain_old(
34  getMaterialPropertyOld<Real>("InstantaneousThermalExpansionFunction_thermal_strain")),
35  _step_one(declareRestartableData<bool>("step_one", true))
36 {
37 }
38 
39 void
41 {
42  _thermal_strain[_qp] = 0;
43 }
44 
45 void
47  Real & thermal_strain, Real & instantaneous_cte)
48 {
49  if (_t_step > 1)
50  _step_one = false;
51 
52  const Real & current_temp = _temperature[_qp];
53 
54  const Real & old_thermal_strain = _thermal_strain_old[_qp];
55 
56  const Real & old_temp = (_step_one ? _stress_free_temperature[_qp] : _temperature_old[_qp]);
57  const Real delta_T = current_temp - old_temp;
58 
59  const Point p;
60  const Real alpha_current_temp = _thermal_expansion_function.value(current_temp, p);
61  const Real alpha_old_temp = _thermal_expansion_function.value(old_temp, p);
62 
63  thermal_strain = old_thermal_strain + delta_T * 0.5 * (alpha_current_temp + alpha_old_temp);
64  _thermal_strain[_qp] = thermal_strain;
65 
66  instantaneous_cte = alpha_current_temp;
67 }
MaterialProperty< Real > & _thermal_strain
Stores the thermal strain as a scalar for use in computing an incremental update to this...
bool & _step_one
Indicates whether we are on the first step, avoiding false positives when restarting.
virtual void computeThermalStrain(Real &thermal_strain, Real &instantaneous_cte) override
ComputeThermalExpansionEigenstrainBase is a base class for all models that compute eigenstrains due t...
InputParameters validParams< ComputeThermalExpansionEigenstrainBase >()
InputParameters validParams< ComputeInstantaneousThermalExpansionFunctionEigenstrain >()