test applications adapted to new decoupled 2p model

This commit is contained in:
Markus Wolff 2009-09-08 10:38:51 +00:00 committed by Andreas Lauser
parent 3cca2f082c
commit 23adf4bdc8
2 changed files with 21 additions and 12 deletions

View File

@ -21,13 +21,14 @@
#include <dune/istl/io.hh>
#include <dune/common/timer.hh>
#include "dumux/fractionalflow/variableclass2p.hh"
#include "dumux/fractionalflow/define2pmodel.hh"
#include "dumux/material/fluids/water.hh"
#include "dumux/material/fluids/lowviscosityoil.hh"
#include "tutorial_soilproperties_decoupled.hh"
#include "dumux/material/twophaserelations.hh"
#include "tutorialproblem_decoupled.hh"
#include "dumux/diffusion/fv/fvtotalvelocity2p.hh"
#include "dumux/transport/fv/fvsaturationwetting2p.hh"
#include "dumux/diffusion/fv/fvvelocity2p.hh"
#include "dumux/transport/fv/fvsaturation2p.hh"
#include "dumux/fractionalflow/impes/impes.hh"
#include "dumux/timedisc/timeloop.hh" /*@\label{tutorial-decoupled:include-end}@*/
@ -60,17 +61,23 @@ int main(int argc, char** argv)
typedef Dune::VariableClass<GridView, Scalar> VariableClass;
VariableClass variables(gridView);
//choose kind of two-phase model. Default: pw, Sw, vtotal
struct Dune::DefineModel modelDef;
// modelDef.pressureType = modelDef.pressureW;
// modelDef.saturationType = modelDef.saturationW;
// modelDef.velocityType = modelDef.velocityTotal;
// create object including the problem definition
typedef Dune::TutorialProblemDecoupled<GridView, Scalar, VariableClass> Problem;
Problem problem(variables, wettingfluid, nonwettingfluid, soil, materialLaw,L, H); /*@\label{tutorial-decoupled:problem}@*/
// create object including the discretisation of the pressure equation
typedef Dune::FVTotalVelocity2P<GridView, Scalar, VariableClass, Problem> Diffusion;
Diffusion diffusion(gridView, problem, "pw","Sw"); /*@\label{tutorial-decoupled:diffusion}@*/
typedef Dune::FVVelocity2P<GridView, Scalar, VariableClass, Problem> Diffusion;
Diffusion diffusion(gridView, problem, modelDef); /*@\label{tutorial-decoupled:diffusion}@*/
// create object including the space discretisation of the saturation equation
typedef Dune::FVSaturationWetting2P<GridView, Scalar, VariableClass, Problem> Transport;
Transport transport(gridView, problem, "vt"); /*@\label{tutorial-decoupled:transport}@*/
typedef Dune::FVSaturation2P<GridView, Scalar, VariableClass, Problem> Transport;
Transport transport(gridView, problem, modelDef); /*@\label{tutorial-decoupled:transport}@*/
// some parameters used in the IMPES-object
int iterFlag = 0;
@ -86,7 +93,7 @@ int main(int argc, char** argv)
double tEnd = 4e7; // stop simulation at t = tEnd
const char* fileName = "tutorial_decoupled"; // name of the output files
int modulo = 1; // define time step interval in which output files are generated
double cFLFactor = 0.99; // security factor for the Courant-Friedrichs-Lewy-Criterion
double cFLFactor = 0.9; // security factor for the Courant-Friedrichs-Lewy-Criterion
// create TimeLoop-object
Dune::TimeLoop<Grid, IMPES> timeloop(tStart, tEnd, fileName, modulo, cFLFactor); /*@\label{tutorial-decoupled:timeloop}@*/

View File

@ -28,6 +28,7 @@ template<class GridView, class Scalar, class VariableClass> class TutorialProble
{
enum
{dim=GridView::dimension, dimWorld = GridView::dimensionworld};
enum{wetting = 0, nonwetting = 1};
typedef typename GridView::Grid Grid;
typedef typename GridView::Traits::template Codim<0>::Entity Element;
typedef Dune::FieldVector<Scalar,dim> LocalPosition;
@ -43,11 +44,11 @@ public:
// function returning source/sink terms for the pressure equation
// depending on the position within the domain
virtual Scalar source(const GlobalPosition& globalPos,
virtual std::vector<Scalar> source(const GlobalPosition& globalPos,
const Element& e, /*@\label{tutorial-decoupled:qpress}@*/
const LocalPosition& localPos)
{
return 0.0;
return std::vector<Scalar>(2,0.0);
}
// function returning the boundary condition type for solution
@ -99,15 +100,16 @@ public:
// function returning the Neumann boundary condition for the solution
// of the pressure equation depending on the position within the domain
Scalar neumannPress(const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:jpress}@*/
std::vector<Scalar> neumannPress(const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:jpress}@*/
const LocalPosition& localPos) const
{
std::vector<Scalar> neumannFlux(2, 0.0);
if (globalPos[0]> Right_ - eps_)
{
return -3e-4;
neumannFlux[nonwetting] = 3e-4;
}
// all other boundaries
return 0.0;
return neumannFlux;
}
// function returning the initial saturation