https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
17template <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
30template <bool is_ad>
37
38template <bool is_ad>
41 const ValueAndDerivative<is_ad> & temperature)
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
registerMooseObject("SolidMechanicsApp", ComputeDilatationThermalExpansionFunctionEigenstrain)
typename std::conditional< is_ad, ADReal, ChainedReal >::type ValueAndDerivative
Return type with a single derivative.
ComputeDilatationThermalExpansionEigenstrainBase computes an eigenstrain for thermal expansion from a...
ComputeDilatationThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion fr...
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 addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)