www.mooseframework.org
BrineFluidProperties.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 #include "Water97FluidProperties.h"
14 
15 #pragma GCC diagnostic push
16 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
17 
34 {
35 public:
37 
39  virtual ~BrineFluidProperties();
40 
45  virtual std::string fluidName() const override;
46 
52  Real molarMass(Real xnacl) const;
53  FPDualReal molarMass(const FPDualReal & 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 
71  const FPDualReal & temperature,
72  const FPDualReal & xnacl) const;
73 
74  virtual void rho_from_p_T_X(Real pressure,
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,
87  Real xnacl,
88  Real & mu,
89  Real & dmu_dp,
90  Real & dmu_dT,
91  Real & dmu_dx) const override;
92 
94  const FPDualReal & temperature,
95  const FPDualReal & 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,
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 
111  const FPDualReal & temperature,
112  const FPDualReal & 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,
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 
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  DualReal henryConstant(const DualReal & 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 
173 protected:
179  Real massFractionToMolalConc(Real xnacl) const;
180 
186  Real massFractionToMoleFraction(Real xnacl) const;
187  FPDualReal massFractionToMoleFraction(const FPDualReal & xnacl) const;
188 
195 
201  mutable bool _water_fp_derivs;
202 };
203 
204 #pragma GCC diagnostic pop
Real molarMass(Real xnacl) const
Average molar mass of brine.
const SinglePhaseFluidProperties * _nacl_fp
NaClFluidProperties UserObject.
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&#39;s law)
static const std::string component
Definition: NS.h:138
virtual std::string fluidName() const override
Fluid name.
DualNumber< Real, DNDerivativeType, true > DualReal
Real molarMassH2O() const
H2O molar mass.
static const std::string temperature
Definition: NS.h:57
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, DNDerivativeSize< 5 > > FPDualReal
Real vaporPressure(Real temperature, Real xnacl) const
Brine vapour pressure From Haas, Physical properties of the coexisting phases and thermochemical prop...
static const unsigned int NACL
Real _Mnacl
Molar mass of NaCl (kg/mol)
Real molarMassNaCl() const
NaCl molar mass.
static const std::string mu
Definition: NS.h:122
virtual const SinglePhaseFluidProperties & getComponent(unsigned int component) const override
Get UserObject for specified component.
Common class for single phase fluid properties.
BrineFluidProperties(const InputParameters &parameters)
Common class for multiple component fluid properties using a pressure and temperature formulation...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _Mh2o
Molar mass of water (H2O) (kg/mol)
virtual Real k_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...
static const std::string pressure
Definition: NS.h:56
const InputParameters & parameters() const
FPDualReal e_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const
Real henryConstant(Real temperature, const std::vector< Real > &coeffs) const
IAPWS formulation of Henry&#39;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
const SinglePhaseFluidProperties * _water_fp
Water97FluidProperties UserObject.
static InputParameters validParams()
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.