www.mooseframework.org
ComputeInstantaneousThermalExpansionFunctionEigenstrain.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "Function.h"
12 #include "RankTwoTensor.h"
13 
15 
17 
18 InputParameters
20 {
21  InputParameters params = ComputeThermalExpansionEigenstrainBase::validParams();
22  params.addClassDescription("Computes eigenstrain due to thermal expansion using a function that "
23  "describes the instantaneous thermal expansion as a function of "
24  "temperature");
25  params.addRequiredParam<FunctionName>("thermal_expansion_function",
26  "Function describing the instantaneous thermal expansion "
27  "coefficient as a function of temperature");
28  return params;
29 }
30 
34  _temperature_old(coupledValueOld("temperature")),
35  _thermal_expansion_function(getFunction("thermal_expansion_function")),
36  _thermal_strain(declareProperty<Real>("InstantaneousThermalExpansionFunction_thermal_strain")),
37  _thermal_strain_old(
38  getMaterialPropertyOld<Real>("InstantaneousThermalExpansionFunction_thermal_strain")),
39  _step_one(declareRestartableData<bool>("step_one", true))
40 {
41 }
42 
43 void
45 {
46  _thermal_strain[_qp] = 0;
47 }
48 
49 void
51  Real & thermal_strain, Real & instantaneous_cte)
52 {
53  if (_t_step > 1)
54  _step_one = false;
55 
56  const Real & current_temp = _temperature[_qp];
57 
58  const Real & old_thermal_strain = _thermal_strain_old[_qp];
59 
60  const Real & old_temp = (_step_one ? _stress_free_temperature[_qp] : _temperature_old[_qp]);
61  const Real delta_T = current_temp - old_temp;
62 
63  const Point p;
64  const Real alpha_current_temp = _thermal_expansion_function.value(current_temp, p);
65  const Real alpha_old_temp = _thermal_expansion_function.value(old_temp, p);
66 
67  thermal_strain = old_thermal_strain + delta_T * 0.5 * (alpha_current_temp + alpha_old_temp);
68  _thermal_strain[_qp] = thermal_strain;
69 
70  instantaneous_cte = alpha_current_temp;
71 }
ComputeInstantaneousThermalExpansionFunctionEigenstrain::computeThermalStrain
virtual void computeThermalStrain(Real &thermal_strain, Real &instantaneous_cte) override
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.C:50
ComputeInstantaneousThermalExpansionFunctionEigenstrain::_thermal_strain_old
const MaterialProperty< Real > & _thermal_strain_old
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.h:42
ComputeThermalExpansionEigenstrainBase::_temperature
const VariableValue & _temperature
Definition: ComputeThermalExpansionEigenstrainBase.h:49
ComputeInstantaneousThermalExpansionFunctionEigenstrain::_thermal_expansion_function
const Function & _thermal_expansion_function
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.h:37
ComputeInstantaneousThermalExpansionFunctionEigenstrain.h
ComputeInstantaneousThermalExpansionFunctionEigenstrain::ComputeInstantaneousThermalExpansionFunctionEigenstrain
ComputeInstantaneousThermalExpansionFunctionEigenstrain(const InputParameters &parameters)
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.C:32
ComputeInstantaneousThermalExpansionFunctionEigenstrain::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.C:44
registerMooseObject
registerMooseObject("TensorMechanicsApp", ComputeInstantaneousThermalExpansionFunctionEigenstrain)
ComputeThermalExpansionEigenstrainBase::_stress_free_temperature
const VariableValue & _stress_free_temperature
Definition: ComputeThermalExpansionEigenstrainBase.h:51
ComputeInstantaneousThermalExpansionFunctionEigenstrain
ComputeInstantaneousThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion...
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.h:24
ComputeInstantaneousThermalExpansionFunctionEigenstrain::_step_one
bool & _step_one
Indicates whether we are on the first step, avoiding false positives when restarting.
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.h:46
ComputeInstantaneousThermalExpansionFunctionEigenstrain::_temperature_old
const VariableValue & _temperature_old
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.h:36
ComputeThermalExpansionEigenstrainBase::validParams
static InputParameters validParams()
Definition: ComputeThermalExpansionEigenstrainBase.C:16
defineLegacyParams
defineLegacyParams(ComputeInstantaneousThermalExpansionFunctionEigenstrain)
ComputeThermalExpansionEigenstrainBase
ComputeThermalExpansionEigenstrainBase is a base class for all models that compute eigenstrains due t...
Definition: ComputeThermalExpansionEigenstrainBase.h:27
ComputeInstantaneousThermalExpansionFunctionEigenstrain::_thermal_strain
MaterialProperty< Real > & _thermal_strain
Stores the thermal strain as a scalar for use in computing an incremental update to this.
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.h:41
ComputeInstantaneousThermalExpansionFunctionEigenstrain::validParams
static InputParameters validParams()
Definition: ComputeInstantaneousThermalExpansionFunctionEigenstrain.C:19