Skip to content
Snippets Groups Projects
Commit 7310caeb authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'feature/free-2poutputfield-from-typetag' into 'master'

[2p][2p1c] Free vtk outputfields from TypeTag

See merge request !819
parents cb813bc5 47221243
No related branches found
No related tags found
1 merge request!819[2p][2p1c] Free vtk outputfields from TypeTag
......@@ -103,7 +103,9 @@ SET_BOOL_PROP(TwoP, EnableEnergyBalance, false); //
SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model
SET_TYPE_PROP(TwoP, VolumeVariables, TwoPVolumeVariables<TypeTag>); //!< the VolumeVariables property
SET_TYPE_PROP(TwoP, SpatialParams, FVSpatialParams<TypeTag>); //!< The spatial parameters. Use FVSpatialParams by default.
SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<TypeTag>); //!< Set the vtk output fields specific to the twop model
//! Set the vtk output fields specific to the twop model
SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
SET_TYPE_PROP(TwoP,
Indices,
......@@ -125,7 +127,9 @@ public:
SET_INT_PROP(TwoPNI, IsothermalNumEq, 2); //!< set isothermal NumEq
SET_TYPE_PROP(TwoPNI, IsothermalVolumeVariables, TwoPVolumeVariables<TypeTag>); //!< set isothermal VolumeVariables
SET_TYPE_PROP(TwoPNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< set isothermal LocalResidual
SET_TYPE_PROP(TwoPNI, IsothermalVtkOutputFields, TwoPVtkOutputFields<TypeTag>); //!< set isothermal output fields
//! Set the vtk output fields specific to the isothermal twop model
SET_TYPE_PROP(TwoPNI, IsothermalVtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
//! Set isothermal Indices
SET_PROP(TwoPNI, IsothermalIndices)
......
......@@ -24,33 +24,29 @@
#ifndef DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH
#define DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH
#include <dumux/common/properties.hh>
namespace Dumux {
/*!
* \ingroup TwoPModel
* \brief Adds vtk output fields specific to the two-phase model
*/
template<class TypeTag>
template<class Indices>
class TwoPVtkOutputFields
{
using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
public:
template <class VtkOutputModule>
static void init(VtkOutputModule& vtk)
{
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.capillaryPressure(); }, "pc");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(Indices::wPhaseIdx); }, "rhoW");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(Indices::nPhaseIdx); }, "rhoN");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.porosity(); }, "porosity");
vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc");
vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "rhoW");
vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::nPhaseIdx); }, "rhoN");
vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW");
vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN");
vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
}
};
......
......@@ -183,7 +183,7 @@ SET_TYPE_PROP(TwoPOneCNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeT
SET_TYPE_PROP(TwoPOneCNI, IsothermalIndices, TwoPOneCIndices<TypeTag, 0>);
//! The isothermal vtk output fields.
SET_TYPE_PROP(TwoPOneCNI, IsothermalVtkOutputFields, TwoPOneCVtkOutputFields<TypeTag>);
SET_TYPE_PROP(TwoPOneCNI, IsothermalVtkOutputFields, TwoPOneCVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
//! Set isothermal NumEq.
SET_INT_PROP(TwoPOneCNI, IsothermalNumEq, 1);
......
......@@ -26,26 +26,24 @@
#include <dumux/porousmediumflow/2p/vtkoutputfields.hh>
namespace Dumux
{
namespace Dumux {
/*!
* \ingroup TwoPOneCModel
* \brief Adds vtk output fields specific to two-phase one-component model.
*/
template<class TypeTag>
template<class Indices>
class TwoPOneCVtkOutputFields
{
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
public:
template <class VtkOutputModule>
static void init(VtkOutputModule& vtk)
{
// use default fields from the 2p model
TwoPVtkOutputFields<TypeTag>::init(vtk);
TwoPVtkOutputFields<Indices>::init(vtk);
//output additional to TwoP output:
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.priVars().state(); }, "phasePresence");
// output additional to TwoP output:
vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phasePresence");
}
};
......
......@@ -49,7 +49,7 @@ public:
static void init(VtkOutputModule& vtk)
{
// use default fields from the 2p model
TwoPVtkOutputFields<TypeTag>::init(vtk);
TwoPVtkOutputFields<Indices>::init(vtk);
//output additional to TwoP output:
for (int i = 0; i < numPhases; ++i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment