https://mooseframework.inl.gov
PorousFlowFluidStateBase.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 
12 #include "GeneralUserObject.h"
14 
17 {
18  LIQUID,
19  GAS,
20  TWOPHASE
21 };
22 
25 {
27  FluidStateProperties(unsigned int n)
28  : pressure(0.0),
29  temperature(0, 0),
30  saturation(0.0),
31  density(0.0),
32  viscosity(1.0), // to guard against division by zero
33  enthalpy(0.0),
34  internal_energy(0.0),
35  mass_fraction(n, 0.0){};
36 
44  std::vector<ADReal> mass_fraction;
45 };
46 
51 {
52 public:
54 
56 
57  void initialize() final{};
58  void execute() final{};
59  void finalize() final{};
60 
65  unsigned int numPhases() const { return _num_phases; };
66 
71  unsigned int numComponents() const { return _num_components; };
72 
77  unsigned int aqueousPhaseIndex() const { return _aqueous_phase_number; };
78 
83  unsigned int gasPhaseIndex() const { return _gas_phase_number; };
84 
88  virtual std::string fluidStateName() const = 0;
89 
94  void clearFluidStateProperties(std::vector<FluidStateProperties> & fsp) const;
95 
96 protected:
98  unsigned int _num_phases;
100  unsigned int _num_components;
102  const unsigned int _aqueous_phase_number;
104  unsigned int _gas_phase_number;
106  const Real _R;
108  const Real _T_c2k;
113 };
const unsigned int _aqueous_phase_number
Phase number of the aqueous phase.
unsigned int _num_phases
Number of phases.
const Real _T_c2k
Conversion from C to K.
FluidStateProperties(unsigned int n)
unsigned int _gas_phase_number
Phase number of the gas phase.
void clearFluidStateProperties(std::vector< FluidStateProperties > &fsp) const
Clears the contents of the FluidStateProperties data structure.
unsigned int _num_components
Number of components.
unsigned int aqueousPhaseIndex() const
The index of the aqueous phase.
static InputParameters validParams()
Base class for fluid states for miscible multiphase flow in porous media.
DualNumber< Real, DNDerivativeType, true > ADReal
Base class for capillary pressure for multiphase flow in porous media.
unsigned int numComponents() const
The maximum number of components in this model.
const Real _R
Universal gas constant (J/mol/K)
unsigned int gasPhaseIndex() const
The index of the gas phase.
AD data structure to pass calculated thermophysical properties.
FluidStatePhaseEnum
Phase state enum.
virtual std::string fluidStateName() const =0
Name of FluidState.
PorousFlowFluidStateBase(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const PorousFlowCapillaryPressure & _pc
Capillary pressure UserObject.
unsigned int numPhases() const
The maximum number of phases in this model.
const InputParameters & parameters() const
FluidStateProperties _empty_fsp
Empty FluidStateProperties object.
std::vector< ADReal > mass_fraction