diff --git a/dumux/decoupled/2p2c/2p2cproperties.hh b/dumux/decoupled/2p2c/2p2cproperties.hh index 4e719c79fa11caeb2e1b5dcba1171fbdbaec8fe1..a0df8bd007a9620a84a0345b66f797b6685e9c1c 100644 --- a/dumux/decoupled/2p2c/2p2cproperties.hh +++ b/dumux/decoupled/2p2c/2p2cproperties.hh @@ -33,7 +33,7 @@ #include <dune/istl/preconditioners.hh> //DUMUX includes -#include <dumux/decoupled/common/impetproperties.hh> +#include <dumux/decoupled/2p/2pproperties.hh> namespace Dumux { @@ -50,7 +50,7 @@ template<class TypeTag> class DecTwoPTwoCFluidState; template <class TypeTag> -struct TwoPCommonIndices; +struct TwoPTwoCIndices; //////////////////////////////// // properties @@ -69,7 +69,7 @@ NEW_TYPE_TAG(DecoupledTwoPTwoC, INHERITS_FROM(IMPET)); // Property tags ////////////////////////////////////////////////////////////////// -NEW_PROP_TAG ( TwoPIndices ); +NEW_PROP_TAG ( TwoPTwoCIndices ); NEW_PROP_TAG( SpatialParameters ); //!< The type of the soil properties object NEW_PROP_TAG( EnableGravity); //!< Returns whether gravity is considered in the problem NEW_PROP_TAG( PressureFormulation); //!< The formulation of the model @@ -85,9 +85,9 @@ NEW_PROP_TAG( mpfa ); // Two-point flux approximation (false) or mpfa (true) ////////////////////////////////////////////////////////////////// // Properties ////////////////////////////////////////////////////////////////// -SET_PROP(DecoupledTwoPTwoC, TwoPIndices) +SET_PROP(DecoupledTwoPTwoC, TwoPTwoCIndices) { - typedef TwoPCommonIndices<TypeTag> type; + typedef TwoPTwoCIndices<TypeTag> type; }; // set fluid/component information @@ -117,15 +117,15 @@ public: //! Set the default formulation SET_INT_PROP(DecoupledTwoPTwoC, PressureFormulation, - TwoPCommonIndices<TypeTag>::pressureW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::pressureW); SET_INT_PROP(DecoupledTwoPTwoC, SaturationFormulation, - TwoPCommonIndices<TypeTag>::saturationW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::saturationW); SET_INT_PROP(DecoupledTwoPTwoC, VelocityFormulation, - TwoPCommonIndices<TypeTag>::velocityW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::velocityW); SET_PROP(DecoupledTwoPTwoC, TransportSolutionType) { @@ -141,7 +141,7 @@ SET_BOOL_PROP(DecoupledTwoPTwoC, EnableCapillarity, false); SET_PROP_DEFAULT(BoundaryMobility) { - static const int value = TwoPCommonIndices<TypeTag>::satDependent; + static const int value = TwoPTwoCIndices<TypeTag>::satDependent; }; SET_PROP_DEFAULT(NumDensityTransport) { @@ -157,32 +157,18 @@ SET_BOOL_PROP(DecoupledTwoPTwoC, mpfa, false); } /*! - * \brief The common indices for the 2p2c are the same as for the two-phase model. + * \brief The common indices for the 2p2c model. + * + * The indices are all of the 2p model plus boundary condition flags + * distinguishing between given composition or saturation on the boundary. */ template <class TypeTag> -struct TwoPCommonIndices +struct TwoPTwoCIndices : TwoPCommonIndices<TypeTag> { private: typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; public: - // Formulations - //saturation flags - static const int saturationW = 0; - static const int saturationNW = 1; - //pressure flags - static const int pressureW = 0; - static const int pressureNW = 1; - static const int pressureGlobal = 2; - //velocity flags - static const int velocityW = 0; - static const int velocityNW = 1; - static const int velocityTotal = 2; - - // Phase indices - static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< Index of the wetting phase in a phase vector - static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< Index of the non-wetting phase in a phase vector - // BoundaryCondition flags static const int satDependent = 0; static const int permDependent = 1; diff --git a/dumux/decoupled/2p2c/dec2p2cfluidstate.hh b/dumux/decoupled/2p2c/dec2p2cfluidstate.hh index 3c40a519c5dbc11a670bf2d59cbd057fc310ea98..bd9072678f10dc28fc79d23d5ce77aeefac22e38 100644 --- a/dumux/decoupled/2p2c/dec2p2cfluidstate.hh +++ b/dumux/decoupled/2p2c/dec2p2cfluidstate.hh @@ -47,7 +47,7 @@ class DecTwoPTwoCFluidState : public FluidState<typename GET_PROP_TYPE(TypeTag, typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; static const int pressureType = GET_PROP_VALUE(TypeTag, PTAG(PressureFormulation)); //!< gives kind of pressure used (\f$ 0 = p_w\f$, \f$ 1 = p_n\f$, \f$ 2 = p_{global}\f$) diff --git a/dumux/decoupled/2p2c/fvpressure2p2c.hh b/dumux/decoupled/2p2c/fvpressure2p2c.hh index bd0733b2d7899a20f9784c848118e5381803a905..5ff44ab60d19141d87e317893d339f7e2acb0911 100644 --- a/dumux/decoupled/2p2c/fvpressure2p2c.hh +++ b/dumux/decoupled/2p2c/fvpressure2p2c.hh @@ -73,7 +73,7 @@ template<class TypeTag> class FVPressure2P2C typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; typedef typename SpatialParameters::MaterialLaw MaterialLaw; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; diff --git a/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh b/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh index 212fe0d29a6d6fb4c896790512e44c18e12f934c..2287ab90d30c378edc3d6b56c5585114d413985f 100644 --- a/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh +++ b/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh @@ -79,7 +79,7 @@ template<class TypeTag> class FVPressure2P2CMultiPhysics typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; typedef typename SpatialParameters::MaterialLaw MaterialLaw; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; diff --git a/dumux/decoupled/2p2c/fvtransport2p2c.hh b/dumux/decoupled/2p2c/fvtransport2p2c.hh index 1112ef8ef20a52142d1236728b7e41b391ab63f0..d5b58f7fd9d318cc44276b71658796e931bd74df 100644 --- a/dumux/decoupled/2p2c/fvtransport2p2c.hh +++ b/dumux/decoupled/2p2c/fvtransport2p2c.hh @@ -54,7 +54,7 @@ class FVTransport2P2C typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; typedef typename SpatialParameters::MaterialLaw MaterialLaw; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; diff --git a/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh b/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh index 652eb4347b5f46137da379c3afe15c81704baee1..95b3f1f292a723a8b1fd6ced4a802f2a78224e05 100644 --- a/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh +++ b/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh @@ -60,7 +60,7 @@ class FVTransport2P2CMultiPhysics typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; typedef typename SpatialParameters::MaterialLaw MaterialLaw; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; diff --git a/dumux/decoupled/2p2c/variableclass2p2c.hh b/dumux/decoupled/2p2c/variableclass2p2c.hh index 54ff69b6c7de0e9011ad6e06311795a20e764e16..c1433aabd51e58640e4c3c154ed6bdf1699e2775 100644 --- a/dumux/decoupled/2p2c/variableclass2p2c.hh +++ b/dumux/decoupled/2p2c/variableclass2p2c.hh @@ -48,7 +48,7 @@ private: typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; typedef typename GET_PROP_TYPE(TypeTag, PTAG(TransportSolutionType)) TransportSolutionType; typedef typename SolutionTypes::ElementMapper ElementMapper; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef VariableClass<TypeTag> ParentClass; @@ -230,7 +230,7 @@ public: ScalarSolutionType *saturation = writer.allocateManagedBuffer (size_); *pressure = this->pressure(); *saturation = saturation_; - if (GET_PROP_VALUE(TypeTag, PTAG(PressureFormulation)) == GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices))::pressureW) + if (GET_PROP_VALUE(TypeTag, PTAG(PressureFormulation)) == GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::pressureW) writer.attachCellData(*pressure, "pressure w_phase"); else writer.attachCellData(*pressure, "pressure nw_phase"); @@ -583,6 +583,11 @@ public: { return perimeter_[Idx][0]; } + //! Returs a reference to the perimeter vector + const ScalarSolutionType& perimeter() const + { + return perimeter_; + } //@} }; } diff --git a/test/decoupled/2p2c/test_dec2p2cproblem.hh b/test/decoupled/2p2c/test_dec2p2cproblem.hh index b5016afefffd99e1f93a1a06738f3ad899f25def..268f77437eb5b355f64838629e8ea42125f73f95 100644 --- a/test/decoupled/2p2c/test_dec2p2cproblem.hh +++ b/test/decoupled/2p2c/test_dec2p2cproblem.hh @@ -80,10 +80,10 @@ SET_PROP(TestDecTwoPTwoCProblem, PressureModel) }; SET_INT_PROP(TestDecTwoPTwoCProblem, VelocityFormulation, - GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices))::velocityW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::velocityW); SET_INT_PROP(TestDecTwoPTwoCProblem, PressureFormulation, - GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices))::pressureW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::pressureW); // Select fluid system @@ -117,7 +117,7 @@ public: SET_BOOL_PROP(TestDecTwoPTwoCProblem, EnableGravity, true); SET_INT_PROP(DecoupledTwoPTwoC, BoundaryMobility, - TwoPCommonIndices<TypeTag>::satDependent); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::satDependent); SET_SCALAR_PROP(TestDecTwoPTwoCProblem, CFLFactor, 0.8); } @@ -142,7 +142,7 @@ typedef TestDecTwoPTwoCProblem<TypeTag> ThisType; typedef IMPETProblem2P2C<TypeTag, ThisType> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; -typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; +typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; diff --git a/test/decoupled/2p2c/test_multiphysics2p2cproblem.hh b/test/decoupled/2p2c/test_multiphysics2p2cproblem.hh index 7b09dd1027673b2c0aba963607781dabefa5f36d..878e4906cc0dafc08e72b6a60bda53515133c2e9 100644 --- a/test/decoupled/2p2c/test_multiphysics2p2cproblem.hh +++ b/test/decoupled/2p2c/test_multiphysics2p2cproblem.hh @@ -80,10 +80,10 @@ SET_PROP(TestMultTwoPTwoCProblem, PressureModel) }; SET_INT_PROP(TestMultTwoPTwoCProblem, VelocityFormulation, - GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices))::velocityW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::velocityW); SET_INT_PROP(TestMultTwoPTwoCProblem, PressureFormulation, - GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices))::pressureW); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::pressureW); //// Select fluid system //SET_PROP(TestMultTwoPTwoCProblem, FluidSystem) @@ -119,7 +119,7 @@ public: SET_BOOL_PROP(TestMultTwoPTwoCProblem, EnableGravity, true); SET_INT_PROP(DecoupledTwoPTwoC, BoundaryMobility, - TwoPCommonIndices<TypeTag>::satDependent); + GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices))::satDependent); SET_SCALAR_PROP(TestMultTwoPTwoCProblem, CFLFactor, 0.8); } @@ -147,7 +147,7 @@ typedef TestMultTwoPTwoCProblem<TypeTag> ThisType; typedef IMPETProblem2P2C<TypeTag, ThisType> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; -typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; +typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPTwoCIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState;