https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad > Class Template Reference

ComputeMeanThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion according to a mean thermal expansion function. More...

#include <ComputeMeanThermalExpansionFunctionEigenstrain.h>

Inheritance diagram for ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputeMeanThermalExpansionFunctionEigenstrainTempl (const InputParameters &parameters)
 
virtual void subdomainSetup () final
 resize _temperature_buffer More...
 
virtual void computeProperties () final
 update _temperature_buffer More...
 
virtual void computeQpEigenstrain () override
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real referenceTemperature () override
 Get the reference temperature for the mean thermal expansion relationship. More...
 
virtual ValueAndDerivative< is_ad > meanThermalExpansionCoefficient (const ValueAndDerivative< is_ad > &temperature) override
 
virtual ValueAndDerivative< is_ad > computeThermalStrain () override
 Compute the total thermal strain relative to the stress-free temperature at the current temperature along with its temperature derivative. More...
 

Protected Attributes

const Function_thermal_expansion_function
 
const Real_thexp_func_ref_temp
 
const Real _thermal_expansion_scale_factor
 Scalar multiplier applied to the strain for sensitivity studies and debugging. More...
 
const std::vector< ValueAndDerivative< is_ad > > & _temperature
 Temperature to use in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true). More...
 
const bool _use_old_temperature
 lag temperature variable More...
 
const VariableValue_temperature_old
 previous time step temperature More...
 
MaterialProperty< RankTwoTensor > * _deigenstrain_dT
 
const VariableValue_stress_free_temperature
 

Detailed Description

template<bool is_ad>
class ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >

ComputeMeanThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion according to a mean thermal expansion function.

Definition at line 19 of file ComputeMeanThermalExpansionFunctionEigenstrain.h.

Constructor & Destructor Documentation

◆ ComputeMeanThermalExpansionFunctionEigenstrainTempl()

Definition at line 35 of file ComputeMeanThermalExpansionFunctionEigenstrain.C.

37  _thermal_expansion_function(this->getFunction("thermal_expansion_function")),
39  this->template getParam<Real>("thermal_expansion_function_reference_temperature"))
40 {
41 }
ComputeMeanThermalExpansionEigenstrainBase is a base class for computing the thermal expansion eigens...

Member Function Documentation

◆ computeProperties()

template<bool is_ad>
void ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::computeProperties ( )
finalvirtualinherited

update _temperature_buffer

Definition at line 71 of file ComputeThermalExpansionEigenstrainBase.C.

72 {
73  // we need to convert the temperature variable to a ChainedReal in the is_ad == false case
74  for (_qp = 0; _qp < this->_qrule->n_points(); ++_qp)
75  if constexpr (is_ad)
76  _temperature_buffer[_qp] =
78  else
79  {
81  _temperature_buffer[_qp] = {_temperature_old[_qp], 0};
82  else
83  _temperature_buffer[_qp] = {_temperature_prop[_qp], 1};
84  }
85 
87 }
const GenericVariableValue< is_ad > & _temperature_prop
current temperature
virtual void computeProperties() override
const VariableValue & _temperature_old
previous time step temperature
std::vector< ValueAndDerivative< is_ad > > _temperature_buffer
Temperature used in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).

◆ computeQpEigenstrain()

template<bool is_ad>
void ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::computeQpEigenstrain ( )
overridevirtualinherited

Definition at line 91 of file ComputeThermalExpansionEigenstrainBase.C.

92 {
93  _eigenstrain[_qp].zero();
94  const auto thermal_strain = computeThermalStrain();
95 
96  if constexpr (is_ad)
97  {
98  _eigenstrain[_qp].addIa(thermal_strain);
100  {
101  if (_temperature[_qp] == _stress_free_temperature[_qp])
102  (*_mean_thermal_expansion_coefficient)[_qp] = 0.0;
103  else
105  thermal_strain / (_temperature[_qp] - _stress_free_temperature[_qp]));
106  }
107  }
108  else
109  {
110  _eigenstrain[_qp].addIa(thermal_strain.value());
112  {
113  if (_temperature[_qp].value() == _stress_free_temperature[_qp])
115  else
117  thermal_strain.value() / (_temperature[_qp].value() - _stress_free_temperature[_qp]);
118  }
119  if (_deigenstrain_dT)
120  {
121  (*_deigenstrain_dT)[_qp].zero();
123  (*_deigenstrain_dT)[_qp].addIa(thermal_strain.derivatives());
124  }
125  }
126 }
MaterialProperty< Real > * _mean_thermal_expansion_coefficient
mean coefficient of thermal expansion (for output verification)
auto raw_value(const Eigen::Map< T > &in)
virtual ValueAndDerivative< is_ad > computeThermalStrain()=0
computeThermalStrain must be overridden in derived classes.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const std::vector< ValueAndDerivative< is_ad > > & _temperature
Temperature to use in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).

◆ computeThermalStrain()

template<bool is_ad>
ValueAndDerivative< is_ad > ComputeMeanThermalExpansionEigenstrainBaseTempl< is_ad >::computeThermalStrain ( )
overrideprotectedvirtualinherited

Compute the total thermal strain relative to the stress-free temperature at the current temperature along with its temperature derivative.

Implements ComputeThermalExpansionEigenstrainBaseTempl< is_ad >.

Definition at line 39 of file ComputeMeanThermalExpansionEigenstrainBase.C.

40 {
41  const auto reference_temperature = referenceTemperature();
42 
43  const auto current_alphabar = meanThermalExpansionCoefficient(this->_temperature[_qp]);
44  const auto thexp_T = current_alphabar * (this->_temperature[_qp] - reference_temperature);
45 
46  // Mean linear thermal expansion coefficient relative to the reference temperature
47  // evaluated at stress_free_temperature. This is
48  // \f$\bar{\alpha} = (\delta L(T_{sf}) / L) / (T_{sf} - T_{ref})\f$
49  // where \f$T_sf\f$ is the stress-free temperature and \f$T_{ref}\f$ is the reference temperature.
50  const auto alphabar_stress_free_temperature =
52 
53  // Thermal expansion relative to the reference temperature evaluated at stress_free_temperature
54  // \f$(\delta L(T_sf) / L)\f$, where \f$T_sf\f$ is the stress-free temperature.
55  const auto thexp_stress_free_temperature =
56  alphabar_stress_free_temperature *
58 
59  // Per M. Niffenegger and K. Reichlin (2012), thermal_strain should be divided
60  // by (1.0 + thexp_stress_free_temperature) to account for the ratio of
61  // the length at the stress-free temperature to the length at the reference
62  // temperature. It can be neglected because it is very close to 1,
63  // but we include it for completeness here.
64 
65  auto thermal_strain =
66  (thexp_T - thexp_stress_free_temperature) / (1.0 + thexp_stress_free_temperature);
67 
68  return _thermal_expansion_scale_factor * thermal_strain;
69 }
virtual Real referenceTemperature()=0
Get the reference temperature for the mean thermal expansion relationship.
const Real _thermal_expansion_scale_factor
Scalar multiplier applied to the strain for sensitivity studies and debugging.
virtual ValueAndDerivative< is_ad > meanThermalExpansionCoefficient(const ValueAndDerivative< is_ad > &temperature)=0
const std::vector< ValueAndDerivative< is_ad > > & _temperature
Temperature to use in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).

◆ meanThermalExpansionCoefficient()

template<bool is_ad>
ValueAndDerivative< is_ad > ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >::meanThermalExpansionCoefficient ( const ValueAndDerivative< is_ad > &  temperature)
overrideprotectedvirtual

Implements ComputeMeanThermalExpansionEigenstrainBaseTempl< is_ad >.

Definition at line 52 of file ComputeMeanThermalExpansionFunctionEigenstrain.C.

54 {
55  // we need these two branches because we cannot yet evaluate Functions with ChainedReals
56  if constexpr (is_ad)
58  else
61  temperature.derivatives()};
62 }
virtual Real timeDerivative(Real t, const Point &p) const
static const std::string temperature
Definition: NS.h:59
virtual Real value(Real t, const Point &p) const

◆ referenceTemperature()

template<bool is_ad>
Real ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >::referenceTemperature ( )
overrideprotectedvirtual

Get the reference temperature for the mean thermal expansion relationship.

This is the temperature at which \(\delta L = 0\).

Implements ComputeMeanThermalExpansionEigenstrainBaseTempl< is_ad >.

Definition at line 45 of file ComputeMeanThermalExpansionFunctionEigenstrain.C.

◆ subdomainSetup()

template<bool is_ad>
void ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::subdomainSetup ( )
finalvirtualinherited

resize _temperature_buffer

Definition at line 59 of file ComputeThermalExpansionEigenstrainBase.C.

60 {
61  // call parent class subdomain setup, which ultimately calls Material::subdomainSetup()
63 
64  // make sure we have enouch space to hold the augmented temperature values
65  const auto nqp = this->_fe_problem.getMaxQps();
66  _temperature_buffer.resize(nqp);
67 }
virtual void subdomainSetup() override
std::vector< ValueAndDerivative< is_ad > > _temperature_buffer
Temperature used in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).

◆ validParams()

template<bool is_ad>
InputParameters ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >::validParams ( )
static

Definition at line 18 of file ComputeMeanThermalExpansionFunctionEigenstrain.C.

19 {
21  params.addClassDescription("Computes eigenstrain due to thermal expansion using a function that "
22  "describes the mean thermal expansion as a function of temperature");
23  params.addRequiredParam<FunctionName>(
24  "thermal_expansion_function",
25  "Function describing the mean thermal expansion as a function of temperature");
26  params.addRequiredParam<Real>("thermal_expansion_function_reference_temperature",
27  "Reference temperature for thermal_exansion_function (IMPORTANT: "
28  "this is different in general from the stress_free_temperature)");
29 
30  return params;
31 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _deigenstrain_dT

template<bool is_ad>
MaterialProperty<RankTwoTensor>* ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::_deigenstrain_dT
protectedinherited

Definition at line 72 of file ComputeThermalExpansionEigenstrainBase.h.

◆ _stress_free_temperature

template<bool is_ad>
const VariableValue& ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::_stress_free_temperature
protectedinherited

Definition at line 74 of file ComputeThermalExpansionEigenstrainBase.h.

◆ _temperature

template<bool is_ad>
const std::vector<ValueAndDerivative<is_ad> >& ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::_temperature
protectedinherited

Temperature to use in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).

We use a const reference to a private member here to prevent derived classes from accidentally overwriting any values.

Definition at line 63 of file ComputeThermalExpansionEigenstrainBase.h.

◆ _temperature_old

template<bool is_ad>
const VariableValue& ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::_temperature_old
protectedinherited

previous time step temperature

Definition at line 69 of file ComputeThermalExpansionEigenstrainBase.h.

◆ _thermal_expansion_function

template<bool is_ad>
const Function& ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >::_thermal_expansion_function
protected

◆ _thermal_expansion_scale_factor

template<bool is_ad>
const Real ComputeMeanThermalExpansionEigenstrainBaseTempl< is_ad >::_thermal_expansion_scale_factor
protectedinherited

Scalar multiplier applied to the strain for sensitivity studies and debugging.

Definition at line 58 of file ComputeMeanThermalExpansionEigenstrainBase.h.

◆ _thexp_func_ref_temp

template<bool is_ad>
const Real& ComputeMeanThermalExpansionFunctionEigenstrainTempl< is_ad >::_thexp_func_ref_temp
protected

◆ _use_old_temperature

template<bool is_ad>
const bool ComputeThermalExpansionEigenstrainBaseTempl< is_ad >::_use_old_temperature
protectedinherited

The documentation for this class was generated from the following files: