mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
final versions of miniworkshop new Materiallaws.
This commit is contained in:
committed by
Andreas Lauser
parent
11d61d54d6
commit
f4f74e26cf
@@ -18,9 +18,7 @@
|
||||
#define DUMUX_TUTORIALPROBLEM_COUPLED_HH
|
||||
|
||||
// fluid properties
|
||||
#include <dumux/material/fluids/water.hh> //TODO: edit here!
|
||||
#include <dumux/material/fluids/lowviscosityoil.hh> //TODO: edit here!
|
||||
|
||||
#include <dumux/new_material/fluidsystems/h2o_n2_system.hh>
|
||||
|
||||
// the numerical model
|
||||
#include <dumux/boxmodels/2p/2pboxmodel.hh>
|
||||
@@ -29,8 +27,8 @@
|
||||
#include <dune/grid/yaspgrid.hh>
|
||||
#include <dune/grid/io/file/dgfparser/dgfs.hh>
|
||||
|
||||
// the soil to be used
|
||||
#include "tutorialsoil_coupled.hh" //TODO: edit here!
|
||||
// assign parameters dependent on space (e.g. soil properties)
|
||||
#include "tutorialspatialparameters_coupled.hh"
|
||||
|
||||
namespace Dumux
|
||||
{
|
||||
@@ -71,20 +69,33 @@ SET_PROP(TutorialProblemCoupled, Grid) /*@\label{tutorial-coupled:set-grid}@*/
|
||||
};
|
||||
|
||||
//TODO: edit from here......
|
||||
// Set the wetting and non-wetting phases
|
||||
SET_TYPE_PROP(TutorialProblemCoupled, WettingPhase, Dumux::Water); /*@\label{tutorial-coupled:set-wetting}@*/
|
||||
SET_TYPE_PROP(TutorialProblemCoupled, NonwettingPhase, Dumux::LowViscosityOil);/*@\label{tutorial-coupled:set-nonwetting}@*/
|
||||
// Select fluid system
|
||||
SET_PROP(TutorialProblemCoupled, FluidSystem)
|
||||
{
|
||||
//typedef Dune::Brine_CO2_System<TypeTag, Dune::IFP::CO2Tables> type;
|
||||
typedef Dumux::H2O_N2_System<TypeTag> type;
|
||||
};
|
||||
|
||||
//// Set the wetting and non-wetting phases - special case of 2p model!
|
||||
//SET_PROP(TutorialProblemCoupled, WettingPhase) /*@\label{tutorial-coupled:set-wetting}@*/
|
||||
//{
|
||||
//private:
|
||||
// typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
|
||||
//public:
|
||||
// typedef Dumux::LiquidPhase<Scalar, Dumux::SimpleH2O<Scalar> > type;
|
||||
//};
|
||||
//SET_PROP(TutorialProblemCoupled, NonwettingPhase)/*@\label{tutorial-coupled:set-nonwetting}@*/
|
||||
//{
|
||||
//private:
|
||||
// typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
|
||||
//public:
|
||||
// typedef Dumux::LiquidPhase<Scalar, Dumux::SimpleDNAPL<Scalar> > type;
|
||||
//};
|
||||
|
||||
// Set the soil properties
|
||||
SET_PROP(TutorialProblemCoupled, Soil) /*@\label{tutorial-coupled:set-soil}@*/
|
||||
SET_PROP(TutorialProblemCoupled, SpatialParameters) /*@\label{tutorial-coupled:set-soil}@*/
|
||||
{
|
||||
private:
|
||||
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Grid)) Grid;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
|
||||
|
||||
public:
|
||||
typedef Dumux::TutorialSoil<Grid, Scalar> type;
|
||||
typedef Dumux::TutorialSpatialParameters<TypeTag> type;
|
||||
};
|
||||
//TODO: .....until here
|
||||
|
||||
|
||||
@@ -46,13 +46,13 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
||||
|
||||
// select materialLaw to be used
|
||||
//TODO: enter materialLaw stuff here
|
||||
typedef LinearMaterial<Scalar> RawMaterialLaw; // example for linear Materiallaw
|
||||
public:
|
||||
// adapter for absolute law
|
||||
typedef EffToAbsLaw<RawMaterialLaw> MaterialLaw;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// determine appropriate parameters depening on selected materialLaw
|
||||
typedef typename MaterialLaw::Params MaterialLawParams;
|
||||
|
||||
|
||||
// method returning the intrinsic permeability tensor K depending
|
||||
@@ -78,61 +78,11 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
||||
const FVElementGeometry &fvElemGeom,
|
||||
int scvIdx) const
|
||||
{
|
||||
//TODO: return current material law Object and delete the relPermFlag stuff!
|
||||
|
||||
|
||||
// if (element.geometry().center()[1] >= 783636.) //Hint for next exercise
|
||||
// return UpperBoundaryMaterialParams_;
|
||||
return materialParams_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// method returning the residual saturation of the wetting fluid
|
||||
// depending on the position within the domain and on the
|
||||
// temperature
|
||||
double Sr_w(const Dune::FieldVector<Scalar,dim>& globalPos, const Element& element, /*@\label{tutorial-coupled:srw}@*/
|
||||
const Dune::FieldVector<Scalar,dim>& localPos, const double T = 283.15) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// method returning the residual saturation of the non-wetting
|
||||
// fluid depending on the position within the domain and on the
|
||||
// temperature
|
||||
double Sr_n(const Dune::FieldVector<Scalar,dim>& globalPos, const Element& element, /*@\label{tutorial-coupled:srn}@*/
|
||||
const Dune::FieldVector<Scalar,dim>& localPos, const double T = 283.15) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// method returning the parameters of the capillary pressure and
|
||||
// the relative permeability functionms depending on the position
|
||||
// within the domain and on the temperature
|
||||
std::vector<double> paramRelPerm(const Dune::FieldVector<Scalar,dim>& globalPos, const Element& element, /*@\label{tutorial-coupled:parameters}@*/
|
||||
const Dune::FieldVector<Scalar,dim>& localPos, const double T = 283.15) const
|
||||
{
|
||||
std::vector<double> param(2);
|
||||
|
||||
//linear law parameters
|
||||
param[0] = 0; // minimal capillary pressure
|
||||
param[1] = 0; // maximal capillary pressure
|
||||
|
||||
//Brooks-Corey parameters
|
||||
// param[0] = 2; // lambda
|
||||
// param[1] = 0.; // entry-pressure
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
// method returning the kind of relation used for the calculation
|
||||
// of the capillary pressure and the relative permeabilities
|
||||
// depending on the position within the domain
|
||||
typename Matrix2p<Grid,Scalar>::modelFlag relPermFlag(const Dune::FieldVector<Scalar,dim>& globalPos, const Element& element, /*@\label{tutorial-coupled:flags}@*/
|
||||
const Dune::FieldVector<Scalar,dim>& localPos) const
|
||||
{
|
||||
return Matrix2p<Grid,Scalar>::linear; //flag types defined in
|
||||
} //dumux/material/property_baseclasses.hh
|
||||
|
||||
|
||||
// constructor
|
||||
TutorialSpatialParameters(const GridView& gridView) :
|
||||
BoxSpatialParameters<TypeTag>(gridView), K_(0)
|
||||
@@ -145,19 +95,20 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
||||
// residual saturations, a minimum value and a maximum value.
|
||||
// Afterwards, please delete the paramRelPerm and Sr_n, Sr_w functions above.
|
||||
|
||||
//set residual saturations
|
||||
materialParams_.setSwr(0.0);
|
||||
materialParams_.setSnr(0.0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//linear material law
|
||||
materialParams_.setEntryPC(0.0);
|
||||
materialParams_.setMaxPC(0.0);
|
||||
}
|
||||
|
||||
private:
|
||||
Dune::FieldMatrix<Scalar, dim, dim> K_;
|
||||
// Object that helds the values/parameters of the selected material law.
|
||||
//TODO: add something here!
|
||||
MaterialLawParams materialParams_;
|
||||
};
|
||||
} // end namespace
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user