Fluid state class using a persistent set of primary variables for the mutliphase, multicomponent case. More...
#include <PorousFlowFluidState.h>
Public Member Functions | |
PorousFlowFluidState (const InputParameters ¶meters) | |
Protected Member Functions | |
virtual void | initQpStatefulProperties () override |
virtual void | computeQpProperties () override |
void | setMaterialVectorSize () const |
Size material property vectors and initialise with zeros. More... | |
virtual void | thermophysicalProperties () |
Calculates all required thermophysical properties and derivatives for each phase and fluid component. More... | |
Protected Attributes | |
const VariableValue & | _gas_porepressure |
Porepressure. More... | |
const VariableGradient & | _gas_gradp_qp |
Gradient of porepressure (only defined at the qps) More... | |
const unsigned int | _gas_porepressure_varnum |
Moose variable number of the gas porepressure. More... | |
const unsigned int | _pvar |
PorousFlow variable number of the gas porepressure. More... | |
std::vector< const VariableValue * > | _Z |
Total mass fraction(s) of the gas component(s) summed over all phases. More... | |
std::vector< const VariableGradient * > | _gradZ_qp |
Gradient(s) of total mass fraction(s) of the gas component(s) (only defined at the qps) More... | |
std::vector< unsigned int > | _Z_varnum |
Moose variable number of Z. More... | |
std::vector< unsigned int > | _Zvar |
PorousFlow variable number of Z. More... | |
const unsigned int | _num_Z_vars |
Number of coupled total mass fractions. Should be _num_phases - 1. More... | |
const VariableValue & | _Xnacl |
Salt mass fraction (kg/kg) More... | |
const VariableGradient & | _grad_Xnacl_qp |
Gradient of salt mass fraction (only defined at the qps) More... | |
const unsigned int | _Xnacl_varnum |
Salt mass fraction variable number. More... | |
const unsigned int | _Xvar |
Salt mass fraction PorousFlow variable number. More... | |
const PorousFlowFluidStateMultiComponentBase & | _fs |
FluidState UserObject. More... | |
const unsigned int | _aqueous_phase_number |
Phase number of the aqueous phase. More... | |
const unsigned int | _gas_phase_number |
Phase number of the gas phase. More... | |
const unsigned int | _aqueous_fluid_component |
Fluid component number of the aqueous component. More... | |
const unsigned int | _gas_fluid_component |
Fluid component number of the gas phase. More... | |
const unsigned int | _salt_component |
Salt component index. More... | |
const MaterialProperty< Real > & | _temperature |
Temperature. More... | |
const MaterialProperty< RealGradient > & | _gradT_qp |
Gradient of temperature (only defined at the qps) More... | |
const MaterialProperty< std::vector< Real > > & | _dtemperature_dvar |
Derivative of temperature wrt PorousFlow variables. More... | |
const unsigned int | _temperature_varnum |
Moose variable number of the temperature. More... | |
const unsigned int | _Tvar |
PorousFlow variable number of the temperature. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _mass_frac |
Mass fraction matrix. More... | |
MaterialProperty< std::vector< std::vector< RealGradient > > > * | _grad_mass_frac_qp |
Gradient of the mass fraction matrix (only defined at the qps) More... | |
MaterialProperty< std::vector< std::vector< std::vector< Real > > > > & | _dmass_frac_dvar |
Derivative of the mass fraction matrix with respect to the Porous Flow variables. More... | |
MaterialProperty< std::vector< Real > > & | _fluid_density |
Fluid density of each phase. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _dfluid_density_dvar |
Derivative of the fluid density for each phase wrt PorousFlow variables. More... | |
MaterialProperty< std::vector< Real > > & | _fluid_viscosity |
Viscosity of each phase. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _dfluid_viscosity_dvar |
Derivative of the fluid viscosity for each phase wrt PorousFlow variables. More... | |
MaterialProperty< std::vector< Real > > & | _fluid_enthalpy |
Enthalpy of each phase. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _dfluid_enthalpy_dvar |
Derivative of the fluid enthalpy for each phase wrt PorousFlow variables. More... | |
MaterialProperty< std::vector< Real > > & | _fluid_internal_energy |
Internal energy of each phase. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _dfluid_internal_energy_dvar |
Derivative of the fluid internal energy for each phase wrt PorousFlow variables. More... | |
const Real | _T_c2k |
Conversion from degrees Celsius to degrees Kelvin. More... | |
bool | _is_initqp |
Flag to indicate whether to calculate stateful properties. More... | |
std::vector< FluidStateProperties > | _fsp |
FluidStateProperties data structure. More... | |
const PorousFlowCapillaryPressure & | _pc |
Capillary pressure UserObject. More... | |
const unsigned int | _pidx |
Index of derivative wrt pressure. More... | |
const unsigned int | _Tidx |
Index of derivative wrt temperature. More... | |
const unsigned int | _Zidx |
Index of derivative wrt total mass fraction Z. More... | |
const unsigned int | _Xidx |
Index of derivative wrt salt mass fraction X. More... | |
const unsigned int | _num_phases |
Number of phases. More... | |
const unsigned int | _num_components |
Number of components. More... | |
const unsigned int | _num_pf_vars |
Number of PorousFlow variables. More... | |
MaterialProperty< std::vector< Real > > & | _porepressure |
Computed nodal or quadpoint values of porepressure of the phases. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _dporepressure_dvar |
d(porepressure)/d(PorousFlow variable) More... | |
MaterialProperty< std::vector< RealGradient > > *const | _gradp_qp |
Grad(p) at the quadpoints. More... | |
MaterialProperty< std::vector< std::vector< Real > > > *const | _dgradp_qp_dgradv |
d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints More... | |
MaterialProperty< std::vector< std::vector< RealGradient > > > *const | _dgradp_qp_dv |
d(grad porepressure)/d(PorousFlow variable) at the quadpoints More... | |
MaterialProperty< std::vector< Real > > & | _saturation |
Computed nodal or qp saturation of the phases. More... | |
MaterialProperty< std::vector< std::vector< Real > > > & | _dsaturation_dvar |
d(saturation)/d(PorousFlow variable) More... | |
MaterialProperty< std::vector< RealGradient > > *const | _grads_qp |
Grad(s) at the quadpoints. More... | |
MaterialProperty< std::vector< std::vector< Real > > > *const | _dgrads_qp_dgradv |
d(grad saturation)/d(grad PorousFlow variable) at the quadpoints More... | |
MaterialProperty< std::vector< std::vector< RealGradient > > > *const | _dgrads_qp_dv |
d(grad saturation)/d(PorousFlow variable) at the quadpoints More... | |
Fluid state class using a persistent set of primary variables for the mutliphase, multicomponent case.
Primary variables are: gas pressure, total mass fraction of a component summed over all phases (and optionally temperature in a non-isothermal case).
The total mass fraction of component i summed over all phases, Z_i, is defined as (for two phases)
Z_i = (S_g rho_g Y_i + S_l rho_l X_i) / (S_g rho_g + S_l rho_l)
where S is saturation, rho is density, and the subscripts correspond to gas and liquid phases, respectively, and Y_i and X_i are the mass fractions of the ith component in the gas and liquid phase, respectively.
Depending on the phase conditions, the primary variable Z_i can represent either a mass fraction (when only a single phase is present), or a saturation when two phases are present, and hence it is a persistent variable.
The PorousFlow kernels expect saturation and mass fractions (as well as pressure and temperature), so these must be calculated from Z_i once the state of the system is determined.
A compositional flash calculation using the Rachford-Rice equation is solved to determine vapor fraction (gas saturation), and subsequently the composition of each phase.
Definition at line 50 of file PorousFlowFluidState.h.
PorousFlowFluidState::PorousFlowFluidState | ( | const InputParameters & | parameters | ) |
Definition at line 38 of file PorousFlowFluidState.C.
|
overrideprotectedvirtual |
Reimplemented from PorousFlowVariableBase.
Definition at line 195 of file PorousFlowFluidState.C.
|
overrideprotectedvirtual |
|
protected |
Size material property vectors and initialise with zeros.
Definition at line 394 of file PorousFlowFluidState.C.
Referenced by computeQpProperties(), and initQpStatefulProperties().
|
protectedvirtual |
Calculates all required thermophysical properties and derivatives for each phase and fluid component.
Definition at line 157 of file PorousFlowFluidState.C.
Referenced by computeQpProperties(), and initQpStatefulProperties().
|
protected |
Fluid component number of the aqueous component.
Definition at line 101 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Phase number of the aqueous phase.
Definition at line 97 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Derivative of the fluid density for each phase wrt PorousFlow variables.
Definition at line 126 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and setMaterialVectorSize().
|
protected |
Derivative of the fluid enthalpy for each phase wrt PorousFlow variables.
Definition at line 134 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and setMaterialVectorSize().
|
protected |
Derivative of the fluid internal energy for each phase wrt PorousFlow variables.
Definition at line 138 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and setMaterialVectorSize().
|
protected |
Derivative of the fluid viscosity for each phase wrt PorousFlow variables.
Definition at line 130 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and setMaterialVectorSize().
|
protectedinherited |
d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints
Definition at line 53 of file PorousFlowVariableBase.h.
Referenced by PorousFlowFluidStateSingleComponent::computeQpProperties(), and computeQpProperties().
|
protectedinherited |
d(grad porepressure)/d(PorousFlow variable) at the quadpoints
Definition at line 56 of file PorousFlowVariableBase.h.
|
protectedinherited |
d(grad saturation)/d(grad PorousFlow variable) at the quadpoints
Definition at line 68 of file PorousFlowVariableBase.h.
|
protectedinherited |
d(grad saturation)/d(PorousFlow variable) at the quadpoints
Definition at line 71 of file PorousFlowVariableBase.h.
|
protected |
Derivative of the mass fraction matrix with respect to the Porous Flow variables.
Definition at line 121 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and setMaterialVectorSize().
|
protectedinherited |
d(porepressure)/d(PorousFlow variable)
Definition at line 47 of file PorousFlowVariableBase.h.
Referenced by PorousFlow1PhaseFullySaturated::computeQpProperties(), PorousFlow2PhasePP::computeQpProperties(), PorousFlow1PhaseP::computeQpProperties(), PorousFlowVariableBase::computeQpProperties(), PorousFlow1PhaseMD_Gaussian::computeQpProperties(), PorousFlow2PhasePS::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), and computeQpProperties().
|
protectedinherited |
d(saturation)/d(PorousFlow variable)
Definition at line 62 of file PorousFlowVariableBase.h.
Referenced by PorousFlow2PhasePP::computeQpProperties(), PorousFlowVariableBase::computeQpProperties(), PorousFlow1PhaseMD_Gaussian::computeQpProperties(), PorousFlow1PhaseP::computeQpProperties(), PorousFlow2PhasePS::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), and computeQpProperties().
|
protected |
Derivative of temperature wrt PorousFlow variables.
Definition at line 111 of file PorousFlowFluidState.h.
|
protected |
Fluid density of each phase.
Definition at line 124 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().
|
protected |
Enthalpy of each phase.
Definition at line 132 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().
|
protected |
Internal energy of each phase.
Definition at line 136 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().
|
protected |
Viscosity of each phase.
Definition at line 128 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().
|
protected |
FluidState UserObject.
Definition at line 95 of file PorousFlowFluidState.h.
Referenced by PorousFlowFluidState(), and thermophysicalProperties().
|
protected |
FluidStateProperties data structure.
Definition at line 145 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), PorousFlowFluidState(), and thermophysicalProperties().
|
protected |
Fluid component number of the gas phase.
Definition at line 103 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Gradient of porepressure (only defined at the qps)
Definition at line 71 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Phase number of the gas phase.
Definition at line 99 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Porepressure.
Definition at line 69 of file PorousFlowFluidState.h.
Referenced by thermophysicalProperties().
|
protected |
Moose variable number of the gas porepressure.
Definition at line 73 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Gradient of the mass fraction matrix (only defined at the qps)
Definition at line 119 of file PorousFlowFluidState.h.
|
protected |
Gradient of salt mass fraction (only defined at the qps)
Definition at line 89 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protectedinherited |
Grad(p) at the quadpoints.
Definition at line 50 of file PorousFlowVariableBase.h.
|
protectedinherited |
Grad(s) at the quadpoints.
Definition at line 65 of file PorousFlowVariableBase.h.
|
protected |
Gradient of temperature (only defined at the qps)
Definition at line 109 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Gradient(s) of total mass fraction(s) of the gas component(s) (only defined at the qps)
Definition at line 79 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and PorousFlowFluidState().
|
protected |
Flag to indicate whether to calculate stateful properties.
Definition at line 143 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().
|
protected |
Mass fraction matrix.
Definition at line 117 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().
|
protectedinherited |
Number of components.
Definition at line 38 of file PorousFlowVariableBase.h.
Referenced by PorousFlowFluidStateSingleComponent::computeQpProperties(), computeQpProperties(), initQpStatefulProperties(), PorousFlowFluidState(), PorousFlowFluidStateSingleComponent::PorousFlowFluidStateSingleComponent(), PorousFlowFluidStateSingleComponent::setMaterialVectorSize(), and setMaterialVectorSize().
|
protectedinherited |
Number of PorousFlow variables.
Definition at line 41 of file PorousFlowVariableBase.h.
Referenced by PorousFlowVariableBase::computeQpProperties(), PorousFlowFluidStateSingleComponent::setMaterialVectorSize(), and setMaterialVectorSize().
|
protectedinherited |
Number of phases.
Definition at line 35 of file PorousFlowVariableBase.h.
Referenced by PorousFlowVariableBase::computeQpProperties(), PorousFlow2PhasePS::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), computeQpProperties(), PorousFlowVariableBase::initQpStatefulProperties(), PorousFlowFluidStateSingleComponent::initQpStatefulProperties(), initQpStatefulProperties(), PorousFlow1PhaseFullySaturated::PorousFlow1PhaseFullySaturated(), PorousFlow1PhaseMD_Gaussian::PorousFlow1PhaseMD_Gaussian(), PorousFlow1PhaseP::PorousFlow1PhaseP(), PorousFlow2PhasePP::PorousFlow2PhasePP(), PorousFlowFluidState(), PorousFlowFluidStateSingleComponent::PorousFlowFluidStateSingleComponent(), PorousFlowFluidStateSingleComponent::setMaterialVectorSize(), and setMaterialVectorSize().
|
protected |
Number of coupled total mass fractions. Should be _num_phases - 1.
Definition at line 85 of file PorousFlowFluidState.h.
Referenced by PorousFlowFluidState().
|
protected |
Capillary pressure UserObject.
Definition at line 147 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Index of derivative wrt pressure.
Definition at line 149 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protectedinherited |
Computed nodal or quadpoint values of porepressure of the phases.
Definition at line 44 of file PorousFlowVariableBase.h.
Referenced by PorousFlow1PhaseMD_Gaussian::buildPS(), PorousFlow2PhasePS::buildQpPPSS(), PorousFlow1PhaseFullySaturated::buildQpPPSS(), PorousFlow1PhaseP::buildQpPPSS(), PorousFlow2PhasePP::buildQpPPSS(), PorousFlow1PhaseMD_Gaussian::computeQpProperties(), PorousFlowVariableBase::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), computeQpProperties(), PorousFlowVariableBase::initQpStatefulProperties(), PorousFlowFluidStateSingleComponent::initQpStatefulProperties(), and initQpStatefulProperties().
|
protected |
PorousFlow variable number of the gas porepressure.
Definition at line 75 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Salt component index.
Definition at line 105 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protectedinherited |
Computed nodal or qp saturation of the phases.
Definition at line 59 of file PorousFlowVariableBase.h.
Referenced by PorousFlow1PhaseMD_Gaussian::buildPS(), PorousFlow2PhasePS::buildQpPPSS(), PorousFlow1PhaseFullySaturated::buildQpPPSS(), PorousFlow1PhaseP::buildQpPPSS(), PorousFlow2PhasePP::buildQpPPSS(), PorousFlow1PhaseMD_Gaussian::computeQpProperties(), PorousFlowVariableBase::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), computeQpProperties(), PorousFlowVariableBase::initQpStatefulProperties(), PorousFlowFluidStateSingleComponent::initQpStatefulProperties(), and initQpStatefulProperties().
|
protected |
Conversion from degrees Celsius to degrees Kelvin.
Definition at line 141 of file PorousFlowFluidState.h.
Referenced by thermophysicalProperties().
|
protected |
Temperature.
Definition at line 107 of file PorousFlowFluidState.h.
Referenced by thermophysicalProperties().
|
protected |
Moose variable number of the temperature.
Definition at line 113 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Index of derivative wrt temperature.
Definition at line 151 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
PorousFlow variable number of the temperature.
Definition at line 115 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Index of derivative wrt salt mass fraction X.
Definition at line 155 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Salt mass fraction (kg/kg)
Definition at line 87 of file PorousFlowFluidState.h.
Referenced by thermophysicalProperties().
|
protected |
Salt mass fraction variable number.
Definition at line 91 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Salt mass fraction PorousFlow variable number.
Definition at line 93 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
Total mass fraction(s) of the gas component(s) summed over all phases.
Definition at line 77 of file PorousFlowFluidState.h.
Referenced by PorousFlowFluidState(), and thermophysicalProperties().
|
protected |
Moose variable number of Z.
Definition at line 81 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and PorousFlowFluidState().
|
protected |
Index of derivative wrt total mass fraction Z.
Definition at line 153 of file PorousFlowFluidState.h.
Referenced by computeQpProperties().
|
protected |
PorousFlow variable number of Z.
Definition at line 83 of file PorousFlowFluidState.h.
Referenced by computeQpProperties(), and PorousFlowFluidState().