https://mooseframework.inl.gov
Loading...
Searching...
No Matches
BrineFluidProperties.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
14
15#pragma GCC diagnostic push
16#pragma GCC diagnostic ignored "-Woverloaded-virtual"
17
34{
35public:
37
39 virtual ~BrineFluidProperties();
40
45 virtual std::string fluidName() const override;
46
52 Real molarMass(Real xnacl) const;
53 FPADReal molarMass(const FPADReal & xnacl) const;
54
59 Real molarMassNaCl() const;
60
65 Real molarMassH2O() const;
66
67 virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override;
68 using MultiComponentFluidProperties::rho_from_p_T_X;
69
70 FPADReal rho_from_p_T_X(const FPADReal & pressure,
71 const FPADReal & temperature,
72 const FPADReal & xnacl) const;
73
74 virtual void rho_from_p_T_X(Real pressure,
75 Real temperature,
76 Real xnacl,
77 Real & rho,
78 Real & drho_dp,
79 Real & drho_dT,
80 Real & drho_dx) const override;
81
82 virtual Real mu_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override;
83 using MultiComponentFluidProperties::mu_from_p_T_X;
84
85 virtual void mu_from_p_T_X(Real pressure,
86 Real temperature,
87 Real xnacl,
88 Real & mu,
89 Real & dmu_dp,
90 Real & dmu_dT,
91 Real & dmu_dx) const override;
92
93 FPADReal h_from_p_T_X(const FPADReal & pressure,
94 const FPADReal & temperature,
95 const FPADReal & xnacl) const;
96
97 virtual Real h_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override;
98 using MultiComponentFluidProperties::h_from_p_T_X;
99
100 virtual void h_from_p_T_X(Real pressure,
101 Real temperature,
102 Real xnacl,
103 Real & h,
104 Real & dh_dp,
105 Real & dh_dT,
106 Real & dh_dx) const override;
107
108 virtual Real cp_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override;
109
110 FPADReal e_from_p_T_X(const FPADReal & pressure,
111 const FPADReal & temperature,
112 const FPADReal & xnacl) const;
113
114 virtual Real e_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override;
115
116 virtual void e_from_p_T_X(Real pressure,
117 Real temperature,
118 Real xnacl,
119 Real & e,
120 Real & de_dp,
121 Real & de_dT,
122 Real & de_dx) const override;
123
124 virtual Real k_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override;
125
136 Real vaporPressure(Real temperature, Real xnacl) const;
137
152 Real haliteSolubility(Real temperature) const;
153
162 Real henryConstant(Real temperature, const std::vector<Real> & coeffs) const;
163 void
164 henryConstant(Real temperature, const std::vector<Real> & coeffs, Real & Kh, Real & dKh_dT) const;
165 ADReal henryConstant(const ADReal & temperature, const std::vector<Real> & coeffs) const;
166
168 static const unsigned int WATER = 0;
169 static const unsigned int NACL = 1;
170
171 virtual const SinglePhaseFluidProperties & getComponent(unsigned int component) const override;
172
173protected:
179 Real massFractionToMolalConc(Real xnacl) const;
180
186 Real massFractionToMoleFraction(Real xnacl) const;
187 FPADReal massFractionToMoleFraction(const FPADReal & xnacl) const;
188
195
197 Real _Mnacl;
199 Real _Mh2o;
201 mutable bool _water_fp_derivs;
202};
203
204#pragma GCC diagnostic pop
DualNumber< Real, DNDerivativeType, true > ADReal
DualNumber< Real, DNDerivativeSize< 5 > > FPADReal
const double mu
const double rho
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
virtual Real mu_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Real massFractionToMolalConc(Real xnacl) const
Conversion from mass fraction to molal concentration (molality)
FPADReal e_from_p_T_X(const FPADReal &pressure, const FPADReal &temperature, const FPADReal &xnacl) const
const SinglePhaseFluidProperties * _nacl_fp
NaClFluidProperties UserObject.
Real molarMassNaCl() const
NaCl molar mass.
FPADReal h_from_p_T_X(const FPADReal &pressure, const FPADReal &temperature, const FPADReal &xnacl) const
virtual Real k_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 _Mh2o
Molar mass of water (H2O) (kg/mol)
Real haliteSolubility(Real temperature) const
Solubility of halite (solid NaCl) in water Originally from Potter et al., A new method for determinin...
static const unsigned int NACL
Real vaporPressure(Real temperature, Real xnacl) const
Brine vapour pressure From Haas, Physical properties of the coexisting phases and thermochemical prop...
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
Real molarMassH2O() const
H2O molar mass.
static InputParameters validParams()
static const unsigned int WATER
Fluid component numbers for water and NaCl.
virtual Real cp_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
virtual const SinglePhaseFluidProperties & getComponent(unsigned int component) const override
Get UserObject for specified component.
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...
bool _water_fp_derivs
Flag to indicate whether to calculate derivatives in water_fp.
Real molarMass(Real xnacl) const
Average molar mass of brine.
const Water97FluidProperties * _water97_fp
Water97FluidProperties UserObject (for Henry's law)
Real _Mnacl
Molar mass of NaCl (kg/mol)
virtual std::string fluidName() const override
Fluid name.
const InputParameters & parameters() const
Common class for multiple component fluid properties using a pressure and temperature formulation.
Common class for single phase fluid properties.
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...