adapt to the changes in opm-material

This commit is contained in:
Andreas Lauser 2013-11-06 14:50:01 +01:00
parent 1145e39559
commit 531d287eda
13 changed files with 209 additions and 179 deletions

View File

@ -21,8 +21,8 @@
* *
* \copydoc Ewoms::TutorialProblemCoupled * \copydoc Ewoms::TutorialProblemCoupled
*/ */
#ifndef EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian1}@*/ #ifndef EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian1}@*/
#define EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian2}@*/ #define EWOMS_TUTORIAL1_PROBLEM_HH // guardian macro /*@\label{tutorial-coupled:guardian2}@*/
// The numerical model // The numerical model
#include <ewoms/models/immiscible/immisciblemodel.hh> #include <ewoms/models/immiscible/immisciblemodel.hh>
@ -31,10 +31,10 @@
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/components/SimpleH2O.hpp>
#include <opm/material/components/Lnapl.hpp> #include <opm/material/components/Lnapl.hpp>
// The material laws // Headers required for the capillary pressure law
#include <opm/material/fluidmatrixinteractions/2p/RegularizedBrooksCorey.hpp> /*@\label{tutorial-coupled:rawLawInclude}@*/ #include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp> /*@\label{tutorial-coupled:rawLawInclude}@*/
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
// For the DUNE grid // For the DUNE grid
#include <dune/grid/yaspgrid.hh> /*@\label{tutorial-coupled:include-grid-manager}@*/ #include <dune/grid/yaspgrid.hh> /*@\label{tutorial-coupled:include-grid-manager}@*/
@ -76,21 +76,22 @@ SET_TYPE_PROP(TutorialProblemCoupled, NonwettingPhase, /*@\label{tutorial-coupl
SET_PROP(TutorialProblemCoupled, MaterialLaw) SET_PROP(TutorialProblemCoupled, MaterialLaw)
{ {
private: 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; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// Select the base material law to be used
typedef Opm::RegularizedBrooksCorey<Scalar> RawMaterialLaw; /*@\label{tutorial-coupled:rawlaw}@*/
// Converts absolute saturations into effective ones before
// passing it to the base material law
typedef Opm::EffToAbsLaw<RawMaterialLaw> TwoPMaterialLaw; /*@\label{tutorial-coupled:eff2abs}@*/
// Retrieve the index of the wetting phase
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { wPhaseIdx = FluidSystem::wPhaseIdx }; typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx> Traits;
// define the material law which is parameterized by effective
// saturations
typedef Opm::RegularizedBrooksCorey<Traits> RawMaterialLaw; /*@\label{tutorial-coupled:rawlaw}@*/
public: public:
// Convert two-phase material law into a general M-phase one. // Convert absolute saturations into effective ones before passing
typedef Opm::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type; // it to the base capillary pressure law
typedef Opm::EffToAbsLaw<RawMaterialLaw> type; /*@\label{tutorial-coupled:eff2abs}@*/
}; };
// Disable gravity // Disable gravity
@ -159,12 +160,15 @@ public:
K_ = this->toDimMatrix_(1e-7); K_ = this->toDimMatrix_(1e-7);
// Parameters of the Brooks-Corey law // 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 materialParams_.setLambda(2); // shape parameter
// Set the residual saturations // Set the residual saturations
materialParams_.setSwr(0.0); materialParams_.setResidualSaturation(wPhaseIdx, 0.0);
materialParams_.setSnr(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. //! Specifies the problem name. This is used for files generated by the simulation.

View File

@ -31,10 +31,10 @@
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp> #include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedBrooksCorey.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/heatconduction/Somerton.hpp> #include <opm/material/heatconduction/Somerton.hpp>
#include <opm/material/binarycoefficients/Brine_CO2.hpp> #include <opm/material/binarycoefficients/Brine_CO2.hpp>
#include <opm/material/StaticTabulated2dFunction.hpp> #include <opm/material/StaticTabulated2dFunction.hpp>
@ -49,18 +49,15 @@
#include <string> #include <string>
namespace Ewoms { namespace Ewoms {
template <class TypeTag> template <class TypeTag>
class Co2InjectionProblem; class Co2InjectionProblem;
namespace Co2Injection { namespace Co2Injection {
#include <opm/material/components/co2tables.inc> #include <opm/material/components/co2tables.inc>
} }} // namespace Ewoms
} // namespace Ewoms
namespace Opm { namespace Opm {
namespace Properties { namespace Properties {
NEW_TYPE_TAG(Co2InjectionBaseProblem); NEW_TYPE_TAG(Co2InjectionBaseProblem);
// declare the CO2 injection problem specific property tags // declare the CO2 injection problem specific property tags
@ -97,18 +94,19 @@ public:
SET_PROP(Co2InjectionBaseProblem, MaterialLaw) SET_PROP(Co2InjectionBaseProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::lPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gPhaseIdx> Traits;
// define the material law which is parameterized by effective // define the material law which is parameterized by effective
// saturations // saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Opm::RegularizedBrooksCorey<Traits> EffMaterialLaw;
typedef Opm::RegularizedBrooksCorey<Scalar> EffMaterialLaw;
// define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffMaterialLaw> TwoPMaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { lPhaseIdx = FluidSystem::lPhaseIdx };
public: public:
typedef Opm::TwoPAdapter<lPhaseIdx, TwoPMaterialLaw> type; // define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffMaterialLaw> type;
}; };
// Set the heat conduction law // Set the heat conduction law
@ -266,17 +264,20 @@ public:
coarsePorosity_ = 0.3; coarsePorosity_ = 0.3;
// residual saturations // residual saturations
fineMaterialParams_.setSwr(0.2); fineMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2);
fineMaterialParams_.setSnr(0.0); fineMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0);
coarseMaterialParams_.setSwr(0.2); coarseMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2);
coarseMaterialParams_.setSnr(0.0); coarseMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0);
// parameters for the Brooks-Corey law // parameters for the Brooks-Corey law
fineMaterialParams_.setPe(1e4); fineMaterialParams_.setEntryPressure(1e4);
coarseMaterialParams_.setPe(5e3); coarseMaterialParams_.setEntryPressure(5e3);
fineMaterialParams_.setLambda(2.0); fineMaterialParams_.setLambda(2.0);
coarseMaterialParams_.setLambda(2.0); coarseMaterialParams_.setLambda(2.0);
fineMaterialParams_.finalize();
coarseMaterialParams_.finalize();
// parameters for the somerton law of heat conduction // parameters for the somerton law of heat conduction
computeHeatCondParams_(fineHeatCondParams_, finePorosity_); computeHeatCondParams_(fineHeatCondParams_, finePorosity_);
computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_); computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_);

View File

@ -30,7 +30,7 @@
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp> #include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
#include <opm/material/fluidmatrixinteractions/3p/3pParkerVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/3p/3pParkerVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/3pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/3pAdapter.hpp>
#include <opm/material/fluidmatrixinteractions/MpLinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/heatconduction/Somerton.hpp> #include <opm/material/heatconduction/Somerton.hpp>
#include <opm/material/constraintsolvers/MiscibleMultiPhaseComposition.hpp> #include <opm/material/constraintsolvers/MiscibleMultiPhaseComposition.hpp>

View File

@ -27,7 +27,8 @@
#include <ewoms/models/ncp/ncpproperties.hh> #include <ewoms/models/ncp/ncpproperties.hh>
#include <ewoms/io/cubegridcreator.hh> #include <ewoms/io/cubegridcreator.hh>
#include <opm/material/fluidmatrixinteractions/MpLinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidsystems/H2ON2FluidSystem.hpp> #include <opm/material/fluidsystems/H2ON2FluidSystem.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp> #include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
@ -39,15 +40,11 @@
#include <string> #include <string>
namespace Ewoms { namespace Ewoms {
template <class TypeTag> template <class TypeTag>
class DiffusionProblem; class DiffusionProblem;
} }
namespace Opm { namespace Opm {
//////////
// Specify the properties for the powerInjection problem
//////////
namespace Properties { namespace Properties {
NEW_TYPE_TAG(DiffusionBaseProblem); NEW_TYPE_TAG(DiffusionBaseProblem);
@ -78,8 +75,16 @@ private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; 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<Scalar,
/*wettingPhaseIdx=*/FluidSystem::lPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gPhaseIdx> Traits;
public: public:
typedef Opm::MpLinearMaterial<FluidSystem::numPhases, Scalar> type; typedef Opm::LinearMaterial<Traits> type;
}; };
// Enable molecular diffusion for this problem // 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 // The default for the initial time step size of the simulation
SET_SCALAR_PROP(DiffusionBaseProblem, InitialTimeStepSize, 1000); SET_SCALAR_PROP(DiffusionBaseProblem, InitialTimeStepSize, 1000);
} // namespace Properties }} // namespace Opm, Properties
} // namespace Opm
namespace Ewoms { namespace Ewoms {
/*! /*!
@ -167,6 +172,8 @@ public:
temperature_ = 273.15 + 20.0; temperature_ = 273.15 + 20.0;
materialParams_.finalize();
K_ = this->toDimMatrix_(1e-12); // [m^2] K_ = this->toDimMatrix_(1e-12); // [m^2]
setupInitialFluidStates_(); setupInitialFluidStates_();

View File

@ -26,11 +26,11 @@
#include "fingergridcreator.hh" #include "fingergridcreator.hh"
#include <opm/material/fluidmatrixinteractions/2p/RegularizedVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2p/ParkerLenhard.hpp> #include <opm/material/fluidmatrixinteractions/ParkerLenhard.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp> #include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
@ -51,9 +51,6 @@ class FingerProblem;
} }
namespace Opm { namespace Opm {
//////////
// Specify the properties for the finger problem
//////////
namespace Properties { namespace Properties {
NEW_TYPE_TAG(FingerBaseProblem); NEW_TYPE_TAG(FingerBaseProblem);
@ -91,15 +88,14 @@ public:
SET_PROP(FingerBaseProblem, MaterialLaw) SET_PROP(FingerBaseProblem, MaterialLaw)
{ {
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx> Traits;
// use the parker-lenhard hysteresis law // use the parker-lenhard hysteresis law
typedef Opm::ParkerLenhard<Scalar> TwoPMaterialLaw; typedef Opm::ParkerLenhard<Traits> ParkerLenhard;
typedef Opm::ParkerLenhard<Scalar> ParkerLenhard; typedef ParkerLenhard type;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
typedef Opm::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type;
}; };
// Enable partial reassembly of the jacobian matrix? // Enable partial reassembly of the jacobian matrix?
@ -249,9 +245,11 @@ public:
// and the main drainage curves. // and the main drainage curves.
micParams_.setVgAlpha(0.0037); micParams_.setVgAlpha(0.0037);
micParams_.setVgN(4.7); micParams_.setVgN(4.7);
micParams_.finalize();
mdcParams_.setVgAlpha(0.0037); mdcParams_.setVgAlpha(0.0037);
mdcParams_.setVgN(4.7); mdcParams_.setVgN(4.7);
mdcParams_.finalize();
// initialize the material parameter objects of the individual // initialize the material parameter objects of the individual
// finite volumes // finite volumes
@ -262,6 +260,7 @@ public:
materialParams_[i].setMdcParams(&mdcParams_); materialParams_[i].setMdcParams(&mdcParams_);
materialParams_[i].setSwr(0.0); materialParams_[i].setSwr(0.0);
materialParams_[i].setSnr(0.1); materialParams_[i].setSnr(0.1);
materialParams_[i].finalize();
ParkerLenhard::reset(materialParams_[i]); ParkerLenhard::reset(materialParams_[i]);
} }
@ -288,8 +287,7 @@ public:
for (int scvIdx = 0; scvIdx < elemCtx.numScv(); ++scvIdx) { for (int scvIdx = 0; scvIdx < elemCtx.numScv(); ++scvIdx) {
int globalIdx = elemCtx.globalSpaceIndex(scvIdx, /*timeIdx=*/0); int globalIdx = elemCtx.globalSpaceIndex(scvIdx, /*timeIdx=*/0);
const auto &fs = elemCtx.volVars(scvIdx, /*timeIdx=*/0).fluidState(); const auto &fs = elemCtx.volVars(scvIdx, /*timeIdx=*/0).fluidState();
ParkerLenhard::update(materialParams_[globalIdx], ParkerLenhard::update(materialParams_[globalIdx], fs);
fs.saturation(wPhaseIdx));
} }
} }
} }

View File

@ -27,11 +27,12 @@
#include <ewoms/parallel/mpihelper.hh> #include <ewoms/parallel/mpihelper.hh>
#include <dune/grid/alugrid.hh> #include <dune/grid/alugrid.hh>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedBrooksCorey.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/heatconduction/Somerton.hpp> #include <opm/material/heatconduction/Somerton.hpp>
#include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp> #include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp>
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/components/SimpleH2O.hpp>
@ -92,20 +93,20 @@ public:
SET_PROP(FractureProblem, MaterialLaw) SET_PROP(FractureProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx> Traits;
// define the material law which is parameterized by effective // define the material law which is parameterized by effective
// saturations // saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Opm::RegularizedBrooksCorey<Traits> EffectiveLaw;
typedef Opm::RegularizedBrooksCorey<Scalar> EffectiveLaw; //typedef RegularizedVanGenuchten<Traits> EffectiveLaw;
//typedef RegularizedVanGenuchten<Scalar> EffectiveLaw; //typedef LinearMaterial<Traits> EffectiveLaw;
//typedef LinearMaterial<Scalar> EffectiveLaw;
//typedef EffToAbsLaw<EffectiveLaw> TwoPMaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
typedef Opm::EffToAbsLaw<EffectiveLaw> TwoPMaterialLaw;
public: public:
typedef Opm::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type; typedef Opm::EffToAbsLaw<EffectiveLaw> type;
}; };
// Enable the energy equation // Enable the energy equation
@ -211,10 +212,10 @@ public:
eps_ = 3e-6; eps_ = 3e-6;
temperature_ = 273.15 + 20; // -> 20°C temperature_ = 273.15 + 20; // -> 20°C
matrixMaterialParams_.setSwr(0.0); matrixMaterialParams_.setResidualSaturation(wPhaseIdx, 0.0);
matrixMaterialParams_.setSnr(0.0); matrixMaterialParams_.setResidualSaturation(nPhaseIdx, 0.0);
fractureMaterialParams_.setSwr(0.0); fractureMaterialParams_.setResidualSaturation(wPhaseIdx, 0.0);
fractureMaterialParams_.setSnr(0.0); fractureMaterialParams_.setResidualSaturation(nPhaseIdx, 0.0);
#if 0 // linear #if 0 // linear
matrixMaterialParams_.setEntryPC(0.0); matrixMaterialParams_.setEntryPC(0.0);
@ -224,10 +225,10 @@ public:
#endif #endif
#if 1 // Brooks-Corey #if 1 // Brooks-Corey
matrixMaterialParams_.setPe(2000); matrixMaterialParams_.setEntryPressure(2000);
matrixMaterialParams_.setLambda(2.0); matrixMaterialParams_.setLambda(2.0);
matrixMaterialParams_.setThresholdSw(1e-1); matrixMaterialParams_.setThresholdSw(1e-1);
fractureMaterialParams_.setPe(1000); fractureMaterialParams_.setEntryPressure(1000);
fractureMaterialParams_.setLambda(2.0); fractureMaterialParams_.setLambda(2.0);
fractureMaterialParams_.setThresholdSw(5e-2); fractureMaterialParams_.setThresholdSw(5e-2);
#endif #endif
@ -239,6 +240,9 @@ public:
fractureMaterialParams_.setVgN(4.7); fractureMaterialParams_.setVgN(4.7);
#endif #endif
matrixMaterialParams_.finalize();
fractureMaterialParams_.finalize();
matrixK_ = this->toDimMatrix_(1e-15); //m^2 matrixK_ = this->toDimMatrix_(1e-15); //m^2
fractureK_ = this->toDimMatrix_(1e5*1e-15); //m^2 fractureK_ = this->toDimMatrix_(1e5*1e-15); //m^2

View File

@ -29,10 +29,10 @@
#include <ewoms/models/immiscible/immiscibleproperties.hh> #include <ewoms/models/immiscible/immiscibleproperties.hh>
#include <ewoms/linear/parallelamgbackend.hh> #include <ewoms/linear/parallelamgbackend.hh>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp> #include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/components/SimpleH2O.hpp>
@ -94,18 +94,19 @@ public:
SET_PROP(LensBaseProblem, MaterialLaw) SET_PROP(LensBaseProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx> Traits;
// define the material law which is parameterized by effective // define the material law which is parameterized by effective
// saturations // saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Opm::RegularizedVanGenuchten<Traits> EffectiveLaw;
typedef Opm::RegularizedVanGenuchten<Scalar> EffectiveLaw;
// define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffectiveLaw> TwoPMaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
public: public:
typedef Opm::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type; // define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffectiveLaw> type;
}; };
// Use the algebraic multi-grid linear solver for this problem // Use the algebraic multi-grid linear solver for this problem
@ -244,6 +245,9 @@ public:
outerMaterialParams_.setVgAlpha(0.0037); outerMaterialParams_.setVgAlpha(0.0037);
outerMaterialParams_.setVgN(4.7); outerMaterialParams_.setVgN(4.7);
lensMaterialParams_.finalize();
outerMaterialParams_.finalize();
lensK_ = this->toDimMatrix_(9.05e-12); lensK_ = this->toDimMatrix_(9.05e-12);
outerK_ = this->toDimMatrix_(4.6e-10); outerK_ = this->toDimMatrix_(4.6e-10);

View File

@ -86,8 +86,7 @@ SET_SCALAR_PROP(NavierStokesTestProblem, InitialTimeStepSize, 1e-3);
// Default grid file to load // Default grid file to load
SET_STRING_PROP(NavierStokesTestProblem, GridFile, "grids/test_navierstokes.dgf"); SET_STRING_PROP(NavierStokesTestProblem, GridFile, "grids/test_navierstokes.dgf");
} // namespace Properties }}
} // namespace Opm
namespace Ewoms { namespace Ewoms {
/*! /*!

View File

@ -29,12 +29,10 @@
#include <opm/material/fluidsystems/H2ON2FluidSystem.hpp> #include <opm/material/fluidsystems/H2ON2FluidSystem.hpp>
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp> #include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedLinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedBrooksCorey.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidmatrixinteractions/MpLinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp>
#include <opm/material/heatconduction/Somerton.hpp> #include <opm/material/heatconduction/Somerton.hpp>
#include <dune/grid/io/file/dgfparser/dgfug.hh> #include <dune/grid/io/file/dgfparser/dgfug.hh>
@ -74,19 +72,18 @@ SET_TYPE_PROP(ObstacleBaseProblem,
SET_PROP(ObstacleBaseProblem, MaterialLaw) SET_PROP(ObstacleBaseProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum {
lPhaseIdx = FluidSystem::lPhaseIdx,
gPhaseIdx = FluidSystem::gPhaseIdx
};
// define the material law // define the material law
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// typedef RegularizedBrooksCorey<Scalar> EffMaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::RegularizedLinearMaterial<Scalar> EffMaterialLaw; typedef Opm::TwoPhaseMaterialTraits<Scalar,
typedef Opm::EffToAbsLaw<EffMaterialLaw> TwoPMaterialLaw; /*wettingPhaseIdx=*/FluidSystem::lPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gPhaseIdx>
MaterialTraits;
typedef Opm::LinearMaterial<MaterialTraits> EffMaterialLaw;
public: public:
typedef Opm::TwoPAdapter<lPhaseIdx, TwoPMaterialLaw> type; typedef Opm::EffToAbsLaw<EffMaterialLaw> type;
}; };
// Set the heat conduction law // Set the heat conduction law
@ -210,28 +207,31 @@ public:
coarsePorosity_ = 0.3; coarsePorosity_ = 0.3;
// residual saturations // residual saturations
fineMaterialParams_.setSwr(0.0); fineMaterialParams_.setResidualSaturation(lPhaseIdx, 0.0);
fineMaterialParams_.setSnr(0.0); fineMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0);
coarseMaterialParams_.setSwr(0.0); coarseMaterialParams_.setResidualSaturation(lPhaseIdx, 0.0);
coarseMaterialParams_.setSnr(0.0); coarseMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0);
// parameters for the linear law, i.e. minimum and maximum // parameters for the linear law, i.e. minimum and maximum
// pressures // pressures
fineMaterialParams_.setEntryPC(0.0); fineMaterialParams_.setPcMinSat(lPhaseIdx,0.0);
coarseMaterialParams_.setEntryPC(0.0); fineMaterialParams_.setPcMaxSat(lPhaseIdx,0.0);
fineMaterialParams_.setMaxPC(0.0); coarseMaterialParams_.setPcMinSat(lPhaseIdx,0.0);
coarseMaterialParams_.setMaxPC(0.0); coarseMaterialParams_.setPcMaxSat(lPhaseIdx,0.0);
/* /*
// entry pressures for Brooks-Corey // entry pressures for Brooks-Corey
fineMaterialParams_.setPe(5e3); fineMaterialParams_.setEntryPressure(5e3);
coarseMaterialParams_.setPe(1e3); coarseMaterialParams_.setEntryPressure(1e3);
// Brooks-Corey shape parameters // Brooks-Corey shape parameters
fineMaterialParams_.setLambda(2); fineMaterialParams_.setLambda(2);
coarseMaterialParams_.setLambda(2); coarseMaterialParams_.setLambda(2);
*/ */
fineMaterialParams_.finalize();
coarseMaterialParams_.finalize();
// parameters for the somerton law of heat conduction // parameters for the somerton law of heat conduction
computeHeatCondParams_(fineHeatCondParams_, finePorosity_); computeHeatCondParams_(fineHeatCondParams_, finePorosity_);
computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_); computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_);

View File

@ -24,10 +24,10 @@
#ifndef EWOMS_POWER_INJECTION_PROBLEM_HH #ifndef EWOMS_POWER_INJECTION_PROBLEM_HH
#define EWOMS_POWER_INJECTION_PROBLEM_HH #define EWOMS_POWER_INJECTION_PROBLEM_HH
#include <opm/material/fluidmatrixinteractions/2p/RegularizedVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp> #include <opm/material/fluidsystems/2pImmiscibleFluidSystem.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/components/SimpleH2O.hpp>
@ -83,18 +83,19 @@ public:
SET_PROP(PowerInjectionBaseProblem, MaterialLaw) SET_PROP(PowerInjectionBaseProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx> Traits;
// define the material law which is parameterized by effective // define the material law which is parameterized by effective
// saturations // saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Opm::RegularizedVanGenuchten<Traits> EffectiveLaw;
typedef Opm::RegularizedVanGenuchten<Scalar> EffectiveLaw;
// define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffectiveLaw> TwoPMaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
public: public:
typedef Opm::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type; // define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffectiveLaw> type;
}; };
// Write out the filter velocities for this problem // Write out the filter velocities for this problem
@ -190,6 +191,7 @@ public:
// alpha and n // alpha and n
materialParams_.setVgAlpha(0.00045); materialParams_.setVgAlpha(0.00045);
materialParams_.setVgN(7.3); materialParams_.setVgN(7.3);
materialParams_.finalize();
K_ = this->toDimMatrix_(5.73e-08); // [m^2] K_ = this->toDimMatrix_(5.73e-08); // [m^2]

View File

@ -26,7 +26,8 @@
#include <ewoms/models/blackoil/blackoilproperties.hh> #include <ewoms/models/blackoil/blackoilproperties.hh>
#include <opm/material/fluidmatrixinteractions/MpLinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh> #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
@ -69,8 +70,13 @@ private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::ThreePhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::oPhaseIdx,
/*gasPhaseIdx=*/FluidSystem::gPhaseIdx> Traits;
public: public:
typedef Opm::MpLinearMaterial<FluidSystem::numPhases, Scalar> type; typedef Opm::LinearMaterial<Traits> type;
}; };
// Write the Newton convergence behavior to disk? // Write the Newton convergence behavior to disk?
@ -275,15 +281,14 @@ public:
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
fineMaterialParams_.setPcMinSat(phaseIdx, 0.0); fineMaterialParams_.setPcMinSat(phaseIdx, 0.0);
fineMaterialParams_.setPcMaxSat(phaseIdx, 0.0); fineMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
fineMaterialParams_.setResidSat(phaseIdx, 0.0);
coarseMaterialParams_.setPcMinSat(phaseIdx, 0.0); coarseMaterialParams_.setPcMinSat(phaseIdx, 0.0);
coarseMaterialParams_.setPcMaxSat(phaseIdx, 0.0); coarseMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
coarseMaterialParams_.setResidSat(phaseIdx, 0.0);
} }
fineMaterialParams_.setResidSat(oPhaseIdx, 0.01); // wrap up the initialization of the material law's parameters
coarseMaterialParams_.setResidSat(oPhaseIdx, 0.01); fineMaterialParams_.finalize();
coarseMaterialParams_.finalize();
initFluidState_(); initFluidState_();
} }

View File

@ -28,10 +28,10 @@
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/components/SimpleH2O.hpp>
#include <opm/material/fluidsystems/LiquidPhase.hpp> #include <opm/material/fluidsystems/LiquidPhase.hpp>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <dune/grid/io/file/dgfparser.hh> #include <dune/grid/io/file/dgfparser.hh>
@ -67,18 +67,19 @@ public:
SET_PROP(RichardsLensProblem, MaterialLaw) SET_PROP(RichardsLensProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx> Traits;
// define the material law which is parameterized by effective // define the material law which is parameterized by effective
// saturations // saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Opm::RegularizedVanGenuchten<Traits> EffectiveLaw;
typedef Opm::RegularizedVanGenuchten<Scalar> EffectiveLaw;
// define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffectiveLaw> TwoPMaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
public: public:
typedef Opm::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type; // define the material law parameterized by absolute saturations
typedef Opm::EffToAbsLaw<EffectiveLaw> type;
}; };
// Enable gravitational acceleration // Enable gravitational acceleration
@ -192,8 +193,11 @@ public:
// alpha and n // alpha and n
lensMaterialParams_.setVgAlpha(0.00045); lensMaterialParams_.setVgAlpha(0.00045);
lensMaterialParams_.setVgN(7.3); lensMaterialParams_.setVgN(7.3);
lensMaterialParams_.finalize();
outerMaterialParams_.setVgAlpha(0.0037); outerMaterialParams_.setVgAlpha(0.0037);
outerMaterialParams_.setVgN(4.7); outerMaterialParams_.setVgN(4.7);
outerMaterialParams_.finalize();
// parameters for the linear law // parameters for the linear law
// minimum and maximum pressures // minimum and maximum pressures

View File

@ -29,10 +29,10 @@
#include <opm/material/fluidsystems/H2OAirFluidSystem.hpp> #include <opm/material/fluidsystems/H2OAirFluidSystem.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/fluidmatrixinteractions/2p/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/2p/RegularizedBrooksCorey.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
#include <opm/material/fluidmatrixinteractions/2p/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/2pAdapter.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/heatconduction/Somerton.hpp> #include <opm/material/heatconduction/Somerton.hpp>
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp> #include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
@ -65,21 +65,20 @@ SET_TYPE_PROP(WaterAirBaseProblem, Problem, Ewoms::WaterAirProblem<TypeTag>);
SET_PROP(WaterAirBaseProblem, MaterialLaw) SET_PROP(WaterAirBaseProblem, MaterialLaw)
{ {
private: private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::lPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gPhaseIdx> Traits;
// define the material law which is parameterized by effective // define the material law which is parameterized by effective
// saturations // saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Opm::RegularizedBrooksCorey<Traits> EffMaterialLaw;
typedef Opm::RegularizedBrooksCorey<Scalar> EffMaterialLaw;
// define the material law parameterized by absolute saturations
// which uses the two-phase API
typedef Opm::EffToAbsLaw<EffMaterialLaw> TwoPMaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
enum { lPhaseIdx = FluidSystem::lPhaseIdx };
public: public:
// define the type of the generic material law // define the material law parameterized by absolute saturations
typedef Opm::TwoPAdapter<lPhaseIdx, TwoPMaterialLaw> type; // which uses the two-phase API
typedef Opm::EffToAbsLaw<EffMaterialLaw> type;
}; };
// Set the heat conduction law // Set the heat conduction law
@ -228,17 +227,20 @@ public:
coarsePorosity_ = 0.3; coarsePorosity_ = 0.3;
// residual saturations // residual saturations
fineMaterialParams_.setSwr(0.2); fineMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2);
fineMaterialParams_.setSnr(0.0); fineMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0);
coarseMaterialParams_.setSwr(0.2); coarseMaterialParams_.setResidualSaturation(lPhaseIdx, 0.2);
coarseMaterialParams_.setSnr(0.0); coarseMaterialParams_.setResidualSaturation(gPhaseIdx, 0.0);
// parameters for the Brooks-Corey law // parameters for the Brooks-Corey law
fineMaterialParams_.setPe(1e4); fineMaterialParams_.setEntryPressure(1e4);
coarseMaterialParams_.setPe(1e4); coarseMaterialParams_.setEntryPressure(1e4);
fineMaterialParams_.setLambda(2.0); fineMaterialParams_.setLambda(2.0);
coarseMaterialParams_.setLambda(2.0); coarseMaterialParams_.setLambda(2.0);
fineMaterialParams_.finalize();
coarseMaterialParams_.finalize();
// parameters for the somerton law of heat conduction // parameters for the somerton law of heat conduction
computeHeatCondParams_(fineHeatCondParams_, finePorosity_); computeHeatCondParams_(fineHeatCondParams_, finePorosity_);
computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_); computeHeatCondParams_(coarseHeatCondParams_, coarsePorosity_);