https://mooseframework.inl.gov
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.addClassDescription("Base class for multiple component fluid state classes");
20  return params;
21 }
22 
24  const InputParameters & parameters)
25  : PorousFlowFluidStateFlash(parameters),
26  _aqueous_fluid_component(getParam<unsigned int>("liquid_fluid_component")),
27  _salt_component(getParam<unsigned int>("salt_component")),
28  _pidx(0),
29  _Zidx(1),
30  _Tidx(2),
31  _Xidx(3)
32 {
33 }
34 
35 void
37  Real Xi,
38  Real Yi,
39  FluidStatePhaseEnum & phase_state) const
40 {
41  if (Zi <= Xi)
42  {
43  // In this case, there is not enough component i to form a gas phase,
44  // so only a liquid phase is present
45  phase_state = FluidStatePhaseEnum::LIQUID;
46  }
47  else if (Zi > Xi && Zi < Yi)
48  {
49  // Two phases are present
50  phase_state = FluidStatePhaseEnum::TWOPHASE;
51  }
52  else // (Zi >= Yi)
53  {
54  // In this case, there is not enough water to form a liquid
55  // phase, so only a gas phase is present
56  phase_state = FluidStatePhaseEnum::GAS;
57  }
58 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
PorousFlowFluidStateMultiComponentBase(const InputParameters &parameters)
FluidStatePhaseEnum
Phase state enum.
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.
Compositional flash routines for miscible multiphase flow classes with multiple fluid components...
void addClassDescription(const std::string &doc_string)
void ErrorVector unsigned int