28 #ifndef EWOMS_VTK_DIFFUSION_MODULE_HH 29 #define EWOMS_VTK_DIFFUSION_MODULE_HH 37 #include <opm/material/densead/Evaluation.hpp> 38 #include <opm/material/densead/Math.hpp> 41 namespace Properties {
55 SET_BOOL_PROP(VtkDiffusion, VtkWriteDiffusionCoefficients,
false);
56 SET_BOOL_PROP(VtkDiffusion, VtkWriteEffectiveDiffusionCoefficients,
false);
72 template <
class TypeTag>
78 typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
79 typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
80 typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
82 typedef Opm::MathToolbox<Evaluation> Toolbox;
84 typedef typename ParentType::PhaseComponentBuffer PhaseComponentBuffer;
85 typedef typename ParentType::PhaseBuffer PhaseBuffer;
87 static const int vtkFormat =
GET_PROP_VALUE(TypeTag, VtkOutputFormat);
104 "Include the tortuosity for each phase in the VTK " 107 "Include the molecular diffusion coefficients in " 108 "the VTK output files");
110 VtkWriteEffectiveDiffusionCoefficients,
111 "Include the effective molecular diffusion " 112 "coefficients the medium in the VTK output files");
121 if (tortuosityOutput_())
123 if (diffusionCoefficientOutput_())
125 if (effectiveDiffusionCoefficientOutput_())
138 for (
unsigned i = 0; i < elemCtx.numPrimaryDof(0); ++i) {
139 unsigned I = elemCtx.globalSpaceIndex(i, 0);
140 const auto& intQuants = elemCtx.intensiveQuantities(i, 0);
142 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
143 if (tortuosityOutput_())
144 tortuosity_[phaseIdx][I] = Toolbox::value(intQuants.tortuosity(phaseIdx));
145 for (
unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
146 if (diffusionCoefficientOutput_())
147 diffusionCoefficient_[phaseIdx][compIdx][I] =
148 Toolbox::value(intQuants.diffusionCoefficient(phaseIdx, compIdx));
149 if (effectiveDiffusionCoefficientOutput_())
150 effectiveDiffusionCoefficient_[phaseIdx][compIdx][I] =
151 Toolbox::value(intQuants.effectiveDiffusionCoefficient(phaseIdx, compIdx));
167 if (tortuosityOutput_())
169 if (diffusionCoefficientOutput_())
171 diffusionCoefficient_);
172 if (effectiveDiffusionCoefficientOutput_())
174 "effectiveDiffusionCoefficient",
175 effectiveDiffusionCoefficient_);
179 static bool tortuosityOutput_()
182 static bool diffusionCoefficientOutput_()
183 {
return EWOMS_GET_PARAM(TypeTag,
bool, VtkWriteDiffusionCoefficients); }
185 static bool effectiveDiffusionCoefficientOutput_()
188 VtkWriteEffectiveDiffusionCoefficients);
191 PhaseBuffer tortuosity_;
192 PhaseComponentBuffer diffusionCoefficient_;
193 PhaseComponentBuffer effectiveDiffusionCoefficient_;
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
Definition: baseauxiliarymodule.hh:37
void commitPhaseBuffer_(BaseOutputWriter &baseWriter, const char *pattern, PhaseBuffer &buffer, BufferType bufferType=DofBuffer)
Add a phase-specific buffer to the result file.
Definition: baseoutputmodule.hh:408
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:63
void allocBuffers()
Allocate memory for the scalar fields we would like to write to the VTK file.
Definition: vtkdiffusionmodule.hh:119
#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.
void processElement(const ElementContext &elemCtx)
Modify the internal buffers according to the intensive quanties relevant for an element.
Definition: vtkdiffusionmodule.hh:133
#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
This file provides the infrastructure to retrieve run-time parameters.
The base class for writer modules.
Definition: baseoutputmodule.hh:80
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkdiffusionmodule.hh:101
void resizePhaseComponentBuffer_(PhaseComponentBuffer &buffer, BufferType bufferType=DofBuffer)
Allocate the space for a buffer storing a phase and component specific buffer.
Definition: baseoutputmodule.hh:281
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName)
Retrieve a runtime parameter.
Definition: parametersystem.hh:99
void resizePhaseBuffer_(PhaseBuffer &buffer, BufferType bufferType=DofBuffer)
Allocate the space for a buffer storing a phase-specific quantity.
Definition: baseoutputmodule.hh:235
VTK output module for quantities which make sense for models which incorperate molecular diffusion...
Definition: vtkdiffusionmodule.hh:73
Provides the magic behind the eWoms property system.
Simplifies writing multi-file VTK datasets.
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: vtkdiffusionmodule.hh:160
void commitPhaseComponentBuffer_(BaseOutputWriter &baseWriter, const char *pattern, PhaseComponentBuffer &buffer, BufferType bufferType=DofBuffer)
Add a phase and component specific quantities to the output.
Definition: baseoutputmodule.hh:454