https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
16template <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
33template <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
43template <bool is_ad>
44Real
49
50template <bool is_ad>
53 const ValueAndDerivative<is_ad> & temperature)
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
registerMooseObject("SolidMechanicsApp", ComputeMeanThermalExpansionFunctionEigenstrain)
typename std::conditional< is_ad, ADReal, ChainedReal >::type ValueAndDerivative
Return type with a single derivative.
ComputeMeanThermalExpansionEigenstrainBase is a base class for computing the thermal expansion eigens...
ComputeMeanThermalExpansionFunctionEigenstrain computes an eigenstrain for thermal expansion accordin...
virtual Real referenceTemperature() override
Get the reference temperature for the mean thermal expansion relationship.
virtual ValueAndDerivative< is_ad > meanThermalExpansionCoefficient(const ValueAndDerivative< is_ad > &temperature) override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)