mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Improve the startup and parameter routines.
This commit is contained in:
parent
348f6e7d35
commit
dc920d9030
@ -30,27 +30,8 @@
|
||||
#include "tutorialproblem_coupled.hh" /*@\label{tutorial-coupled:include-problem-header}@*/
|
||||
#include <dumux/common/start.hh> /*@\label{tutorial-coupled:include-end}@*/
|
||||
|
||||
//! Prints a usage/help message if something goes wrong or the user asks for help
|
||||
void usage(const char *progName, const std::string &errorMsg) /*@\label{tutorial-coupled:usage-function}@*/
|
||||
{
|
||||
std::cout
|
||||
<< "\nUsage: " << progName << " [options]\n";
|
||||
if (errorMsg.size() > 0)
|
||||
std::cout << errorMsg << "\n";
|
||||
std::cout
|
||||
<< "\n"
|
||||
<< "The List of Mandatory arguments for this program is:\n"
|
||||
<< "\t-tEnd The end of the simulation [s]\n"
|
||||
<< "\t-dtInitial The initial timestep size [s]\n"
|
||||
<< "\t-Grid.upperRightX The x-coordinate of the grid's upper-right corner [m]\n"
|
||||
<< "\t-Grid.upperRightY The y-coordinate of the grid's upper-right corner [m]\n"
|
||||
<< "\t-Grid.numberOfCellsX The grid's x-resolution\n"
|
||||
<< "\t-Grid.numberOfCellsY The grid's y-resolution\n"
|
||||
<< "\n";
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
typedef TTAG(TutorialProblemCoupled) TypeTag; /*@\label{tutorial-coupled:set-type-tag}@*/
|
||||
return Dumux::start<TypeTag>(argc, argv, usage); /*@\label{tutorial-coupled:call-start}@*/
|
||||
return Dumux::start<TypeTag>(argc, argv); /*@\label{tutorial-coupled:call-start}@*/
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
tEnd = 500000 # duration of the simulation [s]
|
||||
dtInitial = 10 # initial time step size [s]
|
||||
TEnd = 500e3 # duration of the simulation [s]
|
||||
DtInitial = 10 # initial time step size [s]
|
||||
[Grid]
|
||||
upperRightX = 300 # x-coordinate of the upper-right corner of the grid [m]
|
||||
upperRightY = 60 # y-coordinate of the upper-right corner of the grid [m]
|
||||
numberOfCellsX = 100 # x-resolution of the grid
|
||||
numberOfCellsY = 1 # y-resolution of the grid
|
||||
SizeX = 300 # x-coordinate of the upper-right corner of the grid [m]
|
||||
SizeY = 60 # y-coordinate of the upper-right corner of the grid [m]
|
||||
CellsX = 100 # x-resolution of the grid
|
||||
CellsY = 1 # y-resolution of the grid
|
||||
|
@ -1,7 +1,7 @@
|
||||
tEnd = 100000 # duration of the simulation [s]
|
||||
dtInitial = 10 # initial time step size [s]
|
||||
TEnd = 100000 # duration of the simulation [s]
|
||||
DtInitial = 10 # initial time step size [s]
|
||||
[Grid]
|
||||
upperRightX = 300 # x-coordinate of the upper-right corner of the grid [m]
|
||||
upperRightY = 60 # y-coordinate of the upper-right corner of the grid [m]
|
||||
numberOfCellsX = 100 # x-resolution of the grid
|
||||
numberOfCellsY = 1 # y-resolution of the grid
|
||||
SizeX = 300 # x-coordinate of the upper-right corner of the grid [m]
|
||||
SizeY = 60 # y-coordinate of the upper-right corner of the grid [m]
|
||||
CellsX = 100 # x-resolution of the grid
|
||||
CellsY = 1 # y-resolution of the grid
|
||||
|
@ -76,6 +76,15 @@ public: typedef Dumux::LiquidPhase<Scalar, Dumux::Oil<Scalar> > type; /*@\label{
|
||||
SET_TYPE_PROP(TutorialProblemCoupled, FluidSystem, Dumux::TwoPImmiscibleFluidSystem<TypeTag>);
|
||||
// Disable gravity
|
||||
SET_BOOL_PROP(TutorialProblemCoupled, EnableGravity, false); /*@\label{tutorial-coupled:gravity}@*/
|
||||
|
||||
// define the properties required by the cube grid creator
|
||||
SET_SCALAR_PROP(TutorialProblemCoupled, GridSizeX, 300.0);
|
||||
SET_SCALAR_PROP(TutorialProblemCoupled, GridSizeY, 60.0);
|
||||
SET_SCALAR_PROP(TutorialProblemCoupled, GridSizeZ, 0.0);
|
||||
|
||||
SET_INT_PROP(TutorialProblemCoupled, GridCellsX, 100);
|
||||
SET_INT_PROP(TutorialProblemCoupled, GridCellsY, 1);
|
||||
SET_INT_PROP(TutorialProblemCoupled, GridCellsZ, 0);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -107,9 +116,8 @@ class TutorialProblemCoupled : public TwoPProblem<TypeTag> /*@\label{tutorial-co
|
||||
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
|
||||
|
||||
public:
|
||||
TutorialProblemCoupled(TimeManager &timeManager,
|
||||
const GridView &gridView)
|
||||
: ParentType(timeManager, gridView)
|
||||
TutorialProblemCoupled(TimeManager &timeManager)
|
||||
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
|
||||
, eps_(3e-6)
|
||||
{
|
||||
}
|
||||
|
@ -98,6 +98,15 @@ SET_SCALAR_PROP(TutorialProblemDecoupled, CFLFactor, 0.95); /*@\label{tutorial-d
|
||||
|
||||
// Disable gravity
|
||||
SET_BOOL_PROP(TutorialProblemDecoupled, EnableGravity, false); /*@\label{tutorial-decoupled:gravity}@*/
|
||||
|
||||
// define the properties required by the cube grid creator
|
||||
SET_SCALAR_PROP(TutorialProblemDecoupled, GridSizeX, 300.0);
|
||||
SET_SCALAR_PROP(TutorialProblemDecoupled, GridSizeY, 60.0);
|
||||
SET_SCALAR_PROP(TutorialProblemDecoupled, GridSizeZ, 0.0);
|
||||
|
||||
SET_INT_PROP(TutorialProblemDecoupled, GridCellsX, 100);
|
||||
SET_INT_PROP(TutorialProblemDecoupled, GridCellsY, 1);
|
||||
SET_INT_PROP(TutorialProblemDecoupled, GridCellsZ, 0);
|
||||
} /*@\label{tutorial-decoupled:propertysystem-end}@*/
|
||||
|
||||
/*! \ingroup DecoupledProblems
|
||||
@ -140,8 +149,8 @@ class TutorialProblemDecoupled: public IMPESProblem2P<TypeTag> /*@\label{tutoria
|
||||
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
|
||||
|
||||
public:
|
||||
TutorialProblemDecoupled(TimeManager &timeManager, const GridView &gridView)
|
||||
: ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
|
||||
TutorialProblemDecoupled(TimeManager &timeManager)
|
||||
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
|
||||
{
|
||||
//write only every 10th time step to output file
|
||||
this->setOutputInterval(1);/*@\label{tutorial-decoupled:outputinterval}@*/
|
||||
|
Loading…
Reference in New Issue
Block a user