2009-06-18 12:38:19 -05:00
|
|
|
// $Id$
|
2009-06-18 12:06:44 -05:00
|
|
|
/*****************************************************************************
|
2009-06-19 06:58:37 -05:00
|
|
|
* Copyright (C) 2008-2009 by Markus Wolff *
|
2009-06-18 12:06:44 -05:00
|
|
|
* Institute of Hydraulic Engineering *
|
|
|
|
* University of Stuttgart, Germany *
|
|
|
|
* email: <givenname>.<name>@iws.uni-stuttgart.de *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version, as long as this copyright notice *
|
|
|
|
* is included in its original form. *
|
|
|
|
* *
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY. *
|
|
|
|
*****************************************************************************/
|
2009-06-10 07:08:28 -05:00
|
|
|
#ifndef TUTORIALPROBLEM_DECOUPLED_HH
|
|
|
|
#define TUTORIALPROBLEM_DECOUPLED_HH
|
|
|
|
|
|
|
|
#include "dumux/fractionalflow/fractionalflowproblem.hh"
|
|
|
|
|
|
|
|
namespace Dune
|
|
|
|
{
|
|
|
|
|
|
|
|
/** \todo Please doc me! */
|
|
|
|
|
2009-08-05 09:11:46 -05:00
|
|
|
template<class GridView, class Scalar, class VariableClass> class TutorialProblemDecoupled /*@\label{tutorial-decoupled:tutorialproblem}@*/
|
|
|
|
: public FractionalFlowProblem<GridView, Scalar, VariableClass>
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
|
|
|
enum
|
|
|
|
{dim=GridView::dimension, dimWorld = GridView::dimensionworld};
|
|
|
|
typedef typename GridView::Grid Grid;
|
|
|
|
typedef typename GridView::Traits::template Codim<0>::Entity Element;
|
|
|
|
typedef Dune::FieldVector<Scalar,dim> LocalPosition;
|
|
|
|
typedef Dune::FieldVector<Scalar,dimWorld> GlobalPosition;
|
|
|
|
|
|
|
|
public:
|
2009-08-05 09:11:46 -05:00
|
|
|
TutorialProblemDecoupled(VariableClass& variables, Fluid& wettingphase, Fluid& nonwettingphase, Matrix2p<Grid, Scalar>& soil,
|
2009-06-10 07:08:28 -05:00
|
|
|
TwoPhaseRelations<Grid, Scalar>& materialLaw = *(new TwoPhaseRelations<Grid,Scalar>),
|
|
|
|
const FieldVector<Scalar,dim> Left = 0, const FieldVector<Scalar,dim> Right = 0)
|
2009-08-05 09:11:46 -05:00
|
|
|
: FractionalFlowProblem<GridView, Scalar, VariableClass>(variables, wettingphase, nonwettingphase, soil, materialLaw),
|
2009-06-10 07:08:28 -05:00
|
|
|
Left_(Left[0]), Right_(Right[0]), eps_(1e-8)
|
|
|
|
{}
|
|
|
|
|
|
|
|
// function returning source/sink terms for the pressure equation
|
|
|
|
// depending on the position within the domain
|
2009-08-05 09:11:46 -05:00
|
|
|
virtual Scalar source(const GlobalPosition& globalPos,
|
|
|
|
const Element& e, /*@\label{tutorial-decoupled:qpress}@*/
|
|
|
|
const LocalPosition& localPos)
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
2009-07-01 11:02:50 -05:00
|
|
|
return 0.0;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// function returning the boundary condition type for solution
|
|
|
|
// of the pressure equation depending on the position within the domain
|
|
|
|
typename BoundaryConditions::Flags bctypePress(const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:bctypepress}@*/
|
|
|
|
const LocalPosition& localPos) const
|
|
|
|
{
|
|
|
|
if (globalPos[0] < eps_)
|
|
|
|
{
|
|
|
|
return BoundaryConditions::dirichlet;
|
|
|
|
}
|
|
|
|
// all other boundaries
|
|
|
|
return BoundaryConditions::neumann;
|
|
|
|
}
|
|
|
|
|
|
|
|
// function returning the boundary condition type for solution
|
|
|
|
// of the saturation equation depending on the position within the domain
|
|
|
|
BoundaryConditions::Flags bctypeSat (const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:bctypesat}@*/
|
|
|
|
const LocalPosition& localPos) const
|
|
|
|
{
|
|
|
|
if (globalPos[0]> (Right_ - eps_) || globalPos[0] < eps_)
|
|
|
|
{
|
|
|
|
return Dune::BoundaryConditions::dirichlet;
|
|
|
|
}
|
|
|
|
// all other boundaries
|
|
|
|
return Dune::BoundaryConditions::neumann;
|
|
|
|
}
|
|
|
|
|
|
|
|
// function returning the Dirichlet boundary condition for the solution
|
|
|
|
// of the pressure equation depending on the position within the domain
|
|
|
|
Scalar dirichletPress(const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:gpress}@*/
|
|
|
|
const LocalPosition& localPos) const
|
|
|
|
{
|
2009-08-05 09:11:46 -05:00
|
|
|
return 1e6;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// function returning the Dirichlet boundary condition for the solution
|
|
|
|
// of the saturation equation depending on the position within the domain
|
|
|
|
Scalar dirichletSat(const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:gsat}@*/
|
|
|
|
const LocalPosition& localPos) const
|
|
|
|
{
|
|
|
|
if (globalPos[0] < eps_)
|
|
|
|
{
|
2009-07-01 11:02:50 -05:00
|
|
|
return 1.0;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
// all other boundaries
|
2009-07-01 11:02:50 -05:00
|
|
|
return 0.0;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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}@*/
|
|
|
|
const LocalPosition& localPos) const
|
|
|
|
{
|
|
|
|
if (globalPos[0]> Right_ - eps_)
|
|
|
|
{
|
2009-08-27 11:53:36 -05:00
|
|
|
return -3e-4;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
// all other boundaries
|
2009-07-01 11:02:50 -05:00
|
|
|
return 0.0;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// function returning the initial saturation
|
|
|
|
// depending on the position within the domain
|
|
|
|
Scalar initSat (const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:initsat}@*/
|
|
|
|
const FieldVector<Scalar,dim>& xi) const
|
|
|
|
{
|
2009-07-01 11:02:50 -05:00
|
|
|
return 0.0;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Scalar Left_;
|
|
|
|
Scalar Right_;
|
|
|
|
|
|
|
|
Scalar eps_;
|
|
|
|
};
|
|
|
|
} // end namespace
|
|
|
|
#endif
|