https://mooseframework.inl.gov
ComputeDilatationThermalExpansionFunctionEigenstrain.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
12 #include "Function.h"
13 
16 
17 template <bool is_ad>
20 {
22  params.addClassDescription("Computes eigenstrain due to thermal expansion using a function that "
23  "describes the total dilatation as a function of temperature");
24  params.addRequiredParam<FunctionName>(
25  "dilatation_function",
26  "Function describing the thermal dilatation as a function of temperature");
27  return params;
28 }
29 
30 template <bool is_ad>
34  _dilatation_function(this->getFunction("dilatation_function"))
35 {
36 }
37 
38 template <bool is_ad>
42 {
43  // we need these two branches because we cannot yet evaluate Functions with ChainedReals
44  if constexpr (is_ad)
45  return _dilatation_function.value(temperature);
46  else
47  return {_dilatation_function.value(temperature.value()),
48  _dilatation_function.timeDerivative(temperature.value()) * temperature.derivatives()};
49 }
50 
ComputeDilatationThermalExpansionEigenstrainBase computes an eigenstrain for thermal expansion from a...
static const std::string temperature
Definition: NS.h:59
void addRequiredParam(const std::string &name, const std::string &doc_string)
typename std::conditional< is_ad, ADReal, ChainedReal >::type ValueAndDerivative
Return type with a single derivative.
registerMooseObject("SolidMechanicsApp", ComputeDilatationThermalExpansionFunctionEigenstrain)
virtual ValueAndDerivative< is_ad > computeDilatation(const ValueAndDerivative< is_ad > &temperature) override
Compute the fractional linear dilatation due to thermal expansion delta L / L along with its temperat...
void addClassDescription(const std::string &doc_string)
ComputeDilatationThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion fr...