https://mooseframework.inl.gov
ComputeMeanThermalExpansionFunctionEigenstrain.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 #include "Function.h"
12 
15 
16 template <bool is_ad>
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 }
32 
33 template <bool is_ad>
37  _thermal_expansion_function(this->getFunction("thermal_expansion_function")),
38  _thexp_func_ref_temp(
39  this->template getParam<Real>("thermal_expansion_function_reference_temperature"))
40 {
41 }
42 
43 template <bool is_ad>
44 Real
46 {
47  return _thexp_func_ref_temp;
48 }
49 
50 template <bool is_ad>
54 {
55  // we need these two branches because we cannot yet evaluate Functions with ChainedReals
56  if constexpr (is_ad)
57  return _thermal_expansion_function.value(temperature);
58  else
59  return {_thermal_expansion_function.value(temperature.value()),
60  _thermal_expansion_function.timeDerivative(temperature.value()) *
61  temperature.derivatives()};
62 }
63 
virtual Real referenceTemperature() override
Get the reference temperature for the mean thermal expansion relationship.
ComputeMeanThermalExpansionEigenstrainBase is a base class for computing the thermal expansion eigens...
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.
virtual ValueAndDerivative< is_ad > meanThermalExpansionCoefficient(const ValueAndDerivative< is_ad > &temperature) override
ComputeMeanThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion accordin...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", ComputeMeanThermalExpansionFunctionEigenstrain)