// Dumux is based on DUNE, the Distributed and Unified Numerics Environment, which provides several grid managers and linear solvers. So we need some includes from that.
// Dumux is based on DUNE, the Distributed and Unified Numerics Environment, which provides several grid managers and linear solvers.
// Here, we include classes related to parallel computations, time measurements and file I/O.
// In Dumux, a property system is used to specify the model. For this, different properties are defined containing type definitions, values and methods. All properties are declared in the file `properties.hh`.
// In Dumux, the property system is used to specify classes and compile-time options to be used by the model.
// For this, different properties are defined containing type definitions, values and methods.
// All properties are declared in the file `properties.hh`.
#include <dumux/common/properties.hh>
#include <dumux/common/properties.hh>
// The following file contains the parameter class, which manages the definition of input parameters by a default value, the inputfile or the command line.
// The following file contains the parameter class, which manages the definition and retrieval of input
// parameters by a default value, the inputfile or the command line.
#include <dumux/common/parameters.hh>
#include <dumux/common/parameters.hh>
// The file `dumuxmessage.hh` contains the class defining the start and end message of the simulation.
// The file `dumuxmessage.hh` contains the class defining the start and end message of the simulation.
#include <dumux/common/dumuxmessage.hh>
#include <dumux/common/dumuxmessage.hh>
...
@@ -60,7 +64,7 @@ int main(int argc, char** argv) try
...
@@ -60,7 +64,7 @@ int main(int argc, char** argv) try
{
{
usingnamespaceDumux;
usingnamespaceDumux;
// We define the type tags for the two problems. They are created in the individual problem files.
// Convenience aliases for the type tags of the two problems, which are defined in the individual problem files.
@@ -75,7 +79,11 @@ int main(int argc, char** argv) try
...
@@ -75,7 +79,11 @@ int main(int argc, char** argv) try
Parameters::init(argc,argv);
Parameters::init(argc,argv);
// ### Create the grid
// ### Create the grid
// A gridmanager tries to create the grid either from a grid file or the input file. We solve both problems on the same grid. Hence, the grid is only created once using the type tag of the 1p problem.
// The `GridManager` class creates the grid from information given in the input file.
// This can either be a grid file, or in the case of structured grids, by specifying the coordinates
// of the corners of the grid and the number of cells to be used to discretize each spatial direction.
// Here, we solve both the single-phase and the tracer problem on the same grid.
// Hence, the grid is only created once using the grid type defined by the type tag of the 1p problem.
// In the following section, we set up and solve the 1p problem. As the result of this problem, we obtain the pressure distribution in the problem domain.
// In the following section, we set up and solve the 1p problem. As the result of this problem, we obtain the pressure distribution in the domain.
// #### Set-up
// #### Set-up
// We create and initialize the finite volume grid geometry, the problem, the linear system, including the jacobian matrix, the residual and the solution vector and the gridvariables.
// We create and initialize the finite volume grid geometry, the problem, the linear system, including the jacobian matrix, the residual and the solution vector and the gridvariables.
// We need the finite volume geometry to build up the subcontrolvolumes (scv) and subcontrolvolume faces (scvf) for each element of the grid partition.
// We need the finite volume geometry to build up the subcontrolvolumes (scv) and subcontrolvolume faces (scvf) for each element of the grid partition.
...
@@ -103,13 +111,13 @@ int main(int argc, char** argv) try
...
@@ -103,13 +111,13 @@ int main(int argc, char** argv) try
autoA=std::make_shared<JacobianMatrix>();
autoA=std::make_shared<JacobianMatrix>();
autor=std::make_shared<SolutionVector>();
autor=std::make_shared<SolutionVector>();
// The grid variables store variables on scv and scvf (volume and flux variables).
// The grid variables store variables (primary and secondary variables) on sub-control volumes and faces (volume and flux variables).
// We calculate the volume flux for every subcontrolvolume face, which is not on a Neumann boundary (is not on the boundary or is on a Dirichlet boundary).
// We calculate the volume fluxes for all sub-control volume faces except for Neumann boundary faces