diff --git a/examples/1ptracer/main.cc b/examples/1ptracer/main.cc index 5ee3a9152df1aa6683003016a33693f849fda4c8..acf3502987cf27e755eed1077b2d11113abce6b0 100644 --- a/examples/1ptracer/main.cc +++ b/examples/1ptracer/main.cc @@ -17,8 +17,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// We look now at the main file for the tracer problem. We set up two problems in this file and solve them sequentially, first the 1p problem and afterwards the tracer problem. The result of the 1p problem is the pressure distribution in the problem domain. We use it to calculate the volume fluxes, which act as an input for the tracer problem. Based on this volume fluxes, we calculate the transport of a tracer in the following tracer problem. -// ### Includes +// ## Main program flow (`main.cc`) +// +// +// This file contains the main program flow. In this example, we solve a single-phase flow problem +// to obtain a pressure distribution on the domain. Subsequently, the distribution of volume fluxes +// is computed from that pressure distribution, which is then passed to a tracer problem to solve +// the transport of an initial contamination through the model domain. +// ### Included header files #include <config.h> // We include both problems in the main file, the `problem_1p.hh` and the `problem_tracer.hh`. diff --git a/examples/1ptracer/problem_1p.hh b/examples/1ptracer/problem_1p.hh index e9fae345a191f094e6ca5f77d731ba42356d1347..e5b18505ec267db3ff9fad39478058183eb91b63 100644 --- a/examples/1ptracer/problem_1p.hh +++ b/examples/1ptracer/problem_1p.hh @@ -17,11 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ - -// ### Header guard #ifndef DUMUX_ONEP_TEST_PROBLEM_HH #define DUMUX_ONEP_TEST_PROBLEM_HH +// ## The file `problem_1p.hh` +// +// // Before we enter the problem class containing initial and boundary conditions, we include necessary files and introduce properties. // ### Include files // We use `YaspGrid`, an implementation of the dune grid interface for structured grids: @@ -130,7 +131,7 @@ public: OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry) : ParentType(gridGeometry) {} - // First, we define the type of boundary conditions depending on the location. Two types of boundary conditions + // First, we define the type of boundary conditions depending on the location. Two types of boundary conditions // can be specified: Dirichlet or Neumann boundary condition. On a Dirichlet boundary, the values of the // primary variables need to be fixed. On a Neumann boundary condition, values for derivatives need to be fixed. // Mixed boundary conditions (different types for different equations on the same boundary) are not accepted for @@ -154,7 +155,7 @@ public: return values; } - // Second, we specify the values for the Dirichlet boundaries. We need to fix values of our primary variable + // Second, we specify the values for the Dirichlet boundaries. We need to fix values of our primary variable PrimaryVariables dirichlet(const Element &element, const SubControlVolumeFace &scvf) const { diff --git a/examples/1ptracer/problem_tracer.hh b/examples/1ptracer/problem_tracer.hh index 8a01555af76b09370cd7fce8df27355b23280080..cea84f103e5e54d2294aea7fd9b2b2b0fa24c428 100644 --- a/examples/1ptracer/problem_tracer.hh +++ b/examples/1ptracer/problem_tracer.hh @@ -17,10 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// ### Header guard #ifndef DUMUX_TRACER_TEST_PROBLEM_HH #define DUMUX_TRACER_TEST_PROBLEM_HH +// ## The file `problem_tracer.hh` +// +// //Before we enter the problem class containing initial and boundary conditions, we include necessary files and introduce properties. // ### Include files // Again, we use YaspGrid, the implementation of the dune grid interface for structured grids: diff --git a/examples/1ptracer/spatialparams_1p.hh b/examples/1ptracer/spatialparams_1p.hh index 191f144383c4cc76f2b0b009d5f50243fe1f1516..5cfb74f05345c27eb7bd43209407389e3cc5861f 100644 --- a/examples/1ptracer/spatialparams_1p.hh +++ b/examples/1ptracer/spatialparams_1p.hh @@ -17,10 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// the header guard #ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH #define DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH +// ## The file `spatialparams_1p.hh` +// +// // In this file, we generate a random permeability field in the constructor of the `OnePTestSpatialParams` class. // For this, we use the random number generation facilities provided by the C++ standard library. #include <random> diff --git a/examples/1ptracer/spatialparams_tracer.hh b/examples/1ptracer/spatialparams_tracer.hh index 71590349436ffdb93915e66c42a030196950b4b4..9d1c92762a4c68606b7511ae1e473dafe1b2a364 100644 --- a/examples/1ptracer/spatialparams_tracer.hh +++ b/examples/1ptracer/spatialparams_tracer.hh @@ -17,12 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ - - -// the header guard #ifndef DUMUX_TRACER_TEST_SPATIAL_PARAMS_HH #define DUMUX_TRACER_TEST_SPATIAL_PARAMS_HH +// ## The file `spatialparams_tracer.hh` +// +// // In this file, we define spatial properties of the porous medium such as the permeability and the porosity in various functions for the tracer problem. // Furthermore, spatial dependent properties of the tracer fluid system are defined and in the end two functions handle the calculated volume fluxes from the solution of the 1p problem. // We use the properties for porous medium flow models, declared in the file `properties.hh`. diff --git a/examples/2pinfiltration/main.cc b/examples/2pinfiltration/main.cc index 1df80f0c5cea85150c29fca54256ccc2fa498c44..6fb5f2f5067fd068c5fdbc6efb0c5e85afee0bfe 100644 --- a/examples/2pinfiltration/main.cc +++ b/examples/2pinfiltration/main.cc @@ -16,7 +16,9 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// ## The main file +// ## The file `main.cc` +// +// // This is the main file for the 2pinfiltration example. Here we can see the programme sequence and how the system is solved using Newton's method // ### Includes #include <config.h> @@ -110,7 +112,7 @@ int main(int argc, char** argv) try // In the problem, we define the boundary and initial conditions. using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(gridGeometry); - // We call the `computePointSourceMap` method to compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file. + // We call the `computePointSourceMap` method to compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file. problem->computePointSourceMap(); // We initialize the solution vector, @@ -160,7 +162,7 @@ int main(int argc, char** argv) try } } - // Depending on the initial conditions, another grid adaptation might be necessary. The gridadaptindicator uses the input parameters `Adaptive.RefineTolerance` and `Adaptive.CoarsenTolerance` for this step. + // Depending on the initial conditions, another grid adaptation might be necessary. The gridadaptindicator uses the input parameters `Adaptive.RefineTolerance` and `Adaptive.CoarsenTolerance` for this step. indicator.calculate(x, refineTol, coarsenTol); //we mark the elements that were adapted diff --git a/examples/2pinfiltration/problem.hh b/examples/2pinfiltration/problem.hh index 0c6344275b9a8b45a5659ef96fdd18a31b42ddd1..4b1a322597b77a50a1f46707e33825b16dbf90b9 100644 --- a/examples/2pinfiltration/problem.hh +++ b/examples/2pinfiltration/problem.hh @@ -17,13 +17,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// ## Header guard -// The header guard (or include guard) prevents compilation errors due to duplicate definitions. -// Here, a unique name needs to be defined for the header file: #ifndef DUMUX_LENSPROBLEM_POINTSOURCE_ADAPTIVE_HH #define DUMUX_LENSPROBLEM_POINTSOURCE_ADAPTIVE_HH -// ## Include files +// ## The file `problem.hh` +// +// +// ### Include files // The grid we use #include <dune/alugrid/grid.hh> @@ -125,7 +125,7 @@ namespace Dumux { //We leave the namespace Properties. } -// ## The problem class +// ### The problem class // We enter the problem class where all necessary boundary conditions and initial conditions are set for our simulation. // As this is a porous medium problem, we inherit from the basic PorousMediumFlowProblem. template <class TypeTag > diff --git a/examples/2pinfiltration/spatialparams.hh b/examples/2pinfiltration/spatialparams.hh index 4bcb5292d01b0891a6587d4957baaf304c339d29..f8b4bd01b3306580944af3054be8e6b74d5954dd 100644 --- a/examples/2pinfiltration/spatialparams.hh +++ b/examples/2pinfiltration/spatialparams.hh @@ -17,10 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// the header guard #ifndef DUMUX_TWOP_INCOMPRESSIBLE_EXAMPLE_SPATIAL_PARAMS_HH #define DUMUX_TWOP_INCOMPRESSIBLE_EXAMPLE_SPATIAL_PARAMS_HH +// ## The file `spatialparams.hh` +// +// //we include the basic spatial parameters for finite volumes file from which we will inherit #include <dumux/material/spatialparams/fv.hh> diff --git a/examples/freeflowchannel/main.cc b/examples/freeflowchannel/main.cc index 69a9bd58cdb3d0d6a65aae366c8003017f9ef794..443e712e55b7ee26d6bb93ebc76104ee7c28d02f 100644 --- a/examples/freeflowchannel/main.cc +++ b/examples/freeflowchannel/main.cc @@ -17,6 +17,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ +// ## The file `main.cc` +// +// // We look now at the main file for the channel problem. // ### Includes // Necessary files are included. diff --git a/examples/freeflowchannel/problem.hh b/examples/freeflowchannel/problem.hh index e9f9886d4698f3735a60b17828c79e7ad18df811..b8c9c070e3e78a3da041fb69ba3c0a7e511ce4c2 100644 --- a/examples/freeflowchannel/problem.hh +++ b/examples/freeflowchannel/problem.hh @@ -17,10 +17,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// ### Header guard #ifndef DUMUX_CHANNEL_TEST_PROBLEM_HH #define DUMUX_CHANNEL_TEST_PROBLEM_HH +// ## The file `problem.hh` +// // // ### The problem class // We enter the problem class where all necessary initial and boundary conditions are set for our simulation. @@ -72,11 +73,11 @@ public: // </details> // // Now, we define the type of initial and boundary conditions depending on location. - // Two types of boundary conditions can be specified: Dirichlet and Neumann. On a Dirichlet boundary, + // Two types of boundary conditions can be specified: Dirichlet and Neumann. On a Dirichlet boundary, // the values of the primary variables need to be fixed. // On a Neumann boundary condition, values for derivatives need to be fixed. // When Dirichlet conditions are set for the pressure, the derivative of the velocity - // vector with respect to the direction normal to the boundary is automatically set to + // vector with respect to the direction normal to the boundary is automatically set to // zero. This boundary condition is called in-/outflow boundary condition in Dumux. // In the following we specify Dirichlet boundaries for velocity on the left of our domain // if isInlet_ is true, Dirichlet boundaries for pressure on the right of our domain diff --git a/examples/shallowwaterfriction/main.cc b/examples/shallowwaterfriction/main.cc index 2371f30f5606c13a088c6412af5e3cc50b22a17a..dd4ef4951a9ba561220a3bb140a0f2113ab334ea 100644 --- a/examples/shallowwaterfriction/main.cc +++ b/examples/shallowwaterfriction/main.cc @@ -16,7 +16,10 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// ## The main file + +// ## The file `main.cc` +// +// // This is the main file for the shallow water example. Here we can see the programme sequence and how the system is solved using newton's method. // ### Includes #include <config.h> diff --git a/examples/shallowwaterfriction/problem.hh b/examples/shallowwaterfriction/problem.hh index eb9523df9cdaf68db0483053850ca4a8f9772849..f7e3f365d9fe273fd76a36eee7c6360b4d7318d0 100644 --- a/examples/shallowwaterfriction/problem.hh +++ b/examples/shallowwaterfriction/problem.hh @@ -17,11 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// ## Header guard -// The header guard (or include guard) prevents compilation errors due to duplicate definitions. Here, a unique name needs to be defined for the header file: #ifndef DUMUX_ROUGH_CHANNEL_TEST_PROBLEM_HH #define DUMUX_ROUGH_CHANNEL_TEST_PROBLEM_HH +// ## The file `problem.hh` +// +// // ## Include files // We use the dune yasp grid. #include <dune/grid/yaspgrid.hh> @@ -222,7 +223,11 @@ public: return bcTypes; } - // We specify the neumann boundary. Due to the weak imposition we calculate the flux at the boundary, with a Rieman solver. For this the state of a virtual cell outside of the boundary is needed (`boundaryStateVariables`), wich is calculated with the Riemann invariants (see Yoon and Kang, Finite Volume Model for Two-Dimensional Shallow Water Flows on Unstructured Grids) . The calculation of the Riemann invariants differ depending on the type of the boundary (h, q or no-flow boundary). + // We specify the neumann boundary. Due to the weak imposition we calculate the flux at the + // boundary, with a Rieman solver. For this the state of a virtual cell outside of the boundary + // is needed (`boundaryStateVariables`), wich is calculated with the Riemann invariants + // (see Yoon and Kang, Finite Volume Model for Two-Dimensional Shallow Water Flows on Unstructured Grids). + // The calculation of the Riemann invariants differ depending on the type of the boundary (h, q or no-flow boundary). NeumannFluxes neumann(const Element& element, const FVElementGeometry& fvGeometry, const ElementVolumeVariables& elemVolVars, diff --git a/examples/shallowwaterfriction/spatialparams.hh b/examples/shallowwaterfriction/spatialparams.hh index 17bca79fee127dfc08583c8a67a7fb787477acfe..1638ce5c314c6f16b55a3a88ec138287414fc35d 100644 --- a/examples/shallowwaterfriction/spatialparams.hh +++ b/examples/shallowwaterfriction/spatialparams.hh @@ -17,10 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ -// the header guard #ifndef DUMUX_ROUGH_CHANNEL_SPATIAL_PARAMETERS_HH #define DUMUX_ROUGH_CHANNEL_SPATIAL_PARAMETERS_HH +// ## The file `spatialparams.hh` +// +// // We include the basic spatial parameters for finite volumes file from which we will inherit #include <dumux/material/spatialparams/fv.hh> // The parameters header is needed to retrieve run-time parameters.