18 params.
addParam<UserObjectName>(
"water_fp",
19 "The name of the FluidProperties UserObject for water");
33 const std::string water_name =
name() +
":water";
35 const std::string class_name =
"Water97FluidProperties";
45 _water_fp = &getUserObject<SinglePhaseFluidProperties>(
"water_fp");
49 paramError(
"water_fp",
"A water FluidProperties UserObject must be supplied");
58 const std::string nacl_name =
name() +
":nacl";
60 const std::string class_name =
"NaClFluidProperties";
86 mooseError(
"BrineFluidProperties::getComponent has been provided an incorrect component");
99 return 1.0 / (xnacl /
_Mnacl + (1.0 - xnacl) /
_Mh2o);
105 return 1.0 / (xnacl /
_Mnacl + (1.0 - xnacl) /
_Mh2o);
133 const FPADReal n11 = -54.2958 - 45.7623 * std::exp(-9.44785e-4 * pbar);
134 const FPADReal n21 = -2.6142 - 2.39092e-4 * pbar;
135 const FPADReal n22 = 0.0356828 + 4.37235e-6 * pbar + 2.0566e-9 * pbar2;
136 const FPADReal n1x1 = 330.47 + 0.942876 * std::sqrt(pbar) + 0.0817193 * pbar -
137 2.47556e-8 * pbar2 + 3.45052e-10 * pbar3;
138 const FPADReal n2x1 = -0.0370751 + 0.00237723 * std::sqrt(pbar) + 5.42049e-5 * pbar +
139 5.84709e-9 * pbar2 - 5.99373e-13 * pbar3;
141 const FPADReal n20 = 1.0 - n21 * std::sqrt(n22);
142 const FPADReal n23 = n2x1 - n20 - n21 * std::sqrt(1.0 + n22);
146 const FPADReal n1 = n1x1 + n11 * (1.0 - Xnacl) + n12 * (1.0 - Xnacl) * (1.0 - Xnacl);
147 const FPADReal n2 = n20 + n21 * std::sqrt(Xnacl + n22) + n23 * Xnacl;
155 Real rho, drho_dp, drho_dT;
159 water_density.derivatives() =
pressure.derivatives() * drho_dp + Tv.derivatives() * drho_dT;
180 return ad_rho.value();
190 Real & drho_dx)
const 203 rho = ad_rho.value();
204 drho_dp = ad_rho.derivatives()[0];
205 drho_dT = ad_rho.derivatives()[1];
206 drho_dx = ad_rho.derivatives()[2];
214 const Real mol2 = mol * mol;
215 const Real mol3 = mol2 * mol;
220 const Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
221 0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
225 return a * water_viscosity;
238 Real muw, dmuw_dp, dmuw_dT;
243 Real dmol_dx = 1.0 / ((1.0 - xnacl) * (1.0 - xnacl) *
_Mnacl);
244 Real mol2 = mol * mol;
245 Real mol3 = mol2 * mol;
250 Real a = 1.0 + 0.0816 * mol + 0.0122 * mol2 + 0.128e-3 * mol3 +
251 0.629e-3 * Tc * (1.0 - std::exp(-0.7 * mol));
253 (0.0816 + 0.0244 * mol + 3.84e-4 * mol2 + 4.403e-4 * Tc * std::exp(-0.7 * mol)) * dmol_dx;
254 Real da_dT = 0.629e-3 * (1.0 - std::exp(-0.7 * mol));
257 dmu_dp =
a * dmuw_dp;
258 dmu_dx = da_dx * muw;
259 dmu_dT = da_dT * muw +
a * dmuw_dT;
267 FPADReal q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
276 q11 = -32.1724 + 0.0621255 * pbar;
277 q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
278 q22 = 0.0612567 + 1.88082e-5 * pbar;
280 q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
281 q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
286 q20 = 1.0 - q21 * std::sqrt(q22);
287 q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
289 q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
290 q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
300 Real h, dh_dp, dh_dT;
304 enthalpy.derivatives() =
pressure.derivatives() * dh_dp + Th.derivatives() * dh_dT;
345 dh_dp = ad_h.derivatives()[0];
346 dh_dT = ad_h.derivatives()[1];
347 dh_dx = ad_h.derivatives()[2];
353 Real q1, q2, q10, q11, q12, q20, q21, q22, q23, q1x1, q2x1, Th;
357 Real pbar2 = pbar * pbar;
362 q11 = -32.1724 + 0.0621255 * pbar;
363 q21 = -1.69513 - 4.52781e-4 * pbar - 6.04279e-8 * pbar2;
364 q22 = 0.0612567 + 1.88082e-5 * pbar;
366 q1x1 = 47.9048 - 9.36994e-3 * pbar + 6.51059e-6 * pbar2;
367 q2x1 = 0.241022 + 3.45087e-5 * pbar - 4.28356e-9 * pbar2;
372 q20 = 1.0 - q21 * std::sqrt(q22);
373 q23 = q2x1 - q20 - q21 * std::sqrt(1.0 + q22);
375 q1 = q10 + q11 * (1.0 - Xnacl) + q12 * (1.0 - Xnacl) * (1.0 - Xnacl);
376 q2 = q20 + q21 * std::sqrt(Xnacl + q22) + q23 * Xnacl;
428 de_dp = ad_e.derivatives()[0];
429 de_dT = ad_e.derivatives()[1];
430 de_dx = ad_e.derivatives()[2];
443 Real lambda = 1.0 - (2.3434e-3 - 7.924e-6 * Tc + 3.924e-8 * Tc * Tc) *
S +
444 (1.06e-5 - 2.0e-8 * Tc - 1.2e-10 * Tc * Tc) *
S *
S;
446 return lambda * lambdaw;
454 Real mol2 = mol * mol;
455 Real mol3 = mol2 * mol;
457 Real a = 1.0 + 5.93582e-6 * mol - 5.19386e-5 * mol2 + 1.23156e-5 * mol3;
458 Real b = 1.1542e-6 * mol + 1.41254e-7 * mol2 - 1.92476e-8 * mol3 - 1.70717e-9 * mol * mol3 +
459 1.0539e-10 * mol2 * mol3;
475 return (26.18 + 7.2e-3 * Tc + 1.06e-4 * Tc * Tc) / 100.0;
481 return xnacl / ((1.0 - xnacl) *
_Mnacl);
490 return xnacl * Mbrine /
_Mnacl;
499 return xnacl * Mbrine /
_Mnacl;
510 const std::vector<Real> & coeffs,
519 const std::vector<Real> & coeffs)
const 525 henry.derivatives() =
temperature.derivatives() * dKh_dT;
registerMooseObject("FluidPropertiesApp", BrineFluidProperties)
T & getUserObject(const std::string &name, unsigned int tid=0) const
Real molarMass(Real xnacl) const
Average molar mass of brine.
FPADReal h_from_p_T_X(const FPADReal &pressure, const FPADReal &temperature, const FPADReal &xnacl) const
const SinglePhaseFluidProperties * _nacl_fp
NaClFluidProperties UserObject.
virtual ~BrineFluidProperties()
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Real massFractionToMoleFraction(Real xnacl) const
Conversion from mass fraction to mole fraction.
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
const Water97FluidProperties * _water97_fp
Water97FluidProperties UserObject (for Henry's law)
static const std::string component
virtual std::string fluidName() const override
Fluid name.
virtual Real molarMass() const
Molar mass [kg/mol].
static const std::string density
InputParameters getValidParams(const std::string &name) const
Real molarMassH2O() const
H2O molar mass.
static const std::string temperature
virtual Real mu_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
DualNumber< Real, DNDerivativeType, true > ADReal
virtual const std::string & name() const
static InputParameters validParams()
Real vaporPressure(Real temperature, Real xnacl) const
Brine vapour pressure From Haas, Physical properties of the coexisting phases and thermochemical prop...
DualNumber< Real, DNDerivativeSize< 5 > > FPADReal
static const unsigned int NACL
Real _Mnacl
Molar mass of NaCl (kg/mol)
Real molarMassNaCl() const
NaCl molar mass.
const std::vector< double > x
static const std::string S
static const std::string mu
virtual const SinglePhaseFluidProperties & getComponent(unsigned int component) const override
Get UserObject for specified component.
Common class for single phase fluid properties.
void paramError(const std::string ¶m, Args... args) const
BrineFluidProperties(const InputParameters ¶meters)
FPADReal e_from_p_T_X(const FPADReal &pressure, const FPADReal &temperature, const FPADReal &xnacl) const
Common class for multiple component fluid properties using a pressure and temperature formulation...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
Real _Mh2o
Molar mass of water (H2O) (kg/mol)
virtual Real k_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...
static const std::string pressure
Real henryConstant(Real temperature, const std::vector< Real > &coeffs) const
IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's con...
void mooseError(Args &&... args) const
e e e e s T T T T T rho v v T e p T T virtual T std::string fluidName() const
Fluid name.
const InputParameters & parameters() const
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Real henryConstant(Real temperature, const std::vector< Real > &coeffs) const
IAPWS formulation of Henry's law constant for dissolution in water (implemented in water FluidPropert...
Real haliteSolubility(Real temperature) const
Solubility of halite (solid NaCl) in water Originally from Potter et al., A new method for determinin...
virtual Real cp_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
virtual Real vaporPressure(Real T) const
Vapor pressure.
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
static InputParameters validParams()
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.
static const unsigned int WATER
Fluid component numbers for water and NaCl.