diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index 3a089d8ef..ea035a1db 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -21,8 +21,8 @@ * * \copydoc Ewoms::TutorialProblemCoupled */ -#ifndef EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian1}@*/ -#define EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian2}@*/ +#ifndef EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian1}@*/ +#define EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian2}@*/ // The numerical model #include @@ -31,10 +31,10 @@ #include #include -// The material laws -#include /*@\label{tutorial-coupled:rawLawInclude}@*/ -#include -#include +// Headers required for the capillary pressure law +#include /*@\label{tutorial-coupled:rawLawInclude}@*/ +#include +#include // For the DUNE grid #include /*@\label{tutorial-coupled:include-grid-manager}@*/ @@ -76,21 +76,22 @@ SET_TYPE_PROP(TutorialProblemCoupled, NonwettingPhase, /*@\label{tutorial-coupl SET_PROP(TutorialProblemCoupled, MaterialLaw) { private: - // Retrieve the C++ type used to represent scalar values + // create a class holding the necessary information for a + // two-phase capillary pressure law typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - // Select the base material law to be used - typedef Opm::RegularizedBrooksCorey RawMaterialLaw; /*@\label{tutorial-coupled:rawlaw}@*/ - // Converts absolute saturations into effective ones before - // passing it to the base material law - typedef Opm::EffToAbsLaw TwoPMaterialLaw; /*@\label{tutorial-coupled:eff2abs}@*/ - - // Retrieve the index of the wetting phase typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { wPhaseIdx = FluidSystem::wPhaseIdx }; + typedef Opm::TwoPhaseMaterialTraits Traits; + + // define the material law which is parameterized by effective + // saturations + typedef Opm::RegularizedBrooksCorey RawMaterialLaw; /*@\label{tutorial-coupled:rawlaw}@*/ public: - // Convert two-phase material law into a general M-phase one. - typedef Opm::TwoPAdapter type; + // Convert absolute saturations into effective ones before passing + // it to the base capillary pressure law + typedef Opm::EffToAbsLaw type; /*@\label{tutorial-coupled:eff2abs}@*/ }; // Disable gravity @@ -159,12 +160,15 @@ public: K_ = this->toDimMatrix_(1e-7); // Parameters of the Brooks-Corey law - materialParams_.setPe(500.0); // entry pressure [Pa] /*@\label{tutorial-coupled:setLawParams}@*/ + materialParams_.setEntryPressure(500.0); // entry pressure [Pa] /*@\label{tutorial-coupled:setLawParams}@*/ materialParams_.setLambda(2); // shape parameter // Set the residual saturations - materialParams_.setSwr(0.0); - materialParams_.setSnr(0.0); + materialParams_.setResidualSaturation(wPhaseIdx, 0.0); + materialParams_.setResidualSaturation(nPhaseIdx, 0.0); + + // wrap up the initialization of the material law's parameters + materialParams_.finalize(); } //! Specifies the problem name. This is used for files generated by the simulation. diff --git a/tests/models/problems/co2injectionproblem.hh b/tests/models/problems/co2injectionproblem.hh index 69c04efde..1e7b3c1f3 100644 --- a/tests/models/problems/co2injectionproblem.hh +++ b/tests/models/problems/co2injectionproblem.hh @@ -31,10 +31,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -49,18 +49,15 @@ #include namespace Ewoms { - template class Co2InjectionProblem; namespace Co2Injection { #include -} -} // namespace Ewoms +}} // namespace Ewoms namespace Opm { namespace Properties { - NEW_TYPE_TAG(Co2InjectionBaseProblem); // declare the CO2 injection problem specific property tags @@ -97,18 +94,19 @@ public: SET_PROP(Co2InjectionBaseProblem, MaterialLaw) { private: + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; + // define the material law which is parameterized by effective // saturations - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Opm::RegularizedBrooksCorey EffMaterialLaw; - // define the material law parameterized by absolute saturations - typedef Opm::EffToAbsLaw TwoPMaterialLaw; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { lPhaseIdx = FluidSystem::lPhaseIdx }; + typedef Opm::RegularizedBrooksCorey EffMaterialLaw; public: - typedef Opm::TwoPAdapter type; + // define the material law parameterized by absolute saturations + typedef Opm::EffToAbsLaw type; }; // Set the heat conduction law @@ -266,17 +264,20 @@ public: coarsePorosity_ = 0.3; // residual saturations - fineMaterialParams_.setSwr(0.2); - fineMaterialParams_.setSnr(0.0); - coarseMaterialParams_.setSwr(0.2); - coarseMaterialParams_.setSnr(0.0); + fineMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2); + fineMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0); + coarseMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2); + coarseMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0); // parameters for the Brooks-Corey law - fineMaterialParams_.setPe(1e4); - coarseMaterialParams_.setPe(5e3); + fineMaterialParams_.setEntryPressure(1e4); + coarseMaterialParams_.setEntryPressure(5e3); fineMaterialParams_.setLambda(2.0); coarseMaterialParams_.setLambda(2.0); + fineMaterialParams_.finalize(); + coarseMaterialParams_.finalize(); + // parameters for the somerton law of heat conduction computeHeatCondParams_(fineHeatCondParams_, finePorosity_); computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_); diff --git a/tests/models/problems/cuvetteproblem.hh b/tests/models/problems/cuvetteproblem.hh index 754392dd0..30faf28be 100644 --- a/tests/models/problems/cuvetteproblem.hh +++ b/tests/models/problems/cuvetteproblem.hh @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/models/problems/diffusionproblem.hh b/tests/models/problems/diffusionproblem.hh index 5d1f4c684..018797a22 100644 --- a/tests/models/problems/diffusionproblem.hh +++ b/tests/models/problems/diffusionproblem.hh @@ -27,7 +27,8 @@ #include #include -#include +#include +#include #include #include #include @@ -39,15 +40,11 @@ #include namespace Ewoms { - template class DiffusionProblem; } namespace Opm { -////////// -// Specify the properties for the powerInjection problem -////////// namespace Properties { NEW_TYPE_TAG(DiffusionBaseProblem); @@ -78,8 +75,16 @@ private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + static_assert(FluidSystem::numPhases == 2, + "A fluid system with two phases is required " + "for this problem!"); + + typedef Opm::TwoPhaseMaterialTraits Traits; + public: - typedef Opm::MpLinearMaterial type; + typedef Opm::LinearMaterial type; }; // Enable molecular diffusion for this problem @@ -102,8 +107,8 @@ SET_SCALAR_PROP(DiffusionBaseProblem, EndTime, 1e6); // The default for the initial time step size of the simulation SET_SCALAR_PROP(DiffusionBaseProblem, InitialTimeStepSize, 1000); -} // namespace Properties -} // namespace Opm +}} // namespace Opm, Properties + namespace Ewoms { /*! @@ -167,6 +172,8 @@ public: temperature_ = 273.15 + 20.0; + materialParams_.finalize(); + K_ = this->toDimMatrix_(1e-12); // [m^2] setupInitialFluidStates_(); diff --git a/tests/models/problems/fingerproblem.hh b/tests/models/problems/fingerproblem.hh index 9ec42ab9b..888806d1f 100644 --- a/tests/models/problems/fingerproblem.hh +++ b/tests/models/problems/fingerproblem.hh @@ -26,11 +26,11 @@ #include "fingergridcreator.hh" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -51,9 +51,6 @@ class FingerProblem; } namespace Opm { -////////// -// Specify the properties for the finger problem -////////// namespace Properties { NEW_TYPE_TAG(FingerBaseProblem); @@ -91,15 +88,14 @@ public: SET_PROP(FingerBaseProblem, MaterialLaw) { typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; // use the parker-lenhard hysteresis law - typedef Opm::ParkerLenhard TwoPMaterialLaw; - typedef Opm::ParkerLenhard ParkerLenhard; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { wPhaseIdx = FluidSystem::wPhaseIdx }; - - typedef Opm::TwoPAdapter type; + typedef Opm::ParkerLenhard ParkerLenhard; + typedef ParkerLenhard type; }; // Enable partial reassembly of the jacobian matrix? @@ -249,9 +245,11 @@ public: // and the main drainage curves. micParams_.setVgAlpha(0.0037); micParams_.setVgN(4.7); + micParams_.finalize(); mdcParams_.setVgAlpha(0.0037); mdcParams_.setVgN(4.7); + mdcParams_.finalize(); // initialize the material parameter objects of the individual // finite volumes @@ -262,6 +260,7 @@ public: materialParams_[i].setMdcParams(&mdcParams_); materialParams_[i].setSwr(0.0); materialParams_[i].setSnr(0.1); + materialParams_[i].finalize(); ParkerLenhard::reset(materialParams_[i]); } @@ -288,8 +287,7 @@ public: for (int scvIdx = 0; scvIdx < elemCtx.numScv(); ++scvIdx) { int globalIdx = elemCtx.globalSpaceIndex(scvIdx, /*timeIdx=*/0); const auto &fs = elemCtx.volVars(scvIdx, /*timeIdx=*/0).fluidState(); - ParkerLenhard::update(materialParams_[globalIdx], - fs.saturation(wPhaseIdx)); + ParkerLenhard::update(materialParams_[globalIdx], fs); } } } diff --git a/tests/models/problems/fractureproblem.hh b/tests/models/problems/fractureproblem.hh index 109f9d4fe..358e77240 100644 --- a/tests/models/problems/fractureproblem.hh +++ b/tests/models/problems/fractureproblem.hh @@ -27,11 +27,12 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include + #include #include #include @@ -92,20 +93,20 @@ public: SET_PROP(FractureProblem, MaterialLaw) { private: + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; + // define the material law which is parameterized by effective // saturations - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Opm::RegularizedBrooksCorey EffectiveLaw; - //typedef RegularizedVanGenuchten EffectiveLaw; - //typedef LinearMaterial EffectiveLaw; - //typedef EffToAbsLaw TwoPMaterialLaw; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { wPhaseIdx = FluidSystem::wPhaseIdx }; - typedef Opm::EffToAbsLaw TwoPMaterialLaw; + typedef Opm::RegularizedBrooksCorey EffectiveLaw; + //typedef RegularizedVanGenuchten EffectiveLaw; + //typedef LinearMaterial EffectiveLaw; public: - typedef Opm::TwoPAdapter type; + typedef Opm::EffToAbsLaw type; }; // Enable the energy equation @@ -211,10 +212,10 @@ public: eps_ = 3e-6; temperature_ = 273.15 + 20; // -> 20°C - matrixMaterialParams_.setSwr(0.0); - matrixMaterialParams_.setSnr(0.0); - fractureMaterialParams_.setSwr(0.0); - fractureMaterialParams_.setSnr(0.0); + matrixMaterialParams_.setResidualSaturation(wPhaseIdx, 0.0); + matrixMaterialParams_.setResidualSaturation(nPhaseIdx, 0.0); + fractureMaterialParams_.setResidualSaturation(wPhaseIdx, 0.0); + fractureMaterialParams_.setResidualSaturation(nPhaseIdx, 0.0); #if 0 // linear matrixMaterialParams_.setEntryPC(0.0); @@ -224,10 +225,10 @@ public: #endif #if 1 // Brooks-Corey - matrixMaterialParams_.setPe(2000); + matrixMaterialParams_.setEntryPressure(2000); matrixMaterialParams_.setLambda(2.0); matrixMaterialParams_.setThresholdSw(1e-1); - fractureMaterialParams_.setPe(1000); + fractureMaterialParams_.setEntryPressure(1000); fractureMaterialParams_.setLambda(2.0); fractureMaterialParams_.setThresholdSw(5e-2); #endif @@ -239,6 +240,9 @@ public: fractureMaterialParams_.setVgN(4.7); #endif + matrixMaterialParams_.finalize(); + fractureMaterialParams_.finalize(); + matrixK_ = this->toDimMatrix_(1e-15); //m^2 fractureK_ = this->toDimMatrix_(1e5*1e-15); //m^2 diff --git a/tests/models/problems/lensproblem.hh b/tests/models/problems/lensproblem.hh index 180b35732..88321d302 100644 --- a/tests/models/problems/lensproblem.hh +++ b/tests/models/problems/lensproblem.hh @@ -29,10 +29,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -94,18 +94,19 @@ public: SET_PROP(LensBaseProblem, MaterialLaw) { private: + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; + // define the material law which is parameterized by effective // saturations - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Opm::RegularizedVanGenuchten EffectiveLaw; - // define the material law parameterized by absolute saturations - typedef Opm::EffToAbsLaw TwoPMaterialLaw; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { wPhaseIdx = FluidSystem::wPhaseIdx }; + typedef Opm::RegularizedVanGenuchten EffectiveLaw; public: - typedef Opm::TwoPAdapter type; + // define the material law parameterized by absolute saturations + typedef Opm::EffToAbsLaw type; }; // Use the algebraic multi-grid linear solver for this problem @@ -244,6 +245,9 @@ public: outerMaterialParams_.setVgAlpha(0.0037); outerMaterialParams_.setVgN(4.7); + lensMaterialParams_.finalize(); + outerMaterialParams_.finalize(); + lensK_ = this->toDimMatrix_(9.05e-12); outerK_ = this->toDimMatrix_(4.6e-10); diff --git a/tests/models/problems/navierstokestestproblem.hh b/tests/models/problems/navierstokestestproblem.hh index 2c2125be5..13f25a945 100644 --- a/tests/models/problems/navierstokestestproblem.hh +++ b/tests/models/problems/navierstokestestproblem.hh @@ -86,8 +86,7 @@ SET_SCALAR_PROP(NavierStokesTestProblem, InitialTimeStepSize, 1e-3); // Default grid file to load SET_STRING_PROP(NavierStokesTestProblem, GridFile, "grids/test_navierstokes.dgf"); -} // namespace Properties -} // namespace Opm +}} namespace Ewoms { /*! diff --git a/tests/models/problems/obstacleproblem.hh b/tests/models/problems/obstacleproblem.hh index 1698496be..27484335a 100644 --- a/tests/models/problems/obstacleproblem.hh +++ b/tests/models/problems/obstacleproblem.hh @@ -29,12 +29,10 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -74,19 +72,18 @@ SET_TYPE_PROP(ObstacleBaseProblem, SET_PROP(ObstacleBaseProblem, MaterialLaw) { private: - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { - lPhaseIdx = FluidSystem::lPhaseIdx, - gPhaseIdx = FluidSystem::gPhaseIdx - }; // define the material law typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - // typedef RegularizedBrooksCorey EffMaterialLaw; - typedef Opm::RegularizedLinearMaterial EffMaterialLaw; - typedef Opm::EffToAbsLaw TwoPMaterialLaw; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits + MaterialTraits; + + typedef Opm::LinearMaterial EffMaterialLaw; public: - typedef Opm::TwoPAdapter type; + typedef Opm::EffToAbsLaw type; }; // Set the heat conduction law @@ -210,28 +207,31 @@ public: coarsePorosity_ = 0.3; // residual saturations - fineMaterialParams_.setSwr(0.0); - fineMaterialParams_.setSnr(0.0); - coarseMaterialParams_.setSwr(0.0); - coarseMaterialParams_.setSnr(0.0); + fineMaterialParams_.setResidualSaturation(lPhaseIdx, 0.0); + fineMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0); + coarseMaterialParams_.setResidualSaturation(lPhaseIdx, 0.0); + coarseMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0); // parameters for the linear law, i.e. minimum and maximum // pressures - fineMaterialParams_.setEntryPC(0.0); - coarseMaterialParams_.setEntryPC(0.0); - fineMaterialParams_.setMaxPC(0.0); - coarseMaterialParams_.setMaxPC(0.0); + fineMaterialParams_.setPcMinSat(lPhaseIdx,0.0); + fineMaterialParams_.setPcMaxSat(lPhaseIdx,0.0); + coarseMaterialParams_.setPcMinSat(lPhaseIdx,0.0); + coarseMaterialParams_.setPcMaxSat(lPhaseIdx,0.0); /* // entry pressures for Brooks-Corey - fineMaterialParams_.setPe(5e3); - coarseMaterialParams_.setPe(1e3); + fineMaterialParams_.setEntryPressure(5e3); + coarseMaterialParams_.setEntryPressure(1e3); // Brooks-Corey shape parameters fineMaterialParams_.setLambda(2); coarseMaterialParams_.setLambda(2); */ + fineMaterialParams_.finalize(); + coarseMaterialParams_.finalize(); + // parameters for the somerton law of heat conduction computeHeatCondParams_(fineHeatCondParams_, finePorosity_); computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_); diff --git a/tests/models/problems/powerinjectionproblem.hh b/tests/models/problems/powerinjectionproblem.hh index 0939d8fa4..f4bf0dc88 100644 --- a/tests/models/problems/powerinjectionproblem.hh +++ b/tests/models/problems/powerinjectionproblem.hh @@ -24,10 +24,10 @@ #ifndef EWOMS_POWER_INJECTION_PROBLEM_HH #define EWOMS_POWER_INJECTION_PROBLEM_HH -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -83,18 +83,19 @@ public: SET_PROP(PowerInjectionBaseProblem, MaterialLaw) { private: + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; + // define the material law which is parameterized by effective // saturations - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Opm::RegularizedVanGenuchten EffectiveLaw; - // define the material law parameterized by absolute saturations - typedef Opm::EffToAbsLaw TwoPMaterialLaw; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { wPhaseIdx = FluidSystem::wPhaseIdx }; + typedef Opm::RegularizedVanGenuchten EffectiveLaw; public: - typedef Opm::TwoPAdapter type; + // define the material law parameterized by absolute saturations + typedef Opm::EffToAbsLaw type; }; // Write out the filter velocities for this problem @@ -190,6 +191,7 @@ public: // alpha and n materialParams_.setVgAlpha(0.00045); materialParams_.setVgN(7.3); + materialParams_.finalize(); K_ = this->toDimMatrix_(5.73e-08); // [m^2] diff --git a/tests/models/problems/reservoirproblem.hh b/tests/models/problems/reservoirproblem.hh index f66599450..74e2d90c8 100644 --- a/tests/models/problems/reservoirproblem.hh +++ b/tests/models/problems/reservoirproblem.hh @@ -26,7 +26,8 @@ #include -#include +#include +#include #include #include @@ -69,8 +70,13 @@ private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::ThreePhaseMaterialTraits Traits; + public: - typedef Opm::MpLinearMaterial type; + typedef Opm::LinearMaterial type; }; // Write the Newton convergence behavior to disk? @@ -275,15 +281,14 @@ public: for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { fineMaterialParams_.setPcMinSat(phaseIdx, 0.0); fineMaterialParams_.setPcMaxSat(phaseIdx, 0.0); - fineMaterialParams_.setResidSat(phaseIdx, 0.0); coarseMaterialParams_.setPcMinSat(phaseIdx, 0.0); coarseMaterialParams_.setPcMaxSat(phaseIdx, 0.0); - coarseMaterialParams_.setResidSat(phaseIdx, 0.0); } - fineMaterialParams_.setResidSat(oPhaseIdx, 0.01); - coarseMaterialParams_.setResidSat(oPhaseIdx, 0.01); + // wrap up the initialization of the material law's parameters + fineMaterialParams_.finalize(); + coarseMaterialParams_.finalize(); initFluidState_(); } diff --git a/tests/models/problems/richardslensproblem.hh b/tests/models/problems/richardslensproblem.hh index 4581636ee..a18cea086 100644 --- a/tests/models/problems/richardslensproblem.hh +++ b/tests/models/problems/richardslensproblem.hh @@ -28,10 +28,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -67,18 +67,19 @@ public: SET_PROP(RichardsLensProblem, MaterialLaw) { private: + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; + // define the material law which is parameterized by effective // saturations - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Opm::RegularizedVanGenuchten EffectiveLaw; - // define the material law parameterized by absolute saturations - typedef Opm::EffToAbsLaw TwoPMaterialLaw; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { wPhaseIdx = FluidSystem::wPhaseIdx }; + typedef Opm::RegularizedVanGenuchten EffectiveLaw; public: - typedef Opm::TwoPAdapter type; + // define the material law parameterized by absolute saturations + typedef Opm::EffToAbsLaw type; }; // Enable gravitational acceleration @@ -192,8 +193,11 @@ public: // alpha and n lensMaterialParams_.setVgAlpha(0.00045); lensMaterialParams_.setVgN(7.3); + lensMaterialParams_.finalize(); + outerMaterialParams_.setVgAlpha(0.0037); outerMaterialParams_.setVgN(4.7); + outerMaterialParams_.finalize(); // parameters for the linear law // minimum and maximum pressures diff --git a/tests/models/problems/waterairproblem.hh b/tests/models/problems/waterairproblem.hh index 4ef91ed5f..20756b232 100644 --- a/tests/models/problems/waterairproblem.hh +++ b/tests/models/problems/waterairproblem.hh @@ -29,10 +29,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -65,21 +65,20 @@ SET_TYPE_PROP(WaterAirBaseProblem, Problem, Ewoms::WaterAirProblem); SET_PROP(WaterAirBaseProblem, MaterialLaw) { private: + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef Opm::TwoPhaseMaterialTraits Traits; + // define the material law which is parameterized by effective // saturations - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Opm::RegularizedBrooksCorey EffMaterialLaw; - - // define the material law parameterized by absolute saturations - // which uses the two-phase API - typedef Opm::EffToAbsLaw TwoPMaterialLaw; - - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - enum { lPhaseIdx = FluidSystem::lPhaseIdx }; + typedef Opm::RegularizedBrooksCorey EffMaterialLaw; public: - // define the type of the generic material law - typedef Opm::TwoPAdapter type; + // define the material law parameterized by absolute saturations + // which uses the two-phase API + typedef Opm::EffToAbsLaw type; }; // Set the heat conduction law @@ -228,17 +227,20 @@ public: coarsePorosity_ = 0.3; // residual saturations - fineMaterialParams_.setSwr(0.2); - fineMaterialParams_.setSnr(0.0); - coarseMaterialParams_.setSwr(0.2); - coarseMaterialParams_.setSnr(0.0); + fineMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2); + fineMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0); + coarseMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2); + coarseMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0); // parameters for the Brooks-Corey law - fineMaterialParams_.setPe(1e4); - coarseMaterialParams_.setPe(1e4); + fineMaterialParams_.setEntryPressure(1e4); + coarseMaterialParams_.setEntryPressure(1e4); fineMaterialParams_.setLambda(2.0); coarseMaterialParams_.setLambda(2.0); + fineMaterialParams_.finalize(); + coarseMaterialParams_.finalize(); + // parameters for the somerton law of heat conduction computeHeatCondParams_(fineHeatCondParams_, finePorosity_); computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_);