28 #ifndef OPM_PTFLASH_MODEL_HH 29 #define OPM_PTFLASH_MODEL_HH 31 #include <opm/material/constraintsolvers/PTFlash.hpp> 33 #include <opm/material/densead/Math.hpp> 35 #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp> 36 #include <opm/material/fluidmatrixinteractions/NullMaterial.hpp> 66 template <
class TypeTag>
75 struct FlashModel {
using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
79 template<
class TypeTag>
80 struct LocalResidual<TypeTag, TTag::FlashModel>
81 {
using type = FlashLocalResidual<TypeTag>; };
84 template<
class TypeTag>
89 template<
class TypeTag>
92 using type = PTFlash<GetPropType<TypeTag, Properties::Scalar>,
97 template<
class TypeTag>
102 template<
class TypeTag>
103 struct PrimaryVariables<TypeTag, TTag::FlashModel>
104 {
using type = FlashPrimaryVariables<TypeTag>; };
107 template<
class TypeTag>
108 struct RateVector<TypeTag, TTag::FlashModel>
109 {
using type = FlashRateVector<TypeTag>; };
112 template<
class TypeTag>
113 struct BoundaryRateVector<TypeTag, TTag::FlashModel>
114 {
using type = FlashBoundaryRateVector<TypeTag>; };
117 template<
class TypeTag>
118 struct IntensiveQuantities<TypeTag, TTag::FlashModel>
119 {
using type = FlashIntensiveQuantities<TypeTag>; };
122 template<
class TypeTag>
123 struct ExtensiveQuantities<TypeTag, TTag::FlashModel>
124 {
using type = FlashExtensiveQuantities<TypeTag>; };
127 template<
class TypeTag>
128 struct Indices<TypeTag, TTag::FlashModel>
129 {
using type = FlashIndices<TypeTag, 0>; };
132 template<
class TypeTag>
133 struct EnableDiffusion<TypeTag, TTag::FlashModel>
134 {
static constexpr
bool value =
false; };
137 template<
class TypeTag>
138 struct EnableEnergy<TypeTag, TTag::FlashModel>
139 {
static constexpr
bool value =
false; };
141 template<
class TypeTag>
191 template <
class TypeTag>
203 enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
204 enum { enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>() };
205 enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
211 explicit FlashModel(Simulator& simulator)
212 : ParentType(simulator)
226 if constexpr (enableDiffusion) {
230 if constexpr (enableEnergy) {
234 Parameters::Register<Parameters::FlashTolerance<Scalar>>
235 (
"The maximum tolerance for the flash solver to " 236 "consider the solution converged");
237 Parameters::Register<Parameters::FlashVerbosity>
238 (
"Flash solver verbosity level");
239 Parameters::Register<Parameters::FlashTwoPhaseMethod>
240 (
"Method for solving vapor-liquid composition. Available options include: " 241 "ssi, newton, ssi+newton");
243 Parameters::SetDefault<Parameters::FlashTolerance<Scalar>>(1.e-8);
244 Parameters::SetDefault<Parameters::EnableIntensiveQuantityCache>(
true);
249 Parameters::SetDefault<Parameters::EnableThermodynamicHints>(
true);
257 const std::string& tmp = EnergyModule::primaryVarName(pvIdx);
262 std::ostringstream oss;
263 if (Indices::z0Idx <= pvIdx && pvIdx < Indices::z0Idx + numComponents - 1) {
264 oss <<
"z_," << FluidSystem::componentName(pvIdx - Indices::z0Idx);
266 else if (pvIdx == Indices::pressure0Idx) {
267 oss <<
"pressure_" << FluidSystem::phaseName(0);
281 const std::string& tmp = EnergyModule::eqName(eqIdx);
286 std::ostringstream oss;
287 if (Indices::conti0EqIdx <= eqIdx &&
288 eqIdx < Indices::conti0EqIdx + numComponents)
290 const unsigned compIdx = eqIdx - Indices::conti0EqIdx;
291 oss <<
"continuity^" << FluidSystem::componentName(compIdx);
300 void registerOutputModules_()
302 ParentType::registerOutputModules_();
307 if constexpr (enableDiffusion) {
310 if constexpr (enableEnergy) {
311 this->addOutputModule(std::make_unique<VtkEnergyModule<TypeTag>>(this->simulator_));
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(...))
Definition: propertysystem.hh:233
std::string primaryVarName(unsigned pvIdx) const
Given an primary variable index, return a human readable name.
Definition: flashmodel.hh:255
Specifies the type of the actual Newton method.
Definition: fvbaseproblem.hh:54
VTK output module for quantities which make sense for models which assume thermal equilibrium...
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: flashmodel.hh:218
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkcompositionmodule.hpp:87
Defines the primary variable and equation indices for the compositional multi-phase model based on fl...
This template class contains the data which is required to calculate all fluxes of components over a ...
Enable water?
Definition: multiphasebaseproperties.hh:103
Contains the classes required to consider energy as a conservation quantity in a multi-phase module...
VTK output module for the PT Flash calculation This module deals with the following quantities: K...
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
VTK output module for the PT Flash calculation This module deals with the following quantities: K...
Definition: vtkptflashmodule.hpp:52
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkdiffusionmodule.hpp:88
Declares the properties required by the compositional multi-phase model based on flash calculations...
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: multiphasebasemodel.hh:197
std::string eqName(unsigned eqIdx) const
Given an equation index, return a human readable name.
Definition: flashmodel.hh:279
Represents the primary variables used by the compositional flow model based on flash calculations...
A Newton solver specific to the PTFlash model.
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkenergymodule.hpp:87
VTK output module for the fluid composition.
Definition: vtkcompositionmodule.hpp:56
Contains the intensive quantities of the flash-based compositional multi-phase model.
Implements a boundary vector for the fully implicit compositional multi-phase model which is based on...
Calculates the local residual of the compositional multi-phase model based on flash calculations...
Provides the auxiliary methods required for consideration of the energy equation. ...
Definition: energymodule.hh:54
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:83
Definition: blackoilmodel.hh:80
Declares the parameters for the compositional multi-phase model based on flash calculations.
VTK output module for quantities which make sense for models which incorperate molecular diffusion...
The type of the flash constraint solver.
Definition: flashproperties.hh:39
Implements a vector representing rates of conserved quantities.
A Newton solver specific to the PTFlash model.
Definition: flashnewtonmethod.hh:54
A compositional multi-phase model based on flash-calculations
Definition: flashmodel.hh:64
VTK output module for quantities which make sense for models which incorperate molecular diffusion...
Definition: vtkdiffusionmodule.hpp:57
VTK output module for the fluid composition.
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkptflashmodule.hpp:83
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Definition: multiphasebasemodel.hh:57