starting versions of miniworkshop new Materiallaws. not compileable with anything!!

This commit is contained in:
Benjamin Faigle 2010-04-07 09:46:51 +00:00 committed by Andreas Lauser
parent d06880da8c
commit 11d61d54d6
2 changed files with 88 additions and 54 deletions

View File

@ -18,10 +18,8 @@
#define DUMUX_TUTORIALPROBLEM_COUPLED_HH
// fluid properties
#include <dumux/new_material/fluidsystems/h2o_n2_system.hh>
//#include <dumux/new_material/components/simpleh2o.hh> // special case of 2p model!
//#include <dumux/new_material/components/simplednapl.hh> // special case of 2p model!
#include <dumux/material/fluids/water.hh> //TODO: edit here!
#include <dumux/material/fluids/lowviscosityoil.hh> //TODO: edit here!
// the numerical model
@ -31,8 +29,8 @@
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfs.hh>
// assign parameters dependent on space (e.g. soil properties)
#include "tutorialspatialparameters_coupled.hh"
// the soil to be used
#include "tutorialsoil_coupled.hh" //TODO: edit here!
namespace Dumux
{
@ -72,34 +70,23 @@ SET_PROP(TutorialProblemCoupled, Grid) /*@\label{tutorial-coupled:set-grid}@*/
}
};
// Select fluid system
SET_PROP(TutorialProblemCoupled, FluidSystem)
{
//typedef Dune::Brine_CO2_System<TypeTag, Dune::IFP::CO2Tables> type;
typedef Dumux::H2O_N2_System<TypeTag> type;
};
//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}@*/
//// 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, 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
SET_BOOL_PROP(TutorialProblemCoupled, EnableGravity, false); /*@\label{tutorial-coupled:gravity}@*/

View File

@ -20,7 +20,6 @@
#include <dumux/new_material/spatialparameters/boxspatialparameters.hh>
// 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/efftoabslaw.hh>
@ -46,15 +45,15 @@ class TutorialSpatialParameters: public BoxSpatialParameters<TypeTag> /*@\label{
typedef typename Grid::Traits::template Codim<0>::Entity Element;
// select materialLaw to be used
typedef RegularizedBrooksCorey<Scalar> RawMaterialLaw;
//typedef LinearMaterial<Scalar> RawMaterialLaw; // example for linear Materiallaw
public:
// adapter for absolute law
typedef EffToAbsLaw<RawMaterialLaw> MaterialLaw;
//TODO: enter materialLaw stuff here
// 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
// on the position within the domain
@ -79,12 +78,61 @@ public:
const FVElementGeometry &fvElemGeom,
int scvIdx) const
{
if (element.geometry().center()[1]< 40.)
return secondMaterialParams_;
else
return materialParams_;
//TODO: return current material law Object and delete the relPermFlag stuff!
}
// 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)
@ -92,25 +140,24 @@ public:
for (int i = 0; i < dim; i++)
K_[i][i] = 1e-7;
//set residual saturations
materialParams_.setSwr(0.0);
materialParams_.setSnr(0.0);
//TODO: set the actual values for the respective parameters that are
// of interest in the applied materialLaw. e.g. in a linar law, these are
// 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:
Dune::FieldMatrix<Scalar, dim, dim> K_;
// Object that helds the values/parameters of the selected material law.
MaterialLawParams materialParams_;
SecondMaterialLawParams secondMaterialParams_;
//TODO: add something here!
};
} // end namespace
#endif