27#ifndef OPM_VTK_BLACK_OIL_SOLVENT_MODULE_HPP
28#define OPM_VTK_BLACK_OIL_SOLVENT_MODULE_HPP
30#include <dune/common/fvector.hh>
32#include <opm/material/densead/Math.hpp>
52template <
class TypeTag>
53class VtkBlackOilSolventModule :
public BaseOutputModule<TypeTag>
55 using ParentType = BaseOutputModule<TypeTag>;
69 using ScalarBuffer =
typename ParentType::ScalarBuffer;
72 explicit VtkBlackOilSolventModule(
const Simulator& simulator)
73 : ParentType(simulator)
75 if constexpr (enableSolvent) {
86 if constexpr (enableSolvent) {
97 if constexpr (enableSolvent) {
102 if (params_.solventSaturationOutput_) {
105 if (params_.solventRswOutput_) {
108 if (params_.solventDensityOutput_) {
111 if (params_.solventViscosityOutput_) {
114 if (params_.solventMobilityOutput_) {
126 if constexpr (enableSolvent) {
131 using Toolbox = MathToolbox<Evaluation>;
132 for (
unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(0); ++dofIdx) {
133 const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, 0);
134 const unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, 0);
136 if (params_.solventSaturationOutput_) {
137 solventSaturation_[globalDofIdx] =
138 Toolbox::scalarValue(intQuants.solventSaturation());
141 if (params_.solventRswOutput_) {
142 solventRsw_[globalDofIdx] =
143 Toolbox::scalarValue(intQuants.rsSolw());
146 if (params_.solventDensityOutput_) {
147 solventDensity_[globalDofIdx] =
148 Toolbox::scalarValue(intQuants.solventDensity());
151 if (params_.solventViscosityOutput_) {
152 solventViscosity_[globalDofIdx] =
153 Toolbox::scalarValue(intQuants.solventViscosity());
156 if (params_.solventMobilityOutput_) {
157 solventMobility_[globalDofIdx] =
158 Toolbox::scalarValue(intQuants.solventMobility());
169 if constexpr (enableSolvent) {
170 if (!
dynamic_cast<VtkMultiWriter*
>(&baseWriter)) {
174 if (params_.solventSaturationOutput_) {
176 solventSaturation_, BufferType::Dof);
179 if (params_.solventRswOutput_) {
181 solventRsw_, BufferType::Dof);
184 if (params_.solventDensityOutput_) {
186 solventDensity_, BufferType::Dof);
189 if (params_.solventViscosityOutput_) {
191 solventViscosity_, BufferType::Dof);
194 if (params_.solventMobilityOutput_) {
196 solventMobility_, BufferType::Dof);
203 ScalarBuffer solventSaturation_{};
204 ScalarBuffer solventRsw_{};
205 ScalarBuffer solventDensity_{};
206 ScalarBuffer solventViscosity_{};
207 ScalarBuffer solventMobility_{};
The base class for writer modules.
Declares the properties required by the black oil model.
void resizeScalarBuffer_(ScalarBuffer &buffer, BufferType bufferType)
Allocate the space for a buffer storing a scalar quantity.
Definition baseoutputmodule.hh:157
BufferType
Definition baseoutputmodule.hh:143
void commitScalarBuffer_(BaseOutputWriter &baseWriter, const char *name, ScalarBuffer &buffer, BufferType bufferType)
Add a buffer containing scalar quantities to the result file.
Definition baseoutputmodule.hh:238
The base class for all output writers.
Definition baseoutputwriter.hh:46
void processElement(const ElementContext &elemCtx) override
Modify the internal buffers according to the intensive quantities relevant for an element.
Definition vtkblackoilsolventmodule.hpp:124
void allocBuffers() override
Allocate memory for the scalar fields we would like to write to the VTK file.
Definition vtkblackoilsolventmodule.hpp:95
static void registerParameters()
Register all run-time parameters for the multi-phase VTK output module.
Definition vtkblackoilsolventmodule.hpp:84
void commitBuffers(BaseOutputWriter &baseWriter) override
Add all buffers to the VTK output writer.
Definition vtkblackoilsolventmodule.hpp:167
Simplifies writing multi-file VTK datasets.
Definition vtkmultiwriter.hh:65
Declare the properties used by the infrastructure code of the finite volume discretizations.
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
This file provides the infrastructure to retrieve run-time parameters.
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition parametersystem.hpp:187
The Opm property system, traits with inheritance.
Struct holding the parameters for VtkBlackoilPolymerModule.
Definition vtkblackoilsolventparams.hpp:47
static void registerParameters()
Registers the parameters in parameter system.
Definition vtkblackoilsolventparams.cpp:31
VTK output module for the black oil model's solvent related quantities.
Simplifies writing multi-file VTK datasets.