https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TemperaturePressureFunctionFluidProperties.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
13#include "Function.h"
14
21{
22public:
24
26
32 virtual std::string fluidName() const override;
33
41 virtual Real T_from_v_e(Real v, Real e) const override;
42
50 virtual Real T_from_p_rho(Real p, Real rho) const;
51
59 virtual Real T_from_p_h(Real p, Real h) const override;
60
68 virtual Real p_from_v_e(Real v, Real e) const override;
69
77 virtual Real cp_from_v_e(Real v, Real e) const override;
87 virtual void cp_from_v_e(Real v, Real e, Real & cp, Real & dcp_dv, Real & dcp_de) const override;
88
96 virtual Real cv_from_v_e(Real v, Real e) const override;
106 virtual void cv_from_v_e(Real p, Real T, Real & cv, Real & dcv_dv, Real & dcv_de) const override;
107
115 virtual Real mu_from_v_e(Real v, Real e) const override;
116
124 virtual Real k_from_v_e(Real v, Real e) const override;
125
133 virtual Real rho_from_p_T(Real p, Real T) const override;
134
144 virtual void
145 rho_from_p_T(Real p, Real T, Real & rho, Real & drho_dp, Real & drho_dT) const override;
146 virtual void rho_from_p_T(const ADReal & pressure,
147 const ADReal & temperature,
148 ADReal & rho,
149 ADReal & drho_dp,
150 ADReal & drho_dT) const override;
151
158 virtual Real v_from_p_T(Real p, Real T) const override;
159
168 virtual void v_from_p_T(Real p, Real T, Real & v, Real & dv_dp, Real & dv_dT) const override;
169
177 virtual Real h_from_p_T(Real p, Real T) const override;
178
188 virtual void h_from_p_T(Real p, Real T, Real & h, Real & dh_dp, Real & dh_dT) const override;
189
197 virtual Real e_from_p_T(Real p, Real T) const override;
198
208 virtual void e_from_p_T(Real p, Real T, Real & e, Real & de_dp, Real & de_dT) const override;
209
217 virtual Real e_from_p_rho(Real p, Real rho) const override;
218
226 virtual Real beta_from_p_T(Real p, Real T) const override;
227
235 virtual Real cp_from_p_T(Real p, Real T) const override;
236
246 virtual void cp_from_p_T(Real p, Real T, Real & cp, Real & dcp_dp, Real & dcp_dT) const override;
247
255 virtual Real cv_from_p_T(Real p, Real T) const override;
264 virtual void cv_from_p_T(Real p, Real T, Real & cv, Real & dcv_dp, Real & dcv_dT) const override;
265
273 virtual Real k_from_p_T(Real p, Real T) const override;
274
284 virtual void k_from_p_T(Real p, Real T, Real & k, Real & dk_dp, Real & dk_dT) const override;
285
293 virtual Real mu_from_p_T(Real p, Real T) const override;
294
304 virtual void
305 mu_from_p_T(Real p, Real T, Real & mu, Real & dmu_drho, Real & dmu_dT) const override;
306
307 // Need those to avoid running the infinite loop of s_pT calling s_ve calling s_pT in SinglePhase
308 Real s_from_p_T(Real /*p*/, Real /*T*/) const override { mooseError("Not implemented"); }
309 void s_from_p_T(Real, Real, Real &, Real &, Real &) const override
310 {
311 mooseError("Not implemented");
312 }
313
314 // This is done to avoid hiding the AD implementations from the template
315 // with the regular implementations defined here
316 using SinglePhaseFluidProperties::beta_from_p_T;
317 using SinglePhaseFluidProperties::cp_from_p_T;
318 using SinglePhaseFluidProperties::cp_from_v_e;
319 using SinglePhaseFluidProperties::cv_from_p_T;
320 using SinglePhaseFluidProperties::cv_from_v_e;
321 using SinglePhaseFluidProperties::e_from_p_rho;
322 using SinglePhaseFluidProperties::e_from_p_T;
323 using SinglePhaseFluidProperties::h_from_p_T;
324 using SinglePhaseFluidProperties::k_from_p_T;
325 using SinglePhaseFluidProperties::k_from_v_e;
326 using SinglePhaseFluidProperties::mu_from_p_T;
327 using SinglePhaseFluidProperties::mu_from_v_e;
328 using SinglePhaseFluidProperties::p_from_v_e;
329 using SinglePhaseFluidProperties::rho_from_p_T;
330 using SinglePhaseFluidProperties::s_from_p_T;
331 using SinglePhaseFluidProperties::T_from_p_h;
332 using SinglePhaseFluidProperties::T_from_v_e;
333 using SinglePhaseFluidProperties::v_from_p_T;
334
335protected:
337 void initialSetup() override;
338
341
344
347
350
353
355 const Real _cv;
357 const bool _cv_is_constant;
359 const Real _e_ref;
361 const Real _T_ref;
363 const Real _integration_dT;
364};
DualNumber< Real, DNDerivativeType, true > ADReal
const double mu
const InputParameters & parameters() const
void mooseError(Args &&... args) const
Common class for single phase fluid properties.
e e e e s T T T T T rho v v T e h
Fluid properties provided as multiple-variable functions of temperature and pressure.
virtual Real e_from_p_rho(Real p, Real rho) const override
Specific internal energy from pressure and density.
void initialSetup() override
Functions are constructed after fluid properties, so we delay the getting of the Function.
virtual Real cv_from_v_e(Real v, Real e) const override
Isochoric specific heat from specific volume and specific internal energy.
bool _initialized
whether the object is initialized, eg, the functions have been retrieved from the problem
virtual Real T_from_v_e(Real v, Real e) const override
Temperature from specific volume and specific internal energy.
virtual Real k_from_p_T(Real p, Real T) const override
Thermal conductivity from pressure and temperature.
const Real _integration_dT
Size of temperature intervals when integrating the specific heat to compute the specific energy.
const Function * _rho_function
function defining density as a function of temperature and pressure
const bool _cv_is_constant
whether a constant isochoric specific heat is used
void s_from_p_T(Real, Real, Real &, Real &, Real &) const override
virtual Real p_from_v_e(Real v, Real e) const override
Pressure from specific volume and specific internal energy.
virtual Real cv_from_p_T(Real p, Real T) const override
Isochoric specific heat capacity from pressure and temperature.
virtual Real k_from_v_e(Real v, Real e) const override
Thermal conductivity from specific volume and specific internal energy.
virtual Real e_from_p_T(Real p, Real T) const override
Specific internal energy from pressure and temperature.
virtual Real rho_from_p_T(Real p, Real T) const override
Density from pressure and temperature.
const Function * _mu_function
function defining dynamic viscosity as a function of temperature and pressure
virtual Real h_from_p_T(Real p, Real T) const override
Specific enthalpy from pressure and temperature.
virtual Real T_from_p_rho(Real p, Real rho) const
Temperature from pressure and density.
virtual std::string fluidName() const override
Fluid name.
virtual Real beta_from_p_T(Real p, Real T) const override
Thermal expansion coefficient from pressure and temperature.
virtual Real mu_from_v_e(Real v, Real e) const override
Dynamic viscosity from specific volume and specific internal energy.
const Function * _cp_function
function defining specific heat as a function of temperature and pressure
const Function * _k_function
function defining thermal conductivity as a function of temperature and pressure
virtual Real v_from_p_T(Real p, Real T) const override
Specific volume from pressure and temperature.
virtual Real cp_from_p_T(Real p, Real T) const override
Isobaric specific heat capacity from pressure and temperature.
const Real _T_ref
Reference temperature for the reference specific energy.
virtual Real T_from_p_h(Real p, Real h) const override
Temperature from pressure and specific enthalpy.
virtual Real cp_from_v_e(Real v, Real e) const override
Isobaric specific heat from specific volume and specific internal energy.
virtual Real mu_from_p_T(Real p, Real T) const override
Dynamic viscosity from pressure and temperature.