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"
|
|
|
|
|
2010-03-25 08:02:05 -05:00
|
|
|
namespace Dumux
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
/** \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};
|
2009-09-08 05:38:51 -05:00
|
|
|
enum{wetting = 0, nonwetting = 1};
|
2009-06-10 07:08:28 -05:00
|
|
|
typedef typename GridView::Grid Grid;
|
2010-01-26 05:21:51 -06:00
|
|
|
typedef typename GridView::Intersection Intersection;
|
2009-06-10 07:08:28 -05:00
|
|
|
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>),
|
2010-03-25 08:02:05 -05:00
|
|
|
const Dune::FieldVector<Scalar,dim> Left = 0, const Dune::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-09-08 05:38:51 -05:00
|
|
|
virtual std::vector<Scalar> source(const GlobalPosition& globalPos,
|
2009-08-05 09:11:46 -05:00
|
|
|
const Element& e, /*@\label{tutorial-decoupled:qpress}@*/
|
|
|
|
const LocalPosition& localPos)
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
2009-09-08 05:38:51 -05:00
|
|
|
return std::vector<Scalar>(2,0.0);
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
2009-11-04 08:13:08 -06:00
|
|
|
using FractionalFlowProblem<GridView, Scalar, VariableClass>::bctypePress;
|
|
|
|
|
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
|
2010-01-26 05:21:51 -06:00
|
|
|
typename BoundaryConditions::Flags bctypePress(const GlobalPosition& globalPos, const Intersection& intersection) const /*@\label{tutorial-decoupled:bctypepress}@*/
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
|
|
|
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
|
2010-01-26 05:21:51 -06:00
|
|
|
BoundaryConditions::Flags bctypeSat (const GlobalPosition& globalPos, const Intersection& intersection) const /*@\label{tutorial-decoupled:bctypesat}@*/
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
|
|
|
if (globalPos[0]> (Right_ - eps_) || globalPos[0] < eps_)
|
|
|
|
{
|
2010-03-25 08:02:05 -05:00
|
|
|
return Dumux::BoundaryConditions::dirichlet;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
// all other boundaries
|
2010-03-25 08:02:05 -05:00
|
|
|
return Dumux::BoundaryConditions::neumann;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// function returning the Dirichlet boundary condition for the solution
|
|
|
|
// of the pressure equation depending on the position within the domain
|
2010-01-26 05:21:51 -06:00
|
|
|
Scalar dirichletPress(const GlobalPosition& globalPos, const Intersection& intersection) const /*@\label{tutorial-decoupled:gpress}@*/
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
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
|
2010-01-26 05:21:51 -06:00
|
|
|
Scalar dirichletSat(const GlobalPosition& globalPos, const Intersection& intersection) const /*@\label{tutorial-decoupled:gsat}@*/
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2009-11-04 08:13:08 -06:00
|
|
|
using FractionalFlowProblem<GridView, Scalar, VariableClass>::neumannPress;
|
|
|
|
|
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
|
2010-01-26 05:21:51 -06:00
|
|
|
std::vector<Scalar> neumannPress(const GlobalPosition& globalPos, const Intersection& intersection) const /*@\label{tutorial-decoupled:jpress}@*/
|
2009-06-10 07:08:28 -05:00
|
|
|
{
|
2009-09-08 05:38:51 -05:00
|
|
|
std::vector<Scalar> neumannFlux(2, 0.0);
|
2009-06-10 07:08:28 -05:00
|
|
|
if (globalPos[0]> Right_ - eps_)
|
|
|
|
{
|
2009-09-08 05:38:51 -05:00
|
|
|
neumannFlux[nonwetting] = 3e-4;
|
2009-06-10 07:08:28 -05:00
|
|
|
}
|
|
|
|
// all other boundaries
|
2009-09-08 05:38:51 -05:00
|
|
|
return neumannFlux;
|
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}@*/
|
2010-03-25 08:02:05 -05:00
|
|
|
const Dune::FieldVector<Scalar,dim>& xi) const
|
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
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Scalar Left_;
|
|
|
|
Scalar Right_;
|
|
|
|
|
|
|
|
Scalar eps_;
|
|
|
|
};
|
|
|
|
} // end namespace
|
|
|
|
#endif
|