https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowFluidStateMultiComponentBase.C
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
11
14{
16 params.addParam<unsigned int>(
17 "liquid_fluid_component", 0, "The fluid component number of the primary liquid component");
18 params.addParam<unsigned int>("salt_component", 2, "The component number of salt");
19 params.addParam<bool>("compute_internal_energy", true, "Compute the fluid internal energy");
20 params.addParam<bool>("compute_enthalpy", true, "Compute the fluid enthalpy");
21 params.addClassDescription("Base class for multiple component fluid state classes");
22 return params;
23}
24
26 const InputParameters & parameters)
27 : PorousFlowFluidStateFlash(parameters),
28 _aqueous_fluid_component(getParam<unsigned int>("liquid_fluid_component")),
29 _salt_component(getParam<unsigned int>("salt_component")),
30 _compute_internal_energy(getParam<bool>("compute_internal_energy")),
31 _compute_enthalpy(getParam<bool>("compute_enthalpy")),
32 _pidx(0),
33 _Zidx(1),
34 _Tidx(2),
35 _Xidx(3)
36{
37}
38
39void
41 Real Xi,
42 Real Yi,
43 FluidStatePhaseEnum & phase_state) const
44{
45 if (Zi <= Xi)
46 {
47 // In this case, there is not enough component i to form a gas phase,
48 // so only a liquid phase is present
49 phase_state = FluidStatePhaseEnum::LIQUID;
50 }
51 else if (Zi > Xi && Zi < Yi)
52 {
53 // Two phases are present
55 }
56 else // (Zi >= Yi)
57 {
58 // In this case, there is not enough water to form a liquid
59 // phase, so only a gas phase is present
60 phase_state = FluidStatePhaseEnum::GAS;
61 }
62}
FluidStatePhaseEnum
Phase state enum.
void ErrorVector unsigned int
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Compositional flash routines for miscible multiphase flow classes with multiple fluid components.
static InputParameters validParams()
PorousFlowFluidStateMultiComponentBase(const InputParameters &parameters)
void phaseState(Real Zi, Real Xi, Real Yi, FluidStatePhaseEnum &phase_state) const
Determines the phase state gven the total mass fraction and equilibrium mass fractions.