Commit c196db2b authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[ex3-b] improve docu and indentations in problem

parent e186ec80
......@@ -19,7 +19,7 @@
/*!
* \file
*
* \brief Tutorial problem for a fully coupled twophase box model.
* \brief Tutorial problem for a fully coupled two phase-two component box model.
*/
#ifndef DUMUX_EXERCISE_THREE_B_PROBLEM_HH
#define DUMUX_EXERCISE_THREE_B_PROBLEM_HH
......@@ -27,7 +27,7 @@
// The numerical model
#include <dumux/porousmediumflow/2p2c/model.hh>
//The box discretization
// The box discretization
#include <dumux/discretization/box/properties.hh>
// The base porous media box problem
......@@ -79,7 +79,7 @@ public:
/*!
* \ingroup TwoPBoxModel
*
* \brief Tutorial problem for a fully coupled twophase box model.
* \brief Tutorial problem for a fully coupled two phase-two component box model.
*/
template <class TypeTag>
class ExerciseThreeProblemTwoPTwoC : public PorousMediumFlowProblem<TypeTag>
......@@ -109,7 +109,7 @@ public:
, eps_(3e-6)
{
#if !(HAVE_DUNE_ALUGRID || HAVE_UG)
std::cout << "If you want to use simplices instead of cubes, install and use dune-ALUGrid or UGGrid." << std::endl;
std::cout << "If you want to use simplices instead of cubes, install and use dune-ALUGrid or UGGrid." << std::endl;
#endif // !(HAVE_DUNE_ALUGRID || HAVE_UG)
// initialize the fluid system
......@@ -117,9 +117,6 @@ public:
// set the depth of the bottom of the reservoir
depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1];
// name of the problem and output file
name_ = getParam<std::string>("Problem.Name");
}
/*!
......@@ -127,15 +124,6 @@ public:
*/
// \{
/*!
* \brief Returns the problem name
*
* This is used as a prefix for files generated by the simulation.
*/
const std::string name() const
{ return name_; }
/*!
* \brief Returns the temperature \f$ K \f$
*/
......@@ -174,11 +162,8 @@ public:
*/
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
PrimaryVariables priVars;
priVars.setState(Indices::firstPhaseOnly);
priVars[Indices::pressureIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]);
priVars[Indices::switchIdx] = 0.0; // 0 % oil saturation on left boundary
return priVars;
// use initial as Dirichlet conditions
return initialAtPos(globalPos);
}
/*!
......@@ -196,14 +181,17 @@ public:
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables values(0.0);
Scalar up = this->fvGridGeometry().bBoxMax()[dimWorld-1];
// extraction of oil on the right boundary for approx. 1.e6 seconds
if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) {
// oil outflux of 30 g/(m * s) on the right boundary.
// extraction of oil (30 g/m/s) on a segment of the upper boundary
if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40)
{
// we solve for the mole balance, so we have to divide by the molar mass
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0;
values[Indices::conti0EqIdx + FluidSystem::NAPLIdx] = -3e-2/FluidSystem::MyCompressibleComponent::molarMass();
} else {
}
else
{
// no-flow on the remaining Neumann-boundaries.
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0;
values[Indices::conti0EqIdx + FluidSystem::NAPLIdx] = 0;
......@@ -231,8 +219,13 @@ public:
{
PrimaryVariables values(0.0);
// tell the primary variables the phase state, i.e. which phase/phases
// is/are present, because this changes the meaning of the primary variable
// value at the index Indices::switchIdx
values.setState(Indices::firstPhaseOnly);
// use hydrostatic pressure distribution with 2 bar at the top and zero saturation
values[Indices::pressureIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]); // 200 kPa = 2 bar
values[Indices::switchIdx] = 0.0;
......@@ -250,20 +243,17 @@ public:
*/
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
// we do not define any sources
PrimaryVariables values(0.0);
return values;
}
private:
// small epsilon value
Scalar eps_;
// depth at the bottom of the reservoir
Scalar depthBOR_;
std::string name_;
Scalar eps_; //! small epsilon value
Scalar depthBOR_; //! depth at the bottom of the reservoir
};
}
} // end namespace Dumux
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment