28#ifndef EWOMS_VTK_DIFFUSION_MODULE_HH
29#define EWOMS_VTK_DIFFUSION_MODULE_HH
31#include <opm/material/densead/Evaluation.hpp>
32#include <opm/material/densead/Math.hpp>
63template <
class TypeTag>
73 using Toolbox = MathToolbox<Evaluation>;
78 static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
81 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
82 enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
94 Parameters::Register<Parameters::VtkWriteTortuosities>
95 (
"Include the tortuosity for each phase in the VTK output files");
96 Parameters::Register<Parameters::VtkWriteDiffusionCoefficients>
97 (
"Include the molecular diffusion coefficients in "
98 "the VTK output files");
99 Parameters::Register<Parameters::VtkWriteEffectiveDiffusionCoefficients>
100 (
"Include the effective molecular diffusion "
101 "coefficients the medium in the VTK output files");
110 if (tortuosityOutput_())
112 if (diffusionCoefficientOutput_())
114 if (effectiveDiffusionCoefficientOutput_())
124 if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
128 for (
unsigned i = 0; i < elemCtx.numPrimaryDof(0); ++i) {
129 unsigned I = elemCtx.globalSpaceIndex(i, 0);
130 const auto& intQuants = elemCtx.intensiveQuantities(i, 0);
132 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
133 if (tortuosityOutput_())
134 tortuosity_[phaseIdx][I] = Toolbox::value(intQuants.tortuosity(phaseIdx));
135 for (
unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
136 if (diffusionCoefficientOutput_())
137 diffusionCoefficient_[phaseIdx][compIdx][I] =
138 Toolbox::value(intQuants.diffusionCoefficient(phaseIdx, compIdx));
139 if (effectiveDiffusionCoefficientOutput_())
140 effectiveDiffusionCoefficient_[phaseIdx][compIdx][I] =
141 Toolbox::value(intQuants.effectiveDiffusionCoefficient(phaseIdx, compIdx));
157 if (tortuosityOutput_())
159 if (diffusionCoefficientOutput_())
161 diffusionCoefficient_);
162 if (effectiveDiffusionCoefficientOutput_())
164 "effectiveDiffusionCoefficient",
165 effectiveDiffusionCoefficient_);
169 static bool tortuosityOutput_()
171 static bool val = Parameters::Get<Parameters::VtkWriteTortuosities>();
175 static bool diffusionCoefficientOutput_()
177 static bool val = Parameters::Get<Parameters::VtkWriteDiffusionCoefficients>();
181 static bool effectiveDiffusionCoefficientOutput_()
183 static bool val = Parameters::Get<Parameters::VtkWriteEffectiveDiffusionCoefficients>();
187 PhaseBuffer tortuosity_;
188 PhaseComponentBuffer diffusionCoefficient_;
189 PhaseComponentBuffer effectiveDiffusionCoefficient_;
The base class for writer modules.
Definition: baseoutputmodule.hh:67
void commitPhaseBuffer_(BaseOutputWriter &baseWriter, const char *pattern, PhaseBuffer &buffer, BufferType bufferType=DofBuffer)
Add a phase-specific buffer to the result file.
Definition: baseoutputmodule.hh:345
void resizePhaseBuffer_(PhaseBuffer &buffer, BufferType bufferType=DofBuffer)
Allocate the space for a buffer storing a phase-specific quantity.
Definition: baseoutputmodule.hh:201
std::array< ScalarBuffer, numPhases > PhaseBuffer
Definition: baseoutputmodule.hh:90
void resizePhaseComponentBuffer_(PhaseComponentBuffer &buffer, BufferType bufferType=DofBuffer)
Allocate the space for a buffer storing a phase and component specific buffer.
Definition: baseoutputmodule.hh:229
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:377
std::array< std::array< ScalarBuffer, numComponents >, numPhases > PhaseComponentBuffer
Definition: baseoutputmodule.hh:92
The base class for all output writers.
Definition: baseoutputwriter.hh:44
VTK output module for quantities which make sense for models which incorperate molecular diffusion.
Definition: vtkdiffusionmodule.hh:65
void allocBuffers()
Allocate memory for the scalar fields we would like to write to the VTK file.
Definition: vtkdiffusionmodule.hh:108
void processElement(const ElementContext &elemCtx)
Modify the internal buffers according to the intensive quanties relevant for an element.
Definition: vtkdiffusionmodule.hh:122
VtkDiffusionModule(const Simulator &simulator)
Definition: vtkdiffusionmodule.hh:85
void commitBuffers(BaseOutputWriter &baseWriter)
Add all buffers to the VTK output writer.
Definition: vtkdiffusionmodule.hh:150
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkdiffusionmodule.hh:92
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:66
Declare the properties used by the infrastructure code of the finite volume discretizations.
Definition: blackoilnewtonmethodparameters.hh:31
Definition: blackoilboundaryratevector.hh:37
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:235
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.
Definition: vtkdiffusionmodule.hh:46
static constexpr bool value
Definition: vtkdiffusionmodule.hh:46
Definition: vtkdiffusionmodule.hh:47
static constexpr bool value
Definition: vtkdiffusionmodule.hh:47
Definition: vtkdiffusionmodule.hh:45
static constexpr bool value
Definition: vtkdiffusionmodule.hh:45