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

Fluid state class using a persistent set of primary variables for the mutliphase, multicomponent case. More...

#include <PorousFlowFluidState.h>

Inheritance diagram for PorousFlowFluidState:
[legend]

Public Member Functions

 PorousFlowFluidState (const InputParameters &parameters)
 

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PorousFlowFluidState()

PorousFlowFluidState::PorousFlowFluidState ( const InputParameters &  parameters)

Definition at line 38 of file PorousFlowFluidState.C.

39  : PorousFlowVariableBase(parameters),
40 
41  _gas_porepressure(_nodal_material ? coupledDofValues("gas_porepressure")
42  : coupledValue("gas_porepressure")),
43  _gas_gradp_qp(coupledGradient("gas_porepressure")),
44  _gas_porepressure_varnum(coupled("gas_porepressure")),
45  _pvar(_dictator.isPorousFlowVariable(_gas_porepressure_varnum)
46  ? _dictator.porousFlowVariableNum(_gas_porepressure_varnum)
47  : 0),
48 
49  _num_Z_vars(coupledComponents("z")),
50  _Xnacl(_nodal_material ? coupledDofValues("xnacl") : coupledValue("xnacl")),
51  _grad_Xnacl_qp(coupledGradient("xnacl")),
52  _Xnacl_varnum(coupled("xnacl")),
53  _Xvar(_dictator.isPorousFlowVariable(_Xnacl_varnum)
54  ? _dictator.porousFlowVariableNum(_Xnacl_varnum)
55  : 0),
56 
57  _fs(getUserObject<PorousFlowFluidStateMultiComponentBase>("fluid_state")),
58  _aqueous_phase_number(_fs.aqueousPhaseIndex()),
59  _gas_phase_number(_fs.gasPhaseIndex()),
60  _aqueous_fluid_component(_fs.aqueousComponentIndex()),
61  _gas_fluid_component(_fs.gasComponentIndex()),
62  _salt_component(_fs.saltComponentIndex()),
63 
64  _temperature(_nodal_material ? getMaterialProperty<Real>("PorousFlow_temperature_nodal")
65  : getMaterialProperty<Real>("PorousFlow_temperature_qp")),
66  _gradT_qp(getMaterialProperty<RealGradient>("PorousFlow_grad_temperature_qp")),
68  _nodal_material
69  ? getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")
70  : getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")),
71  _temperature_varnum(coupled("temperature")),
72  _Tvar(_dictator.isPorousFlowVariable(_temperature_varnum)
73  ? _dictator.porousFlowVariableNum(_temperature_varnum)
74  : 0),
75  _mass_frac(_nodal_material
76  ? declareProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal")
77  : declareProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_qp")),
78  _grad_mass_frac_qp(_nodal_material ? nullptr
79  : &declareProperty<std::vector<std::vector<RealGradient>>>(
80  "PorousFlow_grad_mass_frac_qp")),
81  _dmass_frac_dvar(_nodal_material ? declareProperty<std::vector<std::vector<std::vector<Real>>>>(
82  "dPorousFlow_mass_frac_nodal_dvar")
83  : declareProperty<std::vector<std::vector<std::vector<Real>>>>(
84  "dPorousFlow_mass_frac_qp_dvar")),
85 
86  _fluid_density(_nodal_material
87  ? declareProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_nodal")
88  : declareProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_qp")),
89  _dfluid_density_dvar(_nodal_material ? declareProperty<std::vector<std::vector<Real>>>(
90  "dPorousFlow_fluid_phase_density_nodal_dvar")
91  : declareProperty<std::vector<std::vector<Real>>>(
92  "dPorousFlow_fluid_phase_density_qp_dvar")),
93  _fluid_viscosity(_nodal_material
94  ? declareProperty<std::vector<Real>>("PorousFlow_viscosity_nodal")
95  : declareProperty<std::vector<Real>>("PorousFlow_viscosity_qp")),
97  _nodal_material
98  ? declareProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_nodal_dvar")
99  : declareProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_qp_dvar")),
100 
102  _nodal_material
103  ? declareProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal")
104  : declareProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_qp")),
105  _dfluid_enthalpy_dvar(_nodal_material ? declareProperty<std::vector<std::vector<Real>>>(
106  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")
107  : declareProperty<std::vector<std::vector<Real>>>(
108  "dPorousFlow_fluid_phase_enthalpy_qp_dvar")),
109 
111  _nodal_material
112  ? declareProperty<std::vector<Real>>("PorousFlow_fluid_phase_internal_energy_nodal")
113  : declareProperty<std::vector<Real>>("PorousFlow_fluid_phase_internal_energy_qp")),
114  _dfluid_internal_energy_dvar(_nodal_material
115  ? declareProperty<std::vector<std::vector<Real>>>(
116  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")
117  : declareProperty<std::vector<std::vector<Real>>>(
118  "dPorousFlow_fluid_phase_internal_energy_qp_dvar")),
119 
120  _T_c2k(getParam<MooseEnum>("temperature_unit") == 0 ? 0.0 : 273.15),
121  _is_initqp(false),
122  _pc(getUserObject<PorousFlowCapillaryPressure>("capillary_pressure")),
123  _pidx(_fs.getPressureIndex()),
124  _Tidx(_fs.getTemperatureIndex()),
125  _Zidx(_fs.getZIndex()),
126  _Xidx(_fs.getXIndex())
127 {
128  // Check that the number of phases in the fluidstate class is also provided in the Dictator
129  if (_fs.numPhases() != _num_phases)
130  mooseError(name(),
131  ": only ",
132  _fs.numPhases(),
133  " phases are allowed. Please check the number of phases entered in the dictator is "
134  "correct");
135 
136  // Store all total mass fractions and associated variable numbers
137  _Z.resize(_num_Z_vars);
138  _gradZ_qp.resize(_num_Z_vars);
139  _Z_varnum.resize(_num_Z_vars);
140  _Zvar.resize(_num_Z_vars);
141 
142  for (unsigned int i = 0; i < _num_Z_vars; ++i)
143  {
144  _Z[i] = (_nodal_material ? &coupledDofValues("z", i) : &coupledValue("z", i));
145  _gradZ_qp[i] = &coupledGradient("z", i);
146  _Z_varnum[i] = coupled("z", i);
147  _Zvar[i] = (_dictator.isPorousFlowVariable(_Z_varnum[i])
148  ? _dictator.porousFlowVariableNum(_Z_varnum[i])
149  : 0);
150  }
151 
152  // Set the size of the FluidStateProperties vector
154 }

Member Function Documentation

◆ computeQpProperties()

void PorousFlowFluidState::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 195 of file PorousFlowFluidState.C.

196 {
197  _is_initqp = false;
198  // Prepare the derivative vectors
200 
201  // Set the size of all other vectors
203 
204  // Calculate all required thermophysical properties
206 
207  for (unsigned int ph = 0; ph < _num_phases; ++ph)
208  {
209  _saturation[_qp][ph] = _fsp[ph].saturation.value();
210  _porepressure[_qp][ph] = _fsp[ph].pressure.value();
211  _fluid_density[_qp][ph] = _fsp[ph].density.value();
212  _fluid_viscosity[_qp][ph] = _fsp[ph].viscosity.value();
213  _fluid_enthalpy[_qp][ph] = _fsp[ph].enthalpy.value();
214  _fluid_internal_energy[_qp][ph] = _fsp[ph].internal_energy.value();
215 
216  for (unsigned int comp = 0; comp < _num_components; ++comp)
217  _mass_frac[_qp][ph][comp] = _fsp[ph].mass_fraction[comp].value();
218  }
219 
220  // Derivative of properties wrt variables (calculated in fluid state class)
221  for (unsigned int ph = 0; ph < _num_phases; ++ph)
222  {
223  // If porepressure is a PorousFlow variable (it usually is), add derivatives wrt porepressure
224  if (_dictator.isPorousFlowVariable(_gas_porepressure_varnum))
225  {
226  _dporepressure_dvar[_qp][ph][_pvar] = _fsp[ph].pressure.derivatives()[_pidx];
227  _dsaturation_dvar[_qp][ph][_pvar] = _fsp[ph].saturation.derivatives()[_pidx];
228  _dfluid_density_dvar[_qp][ph][_pvar] = _fsp[ph].density.derivatives()[_pidx];
229  _dfluid_viscosity_dvar[_qp][ph][_pvar] = _fsp[ph].viscosity.derivatives()[_pidx];
230  _dfluid_enthalpy_dvar[_qp][ph][_pvar] = _fsp[ph].enthalpy.derivatives()[_pidx];
231  _dfluid_internal_energy_dvar[_qp][ph][_pvar] = _fsp[ph].internal_energy.derivatives()[_pidx];
232 
233  for (unsigned int comp = 0; comp < _num_components; ++comp)
234  _dmass_frac_dvar[_qp][ph][comp][_pvar] = _fsp[ph].mass_fraction[comp].derivatives()[_pidx];
235  }
236 
237  // If Z is a PorousFlow variable (it usually is), add derivatives wrt Z
238  if (_dictator.isPorousFlowVariable(_Z_varnum[0]))
239  {
240  _dporepressure_dvar[_qp][ph][_Zvar[0]] = _fsp[ph].pressure.derivatives()[_Zidx];
241  _dsaturation_dvar[_qp][ph][_Zvar[0]] = _fsp[ph].saturation.derivatives()[_Zidx];
242  _dfluid_density_dvar[_qp][ph][_Zvar[0]] = _fsp[ph].density.derivatives()[_Zidx];
243  _dfluid_viscosity_dvar[_qp][ph][_Zvar[0]] = _fsp[ph].viscosity.derivatives()[_Zidx];
244  _dfluid_enthalpy_dvar[_qp][ph][_Zvar[0]] = _fsp[ph].enthalpy.derivatives()[_Zidx];
245  _dfluid_internal_energy_dvar[_qp][ph][_Zvar[0]] =
246  _fsp[ph].internal_energy.derivatives()[_Zidx];
247 
248  for (unsigned int comp = 0; comp < _num_components; ++comp)
249  _dmass_frac_dvar[_qp][ph][comp][_Zvar[0]] =
250  _fsp[ph].mass_fraction[comp].derivatives()[_Zidx];
251  }
252 
253  // If temperature is a PorousFlow variable (nonisothermal case), add derivatives wrt temperature
254  if (_dictator.isPorousFlowVariable(_temperature_varnum))
255  {
256  _dporepressure_dvar[_qp][ph][_Tvar] = _fsp[ph].pressure.derivatives()[_Tidx];
257  _dsaturation_dvar[_qp][ph][_Tvar] = _fsp[ph].saturation.derivatives()[_Tidx];
258  _dfluid_density_dvar[_qp][ph][_Tvar] = _fsp[ph].density.derivatives()[_Tidx];
259  _dfluid_viscosity_dvar[_qp][ph][_Tvar] = _fsp[ph].viscosity.derivatives()[_Tidx];
260  _dfluid_enthalpy_dvar[_qp][ph][_Tvar] = _fsp[ph].enthalpy.derivatives()[_Tidx];
261  _dfluid_internal_energy_dvar[_qp][ph][_Tvar] = _fsp[ph].internal_energy.derivatives()[_Tidx];
262 
263  for (unsigned int comp = 0; comp < _num_components; ++comp)
264  _dmass_frac_dvar[_qp][ph][comp][_Tvar] = _fsp[ph].mass_fraction[comp].derivatives()[_Tidx];
265  }
266 
267  // If Xnacl is a PorousFlow variable, add derivatives wrt Xnacl
268  if (_dictator.isPorousFlowVariable(_Xnacl_varnum))
269  {
270  _dporepressure_dvar[_qp][ph][_Xvar] = _fsp[ph].pressure.derivatives()[_Xidx];
271  _dsaturation_dvar[_qp][ph][_Xvar] = _fsp[ph].saturation.derivatives()[_Xidx];
272  _dfluid_density_dvar[_qp][ph][_Xvar] += _fsp[ph].density.derivatives()[_Xidx];
273  _dfluid_viscosity_dvar[_qp][ph][_Xvar] += _fsp[ph].viscosity.derivatives()[_Xidx];
274  _dfluid_enthalpy_dvar[_qp][ph][_Xvar] = _fsp[ph].enthalpy.derivatives()[_Xidx];
275  _dfluid_internal_energy_dvar[_qp][ph][_Xvar] = _fsp[ph].internal_energy.derivatives()[_Xidx];
276 
277  for (unsigned int comp = 0; comp < _num_components; ++comp)
278  _dmass_frac_dvar[_qp][ph][comp][_Xvar] = _fsp[ph].mass_fraction[comp].derivatives()[_Xidx];
279  }
280  }
281 
282  // If the material properties are being evaluated at the qps, calculate the gradients as well
283  // Note: only nodal properties are evaluated in initQpStatefulProperties(), so no need to check
284  // _is_initqp flag for qp properties
285  if (!_nodal_material)
286  {
287  // Derivatives of capillary pressure
288  const Real dpc = _pc.dCapillaryPressure(_fsp[_aqueous_phase_number].saturation.value(), _qp);
289  const Real d2pc = _pc.d2CapillaryPressure(_fsp[_aqueous_phase_number].saturation.value(), _qp);
290 
291  // Gradients of saturation and porepressure in all phases
292  (*_grads_qp)[_qp][_gas_phase_number] =
294  _dsaturation_dvar[_qp][_gas_phase_number][_Zvar[0]] * (*_gradZ_qp[0])[_qp] +
296  (*_grads_qp)[_qp][_aqueous_phase_number] = -(*_grads_qp)[_qp][_gas_phase_number];
297 
298  (*_gradp_qp)[_qp][_gas_phase_number] = _gas_gradp_qp[_qp];
299  (*_gradp_qp)[_qp][_aqueous_phase_number] =
300  _gas_gradp_qp[_qp] - dpc * (*_grads_qp)[_qp][_aqueous_phase_number];
301 
302  // Gradients of mass fractions for each component in each phase
303  (*_grad_mass_frac_qp)[_qp][_aqueous_phase_number][_aqueous_fluid_component] =
304  _fsp[_aqueous_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_pidx] *
305  _gas_gradp_qp[_qp] +
306  _fsp[_aqueous_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Zidx] *
307  (*_gradZ_qp[0])[_qp] +
308  _fsp[_aqueous_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Tidx] *
309  _gradT_qp[_qp];
310  (*_grad_mass_frac_qp)[_qp][_aqueous_phase_number][_gas_fluid_component] =
311  -(*_grad_mass_frac_qp)[_qp][_aqueous_phase_number][_aqueous_fluid_component];
312 
313  (*_grad_mass_frac_qp)[_qp][_gas_phase_number][_aqueous_fluid_component] =
314  _fsp[_gas_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_pidx] *
315  _gas_gradp_qp[_qp] +
316  _fsp[_gas_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Zidx] *
317  (*_gradZ_qp[0])[_qp] +
318  _fsp[_gas_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Tidx] *
319  _gradT_qp[_qp];
320  (*_grad_mass_frac_qp)[_qp][_gas_phase_number][_gas_fluid_component] =
321  -(*_grad_mass_frac_qp)[_qp][_gas_phase_number][_aqueous_fluid_component];
322 
323  // Derivatives of gradients wrt variables
324  if (_dictator.isPorousFlowVariable(_gas_porepressure_varnum))
325  {
326  for (unsigned int ph = 0; ph < _num_phases; ++ph)
327  (*_dgradp_qp_dgradv)[_qp][ph][_pvar] = 1.0;
328 
329  (*_dgradp_qp_dgradv)[_qp][_aqueous_phase_number][_pvar] +=
331 
332  (*_dgradp_qp_dv)[_qp][_aqueous_phase_number][_pvar] =
333  -d2pc * (*_grads_qp)[_qp][_aqueous_phase_number] *
335  }
336 
337  if (_dictator.isPorousFlowVariable(_Z_varnum[0]))
338  {
339  (*_dgradp_qp_dgradv)[_qp][_aqueous_phase_number][_Zvar[0]] =
341 
342  (*_dgradp_qp_dv)[_qp][_aqueous_phase_number][_Zvar[0]] =
343  -d2pc * (*_grads_qp)[_qp][_aqueous_phase_number] *
345  }
346 
347  if (_dictator.isPorousFlowVariable(_temperature_varnum))
348  {
349  (*_dgradp_qp_dgradv)[_qp][_aqueous_phase_number][_Tvar] =
351 
352  (*_dgradp_qp_dv)[_qp][_aqueous_phase_number][_Tvar] =
353  -d2pc * (*_grads_qp)[_qp][_aqueous_phase_number] *
355  }
356 
357  // If Xnacl is a PorousFlow variable, add gradients and derivatives wrt Xnacl
358  if (_dictator.isPorousFlowVariable(_Xnacl_varnum))
359  {
360  (*_dgradp_qp_dgradv)[_qp][_aqueous_phase_number][_Xvar] =
362 
363  (*_grads_qp)[_qp][_aqueous_phase_number] +=
365 
366  (*_grads_qp)[_qp][_gas_phase_number] -=
368 
369  (*_gradp_qp)[_qp][_aqueous_phase_number] -=
371 
372  (*_dgradp_qp_dv)[_qp][_aqueous_phase_number][_Xvar] =
373  -d2pc * (*_grads_qp)[_qp][_aqueous_phase_number] *
375 
376  (*_grad_mass_frac_qp)[_qp][_aqueous_phase_number][_salt_component] = _grad_Xnacl_qp[_qp];
377  (*_grad_mass_frac_qp)[_qp][_aqueous_phase_number][_aqueous_fluid_component] +=
378  _fsp[_aqueous_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Xidx] *
379  _grad_Xnacl_qp[_qp];
380  (*_grad_mass_frac_qp)[_qp][_aqueous_phase_number][_gas_fluid_component] -=
381  _fsp[_aqueous_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Xidx] *
382  _grad_Xnacl_qp[_qp];
383  (*_grad_mass_frac_qp)[_qp][_gas_phase_number][_aqueous_fluid_component] +=
384  _fsp[_gas_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Xidx] *
385  _grad_Xnacl_qp[_qp];
386  (*_grad_mass_frac_qp)[_qp][_gas_phase_number][_gas_fluid_component] -=
387  _fsp[_gas_phase_number].mass_fraction[_aqueous_fluid_component].derivatives()[_Xidx] *
388  _grad_Xnacl_qp[_qp];
389  }
390  }
391 }

◆ initQpStatefulProperties()

void PorousFlowFluidState::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 166 of file PorousFlowFluidState.C.

167 {
168  _is_initqp = true;
169  // Set the size of pressure and saturation vectors
171 
172  // Set the size of all other vectors
174 
176 
177  // Set the initial values of the properties at the nodes.
178  // Note: not required for qp materials as no old values at the qps are requested
179  if (_nodal_material)
180  for (unsigned int ph = 0; ph < _num_phases; ++ph)
181  {
182  _saturation[_qp][ph] = _fsp[ph].saturation.value();
183  _porepressure[_qp][ph] = _fsp[ph].pressure.value();
184  _fluid_density[_qp][ph] = _fsp[ph].density.value();
185  _fluid_viscosity[_qp][ph] = _fsp[ph].viscosity.value();
186  _fluid_enthalpy[_qp][ph] = _fsp[ph].enthalpy.value();
187  _fluid_internal_energy[_qp][ph] = _fsp[ph].internal_energy.value();
188 
189  for (unsigned int comp = 0; comp < _num_components; ++comp)
190  _mass_frac[_qp][ph][comp] = _fsp[ph].mass_fraction[comp].value();
191  }
192 }

◆ setMaterialVectorSize()

void PorousFlowFluidState::setMaterialVectorSize ( ) const
protected

Size material property vectors and initialise with zeros.

Definition at line 394 of file PorousFlowFluidState.C.

395 {
396  _fluid_density[_qp].assign(_num_phases, 0.0);
397  _fluid_viscosity[_qp].assign(_num_phases, 0.0);
398  _fluid_enthalpy[_qp].assign(_num_phases, 0.0);
399  _fluid_internal_energy[_qp].assign(_num_phases, 0.0);
400  _mass_frac[_qp].resize(_num_phases);
401 
402  for (unsigned int ph = 0; ph < _num_phases; ++ph)
403  _mass_frac[_qp][ph].resize(_num_components);
404 
405  // Derivatives and gradients are not required in initQpStatefulProperties
406  if (!_is_initqp)
407  {
408  _dfluid_density_dvar[_qp].resize(_num_phases);
409  _dfluid_viscosity_dvar[_qp].resize(_num_phases);
410  _dfluid_enthalpy_dvar[_qp].resize(_num_phases);
412  _dmass_frac_dvar[_qp].resize(_num_phases);
413 
414  if (!_nodal_material)
415  (*_grad_mass_frac_qp)[_qp].resize(_num_phases);
416 
417  for (unsigned int ph = 0; ph < _num_phases; ++ph)
418  {
419  _dfluid_density_dvar[_qp][ph].assign(_num_pf_vars, 0.0);
420  _dfluid_viscosity_dvar[_qp][ph].assign(_num_pf_vars, 0.0);
421  _dfluid_enthalpy_dvar[_qp][ph].assign(_num_pf_vars, 0.0);
422  _dfluid_internal_energy_dvar[_qp][ph].assign(_num_pf_vars, 0.0);
423  _dmass_frac_dvar[_qp][ph].resize(_num_components);
424 
425  for (unsigned int comp = 0; comp < _num_components; ++comp)
426  _dmass_frac_dvar[_qp][ph][comp].assign(_num_pf_vars, 0.0);
427 
428  if (!_nodal_material)
429  (*_grad_mass_frac_qp)[_qp][ph].assign(_num_components, RealGradient());
430  }
431  }
432 }

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ thermophysicalProperties()

void PorousFlowFluidState::thermophysicalProperties ( )
protectedvirtual

Calculates all required thermophysical properties and derivatives for each phase and fluid component.

Definition at line 157 of file PorousFlowFluidState.C.

158 {
159  // The FluidProperty objects use temperature in K
160  Real Tk = _temperature[_qp] + _T_c2k;
161 
162  _fs.thermophysicalProperties(_gas_porepressure[_qp], Tk, _Xnacl[_qp], (*_Z[0])[_qp], _qp, _fsp);
163 }

Referenced by computeQpProperties(), and initQpStatefulProperties().

Member Data Documentation

◆ _aqueous_fluid_component

const unsigned int PorousFlowFluidState::_aqueous_fluid_component
protected

Fluid component number of the aqueous component.

Definition at line 101 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _aqueous_phase_number

const unsigned int PorousFlowFluidState::_aqueous_phase_number
protected

Phase number of the aqueous phase.

Definition at line 97 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _dfluid_density_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFluidState::_dfluid_density_dvar
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().

◆ _dfluid_enthalpy_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFluidState::_dfluid_enthalpy_dvar
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().

◆ _dfluid_internal_energy_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFluidState::_dfluid_internal_energy_dvar
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().

◆ _dfluid_viscosity_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFluidState::_dfluid_viscosity_dvar
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().

◆ _dgradp_qp_dgradv

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgradp_qp_dgradv
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().

◆ _dgradp_qp_dv

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgradp_qp_dv
protectedinherited

d(grad porepressure)/d(PorousFlow variable) at the quadpoints

Definition at line 56 of file PorousFlowVariableBase.h.

◆ _dgrads_qp_dgradv

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgrads_qp_dgradv
protectedinherited

d(grad saturation)/d(grad PorousFlow variable) at the quadpoints

Definition at line 68 of file PorousFlowVariableBase.h.

◆ _dgrads_qp_dv

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgrads_qp_dv
protectedinherited

d(grad saturation)/d(PorousFlow variable) at the quadpoints

Definition at line 71 of file PorousFlowVariableBase.h.

◆ _dmass_frac_dvar

MaterialProperty<std::vector<std::vector<std::vector<Real> > > >& PorousFlowFluidState::_dmass_frac_dvar
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().

◆ _dporepressure_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dporepressure_dvar
protectedinherited

◆ _dsaturation_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dsaturation_dvar
protectedinherited

◆ _dtemperature_dvar

const MaterialProperty<std::vector<Real> >& PorousFlowFluidState::_dtemperature_dvar
protected

Derivative of temperature wrt PorousFlow variables.

Definition at line 111 of file PorousFlowFluidState.h.

◆ _fluid_density

MaterialProperty<std::vector<Real> >& PorousFlowFluidState::_fluid_density
protected

Fluid density of each phase.

Definition at line 124 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().

◆ _fluid_enthalpy

MaterialProperty<std::vector<Real> >& PorousFlowFluidState::_fluid_enthalpy
protected

Enthalpy of each phase.

Definition at line 132 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().

◆ _fluid_internal_energy

MaterialProperty<std::vector<Real> >& PorousFlowFluidState::_fluid_internal_energy
protected

Internal energy of each phase.

Definition at line 136 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().

◆ _fluid_viscosity

MaterialProperty<std::vector<Real> >& PorousFlowFluidState::_fluid_viscosity
protected

Viscosity of each phase.

Definition at line 128 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().

◆ _fs

const PorousFlowFluidStateMultiComponentBase& PorousFlowFluidState::_fs
protected

FluidState UserObject.

Definition at line 95 of file PorousFlowFluidState.h.

Referenced by PorousFlowFluidState(), and thermophysicalProperties().

◆ _fsp

std::vector<FluidStateProperties> PorousFlowFluidState::_fsp
protected

◆ _gas_fluid_component

const unsigned int PorousFlowFluidState::_gas_fluid_component
protected

Fluid component number of the gas phase.

Definition at line 103 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _gas_gradp_qp

const VariableGradient& PorousFlowFluidState::_gas_gradp_qp
protected

Gradient of porepressure (only defined at the qps)

Definition at line 71 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _gas_phase_number

const unsigned int PorousFlowFluidState::_gas_phase_number
protected

Phase number of the gas phase.

Definition at line 99 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _gas_porepressure

const VariableValue& PorousFlowFluidState::_gas_porepressure
protected

Porepressure.

Definition at line 69 of file PorousFlowFluidState.h.

Referenced by thermophysicalProperties().

◆ _gas_porepressure_varnum

const unsigned int PorousFlowFluidState::_gas_porepressure_varnum
protected

Moose variable number of the gas porepressure.

Definition at line 73 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _grad_mass_frac_qp

MaterialProperty<std::vector<std::vector<RealGradient> > >* PorousFlowFluidState::_grad_mass_frac_qp
protected

Gradient of the mass fraction matrix (only defined at the qps)

Definition at line 119 of file PorousFlowFluidState.h.

◆ _grad_Xnacl_qp

const VariableGradient& PorousFlowFluidState::_grad_Xnacl_qp
protected

Gradient of salt mass fraction (only defined at the qps)

Definition at line 89 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _gradp_qp

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_gradp_qp
protectedinherited

Grad(p) at the quadpoints.

Definition at line 50 of file PorousFlowVariableBase.h.

◆ _grads_qp

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_grads_qp
protectedinherited

Grad(s) at the quadpoints.

Definition at line 65 of file PorousFlowVariableBase.h.

◆ _gradT_qp

const MaterialProperty<RealGradient>& PorousFlowFluidState::_gradT_qp
protected

Gradient of temperature (only defined at the qps)

Definition at line 109 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _gradZ_qp

std::vector<const VariableGradient *> PorousFlowFluidState::_gradZ_qp
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().

◆ _is_initqp

bool PorousFlowFluidState::_is_initqp
protected

Flag to indicate whether to calculate stateful properties.

Definition at line 143 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().

◆ _mass_frac

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFluidState::_mass_frac
protected

Mass fraction matrix.

Definition at line 117 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and setMaterialVectorSize().

◆ _num_components

const unsigned int PorousFlowVariableBase::_num_components
protectedinherited

◆ _num_pf_vars

const unsigned int PorousFlowVariableBase::_num_pf_vars
protectedinherited

◆ _num_phases

const unsigned int PorousFlowVariableBase::_num_phases
protectedinherited

◆ _num_Z_vars

const unsigned int PorousFlowFluidState::_num_Z_vars
protected

Number of coupled total mass fractions. Should be _num_phases - 1.

Definition at line 85 of file PorousFlowFluidState.h.

Referenced by PorousFlowFluidState().

◆ _pc

const PorousFlowCapillaryPressure& PorousFlowFluidState::_pc
protected

Capillary pressure UserObject.

Definition at line 147 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _pidx

const unsigned int PorousFlowFluidState::_pidx
protected

Index of derivative wrt pressure.

Definition at line 149 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _porepressure

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_porepressure
protectedinherited

◆ _pvar

const unsigned int PorousFlowFluidState::_pvar
protected

PorousFlow variable number of the gas porepressure.

Definition at line 75 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _salt_component

const unsigned int PorousFlowFluidState::_salt_component
protected

Salt component index.

Definition at line 105 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _saturation

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_saturation
protectedinherited

◆ _T_c2k

const Real PorousFlowFluidState::_T_c2k
protected

Conversion from degrees Celsius to degrees Kelvin.

Definition at line 141 of file PorousFlowFluidState.h.

Referenced by thermophysicalProperties().

◆ _temperature

const MaterialProperty<Real>& PorousFlowFluidState::_temperature
protected

Temperature.

Definition at line 107 of file PorousFlowFluidState.h.

Referenced by thermophysicalProperties().

◆ _temperature_varnum

const unsigned int PorousFlowFluidState::_temperature_varnum
protected

Moose variable number of the temperature.

Definition at line 113 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Tidx

const unsigned int PorousFlowFluidState::_Tidx
protected

Index of derivative wrt temperature.

Definition at line 151 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Tvar

const unsigned int PorousFlowFluidState::_Tvar
protected

PorousFlow variable number of the temperature.

Definition at line 115 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Xidx

const unsigned int PorousFlowFluidState::_Xidx
protected

Index of derivative wrt salt mass fraction X.

Definition at line 155 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Xnacl

const VariableValue& PorousFlowFluidState::_Xnacl
protected

Salt mass fraction (kg/kg)

Definition at line 87 of file PorousFlowFluidState.h.

Referenced by thermophysicalProperties().

◆ _Xnacl_varnum

const unsigned int PorousFlowFluidState::_Xnacl_varnum
protected

Salt mass fraction variable number.

Definition at line 91 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Xvar

const unsigned int PorousFlowFluidState::_Xvar
protected

Salt mass fraction PorousFlow variable number.

Definition at line 93 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Z

std::vector<const VariableValue *> PorousFlowFluidState::_Z
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().

◆ _Z_varnum

std::vector<unsigned int> PorousFlowFluidState::_Z_varnum
protected

Moose variable number of Z.

Definition at line 81 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), and PorousFlowFluidState().

◆ _Zidx

const unsigned int PorousFlowFluidState::_Zidx
protected

Index of derivative wrt total mass fraction Z.

Definition at line 153 of file PorousFlowFluidState.h.

Referenced by computeQpProperties().

◆ _Zvar

std::vector<unsigned int> PorousFlowFluidState::_Zvar
protected

PorousFlow variable number of Z.

Definition at line 83 of file PorousFlowFluidState.h.

Referenced by computeQpProperties(), and PorousFlowFluidState().


The documentation for this class was generated from the following files:
PorousFlowFluidState::_fluid_density
MaterialProperty< std::vector< Real > > & _fluid_density
Fluid density of each phase.
Definition: PorousFlowFluidState.h:124
PorousFlowFluidState::_Z
std::vector< const VariableValue * > _Z
Total mass fraction(s) of the gas component(s) summed over all phases.
Definition: PorousFlowFluidState.h:77
PorousFlowFluidState::_aqueous_phase_number
const unsigned int _aqueous_phase_number
Phase number of the aqueous phase.
Definition: PorousFlowFluidState.h:97
PorousFlowFluidState::_Xidx
const unsigned int _Xidx
Index of derivative wrt salt mass fraction X.
Definition: PorousFlowFluidState.h:155
PorousFlowFluidState::_gradZ_qp
std::vector< const VariableGradient * > _gradZ_qp
Gradient(s) of total mass fraction(s) of the gas component(s) (only defined at the qps)
Definition: PorousFlowFluidState.h:79
PorousFlowFluidState::_aqueous_fluid_component
const unsigned int _aqueous_fluid_component
Fluid component number of the aqueous component.
Definition: PorousFlowFluidState.h:101
PorousFlowVariableBase::computeQpProperties
virtual void computeQpProperties() override
Definition: PorousFlowVariableBase.C:74
PorousFlowVariableBase::_num_components
const unsigned int _num_components
Number of components.
Definition: PorousFlowVariableBase.h:38
PorousFlowFluidStateMultiComponentBase
Compositional flash routines for miscible multiphase flow classes with multiple fluid components.
Definition: PorousFlowFluidStateMultiComponentBase.h:23
PorousFlowFluidStateMultiComponentBase::thermophysicalProperties
virtual void thermophysicalProperties(Real pressure, Real temperature, Real Xnacl, Real Z, unsigned int qp, std::vector< FluidStateProperties > &fsp) const =0
Determines the complete thermophysical state of the system for a given set of primary variables.
PorousFlowFluidState::_dfluid_density_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_density_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables.
Definition: PorousFlowFluidState.h:126
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
PorousFlowFluidState::_gas_porepressure_varnum
const unsigned int _gas_porepressure_varnum
Moose variable number of the gas porepressure.
Definition: PorousFlowFluidState.h:73
PorousFlowFluidState::_fluid_enthalpy
MaterialProperty< std::vector< Real > > & _fluid_enthalpy
Enthalpy of each phase.
Definition: PorousFlowFluidState.h:132
PorousFlowFluidState::_dfluid_viscosity_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_viscosity_dvar
Derivative of the fluid viscosity for each phase wrt PorousFlow variables.
Definition: PorousFlowFluidState.h:130
PorousFlowCapillaryPressure
Base class for capillary pressure for multiphase flow in porous media.
Definition: PorousFlowCapillaryPressure.h:39
PorousFlowFluidState::_Tvar
const unsigned int _Tvar
PorousFlow variable number of the temperature.
Definition: PorousFlowFluidState.h:115
PorousFlowFluidState::_grad_Xnacl_qp
const VariableGradient & _grad_Xnacl_qp
Gradient of salt mass fraction (only defined at the qps)
Definition: PorousFlowFluidState.h:89
PorousFlowFluidState::_fs
const PorousFlowFluidStateMultiComponentBase & _fs
FluidState UserObject.
Definition: PorousFlowFluidState.h:95
PorousFlowVariableBase::_num_phases
const unsigned int _num_phases
Number of phases.
Definition: PorousFlowVariableBase.h:35
PorousFlowFluidState::_pidx
const unsigned int _pidx
Index of derivative wrt pressure.
Definition: PorousFlowFluidState.h:149
PorousFlowVariableBase::_dgradp_qp_dgradv
MaterialProperty< std::vector< std::vector< Real > > > *const _dgradp_qp_dgradv
d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints
Definition: PorousFlowVariableBase.h:53
PorousFlowFluidState::_grad_mass_frac_qp
MaterialProperty< std::vector< std::vector< RealGradient > > > * _grad_mass_frac_qp
Gradient of the mass fraction matrix (only defined at the qps)
Definition: PorousFlowFluidState.h:119
PorousFlowFluidStateBase::numPhases
unsigned int numPhases() const
The maximum number of phases in this model.
Definition: PorousFlowFluidStateBase.h:68
PorousFlowFluidState::_num_Z_vars
const unsigned int _num_Z_vars
Number of coupled total mass fractions. Should be _num_phases - 1.
Definition: PorousFlowFluidState.h:85
PorousFlowFluidState::_Xnacl_varnum
const unsigned int _Xnacl_varnum
Salt mass fraction variable number.
Definition: PorousFlowFluidState.h:91
PorousFlowFluidState::setMaterialVectorSize
void setMaterialVectorSize() const
Size material property vectors and initialise with zeros.
Definition: PorousFlowFluidState.C:394
PorousFlowFluidState::_gas_porepressure
const VariableValue & _gas_porepressure
Porepressure.
Definition: PorousFlowFluidState.h:69
PorousFlowFluidState::_fluid_internal_energy
MaterialProperty< std::vector< Real > > & _fluid_internal_energy
Internal energy of each phase.
Definition: PorousFlowFluidState.h:136
PorousFlowFluidState::_Z_varnum
std::vector< unsigned int > _Z_varnum
Moose variable number of Z.
Definition: PorousFlowFluidState.h:81
PorousFlowFluidState::_gas_phase_number
const unsigned int _gas_phase_number
Phase number of the gas phase.
Definition: PorousFlowFluidState.h:99
PorousFlowFluidState::_mass_frac
MaterialProperty< std::vector< std::vector< Real > > > & _mass_frac
Mass fraction matrix.
Definition: PorousFlowFluidState.h:117
FluidStateProperties
AD data structure to pass calculated thermophysical properties.
Definition: PorousFlowFluidStateBase.h:26
PorousFlowVariableBase::_porepressure
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
Definition: PorousFlowVariableBase.h:44
PorousFlowVariableBase::_dporepressure_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
Definition: PorousFlowVariableBase.h:47
PorousFlowVariableBase::_num_pf_vars
const unsigned int _num_pf_vars
Number of PorousFlow variables.
Definition: PorousFlowVariableBase.h:41
name
const std::string name
Definition: Setup.h:21
PorousFlowFluidState::_gas_fluid_component
const unsigned int _gas_fluid_component
Fluid component number of the gas phase.
Definition: PorousFlowFluidState.h:103
PorousFlowFluidState::_Zidx
const unsigned int _Zidx
Index of derivative wrt total mass fraction Z.
Definition: PorousFlowFluidState.h:153
PorousFlowFluidState::_salt_component
const unsigned int _salt_component
Salt component index.
Definition: PorousFlowFluidState.h:105
PorousFlowCapillaryPressure::dCapillaryPressure
virtual Real dCapillaryPressure(Real saturation, unsigned qp=0) const
Derivative of capillary pressure wrt true saturation.
Definition: PorousFlowCapillaryPressure.C:73
PorousFlowFluidState::_dtemperature_dvar
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
Derivative of temperature wrt PorousFlow variables.
Definition: PorousFlowFluidState.h:111
PorousFlowFluidState::_gas_gradp_qp
const VariableGradient & _gas_gradp_qp
Gradient of porepressure (only defined at the qps)
Definition: PorousFlowFluidState.h:71
PorousFlowFluidState::thermophysicalProperties
virtual void thermophysicalProperties()
Calculates all required thermophysical properties and derivatives for each phase and fluid component.
Definition: PorousFlowFluidState.C:157
PorousFlowFluidState::_dfluid_enthalpy_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_enthalpy_dvar
Derivative of the fluid enthalpy for each phase wrt PorousFlow variables.
Definition: PorousFlowFluidState.h:134
PorousFlowFluidState::_dmass_frac_dvar
MaterialProperty< std::vector< std::vector< std::vector< Real > > > > & _dmass_frac_dvar
Derivative of the mass fraction matrix with respect to the Porous Flow variables.
Definition: PorousFlowFluidState.h:121
PorousFlowCapillaryPressure::d2CapillaryPressure
virtual Real d2CapillaryPressure(Real saturation, unsigned qp=0) const
Second derivative of capillary pressure wrt true saturation.
Definition: PorousFlowCapillaryPressure.C:82
PorousFlowFluidState::_gradT_qp
const MaterialProperty< RealGradient > & _gradT_qp
Gradient of temperature (only defined at the qps)
Definition: PorousFlowFluidState.h:109
PorousFlowFluidState::_is_initqp
bool _is_initqp
Flag to indicate whether to calculate stateful properties.
Definition: PorousFlowFluidState.h:143
PorousFlowFluidState::_Tidx
const unsigned int _Tidx
Index of derivative wrt temperature.
Definition: PorousFlowFluidState.h:151
PorousFlowFluidState::_Zvar
std::vector< unsigned int > _Zvar
PorousFlow variable number of Z.
Definition: PorousFlowFluidState.h:83
PorousFlowVariableBase::PorousFlowVariableBase
PorousFlowVariableBase(const InputParameters &parameters)
Definition: PorousFlowVariableBase.C:23
PorousFlowFluidState::_fluid_viscosity
MaterialProperty< std::vector< Real > > & _fluid_viscosity
Viscosity of each phase.
Definition: PorousFlowFluidState.h:128
PorousFlowFluidState::_pc
const PorousFlowCapillaryPressure & _pc
Capillary pressure UserObject.
Definition: PorousFlowFluidState.h:147
PorousFlowFluidState::_Xvar
const unsigned int _Xvar
Salt mass fraction PorousFlow variable number.
Definition: PorousFlowFluidState.h:93
PorousFlowVariableBase::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: PorousFlowVariableBase.C:66
PorousFlowFluidState::_dfluid_internal_energy_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_internal_energy_dvar
Derivative of the fluid internal energy for each phase wrt PorousFlow variables.
Definition: PorousFlowFluidState.h:138
PorousFlowVariableBase::_saturation
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
Definition: PorousFlowVariableBase.h:59
PorousFlowFluidState::_temperature
const MaterialProperty< Real > & _temperature
Temperature.
Definition: PorousFlowFluidState.h:107
PorousFlowFluidState::_pvar
const unsigned int _pvar
PorousFlow variable number of the gas porepressure.
Definition: PorousFlowFluidState.h:75
PorousFlowFluidState::_T_c2k
const Real _T_c2k
Conversion from degrees Celsius to degrees Kelvin.
Definition: PorousFlowFluidState.h:141
PorousFlowVariableBase::_dsaturation_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
d(saturation)/d(PorousFlow variable)
Definition: PorousFlowVariableBase.h:62
PorousFlowFluidState::_temperature_varnum
const unsigned int _temperature_varnum
Moose variable number of the temperature.
Definition: PorousFlowFluidState.h:113
PorousFlowFluidState::_fsp
std::vector< FluidStateProperties > _fsp
FluidStateProperties data structure.
Definition: PorousFlowFluidState.h:145
PorousFlowFluidState::_Xnacl
const VariableValue & _Xnacl
Salt mass fraction (kg/kg)
Definition: PorousFlowFluidState.h:87