diff --git a/dumux/implicit/2p2c/2p2cvolumevariables.hh b/dumux/implicit/2p2c/2p2cvolumevariables.hh index 02e609f3bfe51a3f5954c80068de9d78fcdee975..063da831e2f86abb409ad8b4dd10fabd9a191f23 100644 --- a/dumux/implicit/2p2c/2p2cvolumevariables.hh +++ b/dumux/implicit/2p2c/2p2cvolumevariables.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_2P2C_VOLUME_VARIABLES_HH #define DUMUX_2P2C_VOLUME_VARIABLES_HH +#include <dune/common/version.hh> + #include <dumux/implicit/common/implicitmodel.hh> #include <dumux/material/fluidstates/compositionalfluidstate.hh> #include <dumux/material/constraintsolvers/computefromreferencephase.hh> @@ -183,9 +185,11 @@ public: Scalar t = Implementation::temperature_(priVars, problem, element, fvGeometry, scvIdx); fluidState.setTemperature(t); - +#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4) + int dofIdxGlobal = problem.model().dofMapper().subIndex(element, scvIdx, dofCodim); +#else int dofIdxGlobal = problem.model().dofMapper().map(element, scvIdx, dofCodim); - +#endif int phasePresence = problem.model().phasePresence(dofIdxGlobal, isOldSol); ///////////// diff --git a/test/implicit/2p2c/injectionproblem.hh b/test/implicit/2p2c/injectionproblem.hh index 3ab8337e6c7fab9980d09502b972503b0d2dffa0..4724bf814d16bb5d9a0650e745769ad725bcf1a8 100644 --- a/test/implicit/2p2c/injectionproblem.hh +++ b/test/implicit/2p2c/injectionproblem.hh @@ -86,8 +86,8 @@ SET_BOOL_PROP(InjectionProblem, VtkAddVelocity, false); * This problem uses the \ref TwoPTwoCModel. * * To run the simulation execute the following line in shell: - * <tt>./test_box2p2c -parameterFile ./test_box2p2c.input</tt> or - * <tt>./test_cc2p2c -parameterFile ./test_cc2p2c.input</tt> + * <tt>./test_box2p2c</tt> or + * <tt>./test_cc2p2c</tt> */ template <class TypeTag> class InjectionProblem : public ImplicitPorousMediaProblem<TypeTag> @@ -192,13 +192,13 @@ public: /*np=*/nPressure_); //stateing in the console whether mole or mass fractions are used - if(!useMoles) + if(useMoles) { - std::cout<<"problem uses mass-fractions"<<std::endl; + std::cout<<"problem uses mole-fractions"<<std::endl; } else { - std::cout<<"problem uses mole-fractions"<<std::endl; + std::cout<<"problem uses mass-fractions"<<std::endl; } } @@ -387,14 +387,16 @@ private: Scalar meanM = FluidSystem::molarMass(wCompIdx)*moleFracLiquidH2O + FluidSystem::molarMass(nCompIdx)*moleFracLiquidN2; - if(!useMoles) //mass fraction formulation + if(useMoles) { - Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(nCompIdx)/meanM; - values[Indices::switchIdx] = massFracLiquidN2; + //mole-fraction formulation + values[Indices::switchIdx] = moleFracLiquidN2; } - else //mole-fraction formulation + else { - values[Indices::switchIdx] = moleFracLiquidN2; + //mass fraction formulation + Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(nCompIdx)/meanM; + values[Indices::switchIdx] = massFracLiquidN2; } values[Indices::pressureIdx] = pl; } @@ -410,8 +412,6 @@ private: Scalar pressureLow_, pressureHigh_; Scalar temperatureLow_, temperatureHigh_; - - }; } //end namespace diff --git a/test/implicit/2p2c/injectionspatialparams.hh b/test/implicit/2p2c/injectionspatialparams.hh index 1a4c8da8317a68138e14f98d08c120d01551df26..029140c28ec2fe3ca04923cdfaef38845eac94a0 100644 --- a/test/implicit/2p2c/injectionspatialparams.hh +++ b/test/implicit/2p2c/injectionspatialparams.hh @@ -119,12 +119,6 @@ public: coarseMaterialParams_.setLambda(2.0); } - /*! - * \brief The destructor - */ - ~InjectionSpatialParams() - {} - /*! * \brief Returns the intrinsic permeability tensor \f$[m^2]\f$ * diff --git a/test/implicit/2p2c/waterairproblem.hh b/test/implicit/2p2c/waterairproblem.hh index 9f27c5fef8025f4c50394a6008f0bf3fb02f64ea..18904fdbce867ef05c1f2ed1c43091236d7b084a 100644 --- a/test/implicit/2p2c/waterairproblem.hh +++ b/test/implicit/2p2c/waterairproblem.hh @@ -101,8 +101,8 @@ SET_BOOL_PROP(WaterAirProblem, UseMoles, true); * This problem uses the \ref TwoPTwoCModel and \ref NIModel model. * * To run the simulation execute the following line in shell: - * <tt>./test_box2p2cni -parameterFile test_box2p2cni.input</tt> or - * <tt>./test_cc2p2cni -parameterFile test_cc2p2cni.input</tt> + * <tt>./test_box2p2cni</tt> or + * <tt>./test_cc2p2cni</tt> * */ template <class TypeTag > class WaterAirProblem : public ImplicitPorousMediaProblem<TypeTag> @@ -117,7 +117,6 @@ class WaterAirProblem : public ImplicitPorousMediaProblem<TypeTag> // copy some indices for convenience typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; enum { - pressureIdx = Indices::pressureIdx, switchIdx = Indices::switchIdx, @@ -138,10 +137,8 @@ class WaterAirProblem : public ImplicitPorousMediaProblem<TypeTag> conti0EqIdx = Indices::conti0EqIdx, contiNEqIdx = conti0EqIdx + Indices::nCompIdx - }; - typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; @@ -177,13 +174,13 @@ public: name_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.Name); //stating in the console whether mole or mass fractions are used - if(!useMoles) + if(useMoles) { - std::cout<<"problem uses mass-fractions"<<std::endl; + std::cout<<"problem uses mole-fractions"<<std::endl; } else { - std::cout<<"problem uses mole-fractions"<<std::endl; + std::cout<<"problem uses mass-fractions"<<std::endl; } } diff --git a/test/implicit/2p2c/waterairspatialparams.hh b/test/implicit/2p2c/waterairspatialparams.hh index 61d9c1b0d2b01bf265cd32657c7e87b58fbba733..8eb1236baf265bc3a9c5821fab6f76cc23497475 100644 --- a/test/implicit/2p2c/waterairspatialparams.hh +++ b/test/implicit/2p2c/waterairspatialparams.hh @@ -114,9 +114,6 @@ public: coarseMaterialParams_.setLambda(2.0); } - ~WaterAirSpatialParams() - {} - /*! * \brief Apply the intrinsic permeability tensor to a pressure * potential gradient.