Line data Source code
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 : 12 : #include "PorousFlowFluidStateFlash.h" 13 : 14 : /** 15 : * Compositional flash routines for miscible multiphase flow classes with multiple 16 : * fluid components 17 : */ 18 : class PorousFlowFluidStateMultiComponentBase : public PorousFlowFluidStateFlash 19 : { 20 : public: 21 : static InputParameters validParams(); 22 : 23 : PorousFlowFluidStateMultiComponentBase(const InputParameters & parameters); 24 : 25 : /** 26 : * The index of the aqueous fluid component 27 : * @return aqueous fluid component number 28 : */ 29 3847 : unsigned int aqueousComponentIndex() const { return _aqueous_fluid_component; }; 30 : 31 : /** 32 : * The index of the gas fluid component 33 : * @return gas fluid component number 34 : */ 35 3847 : unsigned int gasComponentIndex() const { return _gas_fluid_component; }; 36 : 37 : /** 38 : * The index of the salt component 39 : * @return salt component number 40 : */ 41 3846 : unsigned int saltComponentIndex() const { return _salt_component; }; 42 : 43 : /** 44 : * Determines the phase state gven the total mass fraction and equilibrium mass fractions 45 : * 46 : * @param Zi total mass fraction 47 : * @param Xi equilibrium mass fraction in liquid 48 : * @param Yi equilibrium mass fraction in gas 49 : * @param[out] phase_state the phase state (gas, liquid, two phase) 50 : */ 51 : void phaseState(Real Zi, Real Xi, Real Yi, FluidStatePhaseEnum & phase_state) const; 52 : 53 : /** 54 : * Determines the complete thermophysical state of the system for a given set of 55 : * primary variables 56 : * 57 : * @param pressure gas phase pressure (Pa) 58 : * @param temperature fluid temperature (K) 59 : * @param Xnacl mass fraction of NaCl 60 : * @param Z total mass fraction of fluid component 61 : * @param qp quadpoint index 62 : * @param[out] fsp the FluidStateProperties struct containing all properties 63 : */ 64 : virtual void thermophysicalProperties(Real pressure, 65 : Real temperature, 66 : Real Xnacl, 67 : Real Z, 68 : unsigned int qp, 69 : std::vector<FluidStateProperties> & fsp) const = 0; 70 : 71 : virtual void thermophysicalProperties(const ADReal & pressure, 72 : const ADReal & temperature, 73 : const ADReal & Xnacl, 74 : const ADReal & Z, 75 : unsigned int qp, 76 : std::vector<FluidStateProperties> & fsp) const = 0; 77 : 78 : /** 79 : * Total mass fraction of fluid component summed over all phases in the two-phase state 80 : * for a specified gas saturation 81 : * 82 : * @param pressure gas pressure (Pa) 83 : * @param temperature temperature (K) 84 : * @param Xnacl NaCl mass fraction (kg/kg) 85 : * @param saturation gas saturation (-) 86 : * @param qp quadpoint index 87 : * @return total mass fraction Z (-) 88 : */ 89 : virtual Real totalMassFraction( 90 : Real pressure, Real temperature, Real Xnacl, Real saturation, unsigned int qp) const = 0; 91 : 92 3875 : unsigned int getPressureIndex() const { return _pidx; }; 93 3875 : unsigned int getTemperatureIndex() const { return _Tidx; }; 94 3875 : unsigned int getZIndex() const { return _Zidx; }; 95 3864 : unsigned int getXIndex() const { return _Xidx; }; 96 : 97 : protected: 98 : /// Fluid component number of the aqueous component 99 : const unsigned int _aqueous_fluid_component; 100 : /// Fluid component number of the gas phase 101 : unsigned int _gas_fluid_component; 102 : /// Salt component index 103 : const unsigned int _salt_component; 104 : /// Index of derivative wrt pressure 105 : const unsigned int _pidx; 106 : /// Index of derivative wrt total mass fraction Z 107 : const unsigned int _Zidx; 108 : /// Index of derivative wrt temperature 109 : const unsigned int _Tidx; 110 : /// Index of derivative wrt salt mass fraction X 111 : const unsigned int _Xidx; 112 : };