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...
 
Real molarMassNaCl () const
 NaCl molar mass. More...
 
Real molarMassH2O () const
 H2O molar mass. More...
 
virtual Real rho (Real pressure, Real temperature, Real xnacl) const override
 Density. More...
 
virtual void rho_dpTx (Real pressure, Real temperature, Real xnacl, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx) const override
 Density and its derivatives wrt pressure, temperature and mass fraction. More...
 
virtual Real mu (Real pressure, Real temperature, Real xnacl) const override
 
virtual void mu_dpTx (Real pressure, Real temperature, Real xnacl, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const override
 
virtual void rho_mu (Real pressure, Real temperature, Real xnacl, Real &rho, Real &mu) const override
 Density and viscosity. More...
 
virtual void rho_mu_dpTx (Real pressure, Real temperature, Real xnacl, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const override
 Density and viscosity and their derivatives wrt pressure, temperature and mass fraction. More...
 
virtual Real h (Real pressure, Real temperature, Real xnacl) const override
 Enthalpy. More...
 
virtual void h_dpTx (Real pressure, Real temperature, Real xnacl, Real &h, Real &dh_dp, Real &dh_dT, Real &dh_dx) const override
 Enthalpy and derivatives wrt pressure, temperature and mass fraction. More...
 
virtual Real cp (Real pressure, Real temperature, Real xnacl) const override
 Isobaric specific heat capacity. More...
 
virtual Real e (Real pressure, Real temperature, Real xnacl) const override
 Internal energy. More...
 
virtual void e_dpTx (Real pressure, Real temperature, Real xnacl, Real &e, Real &de_dp, Real &de_dT, Real &de_dx) const override
 Internal energy and its derivatives wrt pressure, temperature and mass fraction. More...
 
virtual Real k (Real pressure, Real temperature, Real xnacl) const override
 Thermal conductivity. More...
 
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 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...
 

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...
 
const Real _T_c2k
 Conversion of temperature from Celcius to Kelvin. More...
 

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 36 of file BrineFluidProperties.h.

Constructor & Destructor Documentation

◆ BrineFluidProperties()

BrineFluidProperties::BrineFluidProperties ( const InputParameters &  parameters)

Definition at line 25 of file BrineFluidProperties.C.

26  : MultiComponentFluidPropertiesPT(parameters), _Mnacl(58.443e-3)
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 e(Real pressure, Real temperature, Real xnacl) const override
Internal energy.
virtual Real molarMass() const
Molar mass [kg/mol].
MultiComponentFluidPropertiesPT(const InputParameters &parameters)
Real _Mnacl
Molar mass of NaCl (kg/mol)
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.

◆ ~BrineFluidProperties()

BrineFluidProperties::~BrineFluidProperties ( )
virtual

Definition at line 57 of file BrineFluidProperties.C.

57 {}

Member Function Documentation

◆ cp()

Real BrineFluidProperties::cp ( Real  pressure,
Real  temperature,
Real  xmass 
) const
overridevirtual

Isobaric specific heat capacity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
Returns
cp (J/kg/K)

Implements MultiComponentFluidPropertiesPT.

Definition at line 289 of file BrineFluidProperties.C.

290 {
291  Real q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
292 
293  // The correlation requires the pressure in bar, not Pa.
294  Real pbar = pressure * 1.0e-5;
295  Real pbar2 = pbar * pbar;
296 
297  // The correlation requires mole fraction
298  Real Xnacl = massFractionToMoleFraction(xnacl);
299 
300  q11 = -32.1724 + 0.0621255 * pbar;
301  q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
302  q22 = 0.0612567 + 1.88082e-5 * pbar;
303 
304  q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
305  q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
306 
307  q12 = -q11 - q1x1;
308  q10 = q1x1;
309 
310  q20 = 1.0 - q21 * std::sqrt(q22);
311  q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
312 
313  q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
314  q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
315  // The temperature Th where the brine has the same isobaric heat capacity
316  // as pure water. Note: correlation uses temperature in Celcius
317  Th = q1 + q2 * (temperature - _T_c2k);
318 
319  // The brine isobaric heat capacity is then given by the isobaric heat
320  // capacity of water at temperature Th multiplied by q2
321  // Note: water isobaric heat capacity requires temperature in Kelvin
322  return q2 * _water_fp->cp_from_p_T(pressure, Th + _T_c2k);
323 }
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
virtual Real cp_from_p_T(Real pressure, Real temperature) const
Isobaric specific heat capacity.
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

◆ e()

Real BrineFluidProperties::e ( Real  pressure,
Real  temperature,
Real  xmass 
) const
overridevirtual

Internal energy.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
Returns
internal energy (J/kg)

Implements MultiComponentFluidPropertiesPT.

Definition at line 326 of file BrineFluidProperties.C.

Referenced by e_dpTx(), haliteSolubility(), PorousFlowBrine::initQpStatefulProperties(), k(), and rho().

327 {
328  Real enthalpy = h(pressure, temperature, xnacl);
329  Real density = rho(pressure, temperature, xnacl);
330 
331  return enthalpy - pressure / density;
332 }
virtual Real h(Real pressure, Real temperature, Real xnacl) const override
Enthalpy.
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
virtual Real rho(Real pressure, Real temperature, Real xnacl) const override
Density.

◆ e_dpTx()

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

Internal energy and its derivatives wrt pressure, temperature and mass fraction.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy wrt pressure
[out]de_dTderivative of internal energy wrt temperature
[out]de_dxderivative of internal energy wrt mass fraction

Implements MultiComponentFluidPropertiesPT.

Definition at line 335 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::computeQpProperties().

342 {
343  e = this->e(pressure, temperature, xnacl);
344  // Derivatives are calculated using finite differences due to complexity of correlation
345  Real eps = 1.0e-8;
346  Real peps = pressure * eps;
347  Real Teps = temperature * eps;
348  de_dp = (this->e(pressure + peps, temperature, xnacl) - e) / peps;
349  de_dT = (this->e(pressure, temperature + Teps, xnacl) - e) / Teps;
350  de_dx = (this->e(pressure, temperature, xnacl + eps) - e) / eps;
351 }
virtual Real e(Real pressure, Real temperature, Real xnacl) const override
Internal energy.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 27 of file FluidProperties.h.

27 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 29 of file FluidProperties.h.

29 {}

◆ fluidName()

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

Fluid name.

Returns
"brine"

Implements MultiComponentFluidPropertiesPT.

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

Implements MultiComponentFluidPropertiesPT.

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 BrineFluidProperties::h ( Real  pressure,
Real  temperature,
Real  xmass 
) const
overridevirtual

Enthalpy.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
Returns
enthalpy (J/kg)

Implements MultiComponentFluidPropertiesPT.

Definition at line 234 of file BrineFluidProperties.C.

Referenced by e(), h_dpTx(), and PorousFlowBrine::initQpStatefulProperties().

235 {
236  Real q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
237 
238  // The correlation requires the pressure in bar, not Pa.
239  Real pbar = pressure * 1.0e-5;
240  Real pbar2 = pbar * pbar;
241 
242  // The correlation requires mole fraction
243  Real Xnacl = massFractionToMoleFraction(xnacl);
244 
245  q11 = -32.1724 + 0.0621255 * pbar;
246  q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
247  q22 = 0.0612567 + 1.88082e-5 * pbar;
248 
249  q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
250  q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
251 
252  q12 = -q11 - q1x1;
253  q10 = q1x1;
254 
255  q20 = 1.0 - q21 * std::sqrt(q22);
256  q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
257 
258  q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
259  q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
260  // The temperature Th where the brine has the same enthalpy as pure water
261  // Note: correlation uses temperature in Celcius
262  Th = q1 + q2 * (temperature - _T_c2k);
263 
264  // The brine enthalpy is then given by the enthalpy of water at temperature Th
265  // Note: water enthalpy requires temperature in Kelvin
266  return _water_fp->h_from_p_T(pressure, Th + _T_c2k);
267 }
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
const std::string pressure
Definition: NS.h:26
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

◆ h_dpTx()

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

Enthalpy and derivatives wrt pressure, temperature and mass fraction.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
[out]henthalpy (J/kg)
[out]dh_dpderivative of enthalpy wrt pressure
[out]dh_dTderivative of enthalpy wrt temperature
[out]dh_dxderivative of enthalpy wrt mass fraction

Implements MultiComponentFluidPropertiesPT.

Definition at line 270 of file BrineFluidProperties.C.

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

277 {
278  h = this->h(pressure, temperature, xnacl);
279  // Derivatives are calculated using finite differences due to complexity of correlation
280  Real eps = 1.0e-8;
281  Real peps = pressure * eps;
282  Real Teps = temperature * eps;
283  dh_dp = (this->h(pressure + peps, temperature, xnacl) - h) / peps;
284  dh_dT = (this->h(pressure, temperature + Teps, xnacl) - h) / Teps;
285  dh_dx = (this->h(pressure, temperature, xnacl + eps) - h) / eps;
286 }
virtual Real h(Real pressure, Real temperature, Real xnacl) const override
Enthalpy.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26

◆ 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 390 of file BrineFluidProperties.C.

391 {
392  // This correlation requires temperature in Celcius
393  Real Tc = temperature - _T_c2k;
394 
395  return (26.18 + 7.2e-3 * Tc + 1.06e-4 * Tc * Tc) / 100.0;
396 }
virtual Real e(Real pressure, Real temperature, Real xnacl) const override
Internal energy.
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 28 of file FluidProperties.h.

28 {}

◆ k()

Real BrineFluidProperties::k ( Real  pressure,
Real  temperature,
Real  xmass 
) const
overridevirtual

Thermal conductivity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
Returns
thermal conductivity (W/m/K)

Implements MultiComponentFluidPropertiesPT.

Definition at line 354 of file BrineFluidProperties.C.

355 {
356  // Correlation requires molal concentration (mol/kg)
357  Real mol = massFractionToMolalConc(xnacl);
358  // Correlation requires temperature in C
359  Real Tc = temperature - _T_c2k;
360 
361  Real S = 100.0 * _Mnacl * mol / (1.0 + _Mnacl * mol);
362  Real lambdaw = _water_fp->k_from_p_T(pressure, temperature);
363  Real lambda = 1.0 - (2.3434e-3 - 7.924e-6 * Tc + 3.924e-8 * Tc * Tc) * S +
364  (1.06e-5 - 2.0e-8 * Tc - 1.2e-10 * Tc * Tc) * S * S;
365 
366  return lambda * lambdaw;
367 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
virtual Real e(Real pressure, Real temperature, Real xnacl) const override
Internal energy.
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
Real _Mnacl
Molar mass of NaCl (kg/mol)
virtual Real k_from_p_T(Real pressure, Real temperature) const
Thermal conductivity.
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

◆ 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 399 of file BrineFluidProperties.C.

Referenced by k(), mu(), mu_dpTx(), and vaporPressure().

400 {
401  return xnacl / ((1.0 - xnacl) * _Mnacl);
402 }
Real _Mnacl
Molar mass of NaCl (kg/mol)

◆ massFractionToMoleFraction()

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 405 of file BrineFluidProperties.C.

Referenced by cp(), h(), and rho().

406 {
407  // The average molar mass of brine from the mass fraction
408  Real Mbrine = molarMass(xnacl);
409  // The mole fraction is then
410  return xnacl * Mbrine / _Mnacl;
411 }
Real molarMass(Real xnacl) const
Average molar mass of brine.
Real _Mnacl
Molar mass of NaCl (kg/mol)

◆ molarMass()

Real BrineFluidProperties::molarMass ( Real  xnacl) const

Average molar mass of brine.

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

Definition at line 82 of file BrineFluidProperties.C.

Referenced by massFractionToMoleFraction(), and rho().

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 94 of file BrineFluidProperties.C.

95 {
96  return _Mh2o;
97 }
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 88 of file BrineFluidProperties.C.

89 {
90  return _Mnacl;
91 }
Real _Mnacl
Molar mass of NaCl (kg/mol)

◆ mu()

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

Implements MultiComponentFluidPropertiesPT.

Definition at line 156 of file BrineFluidProperties.C.

Referenced by mu_dpTx(), rho_mu(), and rho_mu_dpTx().

157 {
158  // Correlation requires molal concentration (mol/kg)
159  const Real mol = massFractionToMolalConc(xnacl);
160  const Real mol2 = mol * mol;
161  const Real mol3 = mol2 * mol;
162 
163  // Correlation requires temperature in C
164  const Real Tc = temperature - _T_c2k;
165 
166  const Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
167  0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
168 
169  const Real water_viscosity = _water_fp->mu_from_p_T(pressure, temperature);
170 
171  return a * water_viscosity;
172 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
virtual Real mu_from_p_T(Real pressure, Real temperature) const
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

◆ mu_dpTx()

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

Implements MultiComponentFluidPropertiesPT.

Definition at line 175 of file BrineFluidProperties.C.

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

182 {
183  // Viscosity of water and derivatives wrt pressure and temperature
184  Real muw, dmuw_dp, dmuw_dT;
185  _water_fp->mu_from_p_T(pressure, temperature, muw, dmuw_dp, dmuw_dT);
186 
187  // Correlation requires molal concentration (mol/kg)
188  Real mol = massFractionToMolalConc(xnacl);
189  Real dmol_dx = 1.0 / ((1.0 - xnacl) * (1.0 - xnacl) * _Mnacl);
190  Real mol2 = mol * mol;
191  Real mol3 = mol2 * mol;
192 
193  // Correlation requires temperature in C
194  Real Tc = temperature - _T_c2k;
195 
196  Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
197  0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
198  Real da_dx =
199  (0.0816 + 0.0244 * mol + 3.84e-4 * mol2 + 4.403e-4 * Tc * std::exp(-0.7 * mol)) * dmol_dx;
200  Real da_dT = 0.629e-3 * (1.0 - std::exp(-0.7 * mol));
201 
202  mu = a * muw;
203  dmu_dp = a * dmuw_dp;
204  dmu_dx = da_dx * muw;
205  dmu_dT = da_dT * muw + a * dmuw_dT;
206 }
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
virtual Real mu_from_p_T(Real pressure, Real temperature) const
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
Real _Mnacl
Molar mass of NaCl (kg/mol)
const std::string pressure
Definition: NS.h:26
virtual Real mu(Real pressure, Real temperature, Real xnacl) const override
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

◆ rho()

Real BrineFluidProperties::rho ( Real  pressure,
Real  temperature,
Real  xmass 
) const
overridevirtual

Density.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
xmassmass fraction (-)
Returns
density (kg/m^3)

Implements MultiComponentFluidPropertiesPT.

Definition at line 100 of file BrineFluidProperties.C.

Referenced by e(), PorousFlowBrine::initQpStatefulProperties(), rho_dpTx(), rho_mu(), and rho_mu_dpTx().

101 {
102  // The correlation requires the pressure in bar, not Pa.
103  Real pbar = pressure * 1.0e-5;
104  Real pbar2 = pbar * pbar;
105  Real pbar3 = pbar2 * pbar;
106 
107  // The correlation requires mole fraction
108  const Real Xnacl = massFractionToMoleFraction(xnacl);
109 
110  const Real n11 = -54.2958 - 45.7623 * std::exp(-9.44785e-4 * pbar);
111  const Real n21 = -2.6142 - 2.39092e-4 * pbar;
112  const Real n22 = 0.0356828 + 4.37235e-6 * pbar + 2.0566e-9 * pbar2;
113  const Real n1x1 = 330.47 + 0.942876 * std::sqrt(pbar) + 0.0817193 * pbar - 2.47556e-8 * pbar2 +
114  3.45052e-10 * pbar3;
115  const Real n2x1 = -0.0370751 + 0.00237723 * std::sqrt(pbar) + 5.42049e-5 * pbar +
116  5.84709e-9 * pbar2 - 5.99373e-13 * pbar3;
117  const Real n12 = -n1x1 - n11;
118  const Real n20 = 1.0 - n21 * std::sqrt(n22);
119  const Real n23 = n2x1 - n20 - n21 * std::sqrt(1.0 + n22);
120 
121  // The temperature Tv where the brine has the same molar volume as pure water
122  // Note: correlation uses temperature in Celcius
123  const Real n1 = n1x1 + n11 * (1.0 - Xnacl) + n12 * (1.0 - Xnacl) * (1.0 - Xnacl);
124  const Real n2 = n20 + n21 * std::sqrt(Xnacl + n22) + n23 * Xnacl;
125  const Real Tv = n1 + n2 * (temperature - _T_c2k);
126 
127  // The density of water at temperature Tv
128  // Note: convert Tv to Kelvin to calculate water density
129  const Real water_density = _water_fp->rho_from_p_T(pressure, Tv + _T_c2k);
130 
131  // The brine density is given by the water density scaled by the ratio of
132  // brine molar mass to pure water molar mass
133  return water_density * molarMass(xnacl) / _Mh2o;
134 }
Real molarMass(Real xnacl) const
Average molar mass of brine.
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
virtual Real e(Real pressure, Real temperature, Real xnacl) const override
Internal energy.
const std::string temperature
Definition: NS.h:27
const Real _T_c2k
Conversion of temperature from Celcius to Kelvin.
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
Real _Mh2o
Molar mass of water (H2O) (kg/mol)
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.

◆ rho_dpTx()

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

Density and its 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

Implements MultiComponentFluidPropertiesPT.

Definition at line 137 of file BrineFluidProperties.C.

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

144 {
145  rho = this->rho(pressure, temperature, xnacl);
146  // Derivatives are calculated using finite differences due to complexity of correlation
147  const Real eps = 1.0e-8;
148  const Real peps = pressure * eps;
149  const Real Teps = temperature * eps;
150  drho_dp = (this->rho(pressure + peps, temperature, xnacl) - rho) / peps;
151  drho_dT = (this->rho(pressure, temperature + Teps, xnacl) - rho) / Teps;
152  drho_dx = (this->rho(pressure, temperature, xnacl + eps) - rho) / eps;
153 }
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real rho(Real pressure, Real temperature, Real xnacl) const override
Density.

◆ rho_mu()

void BrineFluidProperties::rho_mu ( Real  pressure,
Real  temperature,
Real  xmass,
Real &  rho,
Real &  mu 
) const
overridevirtual

Density and viscosity.

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

Implements MultiComponentFluidPropertiesPT.

Definition at line 209 of file BrineFluidProperties.C.

211 {
212  rho = this->rho(pressure, temperature, xnacl);
213  mu = this->mu(pressure, temperature, xnacl);
214 }
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual Real mu(Real pressure, Real temperature, Real xnacl) const override
virtual Real rho(Real pressure, Real temperature, Real xnacl) const override
Density.

◆ rho_mu_dpTx()

void BrineFluidProperties::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
overridevirtual

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

Implements MultiComponentFluidPropertiesPT.

Definition at line 217 of file BrineFluidProperties.C.

228 {
229  this->rho_dpTx(pressure, temperature, xnacl, rho, drho_dp, drho_dT, drho_dx);
230  this->mu_dpTx(pressure, temperature, xnacl, mu, dmu_dp, dmu_dT, dmu_dx);
231 }
virtual void rho_dpTx(Real pressure, Real temperature, Real xnacl, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx) const override
Density and its derivatives wrt pressure, temperature and mass fraction.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
virtual void mu_dpTx(Real pressure, Real temperature, Real xnacl, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const override
virtual Real mu(Real pressure, Real temperature, Real xnacl) const override
virtual Real rho(Real pressure, Real temperature, Real xnacl) const override
Density.

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 32 of file FluidProperties.h.

32 {}

◆ threadJoin()

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

Definition at line 31 of file FluidProperties.h.

31 {}

◆ 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 370 of file BrineFluidProperties.C.

Referenced by PorousFlowBrineCO2::solveEquilibriumMoleFractionHighTemp().

371 {
372  // Correlation requires molal concentration (mol/kg)
373  Real mol = massFractionToMolalConc(xnacl);
374  Real mol2 = mol * mol;
375  Real mol3 = mol2 * mol;
376 
377  Real a = 1.0 + 5.93582e-6 * mol - 5.19386e-5 * mol2 + 1.23156e-5 * mol3;
378  Real b = 1.1542e-6 * mol + 1.41254e-7 * mol2 - 1.92476e-8 * mol3 - 1.70717e-9 * mol * mol3 +
379  1.0539e-10 * mol2 * mol3;
380 
381  // The temperature of pure water at the same pressure as the brine is given by
382  Real th20 = std::exp(std::log(temperature) / (a + b * temperature));
383 
384  // The brine vapour pressure is then found by evaluating the saturation pressure for pure water
385  // using this effective temperature
386  return _water_fp->vaporPressure(th20);
387 }
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

◆ _Mh2o

Real BrineFluidProperties::_Mh2o
protected

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

Definition at line 183 of file BrineFluidProperties.h.

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

◆ _Mnacl

Real BrineFluidProperties::_Mnacl
protected

◆ _nacl_fp

const SinglePhaseFluidProperties* BrineFluidProperties::_nacl_fp
protected

NaClFluidProperties UserObject.

Definition at line 178 of file BrineFluidProperties.h.

Referenced by BrineFluidProperties(), and getComponent().

◆ _T_c2k

const Real MultiComponentFluidPropertiesPT::_T_c2k
protectedinherited

Conversion of temperature from Celcius to Kelvin.

Definition at line 207 of file MultiComponentFluidPropertiesPT.h.

Referenced by cp(), h(), haliteSolubility(), k(), mu(), mu_dpTx(), and rho().

◆ _water_fp

const SinglePhaseFluidProperties* BrineFluidProperties::_water_fp
protected

◆ NACL

const unsigned int BrineFluidProperties::NACL = 1
static

Definition at line 156 of file BrineFluidProperties.h.

Referenced by getComponent().

◆ WATER

const unsigned int BrineFluidProperties::WATER = 0
static

Fluid component numbers for water and NaCl.

Definition at line 155 of file BrineFluidProperties.h.

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


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