From 31142087e9f70a087fdcebd5c90d8639bc32d056 Mon Sep 17 00:00:00 2001 From: Tufan Ghosh <tufan.ghosh@iws.uni-stuttgart.de> Date: Wed, 30 Oct 2024 10:00:38 +0100 Subject: [PATCH 01/12] adding relevant header files for the presentation slides --- slides/materialsystem.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slides/materialsystem.md b/slides/materialsystem.md index c7dea42b..8eadd6d6 100644 --- a/slides/materialsystem.md +++ b/slides/materialsystem.md @@ -50,6 +50,8 @@ More resources can be found [in the code documentation](https://dumux.org/docs/d ## Example interfaces +* See _dumux/dumux/material/components/air.hh_ + ```cpp static Scalar gasDensity(Scalar temperature, Scalar pressure) { -- GitLab From c716c201f548653ea9590755e5687e9972883b97 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 14:51:12 +0100 Subject: [PATCH 02/12] [slides][materialsystem] Add file paths for code blocks. --- slides/materialsystem.md | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/slides/materialsystem.md b/slides/materialsystem.md index 8eadd6d6..7e95f813 100644 --- a/slides/materialsystem.md +++ b/slides/materialsystem.md @@ -50,8 +50,6 @@ More resources can be found [in the code documentation](https://dumux.org/docs/d ## Example interfaces -* See _dumux/dumux/material/components/air.hh_ - ```cpp static Scalar gasDensity(Scalar temperature, Scalar pressure) { @@ -59,24 +57,19 @@ static Scalar gasDensity(Scalar temperature, Scalar pressure) return IdealGas::density(molarMass(), temperature, pressure); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/components/air.hh`</span> ## Example interfaces ```cpp -static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure) -{ - constexpr Scalar cpVapA = 19.25; - constexpr Scalar cpVapB = 0.05213; - constexpr Scalar cpVapC = 1.197e-5; - constexpr Scalar cpVapD = -1.132e-8; - - return 1/molarMass()*( - cpVapA + temperature*( - cpVapB/2 + temperature*(cpVapC/3 + temperature*(cpVapD/4)) - ) - ); -} +static Scalar gasHeatCapacity(Scalar T, Scalar pressure) + { + const auto cp = shomateMethod.heatCapacity(T); // J/(mol K) + return cp / molarMass(); // J/(kg K) + } + ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/components/ch4.hh`</span> # Fluid systems @@ -111,6 +104,7 @@ static Scalar heatCapacity(const FluidState& fluidState, int phaseIdx) ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/fluidsystems/brine.hh`</span> # Binary coefficients @@ -141,7 +135,7 @@ static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure) return Daw*(pg0/pressure)*pow((temperature/T0), theta); } ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/binarycoefficients/h2o_air.hh`</span> # Solid systems @@ -269,7 +263,7 @@ _CompositionFromFugacities_ : takes all component fugacities, the temperature an ```cpp template<class TypeTag> -struct FluidSystem<TypeTag, TTag::H2OAir> +struct FluidSystem<TypeTag, TTag::DrainageProblem> { private: using Scalar = GetPropType<TypeTag, Properties::Scalar>; @@ -283,6 +277,7 @@ public: >; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porenetwork/2pnc/properties.hh`</span> # Example: From components to solid system @@ -307,7 +302,7 @@ struct SolidSystem<TypeTag, TTag::ThermoChem> >; }; ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/1pncmin/nonisothermal/properties.hh`</span> # Exercise -- GitLab From 77992217b3e562505e6d1c5ada6b28de2d5ac382 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 14:58:09 +0100 Subject: [PATCH 03/12] [slides][dunemodule] Add file paths for code blocks. --- slides/dunemodule.md | 1 + 1 file changed, 1 insertion(+) diff --git a/slides/dunemodule.md b/slides/dunemodule.md index dfb87153..bd476e39 100644 --- a/slides/dunemodule.md +++ b/slides/dunemodule.md @@ -31,6 +31,7 @@ Depends: dumux dune-alugrid dune-foamgrid dune-uggrid # Optional build dependencies #Suggests: ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dune.module`</span> ## Creating a new dune module Start the script `duneproject` to initiate creating a new module: -- GitLab From 3aa2dff5698e7fd68fb9fc64385b1aa647f0415a Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 15:13:35 +0100 Subject: [PATCH 04/12] [slides][grid] Add file paths for code blocks. --- slides/grid.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/slides/grid.md b/slides/grid.md index 4477b845..f7788368 100644 --- a/slides/grid.md +++ b/slides/grid.md @@ -32,10 +32,11 @@ Implementations of the Dune grid interface #include <dune/grid/yaspgrid.hh> ... template<class TypeTag> - struct Grid<TypeTag, TTag::Injection2p>{ + struct Grid<TypeTag, TTag::TwoPIncompressible>{ using type = Dune::YaspGrid<2>; }; ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/properties.hh`</span> * Include the matching grid manager header files in main file and create the grid via a grid manager instance ```cpp @@ -45,6 +46,7 @@ Implementations of the Dune grid interface GridManager<Grid> gridManager; gridManager.init(); ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/main.cc`</span> ## Create grid @@ -59,6 +61,7 @@ The grid manager looks for grid information in the runtime parameter tree UpperRight = 1 1 Cells = 10 5 ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/params.input`</span> <img src=img/params_grid.png width="200"> @@ -69,6 +72,7 @@ The grid manager looks for grid information in the runtime parameter tree [Grid] File = ./grids/heterogeneousSmall.dgf ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/io/gridmanager/test_gridmanager_dgf.input`</span> * Supported grid file formats * DGF (Dune Grid Format) @@ -82,11 +86,13 @@ constructing a `Dune::YaspGrid`: ```cpp constexpr int dim = 2; +using Yasp = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates< + double, dim>>; std::array<int, dim> cells; cells.fill(30); -Dune::FieldVector<double, dim> lowerLeft(1.0), upperRight(2.0); -using Yasp = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<double, dim>>; +Dune::FieldVector<double, dim> lowerLeft(1.1), upperRight(2.2); Yasp yasp(lowerLeft, upperRight, cells); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/geometry/test_intersectingentity_cartesiangrid.cc`</span> # Exercise ## Exercise -- GitLab From 3f8819385322b0435ca2580cbca3d0e2ad5d661e Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 15:23:56 +0100 Subject: [PATCH 05/12] [slides][multidomain] Add file paths for code blocks. --- slides/multidomain.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/slides/multidomain.md b/slides/multidomain.md index 1c58e304..70a9c621 100644 --- a/slides/multidomain.md +++ b/slides/multidomain.md @@ -64,6 +64,8 @@ void pointSource(PointSource& source...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh`</span> + ## Coupling Residual / Data Transfer (2/3) ```c++ @@ -80,6 +82,7 @@ void pointSource(PointSource& source...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh`</span> ## Coupling Residual / Data Transfer (3/3) @@ -95,6 +98,8 @@ void pointSource(PointSource& source...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh`</span> + ## Coupling Residual (1/2) @@ -112,6 +117,7 @@ decltype(auto) evalCouplingResidual(Dune::index_constant<i> domainI, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> ## Coupling Residual (2/2) @@ -131,6 +137,8 @@ decltype(auto) evalCouplingResidual(...) return residual; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> + ## Coupling Stencil  @@ -151,6 +159,7 @@ const CouplingStencil<j>& couplingStencil(domainI, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> ## Coupling Stencil (2/2) @@ -167,6 +176,7 @@ const CouplingStencil<j>& couplingStencil(domainI, return emptyStencil(domainI); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> # Examples ## Embedded Fracture Model -- GitLab From bc8c5e78051ab204ed0076938c7311d15353a6e5 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 15:56:19 +0100 Subject: [PATCH 06/12] [slides][problem] Add file paths for code blocks. --- slides/problem.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/slides/problem.md b/slides/problem.md index 18da55ee..f6320c50 100644 --- a/slides/problem.md +++ b/slides/problem.md @@ -102,6 +102,8 @@ struct Injection2pCC { using InheritsFrom = std::tuple<TwoP, CCTpfaModel>; }; } // end namespace Dumux::Properties::TTag ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> + ## @@ -116,6 +118,7 @@ struct Grid<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> ## @@ -130,6 +133,7 @@ struct Problem<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> The problem class `InjectionProblem2P` is discussed in one of the following sections. @@ -153,6 +157,7 @@ struct SpatialParams<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> ## @@ -172,6 +177,7 @@ struct FluidSystem<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> # Problem definition @@ -191,6 +197,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> // - scenario name (for output) } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> Inherit from base class `PorousMediumFlowProblem`, only override scenario-specific functions (static polymorphism). @@ -212,7 +219,7 @@ BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const return bcTypes; } ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> ## @@ -222,6 +229,7 @@ Dirichlet boundary condition values (only called on Dirichlet boundaries) PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const { return initialAtPos(globalPos); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> `PrimaryVariables` is an array of primary variables (here, the size of the array is 2). @@ -235,6 +243,7 @@ PrimaryVariables dirichlet(const Element &element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> ```cpp PrimaryVariables dirichlet(const Element &element, const SubControlVolume &scv) const @@ -242,6 +251,7 @@ PrimaryVariables dirichlet(const Element &element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> ## @@ -260,6 +270,7 @@ NumEqVector neumannAtPos(const GlobalPosition& globalPos) const return values; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> `NumEqVector` is an array of equations (here, the size of the array is 2). @@ -278,6 +289,8 @@ NumEqVector neumann(const Element& element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> + ## Initial conditions: @@ -296,6 +309,7 @@ PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const return values; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> ## @@ -306,6 +320,7 @@ Source/sink terms: NumEqVector sourceAtPos(const GlobalPosition &globalPos) const { return NumEqVector(0.0); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> ## @@ -321,6 +336,7 @@ NumEqVector source(const Element &element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> # Spatial Parameters definition @@ -339,6 +355,7 @@ class InjectionSpatialParams // e.g. porosity, permeability }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> Inherit from `FVPorousMediumFlowSpatialParamsMP` where `FV`: finite volumes, `MP`: multi-phase flow. @@ -355,6 +372,7 @@ auto permeabilityAtPos(const GlobalPosition& globalPos) const return aquiferK_; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> ## @@ -369,6 +387,7 @@ Scalar porosityAtPos(const GlobalPosition& globalPos) const return aquiferPorosity_; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> ## @@ -384,6 +403,7 @@ auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const return makeFluidMatrixInteraction(aquiferPcKrSwCurve_); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> ## @@ -392,9 +412,10 @@ Set the (constant) temperature field in the domain: ```cpp Scalar temperatureAtPos(const GlobalPosition& globalPos) const { - return 273.15 + 20.0; // 20°C + return 273.15 + 30.0; // 30°C } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> # Runtime parameters @@ -413,6 +434,7 @@ Cells = 24 16 [Problem] Name = test ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/nonisothermal/params.input`</span> See [Part I: Runtime parameters](./params.html) for details. @@ -436,6 +458,7 @@ int main(int argc, char** argv) // initialize MPI+X backends (mandatory) Dumux::initialize(argc, argv); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -445,6 +468,7 @@ Parse runtime parameters: // parse command line arguments and input file Dumux::Parameters::init(argc, argv); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> See [Part I: Runtime parameters](./params.html) for details. @@ -456,6 +480,7 @@ Define an alias for the test problem type tag using namespace Dumux; using TypeTag = Properties::TTag::Injection2pCC; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> The tag (tag alias) is used to extract types and values via the property system (details on properties in [Part II: Property system](./properties.html)). @@ -473,6 +498,7 @@ gridManager.init(); const auto& grid = gridManager.grid(); const auto& leafGridView = grid.leafGridView(); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> More details on the grid in [Part I: Grid](./grid.html). @@ -490,6 +516,7 @@ auto gridGeometry = std::make_shared<GridGeometry>(leafGridView); using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(gridGeometry); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -508,6 +535,7 @@ auto gridVariables = std::make_shared<GridVariables>(problem, gridGeometry); gridVariables->init(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -528,6 +556,7 @@ vtkWriter.addVelocityOutput( using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -555,6 +584,7 @@ auto r = std::make_shared<SolutionVector>(); assembler->setLinearSystem(A, r); assembler->assembleJacobianAndResidual(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-mainfile/exercise1pamain.cc`</span> ## @@ -570,6 +600,7 @@ auto linearSolver = std::make_shared<LinearSolver>( (*r) *= -1.0; // solve Ax = -r to save update and copy linearSolver->solve(*A, x, *r); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-mainfile/exercise1pamain.cc`</span> ## @@ -585,6 +616,7 @@ Solver solver(assembler, linearSolver); // assemble & solve solver.solve(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/1p/rootbenchmark/main.cc`</span> ## @@ -600,6 +632,7 @@ Solver solver(assembler, linearSolver); // linearize & solve solver.solve(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-mainfile/exercise1pbmain.cc`</span> ## @@ -622,6 +655,7 @@ auto assembler = std::make_shared<Assembler>( // assemble linear/non-linear problem as before // ... ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -634,6 +668,7 @@ timeLoop->start(); do { } while (!timeLoop->finished()); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -649,6 +684,7 @@ timeLoop->start(); do xOld = x; gridVariables->advanceTimeStep(); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -667,6 +703,7 @@ Advancing the time loop to the next step: // print final report timeLoop->finalize(leafGridView.comm()); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> # Build system (CMake) @@ -753,6 +790,7 @@ by defining a name and source file: dumux_add_test(NAME exercise_basic_2p SOURCES 2pmain.cc) ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/CMakeLists.txt`</span> ## Build system @@ -772,6 +810,7 @@ dumux_add_test( test_2p.input -Problem.Name 2p_box" ) ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/CMakeLists.txt`</span> ## Build system @@ -786,6 +825,7 @@ target_compile_definitions( test_2p_incompressible_tpfa PUBLIC TYPETAG=TwoPIncompressibleTpfa ) ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/CMakeLists.txt`</span> ## Build system -- GitLab From 499dce89203bc51bbebc9ffa63a83f1893cb82ed Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 16:48:23 +0100 Subject: [PATCH 07/12] [slides][biomin] Fix enumeration. --- slides/biomin.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/slides/biomin.md b/slides/biomin.md index 07cd6de0..9d6613c0 100644 --- a/slides/biomin.md +++ b/slides/biomin.md @@ -307,15 +307,17 @@ PermeabilityType evaluatePermeability(PermeabilityType refPerm, ## Exercise tasks +<div style="text-align: left; margin-left: 200px"> <small> -1. Get familiar with the code -2. Implement the simplified chemical reactions -3. Use source()-function to link chemistry-file to problem -4. Vary parameters, so that leakage pathway is "sealed" (porosity $<0.07$) -5. Implement new boundary condition for $\mathrm{CO_2}$-injection in lower aquifer -6. Exchange the permeability law from Kozeny-Carman to a Power Law +1. Get familiar with the code +2. Implement the simplified chemical reactions +3. Use source()-function to link chemistry-file to problem +4. Vary parameters, so that leakage pathway is "sealed" (porosity $<$ 0.07) +5. Implement new boundary condition for $\mathrm{CO_2}$-injection in lower aquifer +6. Exchange the permeability law from Kozeny-Carman to a Power Law 7. Use tabulated values for $\mathrm{CO_2}$ </small> +</div> ## Exercise -- GitLab From 5f344621efa871d20f303f1cb29487667c1ca7f9 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Mon, 17 Feb 2025 16:56:38 +0100 Subject: [PATCH 08/12] [slides][model] Add file paths for code blocks. --- slides/model.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/slides/model.md b/slides/model.md index e7f8dfac..6d30e3ba 100644 --- a/slides/model.md +++ b/slides/model.md @@ -99,6 +99,8 @@ class DiffusionModelLocalResidual ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> + Inherits from the `BaseLocalResidual`, which is chosen depending on the discretization scheme, here *Box scheme*. ## Storage term @@ -113,6 +115,7 @@ NumEqVector computeStorage(const Problem& problem, return storage; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Flux term @@ -142,6 +145,7 @@ NumEqVector computeFlux(const Problem& problem, } ``` </font> +<span style="font-size: 0.4em; position: relative; top: -60px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Flux term ```cpp @@ -161,6 +165,7 @@ NumEqVector computeFlux(...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Flux term ```cpp @@ -179,6 +184,7 @@ NumEqVector computeFlux(...) const return flux; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## `LocalResidual` @@ -197,6 +203,8 @@ namespace Dumux::Properties { //define all properties } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> + ## Model type tag The property type tag is an empty struct with the respective name, e.g. `DiffusionModel`. @@ -208,6 +216,7 @@ namespace Dumux::Properties::TTag { struct DiffusionModel {}; } // end namespace Dumux::Properties::TTag ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Defining model properties @@ -218,6 +227,7 @@ template<class TypeTag> struct LocalResidual<TypeTag, TTag::DiffusionModel> { using type = DiffusionModelLocalResidual<TypeTag>; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Defining model properties @@ -238,6 +248,8 @@ struct ModelTraits<TypeTag, TTag::DiffusionModel> }; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> + ## Defining model properties Further model specific properties can be set accordingly by using the model property tag, i.e. `TTag::DiffusionModel` -- GitLab From 6062e21901f27f1acfbcab674073e835e2e5f979 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Tue, 18 Feb 2025 10:51:55 +0100 Subject: [PATCH 09/12] [slides][params] Add file paths for code blocks. --- slides/params.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/slides/params.md b/slides/params.md index 6b63f6eb..a021a97b 100644 --- a/slides/params.md +++ b/slides/params.md @@ -28,6 +28,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## Initialize Parameter Tree @@ -40,6 +41,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/common/parameters/test_loggingparametertree.cc`</span> ## Initialize Parameter Tree @@ -57,6 +59,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/linear/test_parallel_amg_smoothers.cc`</span> ## Initialize Parameter Tree @@ -69,6 +72,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/parameters.cc`</span> ## Reading Runtime Parameters @@ -115,10 +119,12 @@ via the single parameter tree if (hasParam("GROUPNAME.PARAMNAME")) // do something with parameter ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/biomineralization/main.cc`</span> * With group prefix lookup ```cpp if (hasParamInGroup("GROUPNAME","PARAMNAME")) ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/freeflow/rans/problem.hh`</span> ## Parameter tree logs usage @@ -132,6 +138,8 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> + Reports unused parameters. Great for detecting typos in configuration file. @@ -153,6 +161,7 @@ Name = test [FreeFlow.Problem] Name = test_ff ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/params.input`</span> ## Command-line arguments -- GitLab From 3e25672ead62246106f7146ad8f6031dd8c822c8 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Tue, 18 Feb 2025 13:36:22 +0100 Subject: [PATCH 10/12] [slides][properties] Add file paths for code blocks. --- slides/properties.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/slides/properties.md b/slides/properties.md index 73f33d01..2ff9276d 100644 --- a/slides/properties.md +++ b/slides/properties.md @@ -103,6 +103,7 @@ using GOF0 = Dune::GridOperator< >; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dune-pdelab/doc/Recipes/recipe-operator-splitting.cc`</span> ## Technique 1: Traits classes @@ -122,6 +123,7 @@ struct TwoPVolumeVariablesTraits using SaturationReconstruction = SR; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/porousmediumflow/2p/model.hh`</span> ## Technique 2: Type traits @@ -153,6 +155,7 @@ using FluidSystem = typename Traits::FluidSystem ... ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/porousmediumflow/2p/volumevariables.hh`</span> Usage: these VolumeVariables will work for various FluidSystems: @@ -332,6 +335,7 @@ struct MyOtherTypeTag } // end namespace Dumux::Properties::TTag ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-properties/properties.hh`</span> ## How to use II @@ -341,6 +345,8 @@ namespace Dumux::Properties { DUMUX_DEFINE_PROPERTY(Problem) } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/common/propertysystem/test_propertysystem_aliases.cc`</span> + Usually not needed in user code because all necessary properties are already defined in [dumux/common/properties.hh](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/common/properties.hh). @@ -357,6 +363,7 @@ struct Problem<TypeTag, TTag::MyTypeTag> } // end namespace Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-properties/properties.hh`</span> ## How to use III (alternative) @@ -374,6 +381,7 @@ struct MyTypeTag { } // end namespace Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/geomechanics/hyperelastic/properties.hh`</span> ## How to use IV @@ -388,6 +396,7 @@ struct EnableBoxInterfaceSolver<TypeTag, TTag::MyTypeTag> } // end namespace Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/boxdfm/properties.hh`</span> ## How to use IV (alternative) @@ -425,7 +434,7 @@ class Problem } // end namespace Dumux ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/1ptracer/problem_tracer.hh`</span> ## Summary @@ -448,16 +457,18 @@ class Problem - Use a simple template argument ```cpp -template <bool useNeummanBoundaryConditions> -class Problem +template<bool enableRegularization = isRegularized()> +Scalar pcgw(const Scalar sw, const Scalar /*dummySn*/) const { ... - if constexpr (useNeummanBoundaryConditions) - ... - else + if constexpr (enableRegularization)^ + { ... -}; + } + ... +} ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/fluidmatrixinteractions/3p/parkervangenuchten.hh`</span> ## Alternative 2: @@ -468,6 +479,7 @@ template<class CouplingManager> struct SupportsMultithreadedAssembly : public std::false_type {} ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/fvassembler.hh`</span> ## Alternative 2: @@ -496,6 +508,7 @@ class Assembler { } }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/fvassembler.hh`</span> # Exercise ## Exercise -- GitLab From d0648802bf5559a07e960f9a5c220002c360bb6c Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Tue, 18 Feb 2025 14:00:29 +0100 Subject: [PATCH 11/12] [slides][grid] Fix TypeTag. --- slides/grid.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slides/grid.md b/slides/grid.md index f7788368..d797d01d 100644 --- a/slides/grid.md +++ b/slides/grid.md @@ -32,11 +32,11 @@ Implementations of the Dune grid interface #include <dune/grid/yaspgrid.hh> ... template<class TypeTag> - struct Grid<TypeTag, TTag::TwoPIncompressible>{ + struct Grid<TypeTag, TTag::Injection2p>{ using type = Dune::YaspGrid<2>; }; ``` - <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/properties.hh`</span> + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-grids/properties.hh`</span> * Include the matching grid manager header files in main file and create the grid via a grid manager instance ```cpp -- GitLab From 191e1c8debf32140b60400e1afd2401749b13f96 Mon Sep 17 00:00:00 2001 From: IvBu <ivan.buntic@iws.uni-stuttgart.de> Date: Wed, 19 Feb 2025 08:46:52 +0100 Subject: [PATCH 12/12] [slides][materialsystem] Fix indentation. --- slides/materialsystem.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/slides/materialsystem.md b/slides/materialsystem.md index 7e95f813..29c0505d 100644 --- a/slides/materialsystem.md +++ b/slides/materialsystem.md @@ -63,10 +63,11 @@ static Scalar gasDensity(Scalar temperature, Scalar pressure) ```cpp static Scalar gasHeatCapacity(Scalar T, Scalar pressure) - { - const auto cp = shomateMethod.heatCapacity(T); // J/(mol K) - return cp / molarMass(); // J/(kg K) - } +{ + // apply Shomate method + const auto cp = shomateMethod.heatCapacity(T); // J/(mol K) + return cp / molarMass(); // J/(kg K) +} ``` <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/components/ch4.hh`</span> -- GitLab