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

24  : MultiComponentFluidPropertiesPT(parameters), _Mnacl(58.443e-3)
25 {
26  // SinglePhaseFluidPropertiesPT UserObject for water to provide to getComponent
27  std::string water_name = name() + ":water";
28  {
29  std::string class_name = "Water97FluidProperties";
30  InputParameters params = _app.getFactory().getValidParams(class_name);
31  _fe_problem.addUserObject(class_name, water_name, params);
32  }
33  _water_fp = &_fe_problem.getUserObject<SinglePhaseFluidProperties>(water_name);
34 
35  // SinglePhaseFluidPropertiesPT UserObject for NaCl to provide to getComponent
36  std::string nacl_name = name() + ":nacl";
37  {
38  std::string class_name = "NaClFluidProperties";
39  InputParameters params = _app.getFactory().getValidParams(class_name);
40  _fe_problem.addUserObject(class_name, nacl_name, params);
41  }
42  _nacl_fp = &_fe_problem.getUserObject<SinglePhaseFluidProperties>(nacl_name);
43 
44  // Molar mass of NaCl and H20
47 }
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 49 of file BrineFluidProperties.C.

49 {}

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

283 {
284  Real q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
285 
286  // The correlation requires the pressure in bar, not Pa.
287  Real pbar = pressure * 1.0e-5;
288  Real pbar2 = pbar * pbar;
289 
290  // The correlation requires mole fraction
291  Real Xnacl = massFractionToMoleFraction(xnacl);
292 
293  q11 = -32.1724 + 0.0621255 * pbar;
294  q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
295  q22 = 0.0612567 + 1.88082e-5 * pbar;
296 
297  q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
298  q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
299 
300  q12 = -q11 - q1x1;
301  q10 = q1x1;
302 
303  q20 = 1.0 - q21 * std::sqrt(q22);
304  q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
305 
306  q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
307  q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
308  // The temperature Th where the brine has the same isobaric heat capacity
309  // as pure water. Note: correlation uses temperature in Celcius
310  Th = q1 + q2 * (temperature - _T_c2k);
311 
312  // The brine isobaric heat capacity is then given by the isobaric heat
313  // capacity of water at temperature Th multiplied by q2
314  // Note: water isobaric heat capacity requires temperature in Kelvin
315  return q2 * _water_fp->cp_from_p_T(pressure, Th + _T_c2k);
316 }
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 319 of file BrineFluidProperties.C.

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

320 {
321  Real enthalpy = h(pressure, temperature, xnacl);
322  Real density = rho(pressure, temperature, xnacl);
323 
324  return enthalpy - pressure / density;
325 }
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 328 of file BrineFluidProperties.C.

Referenced by PorousFlowBrine::computeQpProperties().

335 {
336  e = this->e(pressure, temperature, xnacl);
337  // Derivatives are calculated using finite differences due to complexity of correlation
338  Real eps = 1.0e-8;
339  Real peps = pressure * eps;
340  Real Teps = temperature * eps;
341  de_dp = (this->e(pressure + peps, temperature, xnacl) - e) / peps;
342  de_dT = (this->e(pressure, temperature + Teps, xnacl) - e) / Teps;
343  de_dx = (this->e(pressure, temperature, xnacl + eps) - e) / eps;
344 }
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 68 of file BrineFluidProperties.C.

Referenced by PorousFlowBrineCO2::PorousFlowBrineCO2().

69 {
70  return "brine";
71 }

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

Referenced by PorousFlowBrine::PorousFlowBrine().

53 {
54  switch (component)
55  {
56  case WATER:
57  return *_water_fp;
58 
59  case NACL:
60  return *_nacl_fp;
61 
62  default:
63  mooseError("BrineFluidProperties::getComponent has been provided an incorrect component");
64  }
65 }
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 227 of file BrineFluidProperties.C.

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

228 {
229  Real q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
230 
231  // The correlation requires the pressure in bar, not Pa.
232  Real pbar = pressure * 1.0e-5;
233  Real pbar2 = pbar * pbar;
234 
235  // The correlation requires mole fraction
236  Real Xnacl = massFractionToMoleFraction(xnacl);
237 
238  q11 = -32.1724 + 0.0621255 * pbar;
239  q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
240  q22 = 0.0612567 + 1.88082e-5 * pbar;
241 
242  q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
243  q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
244 
245  q12 = -q11 - q1x1;
246  q10 = q1x1;
247 
248  q20 = 1.0 - q21 * std::sqrt(q22);
249  q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
250 
251  q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
252  q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
253  // The temperature Th where the brine has the same enthalpy as pure water
254  // Note: correlation uses temperature in Celcius
255  Th = q1 + q2 * (temperature - _T_c2k);
256 
257  // The brine enthalpy is then given by the enthalpy of water at temperature Th
258  // Note: water enthalpy requires temperature in Kelvin
259  return _water_fp->h_from_p_T(pressure, Th + _T_c2k);
260 }
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 263 of file BrineFluidProperties.C.

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

270 {
271  h = this->h(pressure, temperature, xnacl);
272  // Derivatives are calculated using finite differences due to complexity of correlation
273  Real eps = 1.0e-8;
274  Real peps = pressure * eps;
275  Real Teps = temperature * eps;
276  dh_dp = (this->h(pressure + peps, temperature, xnacl) - h) / peps;
277  dh_dT = (this->h(pressure, temperature + Teps, xnacl) - h) / Teps;
278  dh_dx = (this->h(pressure, temperature, xnacl + eps) - h) / eps;
279 }
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 383 of file BrineFluidProperties.C.

384 {
385  // This correlation requires temperature in Celcius
386  Real Tc = temperature - _T_c2k;
387 
388  return (26.18 + 7.2e-3 * Tc + 1.06e-4 * Tc * Tc) / 100.0;
389 }
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 347 of file BrineFluidProperties.C.

348 {
349  // Correlation requires molal concentration (mol/kg)
350  Real mol = massFractionToMolalConc(xnacl);
351  // Correlation requires temperature in C
352  Real Tc = temperature - _T_c2k;
353 
354  Real S = 100.0 * _Mnacl * mol / (1.0 + _Mnacl * mol);
355  Real lambdaw = _water_fp->k_from_p_T(pressure, temperature);
356  Real lambda = 1.0 - (2.3434e-3 - 7.924e-6 * Tc + 3.924e-8 * Tc * Tc) * S +
357  (1.06e-5 - 2.0e-8 * Tc - 1.2e-10 * Tc * Tc) * S * S;
358 
359  return lambda * lambdaw;
360 }
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 392 of file BrineFluidProperties.C.

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

393 {
394  return xnacl / ((1.0 - xnacl) * _Mnacl);
395 }
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 398 of file BrineFluidProperties.C.

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

399 {
400  // The average molar mass of brine from the mass fraction
401  Real Mbrine = molarMass(xnacl);
402  // The mole fraction is then
403  return xnacl * Mbrine / _Mnacl;
404 }
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 74 of file BrineFluidProperties.C.

Referenced by massFractionToMoleFraction(), and rho().

75 {
76  return 1.0 / (xnacl / _Mnacl + (1.0 - xnacl) / _Mh2o);
77 }
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 86 of file BrineFluidProperties.C.

87 {
88  return _Mh2o;
89 }
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 80 of file BrineFluidProperties.C.

81 {
82  return _Mnacl;
83 }
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 151 of file BrineFluidProperties.C.

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

152 {
153  // Correlation requires molal concentration (mol/kg)
154  Real mol = massFractionToMolalConc(xnacl);
155  Real mol2 = mol * mol;
156  Real mol3 = mol2 * mol;
157 
158  // Correlation requires temperature in C
159  Real Tc = temperature - _T_c2k;
160 
161  Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
162  0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
163 
165 }
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 168 of file BrineFluidProperties.C.

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

175 {
176  // Viscosity of water and derivatives wrt pressure and temperature
177  Real muw, dmuw_dp, dmuw_dT;
178  _water_fp->mu_from_p_T(pressure, temperature, muw, dmuw_dp, dmuw_dT);
179 
180  // Correlation requires molal concentration (mol/kg)
181  Real mol = massFractionToMolalConc(xnacl);
182  Real dmol_dx = 1.0 / ((1.0 - xnacl) * (1.0 - xnacl) * _Mnacl);
183  Real mol2 = mol * mol;
184  Real mol3 = mol2 * mol;
185 
186  // Correlation requires temperature in C
187  Real Tc = temperature - _T_c2k;
188 
189  Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
190  0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
191  Real da_dx =
192  (0.0816 + 0.0244 * mol + 3.84e-4 * mol2 + 4.403e-4 * Tc * std::exp(-0.7 * mol)) * dmol_dx;
193  Real da_dT = 0.629e-3 * (1.0 - std::exp(-0.7 * mol));
194 
195  mu = a * muw;
196  dmu_dp = a * dmuw_dp;
197  dmu_dx = da_dx * muw;
198  dmu_dT = da_dT * muw + a * dmuw_dT;
199 }
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 92 of file BrineFluidProperties.C.

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

93 {
94  Real n1, n2, n11, n12, n1x1, n20, n21, n22, n23, n2x1, Tv;
95  Real water_density;
96 
97  // The correlation requires the pressure in bar, not Pa.
98  Real pbar = pressure * 1.0e-5;
99  Real pbar2 = pbar * pbar;
100  Real pbar3 = pbar2 * pbar;
101 
102  // The correlation requires mole fraction
103  Real Xnacl = massFractionToMoleFraction(xnacl);
104 
105  n11 = -54.2958 - 45.7623 * std::exp(-9.44785e-4 * pbar);
106  n21 = -2.6142 - 2.39092e-4 * pbar;
107  n22 = 0.0356828 + 4.37235e-6 * pbar + 2.0566e-9 * pbar2;
108  n1x1 = 330.47 + 0.942876 * std::sqrt(pbar) + 0.0817193 * pbar - 2.47556e-8 * pbar2 +
109  3.45052e-10 * pbar3;
110  n2x1 = -0.0370751 + 0.00237723 * std::sqrt(pbar) + 5.42049e-5 * pbar + 5.84709e-9 * pbar2 -
111  5.99373e-13 * pbar3;
112  n12 = -n1x1 - n11;
113  n20 = 1.0 - n21 * std::sqrt(n22);
114  n23 = n2x1 - n20 - n21 * std::sqrt(1.0 + n22);
115 
116  // The temperature Tv where the brine has the same molar volume as pure water
117  // Note: correlation uses temperature in Celcius
118  n1 = n1x1 + n11 * (1.0 - Xnacl) + n12 * (1.0 - Xnacl) * (1.0 - Xnacl);
119  n2 = n20 + n21 * std::sqrt(Xnacl + n22) + n23 * Xnacl;
120  Tv = n1 + n2 * (temperature - _T_c2k);
121 
122  // The density of water at temperature Tv
123  // Note: convert Tv to Kelvin to calculate water density
124  water_density = _water_fp->rho_from_p_T(pressure, Tv + _T_c2k);
125 
126  // The brine density is given by the water density scaled by the ratio of
127  // brine molar mass to pure water molar mass
128  return water_density * molarMass(xnacl) / _Mh2o;
129 }
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 132 of file BrineFluidProperties.C.

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

139 {
140  rho = this->rho(pressure, temperature, xnacl);
141  // Derivatives are calculated using finite differences due to complexity of correlation
142  Real eps = 1.0e-8;
143  Real peps = pressure * eps;
144  Real Teps = temperature * eps;
145  drho_dp = (this->rho(pressure + peps, temperature, xnacl) - rho) / peps;
146  drho_dT = (this->rho(pressure, temperature + Teps, xnacl) - rho) / Teps;
147  drho_dx = (this->rho(pressure, temperature, xnacl + eps) - rho) / eps;
148 }
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 202 of file BrineFluidProperties.C.

204 {
205  rho = this->rho(pressure, temperature, xnacl);
206  mu = this->mu(pressure, temperature, xnacl);
207 }
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 210 of file BrineFluidProperties.C.

221 {
222  this->rho_dpTx(pressure, temperature, xnacl, rho, drho_dp, drho_dT, drho_dx);
223  this->mu_dpTx(pressure, temperature, xnacl, mu, dmu_dp, dmu_dT, dmu_dx);
224 }
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 363 of file BrineFluidProperties.C.

Referenced by PorousFlowBrineCO2::solveEquilibriumMoleFractionHighTemp().

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