28#ifndef EWOMS_FLASH_MODEL_HH
29#define EWOMS_FLASH_MODEL_HH
31#include <opm/material/constraintsolvers/NcpFlash.hpp>
33#include <opm/material/densead/Math.hpp>
35#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
36#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
63template <
class TypeTag>
68namespace Opm::Properties {
74{
using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
79template<
class TypeTag>
84template<
class TypeTag>
87 using type = NcpFlash<GetPropType<TypeTag, Properties::Scalar>,
92template<
class TypeTag>
97template<
class TypeTag>
102template<
class TypeTag>
107template<
class TypeTag>
112template<
class TypeTag>
117template<
class TypeTag>
122template<
class TypeTag>
127template<
class TypeTag>
129{
static constexpr bool value =
false; };
132template<
class TypeTag>
134{
static constexpr bool value =
false; };
199template <
class TypeTag>
215 using EnergyModule = ::Opm::EnergyModule<TypeTag, enableEnergy>;
218 explicit FlashModel(Simulator& simulator)
219 : ParentType(simulator)
232 if constexpr (enableDiffusion) {
236 if constexpr (enableEnergy) {
241 (
"The maximum tolerance for the flash solver to "
242 "consider the solution converged");
265 const std::string& tmp = EnergyModule::primaryVarName(pvIdx);
270 if (Indices::cTot0Idx <= pvIdx && pvIdx < Indices::cTot0Idx + numComponents) {
271 std::ostringstream oss;
272 oss <<
"c_tot," << FluidSystem::componentName(pvIdx - Indices::cTot0Idx);
286 const std::string& tmp = EnergyModule::eqName(eqIdx);
291 if (Indices::conti0EqIdx <= eqIdx && eqIdx < Indices::conti0EqIdx + numComponents) {
292 const unsigned compIdx = eqIdx - Indices::conti0EqIdx;
293 std::ostringstream oss;
294 oss <<
"continuity^" << FluidSystem::componentName(compIdx);
308 const Scalar tmp = EnergyModule::primaryVarWeight(*
this, globalDofIdx, pvIdx);
313 const unsigned compIdx = pvIdx - Indices::cTot0Idx;
320 return FluidSystem::molarMass(compIdx) / 100.0;
329 Scalar
eqWeight(
unsigned globalDofIdx,
unsigned eqIdx)
const
331 const Scalar tmp = EnergyModule::eqWeight(*
this, globalDofIdx, eqIdx);
336 const unsigned compIdx = eqIdx - Indices::conti0EqIdx;
339 return FluidSystem::molarMass(compIdx);
342 void registerOutputModules_()
344 ParentType::registerOutputModules_();
348 if constexpr (enableDiffusion) {
351 if constexpr (enableEnergy) {
352 this->addOutputModule(std::make_unique<VtkEnergyModule<TypeTag>>(this->simulator_));
Implements a boundary vector for the fully implicit compositional multi-phase model which is based on...
Definition flashboundaryratevector.hh:49
This template class contains the data which is required to calculate all fluxes of components over a ...
Definition flashextensivequantities.hh:54
Defines the primary variable and equation indices for the compositional multi-phase model based on fl...
Definition flashindices.hh:47
Contains the intensive quantities of the flash-based compositional multi-phase model.
Definition flashintensivequantities.hh:60
Calculates the local residual of the compositional multi-phase model based on flash calculations.
Definition flashlocalresidual.hh:47
A compositional multi-phase model based on flash-calculations.
Definition flashmodel.hh:194
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition flashmodel.hh:225
Scalar primaryVarWeight(unsigned globalDofIdx, unsigned pvIdx) const
Returns the relative weight of a primary variable for calculating relative errors.
Definition flashmodel.hh:306
static std::string name()
Definition flashmodel.hh:257
Scalar eqWeight(unsigned globalDofIdx, unsigned eqIdx) const
Returns the relative weight of an equation.
Definition flashmodel.hh:329
std::string primaryVarName(unsigned pvIdx) const
Given an primary variable index, return a human readable name.
Definition flashmodel.hh:263
std::string eqName(unsigned eqIdx) const
Given an equation index, return a human readable name.
Definition flashmodel.hh:284
Represents the primary variables used by the compositional flow model based on flash calculations.
Definition flashprimaryvariables.hh:52
Implements a vector representing rates of conserved quantities.
Definition flashratevector.hh:48
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Definition multiphasebasemodel.hh:168
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition multiphasebasemodel.hh:190
Manages the initializing and running of time dependent problems.
Definition simulator.hh:84
VTK output module for the fluid composition.
Definition vtkcompositionmodule.hpp:57
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition vtkcompositionmodule.hpp:87
VTK output module for quantities which make sense for models which incorperate molecular diffusion.
Definition vtkdiffusionmodule.hpp:58
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition vtkdiffusionmodule.hpp:88
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition vtkenergymodule.hpp:87
Contains the classes required to consider energy as a conservation quantity in a multi-phase module.
Defines the primary variable and equation indices for the compositional multi-phase model based on fl...
Contains the intensive quantities of the flash-based compositional multi-phase model.
Calculates the local residual of the compositional multi-phase model based on flash calculations.
Declares the parameters for the compositional multi-phase model based on flash calculations.
Represents the primary variables used by the compositional flow model based on flash calculations.
Implements a boundary vector for the fully implicit compositional multi-phase model which is based on...
This template class contains the data which is required to calculate all fluxes of components over a ...
Declares the properties required by the compositional multi-phase model based on flash calculations.
Implements a vector representing rates of conserved quantities.
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
The generic type tag for problems using the immiscible multi-phase model.
Definition blackoilmodel.hh:81
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
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
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
void SetDefault(decltype(Param::value) new_value)
Set a runtime parameter.
Definition parametersystem.hpp:212
void Register(const char *usageString)
Register a run-time parameter.
Definition parametersystem.hpp:292
Type of object for specifying boundary conditions.
Definition fvbaseproperties.hh:119
Enable diffusive fluxes?
Definition multiphasebaseproperties.hh:91
Specify whether energy should be considered as a conservation quantity or not.
Definition multiphasebaseproperties.hh:87
Data required to calculate a flux over a face.
Definition fvbaseproperties.hh:149
The type of the flash constraint solver.
Definition flashproperties.hh:39
Enumerations used by the model.
Definition multiphasebaseproperties.hh:51
The secondary variables within a sub-control volume.
Definition fvbaseproperties.hh:133
The type of the local residual function.
Definition fvbaseproperties.hh:94
The type of the model.
Definition basicproperties.hh:88
A vector of primary variables within a sub-control volume.
Definition fvbaseproperties.hh:130
Vector containing volumetric or areal rates of quantities.
Definition fvbaseproperties.hh:116
The type tag for the isothermal single phase problems.
Definition flashmodel.hh:74
VTK output module for the fluid composition.
VTK output module for quantities which make sense for models which incorperate molecular diffusion.
VTK output module for quantities which make sense for models which assume thermal equilibrium.