https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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,
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 {
37 }
38
46 std::vector<ADReal> mass_fraction;
47};
48
53{
54public:
56
58
59 void initialize() final {};
60 void execute() final {};
61 void finalize() final {};
62
67 unsigned int numPhases() const { return _num_phases; };
68
73 unsigned int numComponents() const { return _num_components; };
74
79 unsigned int aqueousPhaseIndex() const { return _aqueous_phase_number; };
80
85 unsigned int gasPhaseIndex() const { return _gas_phase_number; };
86
90 virtual std::string fluidStateName() const = 0;
91
96 void clearFluidStateProperties(std::vector<FluidStateProperties> & fsp) const;
97
98protected:
100 unsigned int _num_phases;
102 unsigned int _num_components;
104 const unsigned int _aqueous_phase_number;
106 unsigned int _gas_phase_number;
108 const Real _R;
110 const Real _T_c2k;
115};
DualNumber< Real, DNDerivativeType, true > ADReal
FluidStatePhaseEnum
Phase state enum.
const InputParameters & parameters() const
Base class for capillary pressure for multiphase flow in porous media.
Base class for fluid states for miscible multiphase flow in porous media.
virtual std::string fluidStateName() const =0
Name of FluidState.
unsigned int gasPhaseIndex() const
The index of the gas phase.
unsigned int _num_components
Number of components.
const PorousFlowCapillaryPressure & _pc
Capillary pressure UserObject.
unsigned int numComponents() const
The maximum number of components in this model.
unsigned int _gas_phase_number
Phase number of the gas phase.
const Real _R
Universal gas constant (J/mol/K)
unsigned int aqueousPhaseIndex() const
The index of the aqueous phase.
const unsigned int _aqueous_phase_number
Phase number of the aqueous phase.
FluidStateProperties _empty_fsp
Empty FluidStateProperties object.
const Real _T_c2k
Conversion from C to K.
unsigned int numPhases() const
The maximum number of phases in this model.
void clearFluidStateProperties(std::vector< FluidStateProperties > &fsp) const
Clears the contents of the FluidStateProperties data structure.
unsigned int _num_phases
Number of phases.
static InputParameters validParams()
AD data structure to pass calculated thermophysical properties.
std::vector< ADReal > mass_fraction