27 #ifndef EWOMS_VTK_BLACK_OIL_POLYMER_MODULE_HH
28 #define EWOMS_VTK_BLACK_OIL_POLYMER_MODULE_HH
30 #include <opm/material/densead/Math.hpp>
39 #include <dune/common/fvector.hh>
44 namespace Properties {
59 SET_BOOL_PROP(VtkBlackOilPolymer, VtkWritePolymerConcentration,
true);
60 SET_BOOL_PROP(VtkBlackOilPolymer, VtkWritePolymerDeadPoreVolume,
true);
61 SET_BOOL_PROP(VtkBlackOilPolymer, VtkWritePolymerViscosityCorrection,
true);
62 SET_BOOL_PROP(VtkBlackOilPolymer, VtkWriteWaterViscosityCorrection,
true);
63 SET_BOOL_PROP(VtkBlackOilPolymer, VtkWritePolymerRockDensity,
true);
64 SET_BOOL_PROP(VtkBlackOilPolymer, VtkWritePolymerAdsorption,
true);
74 template <
class TypeTag>
80 typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
81 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
82 typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
83 typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
85 static const int vtkFormat =
GET_PROP_VALUE(TypeTag, VtkOutputFormat);
90 typedef typename ParentType::ScalarBuffer ScalarBuffer;
107 "Include the concentration of the polymer component in the water phase "
108 "in the VTK output files");
110 "Include the fraction of the \"dead\" pore volume "
111 "in the VTK output files");
113 "Include the amount of already adsorbed polymer component"
114 "in the VTK output files");
116 "Include the adsorption rate of the polymer component"
117 "in the VTK output files");
119 "Include the viscosity correction of the polymer component "
120 "in the VTK output files");
122 "Include the viscosity correction of the water component "
123 "due to polymers in the VTK output files");
138 if (polymerConcentrationOutput_())
140 if (polymerDeadPoreVolumeOutput_())
142 if (polymerRockDensityOutput_())
144 if (polymerAdsorptionOutput_())
146 if (polymerViscosityCorrectionOutput_())
148 if (waterViscosityCorrectionOutput_())
164 for (
unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(0); ++dofIdx) {
165 const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, 0);
166 unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, 0);
168 if (polymerConcentrationOutput_())
169 polymerConcentration_[globalDofIdx] =
170 Opm::scalarValue(intQuants.polymerConcentration());
172 if (polymerDeadPoreVolumeOutput_())
173 polymerDeadPoreVolume_[globalDofIdx] =
174 Opm::scalarValue(intQuants.polymerDeadPoreVolume());
176 if (polymerRockDensityOutput_())
177 polymerRockDensity_[globalDofIdx] =
178 Opm::scalarValue(intQuants.polymerRockDensity());
180 if (polymerAdsorptionOutput_())
181 polymerAdsorption_[globalDofIdx] =
182 Opm::scalarValue(intQuants.polymerAdsorption());
184 if (polymerViscosityCorrectionOutput_())
185 polymerViscosityCorrection_[globalDofIdx] =
186 Opm::scalarValue(intQuants.polymerViscosityCorrection());
188 if (waterViscosityCorrectionOutput_())
189 waterViscosityCorrection_[globalDofIdx] =
190 Opm::scalarValue(intQuants.waterViscosityCorrection());
206 if (polymerConcentrationOutput_())
209 if (polymerDeadPoreVolumeOutput_())
210 this->
commitScalarBuffer_(baseWriter,
"dead pore volume fraction", polymerDeadPoreVolume_);
212 if (polymerRockDensityOutput_())
215 if (polymerAdsorptionOutput_())
218 if (polymerViscosityCorrectionOutput_())
219 this->
commitScalarBuffer_(baseWriter,
"polymer viscosity correction", polymerViscosityCorrection_);
221 if (waterViscosityCorrectionOutput_())
222 this->
commitScalarBuffer_(baseWriter,
"water viscosity correction", waterViscosityCorrection_);
226 static bool polymerConcentrationOutput_()
227 {
return EWOMS_GET_PARAM(TypeTag,
bool, VtkWritePolymerConcentration); }
229 static bool polymerDeadPoreVolumeOutput_()
230 {
return EWOMS_GET_PARAM(TypeTag,
bool, VtkWritePolymerDeadPoreVolume); }
232 static bool polymerRockDensityOutput_()
235 static bool polymerAdsorptionOutput_()
238 static bool polymerViscosityCorrectionOutput_()
239 {
return EWOMS_GET_PARAM(TypeTag,
bool, VtkWritePolymerViscosityCorrection); }
241 static bool waterViscosityCorrectionOutput_()
242 {
return EWOMS_GET_PARAM(TypeTag,
bool, VtkWritePolymerViscosityCorrection); }
244 ScalarBuffer polymerConcentration_;
245 ScalarBuffer polymerDeadPoreVolume_;
246 ScalarBuffer polymerRockDensity_;
247 ScalarBuffer polymerAdsorption_;
248 ScalarBuffer polymerViscosityCorrection_;
249 ScalarBuffer waterViscosityCorrection_;
The base class for all output writers.
Definition: baseoutputwriter.hh:43
#define SET_BOOL_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant boolean value.
Definition: propertysystem.hh:361
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:63
void commitScalarBuffer_(BaseOutputWriter &baseWriter, const char *name, ScalarBuffer &buffer, BufferType bufferType=DofBuffer)
Add a buffer containing scalar quantities to the result file.
Definition: baseoutputmodule.hh:305
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
The base class for writer modules.
#define NEW_TYPE_TAG(...)
Define a new type tag.
Definition: propertysystem.hh:169
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description)
Register a run-time parameter.
Definition: parametersystem.hh:68
Declares the properties required by the black oil model.
This file provides the infrastructure to retrieve run-time parameters.
The base class for writer modules.
Definition: baseoutputmodule.hh:80
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName)
Retrieve a runtime parameter.
Definition: parametersystem.hh:99
void allocBuffers()
Allocate memory for the scalar fields we would like to write to the VTK file.
Definition: vtkblackoilpolymermodule.hh:130
static void registerParameters()
Register all run-time parameters for the multi-phase VTK output module.
Definition: vtkblackoilpolymermodule.hh:101
Provides the magic behind the eWoms property system.
void resizeScalarBuffer_(ScalarBuffer &buffer, BufferType bufferType=DofBuffer)
Allocate the space for a buffer storing a scalar quantity.
Definition: baseoutputmodule.hh:170
Simplifies writing multi-file VTK datasets.
void processElement(const ElementContext &elemCtx)
Modify the internal buffers according to the intensive quantities relevant for an element...
Definition: vtkblackoilpolymermodule.hh:156
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:75
#define NEW_PROP_TAG(PTagName)
Define a property tag.
Definition: propertysystem.hh:247
void commitBuffers(BaseOutputWriter &baseWriter)
Add all buffers to the VTK output writer.
Definition: vtkblackoilpolymermodule.hh:197
VTK output module for the black oil model's polymer related quantities.
Definition: vtkblackoilpolymermodule.hh:75