mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
starting versions of miniworkshop new Materiallaws. not compileable with anything!!
This commit is contained in:
parent
d06880da8c
commit
11d61d54d6
@ -18,10 +18,8 @@
|
|||||||
#define DUMUX_TUTORIALPROBLEM_COUPLED_HH
|
#define DUMUX_TUTORIALPROBLEM_COUPLED_HH
|
||||||
|
|
||||||
// fluid properties
|
// fluid properties
|
||||||
#include <dumux/new_material/fluidsystems/h2o_n2_system.hh>
|
#include <dumux/material/fluids/water.hh> //TODO: edit here!
|
||||||
|
#include <dumux/material/fluids/lowviscosityoil.hh> //TODO: edit here!
|
||||||
//#include <dumux/new_material/components/simpleh2o.hh> // special case of 2p model!
|
|
||||||
//#include <dumux/new_material/components/simplednapl.hh> // special case of 2p model!
|
|
||||||
|
|
||||||
|
|
||||||
// the numerical model
|
// the numerical model
|
||||||
@ -31,8 +29,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>
|
||||||
|
|
||||||
// assign parameters dependent on space (e.g. soil properties)
|
// the soil to be used
|
||||||
#include "tutorialspatialparameters_coupled.hh"
|
#include "tutorialsoil_coupled.hh" //TODO: edit here!
|
||||||
|
|
||||||
namespace Dumux
|
namespace Dumux
|
||||||
{
|
{
|
||||||
@ -72,34 +70,23 @@ SET_PROP(TutorialProblemCoupled, Grid) /*@\label{tutorial-coupled:set-grid}@*/
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Select fluid system
|
//TODO: edit from here......
|
||||||
SET_PROP(TutorialProblemCoupled, FluidSystem)
|
// Set the wetting and non-wetting phases
|
||||||
{
|
SET_TYPE_PROP(TutorialProblemCoupled, WettingPhase, Dumux::Water); /*@\label{tutorial-coupled:set-wetting}@*/
|
||||||
//typedef Dune::Brine_CO2_System<TypeTag, Dune::IFP::CO2Tables> type;
|
SET_TYPE_PROP(TutorialProblemCoupled, NonwettingPhase, Dumux::LowViscosityOil);/*@\label{tutorial-coupled:set-nonwetting}@*/
|
||||||
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, SpatialParameters) /*@\label{tutorial-coupled:set-soil}@*/
|
SET_PROP(TutorialProblemCoupled, Soil) /*@\label{tutorial-coupled:set-soil}@*/
|
||||||
{
|
{
|
||||||
typedef Dumux::TutorialSpatialParameters<TypeTag> type;
|
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;
|
||||||
};
|
};
|
||||||
|
//TODO: .....until here
|
||||||
|
|
||||||
// Disable gravity
|
// Disable gravity
|
||||||
SET_BOOL_PROP(TutorialProblemCoupled, EnableGravity, false); /*@\label{tutorial-coupled:gravity}@*/
|
SET_BOOL_PROP(TutorialProblemCoupled, EnableGravity, false); /*@\label{tutorial-coupled:gravity}@*/
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <dumux/new_material/spatialparameters/boxspatialparameters.hh>
|
#include <dumux/new_material/spatialparameters/boxspatialparameters.hh>
|
||||||
|
|
||||||
// include material laws
|
// include material laws
|
||||||
#include <dumux/new_material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
|
|
||||||
#include <dumux/new_material/fluidmatrixinteractions/2p/linearmaterial.hh>
|
#include <dumux/new_material/fluidmatrixinteractions/2p/linearmaterial.hh>
|
||||||
#include <dumux/new_material/fluidmatrixinteractions/2p/efftoabslaw.hh>
|
#include <dumux/new_material/fluidmatrixinteractions/2p/efftoabslaw.hh>
|
||||||
|
|
||||||
@ -46,15 +45,15 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
|
|||||||
typedef typename Grid::Traits::template Codim<0>::Entity Element;
|
typedef typename Grid::Traits::template Codim<0>::Entity Element;
|
||||||
|
|
||||||
// select materialLaw to be used
|
// select materialLaw to be used
|
||||||
typedef RegularizedBrooksCorey<Scalar> RawMaterialLaw;
|
//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;
|
|
||||||
typedef typename MaterialLaw::Params SecondMaterialLawParams;
|
|
||||||
|
|
||||||
// method returning the intrinsic permeability tensor K depending
|
// method returning the intrinsic permeability tensor K depending
|
||||||
// on the position within the domain
|
// on the position within the domain
|
||||||
@ -79,12 +78,61 @@ public:
|
|||||||
const FVElementGeometry &fvElemGeom,
|
const FVElementGeometry &fvElemGeom,
|
||||||
int scvIdx) const
|
int scvIdx) const
|
||||||
{
|
{
|
||||||
if (element.geometry().center()[1]< 40.)
|
//TODO: return current material law Object and delete the relPermFlag stuff!
|
||||||
return secondMaterialParams_;
|
|
||||||
else
|
|
||||||
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)
|
||||||
@ -92,25 +140,24 @@ public:
|
|||||||
for (int i = 0; i < dim; i++)
|
for (int i = 0; i < dim; i++)
|
||||||
K_[i][i] = 1e-7;
|
K_[i][i] = 1e-7;
|
||||||
|
|
||||||
//set residual saturations
|
//TODO: set the actual values for the respective parameters that are
|
||||||
materialParams_.setSwr(0.0);
|
// of interest in the applied materialLaw. e.g. in a linar law, these are
|
||||||
materialParams_.setSnr(0.0);
|
// residual saturations, a minimum value and a maximum value.
|
||||||
|
// Afterwards, please delete the paramRelPerm and Sr_n, Sr_w functions above.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// //brooks-corey law
|
|
||||||
materialParams_.setPe(0.0);
|
|
||||||
materialParams_.setAlpha(2.0);
|
|
||||||
|
|
||||||
// //linear material law
|
|
||||||
secondMaterialParams_.setPe(0.0);
|
|
||||||
secondMaterialParams_.setAlpha(3.0);
|
|
||||||
secondMaterialParams_.setSnr(0.3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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.
|
||||||
MaterialLawParams materialParams_;
|
//TODO: add something here!
|
||||||
SecondMaterialLawParams secondMaterialParams_;
|
|
||||||
};
|
};
|
||||||
} // end namespace
|
} // end namespace
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user