www.mooseframework.org
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
MultiComponentFluidProperties Class Reference

Common class for multiple component fluid properties using a pressure and temperature formulation. More...

#include <MultiComponentFluidProperties.h>

Inheritance diagram for MultiComponentFluidProperties:
[legend]

Public Member Functions

 MultiComponentFluidProperties (const InputParameters &parameters)
 
virtual ~MultiComponentFluidProperties ()
 
X X virtual X std::string fluidName () const
 Fluid name. More...
 
virtual void rho_mu_from_p_T_X (Real pressure, Real temperature, Real xmass, Real &rho, Real &mu) const
 Density and viscosity. More...
 
virtual void rho_mu_from_p_T_X (DualReal pressure, DualReal temperature, DualReal xmass, DualReal &rho, DualReal &mu) const
 
virtual void rho_mu_from_p_T_X (Real pressure, Real temperature, Real xmass, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const
 Density and viscosity and their derivatives wrt pressure, temperature and mass fraction. More...
 
virtual const SinglePhaseFluidPropertiesgetComponent (unsigned int component) const
 Get UserObject for specified component. More...
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 
virtual void threadJoin (const UserObject &) final
 
virtual void subdomainSetup () final
 

Static Public Attributes

static const Real _R = 8.3144598
 Universal gas constant (J/mol/K) More...
 

Protected Attributes

const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 
const bool _allow_imperfect_jacobians
 Flag to set unimplemented Jacobian entries to zero. More...
 
 p
 
 T
 
p
 
T
 
X X p
 
X X T
 
 propfunc (rho, p, T, X) propfunc(mu
 Compute a fluid property given for the state defined by three given properties. More...
 
propfunc (h, p, T, X) propfunc(cp
 
X X propfunc (e, p, T, X) propfunc(k
 

Detailed Description

Common class for multiple component fluid properties using a pressure and temperature formulation.

Definition at line 69 of file MultiComponentFluidProperties.h.

Constructor & Destructor Documentation

◆ MultiComponentFluidProperties()

MultiComponentFluidProperties::MultiComponentFluidProperties ( const InputParameters &  parameters)

Definition at line 20 of file MultiComponentFluidProperties.C.

21  : FluidProperties(parameters)
22 {
23 }

◆ ~MultiComponentFluidProperties()

MultiComponentFluidProperties::~MultiComponentFluidProperties ( )
virtual

Definition at line 25 of file MultiComponentFluidProperties.C.

25 {}

Member Function Documentation

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 34 of file FluidProperties.h.

34 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 36 of file FluidProperties.h.

36 {}

◆ fluidName()

std::string MultiComponentFluidProperties::fluidName ( ) const
virtual

Fluid name.

Returns
string representing fluid name

Reimplemented in BrineFluidProperties.

Definition at line 28 of file MultiComponentFluidProperties.C.

29 {
30  mooseError(name(), ": fluidName() is not implemented");
31 }

◆ getComponent()

const SinglePhaseFluidProperties & MultiComponentFluidProperties::getComponent ( unsigned int  component) const
virtual

Get UserObject for specified component.

Parameters
componentfluid component
Returns
reference to SinglePhaseFluidPropertiesPT UserObject for component

Reimplemented in BrineFluidProperties.

Definition at line 67 of file MultiComponentFluidProperties.C.

68 {
69  mooseError(name(), ": getComponent() is not implemented");
70 }

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 35 of file FluidProperties.h.

35 {}

◆ propfunc() [1/3]

X X MultiComponentFluidProperties::propfunc ( ,
p  ,
T  ,
 
)

◆ propfunc() [2/3]

X MultiComponentFluidProperties::propfunc ( ,
p  ,
T  ,
 
)

◆ propfunc() [3/3]

MultiComponentFluidProperties::propfunc ( rho  ,
p  ,
T  ,
 
)

Compute a fluid property given for the state defined by three given properties.

For all functions, the first three arguments are the given properties that define the fluid state. For the three-argument variants, the desired property is the return value. The seven-argument variants also provide partial derivatives x/da, dx/db and dx/dc where x is the desired property being computed, a is the first given property, b is the second given property etc. The desired property, dx/da, dx/db and dx/dc are stored into the 4rd, 5th, 6th and 7th arguments respectively.

Properties/parameters used in these function are listed below with their units:

@begincode p pressure [Pa] T temperature [K] X solute mass fraction [-] e specific internal energy [J/kg] rho density [kg/m^3] h specific enthalpy [J/kg] mu viscosity [Pa*s] k thermal conductivity [W/(m*K)] c speed of sound [m/s] cp constant-pressure specific heat [J/K] cv constant-volume specific heat [J/K]

As an example:

@begincode // calculate desnity given pressure, temperature and solute mass fraction: auto density = your_fluid_properties_object.rho_from_p_T_X(p, T, X);

// or use the derivative variant: Real rho = 0; // density will be stored into here Real drho_dp = 0; // derivative will be stored into here Real drho_dT = 0; // derivative will be stored into here Real drho_dX = 0; // derivative will be stored into here your_fluid_properties_object.rho_from_p_T_X(p, T, X, rho, drho_dp, drho_dT, drho_dX);

Automatic differentiation (AD) support is provided through prop_from_p_T_X(DualReal p, DualReal T, DualReal X) versions of the functions where p, T and X must be ADReal/DualNumber's calculated using all AD-supporting values.

◆ rho_mu_from_p_T_X() [1/3]

void MultiComponentFluidProperties::rho_mu_from_p_T_X ( DualReal  pressure,
DualReal  temperature,
DualReal  xmass,
DualReal &  rho,
DualReal &  mu 
) const
virtual

Definition at line 42 of file MultiComponentFluidProperties.C.

44 {
45  rho = rho_from_p_T_X(pressure, temperature, xmass);
46  mu = mu_from_p_T_X(pressure, temperature, xmass);
47 }

◆ rho_mu_from_p_T_X() [2/3]

void MultiComponentFluidProperties::rho_mu_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  drho_dx,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT,
Real &  dmu_dx 
) const
virtual

Density and viscosity and their derivatives wrt pressure, temperature and mass fraction.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature
[out]drho_dxderivative of density wrt mass fraction
[out]muviscosity (Pa.s)
[out]dmu_dpderivative of viscosity wrt pressure
[out]dmu_dTderivative of viscosity wrt temperature
[out]dmu_dxderivative of viscosity wrt mass fraction

Definition at line 50 of file MultiComponentFluidProperties.C.

61 {
62  rho_from_p_T_X(pressure, temperature, xmass, rho, drho_dp, drho_dT, drho_dx);
63  mu_from_p_T_X(pressure, temperature, xmass, mu, dmu_dp, dmu_dT, dmu_dx);
64 }

◆ rho_mu_from_p_T_X() [3/3]

void MultiComponentFluidProperties::rho_mu_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  rho,
Real &  mu 
) const
virtual

Density and viscosity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
[out]rhodensity (kg/m^3)

Definition at line 34 of file MultiComponentFluidProperties.C.

36 {
37  rho = rho_from_p_T_X(pressure, temperature, xmass);
38  mu = mu_from_p_T_X(pressure, temperature, xmass);
39 }

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 39 of file FluidProperties.h.

39 {}

◆ threadJoin()

virtual void FluidProperties::threadJoin ( const UserObject &  )
inlinefinalvirtualinherited

Definition at line 38 of file FluidProperties.h.

38 {}

Member Data Documentation

◆ _allow_imperfect_jacobians

const bool FluidProperties::_allow_imperfect_jacobians
protectedinherited

Flag to set unimplemented Jacobian entries to zero.

Definition at line 48 of file FluidProperties.h.

Referenced by SinglePhaseFluidProperties::fluidPropError().

◆ _R

const Real FluidProperties::_R = 8.3144598
staticinherited

◆ _T_c2k

const Real FluidProperties::_T_c2k
protectedinherited

◆ p [1/3]

MultiComponentFluidProperties::p

◆ p [2/3]

X MultiComponentFluidProperties::p

Definition at line 125 of file MultiComponentFluidProperties.h.

◆ p [3/3]

X X MultiComponentFluidProperties::p

Definition at line 127 of file MultiComponentFluidProperties.h.

◆ T [1/3]

MultiComponentFluidProperties::T

◆ T [2/3]

X MultiComponentFluidProperties::T

Definition at line 125 of file MultiComponentFluidProperties.h.

◆ T [3/3]

X X MultiComponentFluidProperties::T

Definition at line 127 of file MultiComponentFluidProperties.h.


The documentation for this class was generated from the following files:
FluidProperties::FluidProperties
FluidProperties(const InputParameters &parameters)
Definition: FluidProperties.C:27
name
const std::string name
Definition: Setup.h:21
NS::temperature
const std::string temperature
Definition: NS.h:26
NS::pressure
const std::string pressure
Definition: NS.h:25