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

Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fraction. More...

#include <BrineFluidProperties.h>

Inheritance diagram for BrineFluidProperties:
[legend]

Public Member Functions

 BrineFluidProperties (const InputParameters &parameters)
 
virtual ~BrineFluidProperties ()
 
virtual std::string fluidName () const override
 Fluid name. More...
 
Real molarMass (Real xnacl) const
 Average molar mass of brine. More...
 
FPDualReal molarMass (const FPDualReal &xnacl) const
 
Real molarMassNaCl () const
 NaCl molar mass. More...
 
Real molarMassH2O () const
 H2O molar mass. More...
 
virtual Real rho_from_p_T_X (Real pressure, Real temperature, Real xnacl) const override
 
FPDualReal rho_from_p_T_X (const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override
 
virtual void rho_from_p_T_X (Real pressure, Real temperature, Real xnacl, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx) const override
 
virtual Real mu_from_p_T_X (Real pressure, Real temperature, Real xnacl) const override
 
virtual void mu_from_p_T_X (Real pressure, Real temperature, Real xnacl, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const override
 
FPDualReal h_from_p_T_X (const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override
 
virtual Real h_from_p_T_X (Real pressure, Real temperature, Real xnacl) const override
 
virtual void h_from_p_T_X (Real pressure, Real temperature, Real xnacl, Real &h, Real &dh_dp, Real &dh_dT, Real &dh_dx) const override
 
virtual Real cp_from_p_T_X (Real pressure, Real temperature, Real xnacl) const override
 
FPDualReal e_from_p_T_X (const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override
 
virtual Real e_from_p_T_X (Real pressure, Real temperature, Real xnacl) const override
 
virtual void e_from_p_T_X (Real pressure, Real temperature, Real xnacl, Real &e, Real &de_dp, Real &de_dT, Real &de_dx) const override
 
virtual Real k_from_p_T_X (Real pressure, Real temperature, Real xnacl) const override
 
Real vaporPressure (Real temperature, Real xnacl) const
 Brine vapour pressure From Haas, Physical properties of the coexisting phases and thermochemical properties of the H2O component in boiling NaCl solutions, Geological Survey Bulletin, 1421-A (1976). More...
 
Real haliteSolubility (Real temperature) const
 Solubility of halite (solid NaCl) in water Originally from Potter et al., A new method for determining the solubility of salts in aqueous solutions at elevated temperatures, J. More...
 
virtual const SinglePhaseFluidPropertiesgetComponent (unsigned int component) const override
 Get UserObject for specified component. More...
 
virtual Real rho (Real pressure, Real temperature, Real xmass) const
 
virtual void rho_dpTx (Real pressure, Real temperature, Real xmass, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx) const
 
virtual Real mu (Real pressure, Real temperature, Real xmass) const
 
virtual void mu_dpTx (Real pressure, Real temperature, Real xmass, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const
 
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 void rho_mu (Real pressure, Real temperature, Real xmass, Real &rho, Real &mu) const
 
virtual void rho_mu_dpTx (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 Real h (Real pressure, Real temperature, Real xmass) const
 
virtual void h_dpTx (Real pressure, Real temperature, Real xmass, Real &h, Real &dh_dp, Real &dh_dT, Real &dh_dx) const
 
virtual Real cp (Real pressure, Real temperature, Real xmass) const
 
virtual Real e (Real pressure, Real temperature, Real xmass) const
 
virtual void e_dpTx (Real pressure, Real temperature, Real xmass, Real &e, Real &de_dp, Real &de_dT, Real &de_dx) const
 
virtual Real k (Real pressure, Real temperature, Real xmass) const
 
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 unsigned int WATER = 0
 Fluid component numbers for water and NaCl. More...
 
static const unsigned int NACL = 1
 

Protected Member Functions

Real massFractionToMolalConc (Real xnacl) const
 Conversion from mass fraction to molal concentration (molality) More...
 
Real massFractionToMoleFraction (Real xnacl) const
 Conversion from mass fraction to mole fraction. More...
 
FPDualReal massFractionToMoleFraction (const FPDualReal &xnacl) const
 

Protected Attributes

const SinglePhaseFluidProperties_water_fp
 Water97FluidProperties UserObject. More...
 
const SinglePhaseFluidProperties_nacl_fp
 NaClFluidProperties UserObject. More...
 
Real _Mnacl
 Molar mass of NaCl (kg/mol) More...
 
Real _Mh2o
 Molar mass of water (H2O) (kg/mol) More...
 
bool _water_fp_derivs
 Flag to indicate whether to calculate derivatives in water_fp. More...
 
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...
 
 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
 
 p
 
p
 
X X p
 
 T
 
T
 
X X T
 

Detailed Description

Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fraction.

Most properties from: Driesner, The system H2O-NaCl. Part II: Correlations for molar volume, enthalpy, and isobaric heat capacity from 0 to 1000 C, 1 to 5000 bar, and 0 to 1 Xnacl, Geochimica et Cosmochimica Acta 71, 4902-4919 (2007)

Viscosity and thermal conductivity from: Phillips et al, A technical databook for geothermal energy utilization, LbL-12810 (1981) Note: uses water thermal conductivity from IAPWS rather than the correlation given by Phillips et al.

Definition at line 39 of file BrineFluidProperties.h.

Constructor & Destructor Documentation

◆ BrineFluidProperties()

BrineFluidProperties::BrineFluidProperties ( const InputParameters &  parameters)

Definition at line 25 of file BrineFluidProperties.C.

27 {
28  // SinglePhaseFluidPropertiesPT UserObject for water
29  if (parameters.isParamSetByUser("water_fp"))
30  _water_fp = &getUserObject<SinglePhaseFluidProperties>("water_fp");
31  else
32  {
33  // Construct a Water97FluidProperties UserObject
34  const std::string water_name = name() + ":water";
35  {
36  const std::string class_name = "Water97FluidProperties";
37  InputParameters params = _app.getFactory().getValidParams(class_name);
38  _fe_problem.addUserObject(class_name, water_name, params);
39  }
40  _water_fp = &_fe_problem.getUserObject<SinglePhaseFluidProperties>(water_name);
41  }
42 
43  // SinglePhaseFluidPropertiesPT UserObject for NaCl
44  const std::string nacl_name = name() + ":nacl";
45  {
46  const std::string class_name = "NaClFluidProperties";
47  InputParameters params = _app.getFactory().getValidParams(class_name);
48  _fe_problem.addUserObject(class_name, nacl_name, params);
49  }
50  _nacl_fp = &_fe_problem.getUserObject<SinglePhaseFluidProperties>(nacl_name);
51 
52  // Molar mass of NaCl and H20
55 }
const SinglePhaseFluidProperties * _nacl_fp
NaClFluidProperties UserObject.
virtual Real molarMass() const
Molar mass [kg/mol].
Real _Mnacl
Molar mass of NaCl (kg/mol)
MultiComponentFluidProperties(const InputParameters &parameters)
const std::string name
Definition: Setup.h:22
Common class for single phase fluid properties.
Real _Mh2o
Molar mass of water (H2O) (kg/mol)
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.

◆ ~BrineFluidProperties()

BrineFluidProperties::~BrineFluidProperties ( )
virtual

Definition at line 57 of file BrineFluidProperties.C.

57 {}

Member Function Documentation

◆ cp()

Real MultiComponentFluidProperties::cp ( Real  pressure,
Real  temperature,
Real  xmass 
) const
virtualinherited

Definition at line 153 of file MultiComponentFluidProperties.C.

154 {
155  mooseDeprecated(name(), ": cp() is deprecated. Use cp_from_p_T_X() instead");
156  return cp_from_p_T_X(pressure, temperature, xmass);
157 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ cp_from_p_T_X()

Real BrineFluidProperties::cp_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl 
) const
overridevirtual

Definition at line 324 of file BrineFluidProperties.C.

325 {
326  Real q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
327 
328  // The correlation requires the pressure in bar, not Pa.
329  Real pbar = pressure * 1.0e-5;
330  Real pbar2 = pbar * pbar;
331 
332  // The correlation requires mole fraction
333  Real Xnacl = massFractionToMoleFraction(xnacl);
334 
335  q11 = -32.1724 + 0.0621255 * pbar;
336  q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
337  q22 = 0.0612567 + 1.88082e-5 * pbar;
338 
339  q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
340  q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
341 
342  q12 = -q11 - q1x1;
343  q10 = q1x1;
344 
345  q20 = 1.0 - q21 * std::sqrt(q22);
346  q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
347 
348  q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
349  q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
350  // The temperature Th where the brine has the same isobaric heat capacity
351  // as pure water. Note: correlation uses temperature in Celcius
352  Th = q1 + q2 * (temperature - _T_c2k);
353 
354  // The brine isobaric heat capacity is then given by the isobaric heat
355  // capacity of water at temperature Th multiplied by q2
356  // Note: water isobaric heat capacity requires temperature in Kelvin
357  return q2 * _water_fp->cp_from_p_T(pressure, Th + _T_c2k);
358 }
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.

◆ e()

Real MultiComponentFluidProperties::e ( Real  pressure,
Real  temperature,
Real  xmass 
) const
virtualinherited

Definition at line 160 of file MultiComponentFluidProperties.C.

Referenced by MultiComponentFluidProperties::e_dpTx(), e_from_p_T_X(), haliteSolubility(), k_from_p_T_X(), and rho_from_p_T_X().

161 {
162  mooseDeprecated(name(), ": e() is deprecated. Use e_from_p_T_X() instead");
163  return e_from_p_T_X(pressure, temperature, xmass);
164 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ e_dpTx()

void MultiComponentFluidProperties::e_dpTx ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  e,
Real &  de_dp,
Real &  de_dT,
Real &  de_dx 
) const
virtualinherited

Definition at line 167 of file MultiComponentFluidProperties.C.

174 {
175  mooseDeprecated(name(), ": e_dpTx() is deprecated. Use e_from_p_T_X() instead");
176  e_from_p_T_X(pressure, temperature, xmass, e, de_dp, de_dT, de_dx);
177 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature, Real xmass) const
const std::string pressure
Definition: NS.h:26

◆ e_from_p_T_X() [1/3]

FPDualReal BrineFluidProperties::e_from_p_T_X ( const FPDualReal pressure,
const FPDualReal temperature,
const FPDualReal xnacl 
) const
override

Definition at line 361 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::computeQpProperties(), e_from_p_T_X(), and PorousFlowBrine::initQpStatefulProperties().

364 {
367 
368  return enthalpy - pressure / density;
369 }
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::string enthalpy
Definition: NS.h:28
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override

◆ e_from_p_T_X() [2/3]

Real BrineFluidProperties::e_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl 
) const
overridevirtual

Definition at line 372 of file BrineFluidProperties.C.

373 {
374  Real enthalpy = h_from_p_T_X(pressure, temperature, xnacl);
375  Real density = rho_from_p_T_X(pressure, temperature, xnacl);
376 
377  return enthalpy - pressure / density;
378 }
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
const std::string density
Definition: NS.h:17
const std::string temperature
Definition: NS.h:27
const std::string enthalpy
Definition: NS.h:28
const std::string pressure
Definition: NS.h:26
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override

◆ e_from_p_T_X() [3/3]

void BrineFluidProperties::e_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl,
Real &  e,
Real &  de_dp,
Real &  de_dT,
Real &  de_dx 
) const
overridevirtual

Definition at line 381 of file BrineFluidProperties.C.

388 {
389  // Initialise the AD value and derivatives
391  p.derivatives()[0] = 1.0;
393  T.derivatives()[1] = 1.0;
394  FPDualReal x = xnacl;
395  x.derivatives()[2] = 1.0;
396 
397  _water_fp_derivs = true;
398  FPDualReal ad_e = e_from_p_T_X(p, T, x);
399 
400  e = ad_e.value();
401  de_dp = ad_e.derivatives()[0];
402  de_dT = ad_e.derivatives()[1];
403  de_dx = ad_e.derivatives()[2];
404 }
const std::string temperature
Definition: NS.h:27
FPDualReal e_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override
virtual Real e(Real pressure, Real temperature, Real xmass) const
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 35 of file FluidProperties.h.

35 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 37 of file FluidProperties.h.

37 {}

◆ fluidName()

std::string BrineFluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
"brine"

Reimplemented from MultiComponentFluidProperties.

Definition at line 76 of file BrineFluidProperties.C.

Referenced by PorousFlowBrineCO2::PorousFlowBrineCO2().

77 {
78  return "brine";
79 }

◆ getComponent()

const SinglePhaseFluidProperties & BrineFluidProperties::getComponent ( unsigned int  component) const
overridevirtual

Get UserObject for specified component.

Parameters
componentfluid component
Returns
reference to SinglePhaseFluidPropertiesPT UserObject for component

Reimplemented from MultiComponentFluidProperties.

Definition at line 60 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::PorousFlowBrine().

61 {
62  switch (component)
63  {
64  case WATER:
65  return *_water_fp;
66 
67  case NACL:
68  return *_nacl_fp;
69 
70  default:
71  mooseError("BrineFluidProperties::getComponent has been provided an incorrect component");
72  }
73 }
const SinglePhaseFluidProperties * _nacl_fp
NaClFluidProperties UserObject.
Real component(const SymmTensor &symm_tensor, unsigned int index)
static const unsigned int NACL
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
static const unsigned int WATER
Fluid component numbers for water and NaCl.

◆ h()

Real MultiComponentFluidProperties::h ( Real  pressure,
Real  temperature,
Real  xmass 
) const
virtualinherited

Definition at line 133 of file MultiComponentFluidProperties.C.

Referenced by MultiComponentFluidProperties::h_dpTx(), and h_from_p_T_X().

134 {
135  mooseDeprecated(name(), ": h() is deprecated. Use h_from_p_T_X() instead");
136  return h_from_p_T_X(pressure, temperature, xmass);
137 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ h_dpTx()

void MultiComponentFluidProperties::h_dpTx ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  h,
Real &  dh_dp,
Real &  dh_dT,
Real &  dh_dx 
) const
virtualinherited

Definition at line 140 of file MultiComponentFluidProperties.C.

147 {
148  mooseDeprecated(name(), ": h_dpTx() is deprecated. Use h_from_p_T_X() instead");
149  h_from_p_T_X(pressure, temperature, xmass, h, dh_dp, dh_dT, dh_dx);
150 }
virtual Real h(Real pressure, Real temperature, Real xmass) const
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ h_from_p_T_X() [1/3]

FPDualReal BrineFluidProperties::h_from_p_T_X ( const FPDualReal pressure,
const FPDualReal temperature,
const FPDualReal xnacl 
) const
override

Definition at line 242 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::computeQpProperties(), e_from_p_T_X(), h_from_p_T_X(), PorousFlowBrine::initQpStatefulProperties(), and PorousFlowBrineCO2::liquidProperties().

245 {
246  FPDualReal q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
247 
248  // The correlation requires the pressure in bar, not Pa.
249  const FPDualReal pbar = pressure * 1.0e-5;
250  const FPDualReal pbar2 = pbar * pbar;
251 
252  // The correlation requires mole fraction
253  const FPDualReal Xnacl = massFractionToMoleFraction(xnacl);
254 
255  q11 = -32.1724 + 0.0621255 * pbar;
256  q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
257  q22 = 0.0612567 + 1.88082e-5 * pbar;
258 
259  q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
260  q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
261 
262  q12 = -q11 - q1x1;
263  q10 = q1x1;
264 
265  q20 = 1.0 - q21 * std::sqrt(q22);
266  q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
267 
268  q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
269  q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
270  // The temperature Th where the brine has the same enthalpy as pure water
271  // Note: correlation uses temperature in Celcius
272  Th = q1 + q2 * (temperature - _T_c2k);
273 
274  // The brine enthalpy is then given by the enthalpy of water at temperature Th
275  // Note: water enthalpy requires temperature in Kelvin
277  if (_water_fp_derivs)
278  enthalpy = _water_fp->h_from_p_T(pressure, Th + _T_c2k);
279  else
280  enthalpy = _water_fp->h_from_p_T(pressure.value(), Th.value() + _T_c2k);
281 
282  return enthalpy;
283 }
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
const std::string temperature
Definition: NS.h:27
const std::string enthalpy
Definition: NS.h:28
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.

◆ h_from_p_T_X() [2/3]

Real BrineFluidProperties::h_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl 
) const
overridevirtual

Definition at line 286 of file BrineFluidProperties.C.

287 {
288  // Initialise the AD value (no derivatives required)
291  FPDualReal x = xnacl;
292 
293  _water_fp_derivs = false;
294  return h_from_p_T_X(p, T, x).value();
295 }
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override

◆ h_from_p_T_X() [3/3]

void BrineFluidProperties::h_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl,
Real &  h,
Real &  dh_dp,
Real &  dh_dT,
Real &  dh_dx 
) const
overridevirtual

Definition at line 298 of file BrineFluidProperties.C.

305 {
306  // Initialise the AD value and derivatives
308  p.derivatives()[0] = 1.0;
310  T.derivatives()[1] = 1.0;
311  FPDualReal x = xnacl;
312  x.derivatives()[2] = 1.0;
313 
314  _water_fp_derivs = true;
315  FPDualReal ad_h = h_from_p_T_X(p, T, x);
316 
317  h = ad_h.value();
318  dh_dp = ad_h.derivatives()[0];
319  dh_dT = ad_h.derivatives()[1];
320  dh_dx = ad_h.derivatives()[2];
321 }
virtual Real h(Real pressure, Real temperature, Real xmass) const
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const override

◆ haliteSolubility()

Real BrineFluidProperties::haliteSolubility ( Real  temperature) const

Solubility of halite (solid NaCl) in water Originally from Potter et al., A new method for determining the solubility of salts in aqueous solutions at elevated temperatures, J.

Res. U.S. Geol. Surv., 5, 389-395 (1977). Equation describing halite solubility is repeated in Chou, Phase relations in the system NaCI-KCI-H2O. III: Solubilities of halite in vapor-saturated liquids above 445 C and redetermination of phase equilibrium properties in the system NaCI-HzO to 1000 C and 1500 bars, Geochimica et Cosmochimica Acta 51, 1965-1975 (1987). Note: this correlation is valid for 0 <= T <= 424.5 C

Parameters
temperaturetemperature (K)
Returns
halite solubility (kg/kg)

Definition at line 443 of file BrineFluidProperties.C.

444 {
445  // This correlation requires temperature in Celcius
446  Real Tc = temperature - _T_c2k;
447 
448  return (26.18 + 7.2e-3 * Tc + 1.06e-4 * Tc * Tc) / 100.0;
449 }
const std::string temperature
Definition: NS.h:27
virtual Real e(Real pressure, Real temperature, Real xmass) const
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 36 of file FluidProperties.h.

36 {}

◆ k()

Real MultiComponentFluidProperties::k ( Real  pressure,
Real  temperature,
Real  xmass 
) const
virtualinherited

Definition at line 180 of file MultiComponentFluidProperties.C.

181 {
182  mooseDeprecated(name(), ": k() is deprecated. Use k_from_p_T_X() instead");
183  return k_from_p_T_X(pressure, temperature, xmass);
184 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ k_from_p_T_X()

Real BrineFluidProperties::k_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl 
) const
overridevirtual

Definition at line 407 of file BrineFluidProperties.C.

408 {
409  // Correlation requires molal concentration (mol/kg)
410  Real mol = massFractionToMolalConc(xnacl);
411  // Correlation requires temperature in C
412  Real Tc = temperature - _T_c2k;
413 
414  Real S = 100.0 * _Mnacl * mol / (1.0 + _Mnacl * mol);
415  Real lambdaw = _water_fp->k_from_p_T(pressure, temperature);
416  Real lambda = 1.0 - (2.3434e-3 - 7.924e-6 * Tc + 3.924e-8 * Tc * Tc) * S +
417  (1.06e-5 - 2.0e-8 * Tc - 1.2e-10 * Tc * Tc) * S * S;
418 
419  return lambda * lambdaw;
420 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
const std::string temperature
Definition: NS.h:27
Real _Mnacl
Molar mass of NaCl (kg/mol)
virtual Real e(Real pressure, Real temperature, Real xmass) const
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.

◆ massFractionToMolalConc()

Real BrineFluidProperties::massFractionToMolalConc ( Real  xnacl) const
protected

Conversion from mass fraction to molal concentration (molality)

Parameters
xnaclNaCl mass fraction (kg/kg)
Returns
molal concentration (mol/kg)

Definition at line 452 of file BrineFluidProperties.C.

Referenced by k_from_p_T_X(), mu_from_p_T_X(), and vaporPressure().

453 {
454  return xnacl / ((1.0 - xnacl) * _Mnacl);
455 }
Real _Mnacl
Molar mass of NaCl (kg/mol)

◆ massFractionToMoleFraction() [1/2]

Real BrineFluidProperties::massFractionToMoleFraction ( Real  xnacl) const
protected

Conversion from mass fraction to mole fraction.

Parameters
xnaclNaCl mass fraction (kg/kg)
Returns
mole fraction (mol/mol)

Definition at line 458 of file BrineFluidProperties.C.

Referenced by cp_from_p_T_X(), h_from_p_T_X(), and rho_from_p_T_X().

459 {
460  // The average molar mass of brine from the mass fraction
461  Real Mbrine = molarMass(xnacl);
462  // The mole fraction is then
463  return xnacl * Mbrine / _Mnacl;
464 }
Real molarMass(Real xnacl) const
Average molar mass of brine.
Real _Mnacl
Molar mass of NaCl (kg/mol)

◆ massFractionToMoleFraction() [2/2]

FPDualReal BrineFluidProperties::massFractionToMoleFraction ( const FPDualReal xnacl) const
protected

Definition at line 467 of file BrineFluidProperties.C.

468 {
469  // The average molar mass of brine from the mass fraction
470  FPDualReal Mbrine = molarMass(xnacl);
471  // The mole fraction is then
472  return xnacl * Mbrine / _Mnacl;
473 }
Real molarMass(Real xnacl) const
Average molar mass of brine.
Real _Mnacl
Molar mass of NaCl (kg/mol)
DualNumber< Real, NumberArray< 5, Real > > FPDualReal

◆ molarMass() [1/2]

Real BrineFluidProperties::molarMass ( Real  xnacl) const

Average molar mass of brine.

Parameters
xnaclNaCl mass fraction (-)
Returns
average molar mass (kg/mol)

Definition at line 88 of file BrineFluidProperties.C.

Referenced by massFractionToMoleFraction(), and rho_from_p_T_X().

89 {
90  return 1.0 / (xnacl / _Mnacl + (1.0 - xnacl) / _Mh2o);
91 }
Real _Mnacl
Molar mass of NaCl (kg/mol)
Real _Mh2o
Molar mass of water (H2O) (kg/mol)

◆ molarMass() [2/2]

FPDualReal BrineFluidProperties::molarMass ( const FPDualReal xnacl) const

Definition at line 82 of file BrineFluidProperties.C.

83 {
84  return 1.0 / (xnacl / _Mnacl + (1.0 - xnacl) / _Mh2o);
85 }
Real _Mnacl
Molar mass of NaCl (kg/mol)
Real _Mh2o
Molar mass of water (H2O) (kg/mol)

◆ molarMassH2O()

Real BrineFluidProperties::molarMassH2O ( ) const

H2O molar mass.

Returns
molar mass of H2O (kg/mol)

Definition at line 100 of file BrineFluidProperties.C.

101 {
102  return _Mh2o;
103 }
Real _Mh2o
Molar mass of water (H2O) (kg/mol)

◆ molarMassNaCl()

Real BrineFluidProperties::molarMassNaCl ( ) const

NaCl molar mass.

Returns
molar mass of NaCl (kg/mol)

Definition at line 94 of file BrineFluidProperties.C.

95 {
96  return _Mnacl;
97 }
Real _Mnacl
Molar mass of NaCl (kg/mol)

◆ mu()

Real MultiComponentFluidProperties::mu ( Real  pressure,
Real  temperature,
Real  xmass 
) const
virtualinherited

Definition at line 54 of file MultiComponentFluidProperties.C.

Referenced by MultiComponentFluidProperties::mu_dpTx(), mu_from_p_T_X(), MultiComponentFluidProperties::rho_mu(), MultiComponentFluidProperties::rho_mu_dpTx(), and MultiComponentFluidProperties::rho_mu_from_p_T_X().

55 {
56  mooseDeprecated(name(), ": mu() is deprecated. Use mu_from_p_T_X() instead");
57  return mu_from_p_T_X(pressure, temperature, xmass);
58 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ mu_dpTx()

void MultiComponentFluidProperties::mu_dpTx ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT,
Real &  dmu_dx 
) const
virtualinherited

Definition at line 61 of file MultiComponentFluidProperties.C.

68 {
69  mooseDeprecated(name(), ": mu_dpTx() is deprecated. Use mu_from_p_T_X() instead");
70  mu_from_p_T_X(pressure, temperature, xmass, mu, dmu_dp, dmu_dT, dmu_dx);
71 }
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ mu_from_p_T_X() [1/2]

Real BrineFluidProperties::mu_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl 
) const
overridevirtual

Definition at line 189 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::computeQpProperties(), and PorousFlowBrineCO2::liquidProperties().

190 {
191  // Correlation requires molal concentration (mol/kg)
192  const Real mol = massFractionToMolalConc(xnacl);
193  const Real mol2 = mol * mol;
194  const Real mol3 = mol2 * mol;
195 
196  // Correlation requires temperature in C
197  const Real Tc = temperature - _T_c2k;
198 
199  const Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
200  0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
201 
202  const Real water_viscosity = _water_fp->mu_from_p_T(pressure, temperature);
203 
204  return a * water_viscosity;
205 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.

◆ mu_from_p_T_X() [2/2]

void BrineFluidProperties::mu_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT,
Real &  dmu_dx 
) const
overridevirtual

Definition at line 208 of file BrineFluidProperties.C.

215 {
216  // Viscosity of water and derivatives wrt pressure and temperature
217  Real muw, dmuw_dp, dmuw_dT;
218  _water_fp->mu_from_p_T(pressure, temperature, muw, dmuw_dp, dmuw_dT);
219 
220  // Correlation requires molal concentration (mol/kg)
221  Real mol = massFractionToMolalConc(xnacl);
222  Real dmol_dx = 1.0 / ((1.0 - xnacl) * (1.0 - xnacl) * _Mnacl);
223  Real mol2 = mol * mol;
224  Real mol3 = mol2 * mol;
225 
226  // Correlation requires temperature in C
227  Real Tc = temperature - _T_c2k;
228 
229  Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
230  0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
231  Real da_dx =
232  (0.0816 + 0.0244 * mol + 3.84e-4 * mol2 + 4.403e-4 * Tc * std::exp(-0.7 * mol)) * dmol_dx;
233  Real da_dT = 0.629e-3 * (1.0 - std::exp(-0.7 * mol));
234 
235  mu = a * muw;
236  dmu_dp = a * dmuw_dp;
237  dmu_dx = da_dx * muw;
238  dmu_dT = da_dT * muw + a * dmuw_dT;
239 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
Real _Mnacl
Molar mass of NaCl (kg/mol)
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.

◆ propfunc() [1/3]

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

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:

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:

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

◆ propfunc() [2/3]

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

◆ propfunc() [3/3]

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

◆ rho()

Real MultiComponentFluidProperties::rho ( Real  pressure,
Real  temperature,
Real  xmass 
) const
virtualinherited

Definition at line 34 of file MultiComponentFluidProperties.C.

Referenced by MultiComponentFluidProperties::rho_dpTx(), rho_from_p_T_X(), MultiComponentFluidProperties::rho_mu(), MultiComponentFluidProperties::rho_mu_dpTx(), and MultiComponentFluidProperties::rho_mu_from_p_T_X().

35 {
36  mooseDeprecated(name(), ": rho() is deprecated. Use rho_from_p_T_X() instead");
37  return rho_from_p_T_X(pressure, temperature, xmass);
38 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26

◆ rho_dpTx()

void MultiComponentFluidProperties::rho_dpTx ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  drho_dx 
) const
virtualinherited

Definition at line 41 of file MultiComponentFluidProperties.C.

48 {
49  mooseDeprecated(name(), ": rho_dpTx() is deprecated. Use rho_from_p_T_X() instead");
50  rho_from_p_T_X(pressure, temperature, xmass, rho, drho_dp, drho_dT, drho_dx);
51 }
const std::string temperature
Definition: NS.h:27
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26
virtual Real rho(Real pressure, Real temperature, Real xmass) const

◆ rho_from_p_T_X() [1/3]

Real BrineFluidProperties::rho_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl 
) const
overridevirtual

Definition at line 149 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::computeQpProperties(), e_from_p_T_X(), PorousFlowBrine::initQpStatefulProperties(), PorousFlowBrineCO2::liquidProperties(), rho_from_p_T_X(), and PorousFlowBrineCO2::saturationTwoPhase().

150 {
151  // Initialise the AD value (no derivatives required)
154  FPDualReal x = xnacl;
155 
156  _water_fp_derivs = false;
157  FPDualReal ad_rho = this->rho_from_p_T_X(p, T, x);
158 
159  return ad_rho.value();
160 }
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.

◆ rho_from_p_T_X() [2/3]

FPDualReal BrineFluidProperties::rho_from_p_T_X ( const FPDualReal pressure,
const FPDualReal temperature,
const FPDualReal xnacl 
) const
override

Definition at line 106 of file BrineFluidProperties.C.

109 {
110  // The correlation requires the pressure in bar, not Pa.
111  FPDualReal pbar = pressure * 1.0e-5;
112  FPDualReal pbar2 = pbar * pbar;
113  FPDualReal pbar3 = pbar2 * pbar;
114 
115  // The correlation requires mole fraction
116  const FPDualReal Xnacl = massFractionToMoleFraction(xnacl);
117 
118  const FPDualReal n11 = -54.2958 - 45.7623 * std::exp(-9.44785e-4 * pbar);
119  const FPDualReal n21 = -2.6142 - 2.39092e-4 * pbar;
120  const FPDualReal n22 = 0.0356828 + 4.37235e-6 * pbar + 2.0566e-9 * pbar2;
121  const FPDualReal n1x1 = 330.47 + 0.942876 * std::sqrt(pbar) + 0.0817193 * pbar -
122  2.47556e-8 * pbar2 + 3.45052e-10 * pbar3;
123  const FPDualReal n2x1 = -0.0370751 + 0.00237723 * std::sqrt(pbar) + 5.42049e-5 * pbar +
124  5.84709e-9 * pbar2 - 5.99373e-13 * pbar3;
125  const FPDualReal n12 = -n1x1 - n11;
126  const FPDualReal n20 = 1.0 - n21 * std::sqrt(n22);
127  const FPDualReal n23 = n2x1 - n20 - n21 * std::sqrt(1.0 + n22);
128 
129  // The temperature Tv where the brine has the same molar volume as pure water
130  // Note: correlation uses temperature in Celcius
131  const FPDualReal n1 = n1x1 + n11 * (1.0 - Xnacl) + n12 * (1.0 - Xnacl) * (1.0 - Xnacl);
132  const FPDualReal n2 = n20 + n21 * std::sqrt(Xnacl + n22) + n23 * Xnacl;
133  const FPDualReal Tv = n1 + n2 * (temperature - _T_c2k);
134 
135  // The density of water at temperature Tv
136  // Note: convert Tv to Kelvin to calculate water density
137  FPDualReal water_density;
138  if (_water_fp_derivs)
139  water_density = _water_fp->rho_from_p_T(pressure, Tv + _T_c2k);
140  else
141  water_density = _water_fp->rho_from_p_T(pressure.value(), Tv.value() + _T_c2k);
142 
143  // The brine density is given by the water density scaled by the ratio of
144  // brine molar mass to pure water molar mass
145  return water_density * molarMass(xnacl) / _Mh2o;
146 }
Real molarMass(Real xnacl) const
Average molar mass of brine.
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
const std::string temperature
Definition: NS.h:27
virtual Real e(Real pressure, Real temperature, Real xmass) const
Real _Mh2o
Molar mass of water (H2O) (kg/mol)
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
const Real _T_c2k
Conversion of temperature from Celsius to Kelvin.
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.

◆ rho_from_p_T_X() [3/3]

void BrineFluidProperties::rho_from_p_T_X ( Real  pressure,
Real  temperature,
Real  xnacl,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  drho_dx 
) const
overridevirtual

Definition at line 163 of file BrineFluidProperties.C.

170 {
171  // Initialise the AD value and derivatives
173  p.derivatives()[0] = 1.0;
175  T.derivatives()[1] = 1.0;
176  FPDualReal x = xnacl;
177  x.derivatives()[2] = 1.0;
178 
179  _water_fp_derivs = true;
180  FPDualReal ad_rho = this->rho_from_p_T_X(p, T, x);
181 
182  rho = ad_rho.value();
183  drho_dp = ad_rho.derivatives()[0];
184  drho_dT = ad_rho.derivatives()[1];
185  drho_dx = ad_rho.derivatives()[2];
186 }
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
DualNumber< Real, NumberArray< 5, Real > > FPDualReal
virtual Real rho(Real pressure, Real temperature, Real xmass) const
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.

◆ rho_mu()

void MultiComponentFluidProperties::rho_mu ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  rho,
Real &  mu 
) const
virtualinherited

Definition at line 90 of file MultiComponentFluidProperties.C.

92 {
93  mooseDeprecated(name(), ": rho_mu() is deprecated. Use rho_mu_from_p_T_X() instead");
95 }
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26
virtual void rho_mu_from_p_T_X(Real pressure, Real temperature, Real xmass, Real &rho, Real &mu) const
Density and viscosity.
virtual Real rho(Real pressure, Real temperature, Real xmass) const

◆ rho_mu_dpTx()

void MultiComponentFluidProperties::rho_mu_dpTx ( 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
virtualinherited

Definition at line 115 of file MultiComponentFluidProperties.C.

126 {
127  mooseDeprecated(name(), ": rho_mu_dpTx() is deprecated. Use rho_mu_from_p_T_X() instead");
129  pressure, temperature, xmass, rho, drho_dp, drho_dT, drho_dx, mu, dmu_dp, dmu_dT, dmu_dx);
130 }
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
const std::string name
Definition: Setup.h:22
const std::string pressure
Definition: NS.h:26
virtual void rho_mu_from_p_T_X(Real pressure, Real temperature, Real xmass, Real &rho, Real &mu) const
Density and viscosity.
virtual Real rho(Real pressure, Real temperature, Real xmass) const

◆ rho_mu_from_p_T_X() [1/3]

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

Density and viscosity.

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

Definition at line 74 of file MultiComponentFluidProperties.C.

Referenced by MultiComponentFluidProperties::rho_mu(), and MultiComponentFluidProperties::rho_mu_dpTx().

76 {
77  rho = rho_from_p_T_X(pressure, temperature, xmass);
78  mu = mu_from_p_T_X(pressure, temperature, xmass);
79 }
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
const std::string pressure
Definition: NS.h:26
virtual Real rho(Real pressure, Real temperature, Real xmass) const

◆ rho_mu_from_p_T_X() [2/3]

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

Definition at line 82 of file MultiComponentFluidProperties.C.

84 {
85  rho = rho_from_p_T_X(pressure, temperature, xmass);
86  mu = mu_from_p_T_X(pressure, temperature, xmass);
87 }
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
const std::string pressure
Definition: NS.h:26
virtual Real rho(Real pressure, Real temperature, Real xmass) const

◆ 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 &  drho_dp,
Real &  drho_dT,
Real &  drho_dx,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT,
Real &  dmu_dx 
) const
virtualinherited

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 98 of file MultiComponentFluidProperties.C.

109 {
110  rho_from_p_T_X(pressure, temperature, xmass, rho, drho_dp, drho_dT, drho_dx);
111  mu_from_p_T_X(pressure, temperature, xmass, mu, dmu_dp, dmu_dT, dmu_dx);
112 }
const std::string temperature
Definition: NS.h:27
virtual Real mu(Real pressure, Real temperature, Real xmass) const
const std::string pressure
Definition: NS.h:26
virtual Real rho(Real pressure, Real temperature, Real xmass) const

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 40 of file FluidProperties.h.

40 {}

◆ threadJoin()

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

Definition at line 39 of file FluidProperties.h.

39 {}

◆ vaporPressure()

Real BrineFluidProperties::vaporPressure ( Real  temperature,
Real  xnacl 
) const

Brine vapour pressure From Haas, Physical properties of the coexisting phases and thermochemical properties of the H2O component in boiling NaCl solutions, Geological Survey Bulletin, 1421-A (1976).

Parameters
temperaturebrine temperature (K)
xnaclsalt mass fraction (-)
Returns
brine vapour pressure (Pa)

Definition at line 423 of file BrineFluidProperties.C.

Referenced by PorousFlowBrineCO2::solveEquilibriumMoleFractionHighTemp().

424 {
425  // Correlation requires molal concentration (mol/kg)
426  Real mol = massFractionToMolalConc(xnacl);
427  Real mol2 = mol * mol;
428  Real mol3 = mol2 * mol;
429 
430  Real a = 1.0 + 5.93582e-6 * mol - 5.19386e-5 * mol2 + 1.23156e-5 * mol3;
431  Real b = 1.1542e-6 * mol + 1.41254e-7 * mol2 - 1.92476e-8 * mol3 - 1.70717e-9 * mol * mol3 +
432  1.0539e-10 * mol2 * mol3;
433 
434  // The temperature of pure water at the same pressure as the brine is given by
435  Real th20 = std::exp(std::log(temperature) / (a + b * temperature));
436 
437  // The brine vapour pressure is then found by evaluating the saturation pressure for pure water
438  // using this effective temperature
439  return _water_fp->vaporPressure(th20);
440 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
virtual Real vaporPressure(Real temperature) const
Vapor pressure.
const std::string temperature
Definition: NS.h:27
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

Member Data Documentation

◆ _allow_imperfect_jacobians

const bool FluidProperties::_allow_imperfect_jacobians
protectedinherited

Flag to set unimplemented Jacobian entries to zero.

Definition at line 46 of file FluidProperties.h.

Referenced by SinglePhaseFluidProperties::fluidPropError().

◆ _Mh2o

Real BrineFluidProperties::_Mh2o
protected

Molar mass of water (H2O) (kg/mol)

Definition at line 185 of file BrineFluidProperties.h.

Referenced by BrineFluidProperties(), molarMass(), molarMassH2O(), and rho_from_p_T_X().

◆ _Mnacl

Real BrineFluidProperties::_Mnacl
protected

◆ _nacl_fp

const SinglePhaseFluidProperties* BrineFluidProperties::_nacl_fp
protected

NaClFluidProperties UserObject.

Definition at line 180 of file BrineFluidProperties.h.

Referenced by BrineFluidProperties(), and getComponent().

◆ _T_c2k

const Real FluidProperties::_T_c2k
protectedinherited

◆ _water_fp

const SinglePhaseFluidProperties* BrineFluidProperties::_water_fp
protected

◆ _water_fp_derivs

bool BrineFluidProperties::_water_fp_derivs
mutableprotected

Flag to indicate whether to calculate derivatives in water_fp.

Definition at line 187 of file BrineFluidProperties.h.

Referenced by e_from_p_T_X(), h_from_p_T_X(), and rho_from_p_T_X().

◆ NACL

const unsigned int BrineFluidProperties::NACL = 1
static

Definition at line 157 of file BrineFluidProperties.h.

Referenced by getComponent().

◆ p [1/3]

MultiComponentFluidProperties::p
inherited

Definition at line 145 of file MultiComponentFluidProperties.h.

Referenced by e_from_p_T_X(), h_from_p_T_X(), and rho_from_p_T_X().

◆ p [2/3]

X MultiComponentFluidProperties::p
inherited

Definition at line 147 of file MultiComponentFluidProperties.h.

◆ p [3/3]

X X MultiComponentFluidProperties::p
inherited

Definition at line 149 of file MultiComponentFluidProperties.h.

◆ T [1/3]

MultiComponentFluidProperties::T
inherited

Definition at line 145 of file MultiComponentFluidProperties.h.

Referenced by e_from_p_T_X(), h_from_p_T_X(), and rho_from_p_T_X().

◆ T [2/3]

X MultiComponentFluidProperties::T
inherited

Definition at line 147 of file MultiComponentFluidProperties.h.

◆ T [3/3]

X X MultiComponentFluidProperties::T
inherited

Definition at line 149 of file MultiComponentFluidProperties.h.

◆ WATER

const unsigned int BrineFluidProperties::WATER = 0
static

Fluid component numbers for water and NaCl.

Definition at line 156 of file BrineFluidProperties.h.

Referenced by getComponent(), and PorousFlowBrine::PorousFlowBrine().


The documentation for this class was generated from the following files: