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
|
#define DUMUX_TUTORIALPROBLEM_COUPLED_HH
|
||||||
|
|
||||||
// fluid properties
|
// fluid properties
|
||||||
#include <dumux/material/fluids/water.hh> //TODO: edit here!
|
#include <dumux/new_material/fluidsystems/h2o_n2_system.hh>
|
||||||
#include <dumux/material/fluids/lowviscosityoil.hh> //TODO: edit here!
|
|
||||||
|
|
||||||
|
|
||||||
// the numerical model
|
// the numerical model
|
||||||
#include <dumux/boxmodels/2p/2pboxmodel.hh>
|
#include <dumux/boxmodels/2p/2pboxmodel.hh>
|
||||||
@@ -29,8 +27,8 @@
|
|||||||
#include <dune/grid/yaspgrid.hh>
|
#include <dune/grid/yaspgrid.hh>
|
||||||
#include <dune/grid/io/file/dgfparser/dgfs.hh>
|
#include <dune/grid/io/file/dgfparser/dgfs.hh>
|
||||||
|
|
||||||
// the soil to be used
|
// assign parameters dependent on space (e.g. soil properties)
|
||||||
#include "tutorialsoil_coupled.hh" //TODO: edit here!
|
#include "tutorialspatialparameters_coupled.hh"
|
||||||
|
|
||||||
namespace Dumux
|
namespace Dumux
|
||||||
{
|
{
|
||||||
@@ -71,20 +69,33 @@ SET_PROP(TutorialProblemCoupled, Grid) /*@\label{tutorial-coupled:set-grid}@*/
|
|||||||
};
|
};
|
||||||
|
|
||||||
//TODO: edit from here......
|
//TODO: edit from here......
|
||||||
// Set the wetting and non-wetting phases
|
// Select fluid system
|
||||||
SET_TYPE_PROP(TutorialProblemCoupled, WettingPhase, Dumux::Water); /*@\label{tutorial-coupled:set-wetting}@*/
|
SET_PROP(TutorialProblemCoupled, FluidSystem)
|
||||||
SET_TYPE_PROP(TutorialProblemCoupled, NonwettingPhase, Dumux::LowViscosityOil);/*@\label{tutorial-coupled:set-nonwetting}@*/
|
{
|
||||||
|
//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 the soil properties
|
||||||
SET_PROP(TutorialProblemCoupled, Soil) /*@\label{tutorial-coupled:set-soil}@*/
|
SET_PROP(TutorialProblemCoupled, SpatialParameters) /*@\label{tutorial-coupled:set-soil}@*/
|
||||||
{
|
{
|
||||||
private:
|
typedef Dumux::TutorialSpatialParameters<TypeTag> type;
|
||||||
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;
|
|
||||||
};
|
};
|
||||||
//TODO: .....until here
|
//TODO: .....until here
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
|||||||
|
|
||||||
// select materialLaw to be used
|
// select materialLaw to be used
|
||||||
//TODO: enter materialLaw stuff here
|
//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
|
// method returning the intrinsic permeability tensor K depending
|
||||||
@@ -78,61 +78,11 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
|||||||
const FVElementGeometry &fvElemGeom,
|
const FVElementGeometry &fvElemGeom,
|
||||||
int scvIdx) const
|
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
|
// constructor
|
||||||
TutorialSpatialParameters(const GridView& gridView) :
|
TutorialSpatialParameters(const GridView& gridView) :
|
||||||
BoxSpatialParameters<TypeTag>(gridView), K_(0)
|
BoxSpatialParameters<TypeTag>(gridView), K_(0)
|
||||||
@@ -145,19 +95,20 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
|||||||
// residual saturations, a minimum value and a maximum value.
|
// residual saturations, a minimum value and a maximum value.
|
||||||
// Afterwards, please delete the paramRelPerm and Sr_n, Sr_w functions above.
|
// 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:
|
private:
|
||||||
Dune::FieldMatrix<Scalar, dim, dim> K_;
|
Dune::FieldMatrix<Scalar, dim, dim> K_;
|
||||||
// Object that helds the values/parameters of the selected material law.
|
// Object that helds the values/parameters of the selected material law.
|
||||||
//TODO: add something here!
|
//TODO: add something here!
|
||||||
|
MaterialLawParams materialParams_;
|
||||||
};
|
};
|
||||||
} // end namespace
|
} // end namespace
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user