https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ThermalSolidProperties.h
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
10#pragma once
11
12#include "SolidProperties.h"
13
17#define propfuncNonADValueOnly(want) \
18 virtual Real want##_from_T(const Real &) const \
19 { \
20 mooseError(__PRETTY_FUNCTION__, " not implemented."); \
21 }
22
27#define propfuncNonADDerivatives(want) \
28 virtual void want##_from_T(const Real & T, Real & val, Real & d##want##dT) const \
29 { \
30 solidPropError(__PRETTY_FUNCTION__, " derivatives not implemented."); \
31 d##want##dT = 0; \
32 val = want##_from_T(T); \
33 }
34
40#define propfuncAD(want) \
41 virtual ADReal want##_from_T(const ADReal & T) const \
42 { \
43 Real x = 0; \
44 Real raw = T.value(); \
45 Real dxdT = 0; \
46 want##_from_T(raw, x, dxdT); \
47 \
48 ADReal result = x; \
49 result.derivatives() = T.derivatives() * dxdT; \
50 return result; \
51 }
52
57#define propfunc(want) propfuncNonADValueOnly(want) propfuncNonADDerivatives(want) propfuncAD(want)
58
63{
64public:
66
68
69#pragma GCC diagnostic push
70#pragma GCC diagnostic ignored "-Woverloaded-virtual"
71 // clang-format off
72
93 propfunc(cp)
95
96
103 virtual Real cp_integral(const Real & /*T*/) const
104 {
105 mooseError(__PRETTY_FUNCTION__, " not implemented.");
106 }
107
108 // Specific internal energy methods; these designed to not be virtual; only
109 // cp_integral(T) needs to be implemented.
110 Real e_from_T(const Real & T) const;
111 void e_from_T(const Real & T, Real & val, Real & dedT) const;
112 propfuncAD(e)
114
115 // clang-format on
116
117#undef propfunc
118#undef propfuncAD
119
120 protected :
122 template <typename... Args>
123 void solidPropError(Args... args) const
124 {
126 mooseDoOnce(mooseWarning(std::forward<Args>(args)...));
127 else
128 mooseError(std::forward<Args>(args)...);
129 }
130
131protected:
133 const Real _T_zero_e;
134};
135
136#pragma GCC diagnostic pop
const double rho
const double T
const InputParameters & parameters() const
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
const bool _allow_imperfect_jacobians
Flag to set unimplemented Jacobian entries to zero.
Common class for solid properties that are a function of temperature.
static InputParameters validParams()
propfunc(k) propfunc(cp) propfunc(rho) virtual Real cp_integral(const Real &) const
Compute a solid property as a function of temperature (Kelvin)
Real e_from_T(const Real &T) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real