diff --git a/.patches/exercise-basic/exercise-basic.patch b/.patches/exercise-basic/exercise-basic.patch index 26e8cd0d9475b07903d2df320ac3adcc418a9ead..1e00fd3b7ff4bbcbd70ad4e68046374e5c2a0098 100644 --- a/.patches/exercise-basic/exercise-basic.patch +++ b/.patches/exercise-basic/exercise-basic.patch @@ -1,5 +1,5 @@ diff -ruN exercises/exercise-basic/2pmain.cc exercises/solution/exercise-basic/2pmain.cc ---- exercises/exercise-basic/2pmain.cc 2025-02-26 11:57:52.812342780 +0100 +--- exercises/exercise-basic/2pmain.cc 2025-03-07 11:30:34.870192062 +0100 +++ exercises/solution/exercise-basic/2pmain.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,153 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -32,7 +32,7 @@ diff -ruN exercises/exercise-basic/2pmain.cc exercises/solution/exercise-basic/2 -#include <dumux/io/grid/gridmanager_yasp.hh> - -/*! -- * TODO:dumux-course-task 3: +- * TODO: dumux-course-task 3: - * In 2pnimain.cc include the correct properties headerfile - */ -// The properties file, where the compile time options are defined @@ -46,7 +46,7 @@ diff -ruN exercises/exercise-basic/2pmain.cc exercises/solution/exercise-basic/2 - using namespace Dumux; - - /*! -- * TODO:dumux-course-task 3: +- * TODO: dumux-course-task 3: - * In 2pnimain.cc change the type tag for the new injection problem - */ - // define the type tag for this problem @@ -157,7 +157,7 @@ diff -ruN exercises/exercise-basic/2pmain.cc exercises/solution/exercise-basic/2 -} // end main diff -ruN exercises/exercise-basic/2pnimain.cc exercises/solution/exercise-basic/2pnimain.cc --- exercises/exercise-basic/2pnimain.cc 1970-01-01 01:00:00.000000000 +0100 -+++ exercises/solution/exercise-basic/2pnimain.cc 2025-02-26 11:38:46.841816361 +0100 ++++ exercises/solution/exercise-basic/2pnimain.cc 2025-03-07 10:42:02.617882948 +0100 @@ -0,0 +1,138 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: @@ -298,8 +298,8 @@ diff -ruN exercises/exercise-basic/2pnimain.cc exercises/solution/exercise-basic + return 0; +} // end main diff -ruN exercises/exercise-basic/CMakeLists.txt exercises/solution/exercise-basic/CMakeLists.txt ---- exercises/exercise-basic/CMakeLists.txt 2025-02-26 12:06:05.764771983 +0100 -+++ exercises/solution/exercise-basic/CMakeLists.txt 2025-02-26 11:38:46.841816361 +0100 +--- exercises/exercise-basic/CMakeLists.txt 2025-03-07 11:30:34.870192062 +0100 ++++ exercises/solution/exercise-basic/CMakeLists.txt 2025-03-07 10:42:02.617882948 +0100 @@ -1,12 +1,9 @@ # SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder # SPDX-License-Identifier: GPL-3.0-or-later @@ -308,7 +308,7 @@ diff -ruN exercises/exercise-basic/CMakeLists.txt exercises/solution/exercise-ba -dumux_add_test(NAME exercise_basic_2p - SOURCES 2pmain.cc) - --# TODO: add the two-phase non-isothermal simulation program +-# TODO: dumux-course-task 3: add the two-phase non-isothermal simulation program - +# the two-phase non-isothermal simulation program +dumux_add_test(NAME exercise_basic_2pni_solution @@ -317,8 +317,8 @@ diff -ruN exercises/exercise-basic/CMakeLists.txt exercises/solution/exercise-ba # add a symlink for each input file add_input_file_links() diff -ruN exercises/exercise-basic/injection2pniproblem.hh exercises/solution/exercise-basic/injection2pniproblem.hh ---- exercises/exercise-basic/injection2pniproblem.hh 2025-02-26 11:38:46.801818192 +0100 -+++ exercises/solution/exercise-basic/injection2pniproblem.hh 2025-02-26 11:38:46.841816361 +0100 +--- exercises/exercise-basic/injection2pniproblem.hh 2025-03-07 11:30:34.871192055 +0100 ++++ exercises/solution/exercise-basic/injection2pniproblem.hh 2025-03-07 10:42:02.617882948 +0100 @@ -7,7 +7,7 @@ /*! * \file @@ -342,7 +342,7 @@ diff -ruN exercises/exercise-basic/injection2pniproblem.hh exercises/solution/ex bcTypes.setAllNeumann(); - /*! -- * TODO:dumux-course-task 4: +- * TODO: dumux-course-task 4: - * Set Dirichlet conditions for the energy equation on the left boundary - * and Neumann everywhere else. - * Think about: is there anything necessary to do here? @@ -357,7 +357,7 @@ diff -ruN exercises/exercise-basic/injection2pniproblem.hh exercises/solution/ex return initialAtPos(globalPos); - - /*! -- * TODO:dumux-course-task 4: +- * TODO: dumux-course-task 4: - * Set Dirichlet conditions for the energy equation on the left boundary. - * Think about: is there anything necessary to do here? - */ @@ -377,7 +377,7 @@ diff -ruN exercises/exercise-basic/injection2pniproblem.hh exercises/solution/ex values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0; - /*! -- * TODO:dumux-course-task 4: +- * TODO: dumux-course-task 4: - * Set Neumann noflow conditions for the energy equation everywhere else except the left boundary. - * Additionally, consider the energy flux at the injection point which is equal to the product of the respective mass flux and the matching enthalpy. Use the function `gasEnthalpy(temperature,pressure)` from the N2 component to access the necessary enthalpy. - * hint: use `Indices::energyEqIdx` to access the entry belonging to the energy flux. @@ -395,7 +395,7 @@ diff -ruN exercises/exercise-basic/injection2pniproblem.hh exercises/solution/ex values[Indices::saturationIdx] = 0.0; - /*! -- * TODO:dumux-course-task 4: +- * TODO: dumux-course-task 4: - * Set a temperature gradient of 0.03 K per m beginning at 283 K here. - * Hint: you can use aquiferDepth_ and the globalPos similar to the pressure gradient. - * Use globalPos[0] and globalPos[1] to implement the high temperature lens with 380 K @@ -409,7 +409,7 @@ diff -ruN exercises/exercise-basic/injection2pniproblem.hh exercises/solution/ex } diff -ruN exercises/exercise-basic/injection2pproblem.hh exercises/solution/exercise-basic/injection2pproblem.hh ---- exercises/exercise-basic/injection2pproblem.hh 2025-02-26 11:38:46.801818192 +0100 +--- exercises/exercise-basic/injection2pproblem.hh 2025-03-07 10:42:02.607883011 +0100 +++ exercises/solution/exercise-basic/injection2pproblem.hh 1970-01-01 01:00:00.000000000 +0100 @@ -1,211 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -624,13 +624,13 @@ diff -ruN exercises/exercise-basic/injection2pproblem.hh exercises/solution/exer - -#endif diff -ruN exercises/exercise-basic/params.input exercises/solution/exercise-basic/params.input ---- exercises/exercise-basic/params.input 2025-02-26 12:13:01.057757112 +0100 +--- exercises/exercise-basic/params.input 2025-03-07 11:30:34.871192055 +0100 +++ exercises/solution/exercise-basic/params.input 2025-02-26 11:38:46.841816361 +0100 @@ -23,8 +23,8 @@ Aquifer.Swr = 0.2 Aquifer.Snr = 0.0 --# TODO: these parameters are only used in the nonisothermal model. Uncomment them for that +-# TODO: dumux-course-task 4: these parameters are only used in the nonisothermal model. Uncomment them for that -#[Component] -#SolidDensity = 2700 # solid density of granite -#SolidThermalConductivity = 2.8 # solid thermal conducitivity of granite @@ -641,7 +641,7 @@ diff -ruN exercises/exercise-basic/params.input exercises/solution/exercise-basi +SolidThermalConductivity = 2.8 # solid thermal conducitivity of granite +SolidHeatCapacity = 790 # solid heat capacity of granite diff -ruN exercises/exercise-basic/properties2p.hh exercises/solution/exercise-basic/properties2p.hh ---- exercises/exercise-basic/properties2p.hh 2025-02-26 11:38:46.801818192 +0100 +--- exercises/exercise-basic/properties2p.hh 2025-03-07 10:42:02.608883005 +0100 +++ exercises/solution/exercise-basic/properties2p.hh 1970-01-01 01:00:00.000000000 +0100 @@ -1,63 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -708,14 +708,14 @@ diff -ruN exercises/exercise-basic/properties2p.hh exercises/solution/exercise-b - -#endif diff -ruN exercises/exercise-basic/properties2pni.hh exercises/solution/exercise-basic/properties2pni.hh ---- exercises/exercise-basic/properties2pni.hh 2025-02-26 11:38:46.801818192 +0100 -+++ exercises/solution/exercise-basic/properties2pni.hh 2025-02-26 11:38:46.841816361 +0100 +--- exercises/exercise-basic/properties2pni.hh 2025-03-07 11:30:34.871192055 +0100 ++++ exercises/solution/exercise-basic/properties2pni.hh 2025-03-07 10:42:02.617882948 +0100 @@ -24,13 +24,9 @@ namespace Dumux::Properties { - /*! --* TODO:dumux-course-task 4 +-* TODO: dumux-course-task 4: -* Inherit from the TwoPNI model instead of TwoP here -*/ // Create new type tags @@ -726,7 +726,7 @@ diff -ruN exercises/exercise-basic/properties2pni.hh exercises/solution/exercise } // end namespace TTag diff -ruN exercises/exercise-basic/README.md exercises/solution/exercise-basic/README.md ---- exercises/exercise-basic/README.md 2025-03-04 10:55:49.676212309 +0100 +--- exercises/exercise-basic/README.md 2025-03-07 10:34:20.577090067 +0100 +++ exercises/solution/exercise-basic/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +0,0 @@ -# Exercise Basics (DuMuX course) diff --git a/.patches/exercise-biomineralization/exercise-biomineralization.patch b/.patches/exercise-biomineralization/exercise-biomineralization.patch index 7a2f6aae2a94efac358468843248e442872cc91e..f5986d5613a911567750b1db2a9ce723b4d93fae 100644 --- a/.patches/exercise-biomineralization/exercise-biomineralization.patch +++ b/.patches/exercise-biomineralization/exercise-biomineralization.patch @@ -1,12 +1,9 @@ diff -ruN exercises/exercise-biomineralization/biominproblem.hh exercises/solution/exercise-biomineralization/biominproblem.hh ---- exercises/exercise-biomineralization/biominproblem.hh 2025-03-03 11:34:18.218509920 +0100 -+++ exercises/solution/exercise-biomineralization/biominproblem.hh 2025-02-26 11:38:46.841816361 +0100 -@@ -17,12 +17,14 @@ - #include <dumux/common/numeqvector.hh> - #include <dumux/porousmediumflow/problem.hh> +--- exercises/exercise-biomineralization/biominproblem.hh 2025-03-07 11:30:34.871192055 +0100 ++++ exercises/solution/exercise-biomineralization/biominproblem.hh 2025-03-07 11:30:34.877192015 +0100 +@@ -19,10 +19,12 @@ --// TODO: dumux-course-task 3 -+// TODO: dumux-course-task + // TODO: dumux-course-task 3: // include chemistry file here +#include "chemistry/simplebiominreactions.hh" // chemical reactions @@ -17,12 +14,9 @@ diff -ruN exercises/exercise-biomineralization/biominproblem.hh exercises/soluti * \brief Problem biomineralization (MICP) in an experimental setup. */ template <class TypeTag> -@@ -51,8 +53,9 @@ - using Element = typename GridView::template Codim<0>::Entity; - using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; +@@ -53,6 +55,7 @@ using SubControlVolume = typename FVElementGeometry::SubControlVolume; -- // TODO: dumux-course-task 3 -+ // TODO: dumux-course-task + // TODO: dumux-course-task 3: // set the chemistry TypeTag + using Chemistry = typename Dumux::SimpleBiominReactions<NumEqVector, VolumeVariables>; @@ -43,12 +37,9 @@ diff -ruN exercises/exercise-biomineralization/biominproblem.hh exercises/soluti && globalPos[1] < 12.0 + eps_ && time_ < injBioTime_) { -@@ -183,8 +186,15 @@ - values[conti0EqIdx + CaIdx] = - waterFlux * concCa_ / FluidSystem::molarMass(CaIdx); - values[conti0EqIdx + UreaIdx] = - waterFlux * concUrea_ / FluidSystem::molarMass(UreaIdx); +@@ -185,6 +188,13 @@ } -- // TODO: dumux-course-task 5 -+ // TODO: dumux-course-task + // TODO: dumux-course-task 5: // Set CO2 injection below aquitard after the injBioTime + if(globalPos[0] < eps_ + && globalPos[1] > 2.0 + eps_ @@ -60,12 +51,9 @@ diff -ruN exercises/exercise-biomineralization/biominproblem.hh exercises/soluti return values; } -@@ -245,16 +255,17 @@ - { - NumEqVector source(0.0); +@@ -247,14 +257,15 @@ -- // TODO: dumux-course-task 3 -+ // TODO: dumux-course-task + // TODO: dumux-course-task 3: // set Chemistry -// Chemistry chemistry; + Chemistry chemistry; @@ -82,11 +70,11 @@ diff -ruN exercises/exercise-biomineralization/biominproblem.hh exercises/soluti { return Kxx_; diff -ruN exercises/exercise-biomineralization/biominspatialparams.hh exercises/solution/exercise-biomineralization/biominspatialparams.hh ---- exercises/exercise-biomineralization/biominspatialparams.hh 2025-02-26 11:38:46.802818146 +0100 -+++ exercises/solution/exercise-biomineralization/biominspatialparams.hh 2025-02-26 11:38:46.841816361 +0100 +--- exercises/exercise-biomineralization/biominspatialparams.hh 2025-03-07 11:30:34.871192055 +0100 ++++ exercises/solution/exercise-biomineralization/biominspatialparams.hh 2025-03-07 11:30:34.877192015 +0100 @@ -18,7 +18,7 @@ #include <dumux/material/fluidmatrixinteractions/porosityprecipitation.hh> - // TODO: dumux-course-task + // TODO: dumux-course-task 6: // include the new permeability law (power law) instead of Kozeny-Carman -#include <dumux/material/fluidmatrixinteractions/permeabilitykozenycarman.hh> +#include "fluidmatrixinteractions/permeabilitypowerlaw.hh" //the power-law porosity-permeability relation @@ -95,7 +83,7 @@ diff -ruN exercises/exercise-biomineralization/biominspatialparams.hh exercises/ @@ -273,7 +273,7 @@ - // TODO: dumux-course-task + // TODO: dumux-course-task 6: // define the power law as the permeability law - PermeabilityKozenyCarman<PermeabilityType> permLaw_; + PermeabilityPowerLaw<PermeabilityType> permLaw_; @@ -103,9 +91,9 @@ diff -ruN exercises/exercise-biomineralization/biominspatialparams.hh exercises/ Scalar initialPorosity_; diff -ruN exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh exercises/solution/exercise-biomineralization/chemistry/simplebiominreactions.hh ---- exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh 2025-03-03 11:26:35.285339610 +0100 -+++ exercises/solution/exercise-biomineralization/chemistry/simplebiominreactions.hh 2025-02-26 11:38:46.841816361 +0100 -@@ -73,36 +73,38 @@ +--- exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh 2025-03-07 11:30:34.872192048 +0100 ++++ exercises/solution/exercise-biomineralization/chemistry/simplebiominreactions.hh 2025-03-07 11:30:34.877192015 +0100 +@@ -73,24 +73,27 @@ // define and compute some parameters for convenience: const Scalar xwCa = volVars.moleFraction(liquidPhaseIdx,CaIdx); const Scalar densityBiofilm = volVars.solidComponentDensity(BiofilmPhaseIdx); @@ -113,9 +101,8 @@ diff -ruN exercises/exercise-biomineralization/chemistry/simplebiominreactions.h using std::max; const Scalar volFracBiofilm = max(volVars.solidVolumeFraction(BiofilmPhaseIdx),0.0); -- // TODO: dumux-course-task 2 + -+ // TODO: dumux-course-task + // TODO: dumux-course-task 2: // implement mass of biofilm - const Scalar massBiofilm = 0.0; + const Scalar massBiofilm = densityBiofilm * volFracBiofilm; @@ -124,24 +111,22 @@ diff -ruN exercises/exercise-biomineralization/chemistry/simplebiominreactions.h xwCa, volVars.moleFraction(liquidPhaseIdx,CO2Idx)); // [mol_urea/kg_H2O] -- // TODO: dumux-course-task 2 + // TODO: dumux-course-task 2: - // compute rate of ureolysis by implementing Zub and rurea - const Scalar Zub = 0.0; - const Scalar rurea = 0.0; -+ // TODO: dumux-course-task + // compute rate of ureolysis by implementing Z_urease,biofilm and r_urea + const Scalar Zub = kub_ * massBiofilm; // [kg urease/m³] + const Scalar rurea = kUrease_ * Zub * molalityUrea / (kUrea_ + molalityUrea); // [mol/m³s] -- // TODO: dumux-course-task 2 + // TODO: dumux-course-task 2: // compute/set dissolution and precipitation rate of calcite - const Scalar rprec = 0.0; + const Scalar rprec = rurea; // set source terms -- // TODO: dumux-course-task 2 -+ // TODO: dumux-course-task - // set the source terms using the reaction rates defined above and signs based on the stoichiometry of the reactions. + // TODO: dumux-course-task 2: +@@ -98,11 +101,11 @@ // Hint: Ammonium occurs in the reaction equation, but is not accounted for in this simplified setup. // Additionally, the consumption of water by the reaction may be neglected, as water is present in excess. q[H2OIdx] += 0.0; @@ -158,8 +143,8 @@ diff -ruN exercises/exercise-biomineralization/chemistry/simplebiominreactions.h private: diff -ruN exercises/exercise-biomineralization/CMakeLists.txt exercises/solution/exercise-biomineralization/CMakeLists.txt ---- exercises/exercise-biomineralization/CMakeLists.txt 2025-02-26 11:38:46.801818192 +0100 -+++ exercises/solution/exercise-biomineralization/CMakeLists.txt 2025-02-26 11:38:46.841816361 +0100 +--- exercises/exercise-biomineralization/CMakeLists.txt 2025-03-07 10:42:02.608883005 +0100 ++++ exercises/solution/exercise-biomineralization/CMakeLists.txt 2025-03-07 10:42:02.617882948 +0100 @@ -2,9 +2,9 @@ # SPDX-License-Identifier: GPL-3.0-or-later @@ -173,8 +158,8 @@ diff -ruN exercises/exercise-biomineralization/CMakeLists.txt exercises/solution # add a symlink for each input file add_input_file_links() diff -ruN exercises/exercise-biomineralization/components/biofilm.hh exercises/solution/exercise-biomineralization/components/biofilm.hh ---- exercises/exercise-biomineralization/components/biofilm.hh 2025-02-26 11:38:46.802818146 +0100 -+++ exercises/solution/exercise-biomineralization/components/biofilm.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-biomineralization/components/biofilm.hh 2025-03-07 10:42:02.608883005 +0100 ++++ exercises/solution/exercise-biomineralization/components/biofilm.hh 2025-03-07 10:42:02.617882948 +0100 @@ -12,9 +12,10 @@ #ifndef DUMUX_BIOFILM_HH #define DUMUX_BIOFILM_HH @@ -188,19 +173,15 @@ diff -ruN exercises/exercise-biomineralization/components/biofilm.hh exercises/s namespace Dumux::Components { diff -ruN exercises/exercise-biomineralization/fluidmatrixinteractions/permeabilitypowerlaw.hh exercises/solution/exercise-biomineralization/fluidmatrixinteractions/permeabilitypowerlaw.hh ---- exercises/exercise-biomineralization/fluidmatrixinteractions/permeabilitypowerlaw.hh 2025-03-03 11:37:11.636848883 +0100 -+++ exercises/solution/exercise-biomineralization/fluidmatrixinteractions/permeabilitypowerlaw.hh 2025-02-26 11:38:46.842816315 +0100 -@@ -39,12 +39,13 @@ - PermeabilityType evaluatePermeability(PermeabilityType refPerm, Scalar refPoro, Scalar poro) const - { +--- exercises/exercise-biomineralization/fluidmatrixinteractions/permeabilitypowerlaw.hh 2025-03-07 11:30:34.872192048 +0100 ++++ exercises/solution/exercise-biomineralization/fluidmatrixinteractions/permeabilitypowerlaw.hh 2025-03-07 11:30:34.877192015 +0100 +@@ -41,10 +41,11 @@ using std::pow; -- // TODO: dumux-course-task 6 -+ // TODO: dumux-course-task + // TODO: dumux-course-task 6: // read the exponent for the power law from the input file + const Scalar exponent = getParam<Scalar>("PowerLaw.Exponent", 5.0); -- // TODO: dumux-course-task 6 -+ // TODO: dumux-course-task + // TODO: dumux-course-task 6: // return the updated permeability according to K=K_0*(poro/refPoro)^exponent - return refPerm; + return refPerm * pow(poro/refPoro, exponent); @@ -208,8 +189,8 @@ diff -ruN exercises/exercise-biomineralization/fluidmatrixinteractions/permeabil }; diff -ruN exercises/exercise-biomineralization/fluidsystems/biomin.hh exercises/solution/exercise-biomineralization/fluidsystems/biomin.hh ---- exercises/exercise-biomineralization/fluidsystems/biomin.hh 2025-02-26 11:38:46.802818146 +0100 -+++ exercises/solution/exercise-biomineralization/fluidsystems/biomin.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-biomineralization/fluidsystems/biomin.hh 2025-03-07 10:42:02.608883005 +0100 ++++ exercises/solution/exercise-biomineralization/fluidsystems/biomin.hh 2025-03-07 10:42:02.617882948 +0100 @@ -219,7 +219,7 @@ static void init() { @@ -220,17 +201,9 @@ diff -ruN exercises/exercise-biomineralization/fluidsystems/biomin.hh exercises/ } diff -ruN exercises/exercise-biomineralization/params.input exercises/solution/exercise-biomineralization/params.input ---- exercises/exercise-biomineralization/params.input 2025-03-03 11:36:58.886338421 +0100 -+++ exercises/solution/exercise-biomineralization/params.input 2025-02-26 11:38:46.842816315 +0100 -@@ -10,18 +10,16 @@ - UpperRight = 20 15 # x-/y-coordinates of the upper-right corner of the grid [m] - Cells = 20 15 # x-/y-resolution of the grid - --# TODO: dumux-course-task 4 --# vary parameters InjBioTime, InitBiofilm, InjVolumeflux, ConcUrea and ConcCa - [Initial] - InitDensityW = 997 # [kg/m³] initial wetting density - InitPressure = 1e5 # [Pa] initial pressure +--- exercises/exercise-biomineralization/params.input 2025-03-07 11:30:34.872192048 +0100 ++++ exercises/solution/exercise-biomineralization/params.input 2025-03-07 11:30:34.877192015 +0100 +@@ -18,10 +18,10 @@ InitBiofilm = 0.05 # [-] initial volumefraction biofilm [Injection] @@ -244,7 +217,7 @@ diff -ruN exercises/exercise-biomineralization/params.input exercises/solution/e ConcCa = 40 # [kg/m³] injected calcium concentration (max: 50) ConcUrea = 60 # [kg/m³] injected urea concentration, should be 1.5 times ConcCa (max: 80) -@@ -37,7 +35,6 @@ +@@ -37,7 +37,6 @@ Aquitard.Swr = 0.0 Aquitard.Snr = 0.0 @@ -252,26 +225,23 @@ diff -ruN exercises/exercise-biomineralization/params.input exercises/solution/e [BioCoefficients] RhoBiofilm = 6.9 # [kg/m³] density of biofilm -@@ -49,5 +46,7 @@ - [Brine] +@@ -50,4 +49,6 @@ Salinity = 0.1 --#TODO: dumux-course-task 6 + # TODO: dumux-course-task 6: -# add the power law's exponent parameter PowerLaw.Exponent = 5.0 -+#TODO: dumux-course-task +# add the power law's exponent parameter PowerLaw.Exponent = 5 +[PowerLaw] +Exponent = 5.0 diff -ruN exercises/exercise-biomineralization/properties.hh exercises/solution/exercise-biomineralization/properties.hh ---- exercises/exercise-biomineralization/properties.hh 2025-03-03 11:38:57.413788851 +0100 -+++ exercises/solution/exercise-biomineralization/properties.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-biomineralization/properties.hh 2025-03-07 11:30:34.872192048 +0100 ++++ exercises/solution/exercise-biomineralization/properties.hh 2025-03-07 11:30:34.878192008 +0100 @@ -18,17 +18,20 @@ #include <dumux/discretization/cctpfa.hh> #include <dumux/porousmediumflow/2pncmin/model.hh> #include <dumux/porousmediumflow/problem.hh> -#include <dumux/material/components/simpleco2.hh> //!< Simplified CO2 component based on ideal gas law --// TODO: dumux-course-task 7 -+// TODO: dumux-course-task + // TODO: dumux-course-task 7: // include the CO2 component and tabulated values from DuMux -#include "solidsystems/biominsolidphase.hh" // The biomineralization solid system +#include <dumux/material/components/co2.hh> //!< CO2 component for use with tabulated values @@ -289,12 +259,9 @@ diff -ruN exercises/exercise-biomineralization/properties.hh exercises/solution/ namespace Properties { //! Create new type tag for the problem -@@ -52,9 +55,9 @@ - { - private: +@@ -54,7 +57,7 @@ using Scalar = GetPropType<TypeTag, Properties::Scalar>; -- // TODO: dumux-course-task 7 -+ // TODO: dumux-course-task + // TODO: dumux-course-task 7: // use the CO2 component with tabulated values - using CO2Impl = Components::SimpleCO2<Scalar>; + using CO2Impl = Components::CO2<Scalar, GeneratedCO2Tables::CO2Tables>; @@ -302,7 +269,7 @@ diff -ruN exercises/exercise-biomineralization/properties.hh exercises/solution/ public: using type = FluidSystems::BioMin<Scalar, CO2Impl, H2OType>; diff -ruN exercises/exercise-biomineralization/README.md exercises/solution/exercise-biomineralization/README.md ---- exercises/exercise-biomineralization/README.md 2025-03-04 10:55:49.676212309 +0100 +--- exercises/exercise-biomineralization/README.md 2025-03-07 10:34:20.578090053 +0100 +++ exercises/solution/exercise-biomineralization/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,257 +0,0 @@ -# Exercise Biomineralization (DuMuX Course) @@ -563,8 +530,8 @@ diff -ruN exercises/exercise-biomineralization/README.md exercises/solution/exer -output.CellData.append((S_gas_0-S_gas_1),'diffS_gas'); -``` diff -ruN exercises/exercise-biomineralization/solidsystems/biominsolidphase.hh exercises/solution/exercise-biomineralization/solidsystems/biominsolidphase.hh ---- exercises/exercise-biomineralization/solidsystems/biominsolidphase.hh 2025-02-26 11:38:46.803818101 +0100 -+++ exercises/solution/exercise-biomineralization/solidsystems/biominsolidphase.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-biomineralization/solidsystems/biominsolidphase.hh 2025-03-07 10:42:02.609882998 +0100 ++++ exercises/solution/exercise-biomineralization/solidsystems/biominsolidphase.hh 2025-03-07 10:42:02.618882942 +0100 @@ -15,12 +15,12 @@ #include <string> #include <dune/common/exceptions.hh> diff --git a/.patches/exercise-coupling-ff-pm/exercise-coupling-ff-pm.patch b/.patches/exercise-coupling-ff-pm/exercise-coupling-ff-pm.patch index c62102c7e7685eac0d76c80c0cab9d6823bc6d06..3bb7e017b3b438a925be8634de08ff259c73ee52 100644 --- a/.patches/exercise-coupling-ff-pm/exercise-coupling-ff-pm.patch +++ b/.patches/exercise-coupling-ff-pm/exercise-coupling-ff-pm.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/CMakeLists.txt exercises/solution/exercise-coupling-ff-pm/interface/CMakeLists.txt ---- exercises/exercise-coupling-ff-pm/interface/CMakeLists.txt 2025-02-26 11:38:46.803818101 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/interface/CMakeLists.txt 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-coupling-ff-pm/interface/CMakeLists.txt 2025-03-07 10:42:02.609882998 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/interface/CMakeLists.txt 2025-03-07 10:42:02.618882942 +0100 @@ -1,10 +1,30 @@ # SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder # SPDX-License-Identifier: GPL-3.0-or-later @@ -36,13 +36,13 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/CMakeLists.txt exercises/s # add a symlink for each input file add_input_file_links() diff -ruN exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh ---- exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh 2025-02-28 14:04:01.038375893 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh 2025-03-07 11:30:34.872192048 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh 2025-03-07 10:42:02.618882942 +0100 @@ -71,8 +71,7 @@ const auto& globalPos = scvf.dofPosition(); -- // TODO: dumux-course-task 1.A +- // TODO: dumux-course-task 1.A: - // Change the boundary conditions here as described in the exercise +#if EXNUMBER == 0 // flow from top to bottom if(onUpperBoundary_(globalPos)) @@ -73,13 +73,13 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh exer // coupling interface if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf)) { -- // TODO: dumux-course-task 1.C +- // TODO: dumux-course-task 1.C: - // set the Beaver-Joseph-Saffman slip condition for the tangential momentum balance equation, - // consider orientation of face automatically values.setCouplingNeumann(Indices::conti0EqIdx); +#if EXNUMBER < 3 values.setCouplingNeumann(Indices::momentumYBalanceIdx); -- // TODO: dumux-course-task 1.B +- // TODO: dumux-course-task 1.B: - // Replace Dirichlet BC with Beavers-Joseph-Saffman slip condition for the tangential momentum balance - values.setDirichlet(Indices::velocityXIdx); // assume no slip on interface +#else @@ -104,11 +104,11 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh exer PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const { PrimaryVariables values(0.0); -- // TODO: dumux-course-task 1.A +- // TODO: dumux-course-task 1.A: - // set a no-slip, no-flow condition at the top +#if EXNUMBER == 0 values[Indices::velocityYIdx] = -1e-6 * globalPos[0] * (this->gridGeometry().bBoxMax()[0] - globalPos[0]); -- // TODO: dumux-course-task 1.A +- // TODO: dumux-course-task 1.A: +#elif EXNUMBER == 4 + values[Indices::velocityXIdx] = 1e-6 * (globalPos[1] - this->gridGeometry().bBoxMin()[1]) + * (this->gridGeometry().bBoxMax()[1] - globalPos[1]); @@ -138,13 +138,13 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh exer } diff -ruN exercises/exercise-coupling-ff-pm/interface/main.cc exercises/solution/exercise-coupling-ff-pm/interface/main.cc ---- exercises/exercise-coupling-ff-pm/interface/main.cc 2025-02-26 11:38:46.803818101 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/interface/main.cc 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-coupling-ff-pm/interface/main.cc 2025-03-07 11:30:34.872192048 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/interface/main.cc 2025-03-07 10:42:02.618882942 +0100 @@ -52,9 +52,7 @@ using FreeflowTypeTag = Properties::TTag::FreeflowOneP; using PorousMediumTypeTag = Properties::TTag::PorousMediumFlowOneP; -- //TODO: dumux-course-task 1.C +- //TODO: dumux-course-task 1.C: - // ******************** comment-out this section for the last exercise **************** // - +#if EXNUMBER < 3 @@ -256,7 +256,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/main.cc exercises/solution StaggeredVtkOutputModule<FreeflowGridVariables, decltype(freeflowSol)> freeflowVtkWriter(*freeflowGridVariables, freeflowSol, freeflowName); GetPropType<FreeflowTypeTag, Properties::IOFields>::initOutputModule(freeflowVtkWriter); -- //TODO: dumux-course-task 1.B +- //TODO: dumux-course-task 1.B: - //****** uncomment the add analytical solution of v_x *****// - // freeflowVtkWriter.addField(freeflowProblem->getAnalyticalVelocityX(), "analyticalV_x"); +#if EXNUMBER >= 2 @@ -266,11 +266,11 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/main.cc exercises/solution using PorousMediumSolutionVector = GetPropType<PorousMediumTypeTag, Properties::SolutionVector>; VtkOutputModule<PorousMediumGridVariables, PorousMediumSolutionVector> porousMediumVtkWriter(*porousMediumGridVariables, diff -ruN exercises/exercise-coupling-ff-pm/interface/params.input exercises/solution/exercise-coupling-ff-pm/interface/params.input ---- exercises/exercise-coupling-ff-pm/interface/params.input 2025-02-28 13:50:32.335817360 +0100 +--- exercises/exercise-coupling-ff-pm/interface/params.input 2025-03-07 11:30:34.872192048 +0100 +++ exercises/solution/exercise-coupling-ff-pm/interface/params.input 2025-02-26 11:38:46.842816315 +0100 @@ -1,17 +1,14 @@ --# # TODO: dumux-course-task 1.C: uncomment the following group [Grid] --# # for dune-subgrid +-# TODO: dumux-course-task 1.C: uncomment the following group [Grid] + # for dune-subgrid -#[Grid] -#Positions0 = 0 1 -#Positions1 = 0 0.2 0.3 0.65 @@ -280,7 +280,6 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/params.input exercises/sol -#Amplitude = 0.04 # [m] -#Offset = 0.5 # [m] -#Scaling = 0.2 #[m] -+# for dune-subgrid +[Grid] +Positions0 = 0 1 +Positions1 = 0 0.2 0.3 0.65 @@ -306,13 +305,13 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/params.input exercises/sol Verbosity = true Positions0 = 0.0 1.0 diff -ruN exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh ---- exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh 2025-02-28 12:14:15.560013094 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh 2025-03-07 11:30:34.873192042 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh 2025-03-07 10:42:02.618882942 +0100 @@ -65,14 +65,13 @@ { BoundaryTypes values; -- // TODO: dumux-course-task 1.A +- // TODO: dumux-course-task 1.A: - // Set for all boundaries Neumann no-flow and keep the coupling conditions // set Neumann BCs to all boundaries first values.setAllNeumann(); @@ -326,13 +325,13 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh // set the coupling boundary condition at the interface if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf)) diff -ruN exercises/exercise-coupling-ff-pm/interface/properties.hh exercises/solution/exercise-coupling-ff-pm/interface/properties.hh ---- exercises/exercise-coupling-ff-pm/interface/properties.hh 2025-02-26 11:38:46.804818055 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/interface/properties.hh 2025-02-26 11:38:46.842816315 +0100 +--- exercises/exercise-coupling-ff-pm/interface/properties.hh 2025-03-07 11:30:34.873192042 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/interface/properties.hh 2025-03-07 10:42:02.618882942 +0100 @@ -16,9 +16,9 @@ #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh> --// TODO: dumux-course-task 1.C +-// TODO: dumux-course-task 1.C: -//****** uncomment for the last exercise *****// -// #include <dumux/io/grid/gridmanager_sub.hh> +#if EXNUMBER >= 3 @@ -345,7 +344,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/properties.hh exercises/so using Scalar = GetPropType<TypeTag, Properties::Scalar>; using TensorGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates<Scalar, dim> >; --// TODO: dumux-course-task 1.C +-// TODO: dumux-course-task 1.C: -//****** comment out for the last exercise *****// - // use "normal" grid +#if EXNUMBER < 3 // use "normal" grid @@ -366,7 +365,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/properties.hh exercises/so using Scalar = GetPropType<TypeTag, Properties::Scalar>; using TensorGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates<Scalar, dim> >; --// TODO: dumux-course-task 1.C +-// TODO: dumux-course-task 1.C: -//****** comment out for the last exercise *****// - // use "normal" grid +#if EXNUMBER < 3 // use "normal" grid @@ -384,7 +383,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/properties.hh exercises/so template<class TypeTag> diff -ruN exercises/exercise-coupling-ff-pm/interface/README.md exercises/solution/exercise-coupling-ff-pm/interface/README.md ---- exercises/exercise-coupling-ff-pm/interface/README.md 2025-03-04 10:55:49.676212309 +0100 +--- exercises/exercise-coupling-ff-pm/interface/README.md 2025-03-07 10:34:20.581090010 +0100 +++ exercises/solution/exercise-coupling-ff-pm/interface/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,175 +0,0 @@ -## 1. Changing the interface @@ -563,8 +562,8 @@ diff -ruN exercises/exercise-coupling-ff-pm/interface/README.md exercises/soluti -What changes to the left boundary conditions in the free-flow domain would you make to introduce this? What conditions can be enforced on the right boundary? -Hint: A relation between velocity and position is used for the vertical velocity component in the original form of the `dirichletAtPos` method. diff -ruN exercises/exercise-coupling-ff-pm/models/CMakeLists.txt exercises/solution/exercise-coupling-ff-pm/models/CMakeLists.txt ---- exercises/exercise-coupling-ff-pm/models/CMakeLists.txt 2025-02-26 11:38:46.804818055 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/models/CMakeLists.txt 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/models/CMakeLists.txt 2025-03-07 10:42:02.610882992 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/models/CMakeLists.txt 2025-03-07 10:42:02.618882942 +0100 @@ -1,9 +1,32 @@ # SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder # SPDX-License-Identifier: GPL-3.0-or-later @@ -603,8 +602,8 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/CMakeLists.txt exercises/solu + +dune_symlink_to_source_files(FILES "params_orig_a.input" "params_b_c.input" plotFluxes.py) diff -ruN exercises/exercise-coupling-ff-pm/models/main.cc exercises/solution/exercise-coupling-ff-pm/models/main.cc ---- exercises/exercise-coupling-ff-pm/models/main.cc 2025-02-26 11:38:46.804818055 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/models/main.cc 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/models/main.cc 2025-03-07 10:42:02.610882992 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/models/main.cc 2025-03-07 10:42:02.618882942 +0100 @@ -127,9 +127,15 @@ auto porousMediumGridVariables = std::make_shared<PorousMediumGridVariables>(porousMediumProblem, porousMediumFvGridGeometry); porousMediumGridVariables->init(sol[porousMediumIdx]); @@ -686,7 +685,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/params_b_c.input exercises/so +[Assembly] +NumericDifference.BaseEpsilon = 1e-8 diff -ruN exercises/exercise-coupling-ff-pm/models/params.input exercises/solution/exercise-coupling-ff-pm/models/params.input ---- exercises/exercise-coupling-ff-pm/models/params.input 2025-02-28 14:41:58.699499416 +0100 +--- exercises/exercise-coupling-ff-pm/models/params.input 2025-03-07 10:42:02.671882610 +0100 +++ exercises/solution/exercise-coupling-ff-pm/models/params.input 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -[TimeLoop] @@ -810,8 +809,8 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/params_orig_a.input exercises +[Assembly] +NumericDifference.BaseEpsilon = 1e-8 diff -ruN exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh ---- exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh 2025-02-26 11:38:46.804818055 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh 2025-03-07 11:30:34.873192042 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh 2025-03-07 10:42:02.619882935 +0100 @@ -52,10 +52,15 @@ // primary variable indices static constexpr int conti0EqIdx = Indices::conti0EqIdx; @@ -903,9 +902,9 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh exe PrimaryVariables values(0.0); values[pressureIdx] = freeflowPressure; -- // TODO: dumux-course-task 2.A +- // TODO: dumux-course-task 2.A: - // Declare here which phases are present. -- // TODO: dumux-course-task 2.C +- // TODO: dumux-course-task 2.C: - // Change initial condition to 2p system with liquid saturation of 0.1 +#if EXNUMBER >= 3 + values.setState(3/*bothPhases*/); @@ -933,20 +932,20 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh exe std::shared_ptr<CouplingManager> couplingManager_; diff -ruN exercises/exercise-coupling-ff-pm/models/properties.hh exercises/solution/exercise-coupling-ff-pm/models/properties.hh ---- exercises/exercise-coupling-ff-pm/models/properties.hh 2025-02-26 11:38:46.804818055 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/models/properties.hh 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/models/properties.hh 2025-03-07 11:30:34.873192042 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/models/properties.hh 2025-03-07 10:42:02.619882935 +0100 @@ -25,12 +25,14 @@ #include <dumux/discretization/cctpfa.hh> #include <dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh> --// TODO: dumux-course-task 2.A +-// TODO: dumux-course-task 2.A: -// Include 2pnc model here +#if EXNUMBER >= 1 +#include <dumux/porousmediumflow/2pnc/model.hh> +#include "../2pspatialparams.hh" +#else #include <dumux/porousmediumflow/1pnc/model.hh> --// TODO: dumux-course-task 2.A +-// TODO: dumux-course-task 2.A: -// Include spatial params for a 2-phase system #include "../1pspatialparams.hh" +#endif @@ -958,7 +957,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/properties.hh exercises/solut // Create new type tags namespace TTag { struct FreeflowNC { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; --// TODO: dumux-course-task 2.A +-// TODO: dumux-course-task 2.A: -// Change the inheritance such that the correct model is used. +#if EXNUMBER >= 1 +struct PorousMediumOnePNC { using InheritsFrom = std::tuple<TwoPNC, CCTpfaModel>; }; @@ -972,7 +971,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/properties.hh exercises/solut struct Problem<TypeTag, TTag::FreeflowNC> { using type = Dumux::FreeFlowSubProblem<TypeTag> ; }; // The fluid system --// TODO: dumux-course-task 2.A +-// TODO: dumux-course-task 2.A: -// Change to property of the `FluidSystem` such that `H2OAir` is used directly. template<class TypeTag> struct FluidSystem<TypeTag, TTag::PorousMediumOnePNC> @@ -990,7 +989,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/properties.hh exercises/solut struct EffectiveDiffusivityModel<TypeTag, TTag::PorousMediumOnePNC> { using type = DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>; }; --// TODO: dumux-course-task 2.A +-// TODO: dumux-course-task 2.A: -// Define new formulation for primary variables here. +#if EXNUMBER >= 1 +//! Set the default formulation to pw-Sn: This can be over written in the problem. @@ -1000,7 +999,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/models/properties.hh exercises/solut +#endif // Set the spatial parameters type --// TODO: dumux-course-task 2.A +-// TODO: dumux-course-task 2.A: -// Adapt the spatial params here. +#if EXNUMBER >= 1 +template<class TypeTag> @@ -1268,8 +1267,8 @@ diff -ruN exercises/exercise-coupling-ff-pm/README.md exercises/solution/exercis -* [**Exercise 2:** Changing the porous medium model](./models/README.md) -* [**Exercise 3:** Introducing a turbulence model in the free flow domain](./turbulence/README.md) diff -ruN exercises/exercise-coupling-ff-pm/turbulence/CMakeLists.txt exercises/solution/exercise-coupling-ff-pm/turbulence/CMakeLists.txt ---- exercises/exercise-coupling-ff-pm/turbulence/CMakeLists.txt 2025-02-26 11:38:46.804818055 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/turbulence/CMakeLists.txt 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/turbulence/CMakeLists.txt 2025-03-07 10:42:02.611882986 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/turbulence/CMakeLists.txt 2025-03-07 10:42:02.619882935 +0100 @@ -1,10 +1,33 @@ # SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder # SPDX-License-Identifier: GPL-3.0-or-later @@ -1308,8 +1307,8 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/CMakeLists.txt exercises/ # add a symlink for each input file add_input_file_links() diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh ---- exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh 2025-02-26 11:38:46.805818009 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh 2025-03-07 11:30:34.873192042 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh 2025-03-07 10:42:02.619882935 +0100 @@ -8,8 +8,8 @@ * \file * \brief The free-flow sub problem @@ -1325,7 +1324,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe #include <dumux/multidomain/boundary/stokesdarcy/couplingdata.hh> #include <dumux/freeflow/turbulencemodel.hh> --// TODO: dumux-course-task 3.A +-// TODO: dumux-course-task 3.A: -// Include headers for turbulence problem (rans) here. +#if EXNUMBER >= 1 +#include <dumux/freeflow/turbulenceproperties.hh> @@ -1341,7 +1340,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe * \brief The free-flow sub problem */ template <class TypeTag> --// TODO: dumux-course-task 3.A +-// TODO: dumux-course-task 3.A: -// Adapt the inheritance of the problem class. +#if EXNUMBER >= 1 +class FreeFlowSubProblem : public RANSProblem<TypeTag> @@ -1359,7 +1358,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: - // Change the boundary types to Dumux::RANSBoundaryTypes<ModelTraits, ModelTraits::numEq()> +#if EXNUMBER >= 1 + using BoundaryTypes = Dumux::RANSBoundaryTypes<ModelTraits, ModelTraits::numEq()>; @@ -1409,7 +1408,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe BoundaryTypes values; const auto& globalPos = scvf.center(); -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: - // set boundary conditions for the turbulence model primary variables k and \omega everywhere (outflow on right boundary, otherwise dirichlet) + +#if EXNUMBER >=1 @@ -1432,7 +1431,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe values.setDirichlet(Indices::energyEqIdx); } -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: - // set wall conditions for the turbulence model at the walls (values.setWall()) corresponding to the upper and lower boundary if (onLowerBoundary_(globalPos)) { @@ -1448,7 +1447,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe if (onUpperBoundary_(globalPos)) { -- // TODO: dumux-course-task 3.B +- // TODO: dumux-course-task 3.B: - // Replace all conditions here with symmetric BCs. +#if EXNUMBER >=2 + values.setAllSymmetry(); @@ -1473,9 +1472,9 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe const auto globalPos = scvf.ipGlobal(); PrimaryVariables values(initialAtPos(globalPos)); -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: - // Add dirichlet conditions setting TKE and Dissipation to zero on the upper and lower walls. -- // TODO: dumux-course-task 3.B +- // TODO: dumux-course-task 3.B: - // Remove the condition `onUpperBoundary_(globalPos)` here. - // if (onUpperBoundary_(globalPos) || onLowerBoundary_(globalPos)) - // { @@ -1503,7 +1502,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe values[Indices::velocityXIdx] = refVelocity(); values[Indices::temperatureIdx] = refTemperature(); -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: - // Set initial conditions for the TKE and the Dissipation. Values calculated in the constructor - // values[Indices::turbulentKineticEnergyIdx] = TODO??; - // values[Indices::dissipationIdx] = TODO??; @@ -1512,7 +1511,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe + values[Indices::dissipationIdx] = dissipation_; +#endif -- // TODO: dumux-course-task 3.B +- // TODO: dumux-course-task 3.B: - // Remove the condition `onUpperBoundary_(globalPos)` here. +#if EXNUMBER >= 2 + if(onLowerBoundary_(globalPos)) @@ -1525,17 +1524,17 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh exe return values; } diff -ruN exercises/exercise-coupling-ff-pm/turbulence/main.cc exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc ---- exercises/exercise-coupling-ff-pm/turbulence/main.cc 2025-02-26 11:38:46.805818009 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/turbulence/main.cc 2025-03-07 11:30:34.873192042 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc 2025-03-07 10:42:02.619882935 +0100 @@ -122,11 +122,12 @@ couplingManager->init(freeflowProblem, porousMediumProblem, sol); -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: +#if EXNUMBER >= 1 // Update static wall properties - -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: + freeflowProblem->updateStaticWallProperties(); // Update dynamic wall properties + freeflowProblem->updateDynamicWallProperties(freeflowSol); @@ -1547,7 +1546,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/main.cc exercises/solutio // make the new solution the old solution solOld = sol; -- // TODO: dumux-course-task 3.A +- // TODO: dumux-course-task 3.A: +#if EXNUMBER >= 1 // Update dynamic wall properties + freeflowProblem->updateDynamicWallProperties(freeflowSol); @@ -1708,7 +1707,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/params_c_d.input exercise +[RANS] +IsFlatWallBounded = True diff -ruN exercises/exercise-coupling-ff-pm/turbulence/params.input exercises/solution/exercise-coupling-ff-pm/turbulence/params.input ---- exercises/exercise-coupling-ff-pm/turbulence/params.input 2025-02-26 11:38:46.805818009 +0100 +--- exercises/exercise-coupling-ff-pm/turbulence/params.input 2025-03-07 11:30:34.874192035 +0100 +++ exercises/solution/exercise-coupling-ff-pm/turbulence/params.input 1970-01-01 01:00:00.000000000 +0100 @@ -1,73 +0,0 @@ -[TimeLoop] @@ -1718,13 +1717,13 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/params.input exercises/so - -[Freeflow.Grid] -Positions0 = 0.0 0.25 --# TODO: dumux-course-task 3.B - use only half of FF domain height +-# TODO: dumux-course-task 3.B: use only half of FF domain height -Positions1 = 0.25 0.5 --# TODO: dumux-course-task 3.C - refine towards interface +-# TODO: dumux-course-task 3.C: refine towards interface -Grading0 = 1.0 -Grading1 = 1.0 -Cells0 = 15 --# TODO: dumux-course-task 3.B - use only half of FF domain height and adapt cell number +-# TODO: dumux-course-task 3.B: use only half of FF domain height and adapt cell number -Cells1 = 20 -Verbosity = true - @@ -1733,7 +1732,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/params.input exercises/so -Positions1 = 0.0 0.25 -Cells0 = 15 -Cells1 = 10 --# TODO: dumux-course-task 3.C - refine towards interface +-# TODO: dumux-course-task 3.C: refine towards interface -Grading0 = 1.0 -Grading1 = 1.0 -Verbosity = true @@ -1861,8 +1860,8 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/params_orig_a.input exerc +[RANS] +IsFlatWallBounded = True diff -ruN exercises/exercise-coupling-ff-pm/turbulence/properties.hh exercises/solution/exercise-coupling-ff-pm/turbulence/properties.hh ---- exercises/exercise-coupling-ff-pm/turbulence/properties.hh 2025-02-26 11:38:46.805818009 +0100 -+++ exercises/solution/exercise-coupling-ff-pm/turbulence/properties.hh 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-coupling-ff-pm/turbulence/properties.hh 2025-03-07 11:30:34.874192035 +0100 ++++ exercises/solution/exercise-coupling-ff-pm/turbulence/properties.hh 2025-03-07 10:42:02.619882935 +0100 @@ -8,8 +8,8 @@ * \file * \brief The coupled exercise properties file or the turbulent case. @@ -1878,7 +1877,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/properties.hh exercises/s // Free-flow domain #include <dumux/discretization/staggered/freeflow/properties.hh> --// TODO: dumux-course-task 3.A +-// TODO: dumux-course-task 3.A: -// Include headers for compositional k-\omega SST turbulence model here. + +#if EXNUMBER >= 1 @@ -1893,7 +1892,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/properties.hh exercises/s // Create new type tags namespace TTag { struct PorousMediumFlowModel { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; }; --// TODO: dumux-course-task 3.A +-// TODO: dumux-course-task 3.A: -// Change the entry in the `FreeflowModel` definition accordingly. +#if EXNUMBER >= 1 +struct FreeflowModel { using InheritsFrom = std::tuple<SSTNCNI, StaggeredFreeFlowModel>; }; @@ -1904,7 +1903,7 @@ diff -ruN exercises/exercise-coupling-ff-pm/turbulence/properties.hh exercises/s // Set the coupling manager diff -ruN exercises/exercise-coupling-ff-pm/turbulence/README.md exercises/solution/exercise-coupling-ff-pm/turbulence/README.md ---- exercises/exercise-coupling-ff-pm/turbulence/README.md 2025-03-04 10:55:49.677212273 +0100 +--- exercises/exercise-coupling-ff-pm/turbulence/README.md 2025-03-07 10:34:20.583089982 +0100 +++ exercises/solution/exercise-coupling-ff-pm/turbulence/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,126 +0,0 @@ -## 3. Use a turbulence model in the free flow domain diff --git a/.patches/exercise-fluidsystem/exercise-fluidsystem.patch b/.patches/exercise-fluidsystem/exercise-fluidsystem.patch index a71e36d28e8c3c76998e921aed9ecac95a26b605..3fa03cc575f29053cace776821172e54d67d8dce 100644 --- a/.patches/exercise-fluidsystem/exercise-fluidsystem.patch +++ b/.patches/exercise-fluidsystem/exercise-fluidsystem.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-fluidsystem/2p2cproblem.hh exercises/solution/exercise-fluidsystem/2p2cproblem.hh ---- exercises/exercise-fluidsystem/2p2cproblem.hh 2025-02-26 11:38:46.805818009 +0100 -+++ exercises/solution/exercise-fluidsystem/2p2cproblem.hh 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-fluidsystem/2p2cproblem.hh 2025-03-07 10:42:02.611882986 +0100 ++++ exercises/solution/exercise-fluidsystem/2p2cproblem.hh 2025-03-07 10:42:02.619882935 +0100 @@ -12,7 +12,7 @@ #ifndef DUMUX_EXERCISE_FLUIDSYSTEM_B_PROBLEM_HH #define DUMUX_EXERCISE_FLUIDSYSTEM_B_PROBLEM_HH @@ -11,8 +11,8 @@ diff -ruN exercises/exercise-fluidsystem/2p2cproblem.hh exercises/solution/exerc #include <dumux/common/boundarytypes.hh> #include <dumux/common/properties.hh> diff -ruN exercises/exercise-fluidsystem/2pproperties.hh exercises/solution/exercise-fluidsystem/2pproperties.hh ---- exercises/exercise-fluidsystem/2pproperties.hh 2025-02-26 11:38:46.805818009 +0100 -+++ exercises/solution/exercise-fluidsystem/2pproperties.hh 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-fluidsystem/2pproperties.hh 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/2pproperties.hh 2025-03-07 10:42:02.619882935 +0100 @@ -25,15 +25,13 @@ #include "spatialparams.hh" @@ -52,7 +52,7 @@ diff -ruN exercises/exercise-fluidsystem/2pproperties.hh exercises/solution/exer public: using type = typename FluidSystems::TwoPImmiscible<Scalar, LiquidWaterPhase, LiquidMyComponentPhase>; diff -ruN exercises/exercise-fluidsystem/aparams.input exercises/solution/exercise-fluidsystem/aparams.input ---- exercises/exercise-fluidsystem/aparams.input 2025-02-27 11:12:28.808186516 +0100 +--- exercises/exercise-fluidsystem/aparams.input 2025-03-07 11:30:34.874192035 +0100 +++ exercises/solution/exercise-fluidsystem/aparams.input 2025-02-26 11:38:46.843816269 +0100 @@ -3,7 +3,7 @@ DtInitial = 10 # initial time step size [s] @@ -67,7 +67,7 @@ diff -ruN exercises/exercise-fluidsystem/aparams.input exercises/solution/exerci Cells = 60 60 # x-/y-resolution of the grid [Output] --# TODO Task 2.2: Set the plot density to true +-# TODO: dumux-course-task 2.2: set the plot density to true -PlotDensity = false # plot density over pressure for your component +PlotDensity = true # plot density over pressure for your component diff -ruN exercises/exercise-fluidsystem/bparams.input exercises/solution/exercise-fluidsystem/bparams.input @@ -83,8 +83,8 @@ diff -ruN exercises/exercise-fluidsystem/bparams.input exercises/solution/exerci [SpatialParams] BrooksCoreyPcEntry = 5.0e2 # [Pa] diff -ruN exercises/exercise-fluidsystem/CMakeLists.txt exercises/solution/exercise-fluidsystem/CMakeLists.txt ---- exercises/exercise-fluidsystem/CMakeLists.txt 2025-02-26 11:38:46.805818009 +0100 -+++ exercises/solution/exercise-fluidsystem/CMakeLists.txt 2025-02-26 11:38:46.843816269 +0100 +--- exercises/exercise-fluidsystem/CMakeLists.txt 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/CMakeLists.txt 2025-03-07 10:42:02.619882935 +0100 @@ -3,18 +3,16 @@ # executables for exercise part a & b @@ -111,8 +111,8 @@ diff -ruN exercises/exercise-fluidsystem/CMakeLists.txt exercises/solution/exerc -# add a symlink for the grids folder -dune_symlink_to_source_files(FILES grids) diff -ruN exercises/exercise-fluidsystem/components/mycompressiblecomponent.hh exercises/solution/exercise-fluidsystem/components/mycompressiblecomponent.hh ---- exercises/exercise-fluidsystem/components/mycompressiblecomponent.hh 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fluidsystem/components/mycompressiblecomponent.hh 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fluidsystem/components/mycompressiblecomponent.hh 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/components/mycompressiblecomponent.hh 2025-03-07 10:42:02.620882929 +0100 @@ -38,7 +38,7 @@ static std::string name() { return "MyCompressibleComponent"; } @@ -174,8 +174,8 @@ diff -ruN exercises/exercise-fluidsystem/components/mycompressiblecomponent.hh e }; diff -ruN exercises/exercise-fluidsystem/components/myincompressiblecomponent.hh exercises/solution/exercise-fluidsystem/components/myincompressiblecomponent.hh ---- exercises/exercise-fluidsystem/components/myincompressiblecomponent.hh 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fluidsystem/components/myincompressiblecomponent.hh 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fluidsystem/components/myincompressiblecomponent.hh 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/components/myincompressiblecomponent.hh 2025-03-07 10:42:02.620882929 +0100 @@ -48,10 +48,7 @@ */ static Scalar molarMass() @@ -214,7 +214,7 @@ diff -ruN exercises/exercise-fluidsystem/components/myincompressiblecomponent.hh diff -ruN exercises/exercise-fluidsystem/components/plotdensityfunction.py exercises/solution/exercise-fluidsystem/components/plotdensityfunction.py --- exercises/exercise-fluidsystem/components/plotdensityfunction.py 1970-01-01 01:00:00.000000000 +0100 -+++ exercises/solution/exercise-fluidsystem/components/plotdensityfunction.py 2025-02-26 11:38:46.844816223 +0100 ++++ exercises/solution/exercise-fluidsystem/components/plotdensityfunction.py 2025-03-07 10:42:02.620882929 +0100 @@ -0,0 +1,22 @@ +#!usr/bin/env python +# SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder @@ -239,8 +239,8 @@ diff -ruN exercises/exercise-fluidsystem/components/plotdensityfunction.py exerc +plt.semilogx(p, r) +plt.show() diff -ruN exercises/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent.hh exercises/solution/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent.hh ---- exercises/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent.hh 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent.hh 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent.hh 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent.hh 2025-03-07 10:42:02.620882929 +0100 @@ -20,10 +20,10 @@ #include <dumux/material/fluidsystems/base.hh> @@ -277,8 +277,8 @@ diff -ruN exercises/exercise-fluidsystem/fluidsystems/h2omycompressiblecomponent else { diff -ruN exercises/exercise-fluidsystem/main.cc exercises/solution/exercise-fluidsystem/main.cc ---- exercises/exercise-fluidsystem/main.cc 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fluidsystem/main.cc 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fluidsystem/main.cc 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/main.cc 2025-03-07 10:42:02.620882929 +0100 @@ -36,7 +36,7 @@ int main(int argc, char** argv) { @@ -304,7 +304,7 @@ diff -ruN exercises/exercise-fluidsystem/main.cc exercises/solution/exercise-flu using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); diff -ruN exercises/exercise-fluidsystem/README.md exercises/solution/exercise-fluidsystem/README.md ---- exercises/exercise-fluidsystem/README.md 2025-03-04 10:55:49.677212273 +0100 +--- exercises/exercise-fluidsystem/README.md 2025-03-07 10:34:20.584089967 +0100 +++ exercises/solution/exercise-fluidsystem/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,265 +0,0 @@ -# Exercise Fluidsystem (DuMuX Course) @@ -573,8 +573,8 @@ diff -ruN exercises/exercise-fluidsystem/README.md exercises/solution/exercise-f -./exercise_fluidsystem_b bparams.input -``` diff -ruN exercises/exercise-fluidsystem/spatialparams.hh exercises/solution/exercise-fluidsystem/spatialparams.hh ---- exercises/exercise-fluidsystem/spatialparams.hh 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fluidsystem/spatialparams.hh 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fluidsystem/spatialparams.hh 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fluidsystem/spatialparams.hh 2025-03-07 10:42:02.620882929 +0100 @@ -113,13 +113,17 @@ template<class FluidSystem> int wettingPhaseAtPos(const GlobalPosition& globalPos) const diff --git a/.patches/exercise-fractures/exercise-fractures.patch b/.patches/exercise-fractures/exercise-fractures.patch index a786a05bc906b85a867edaecb2ebefc04ca24f3f..e8f59ff444f7dc14ecb8d7feaac74cb4e94245df 100644 --- a/.patches/exercise-fractures/exercise-fractures.patch +++ b/.patches/exercise-fractures/exercise-fractures.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-fractures/CMakeLists.txt exercises/solution/exercise-fractures/CMakeLists.txt ---- exercises/exercise-fractures/CMakeLists.txt 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fractures/CMakeLists.txt 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fractures/CMakeLists.txt 2025-03-07 10:42:02.612882979 +0100 ++++ exercises/solution/exercise-fractures/CMakeLists.txt 2025-03-07 10:42:02.620882929 +0100 @@ -1,9 +1,26 @@ # SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder # SPDX-License-Identifier: GPL-3.0-or-later @@ -166,8 +166,8 @@ diff -ruN exercises/exercise-fractures/exercise_fractures_solution_c.input exerc +SpatialParams.Barrier.Snr = 0.0 +SpatialParams.Barrier.Swr = 0.0 diff -ruN exercises/exercise-fractures/fractureproblem.hh exercises/solution/exercise-fractures/fractureproblem.hh ---- exercises/exercise-fractures/fractureproblem.hh 2025-02-26 11:38:46.806817963 +0100 -+++ exercises/solution/exercise-fractures/fractureproblem.hh 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fractures/fractureproblem.hh 2025-03-07 11:30:34.874192035 +0100 ++++ exercises/solution/exercise-fractures/fractureproblem.hh 2025-03-07 10:42:02.620882929 +0100 @@ -59,6 +59,10 @@ std::shared_ptr<typename ParentType::SpatialParams> spatialParams, const std::string& paramGroup) @@ -185,7 +185,7 @@ diff -ruN exercises/exercise-fractures/fractureproblem.hh exercises/solution/exe - // However, there is one fracture reaching the top boundary. For this - // fracture tip we set Dirichlet Bcs as in the matrix domain -- // TODO dumux-course-task A +- // TODO: dumux-course-task A: - // Change boundary conditions - if (globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) - values.setAllDirichlet(); @@ -199,8 +199,8 @@ diff -ruN exercises/exercise-fractures/fractureproblem.hh exercises/solution/exe return values; } diff -ruN exercises/exercise-fractures/fracturespatialparams.hh exercises/solution/exercise-fractures/fracturespatialparams.hh ---- exercises/exercise-fractures/fracturespatialparams.hh 2025-03-03 10:33:05.767624826 +0100 -+++ exercises/solution/exercise-fractures/fracturespatialparams.hh 2025-02-26 11:38:46.844816223 +0100 +--- exercises/exercise-fractures/fracturespatialparams.hh 2025-03-07 11:30:34.874192035 +0100 ++++ exercises/solution/exercise-fractures/fracturespatialparams.hh 2025-03-07 10:42:02.620882929 +0100 @@ -41,6 +41,7 @@ using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -226,7 +226,7 @@ diff -ruN exercises/exercise-fractures/fracturespatialparams.hh exercises/soluti const SubControlVolume& scv, const ElementSolution& elemSol) const { -- // TODO dumux-course-task B/C +- // TODO: dumux-course-task B/C: - // Change fracture properties - return permeability_; + // in the unmodified state and exercise part a return the non-barrier parameters @@ -252,7 +252,7 @@ diff -ruN exercises/exercise-fractures/fracturespatialparams.hh exercises/soluti const SubControlVolume& scv, const ElementSolution& elemSol) const { -- // TODO dumux-course-task B/C +- // TODO: dumux-course-task B/C: - // Change fracture properties - return porosity_; + // in the unmodified state and exercise part a return the non-barrier parameters @@ -278,7 +278,7 @@ diff -ruN exercises/exercise-fractures/fracturespatialparams.hh exercises/soluti const SubControlVolume& scv, const ElementSolution& elemSol) const { -- // TODO dumux-course-task B/C +- // TODO: dumux-course-task B/C: - // Change fracture properties - return makeFluidMatrixInteraction(pcKrSwCurve_); + // in the unmodified state and exercise part a return the non-barrier parameters @@ -322,8 +322,8 @@ diff -ruN exercises/exercise-fractures/fracturespatialparams.hh exercises/soluti } // end namespace Dumux diff -ruN exercises/exercise-fractures/main.cc exercises/solution/exercise-fractures/main.cc ---- exercises/exercise-fractures/main.cc 2025-02-26 11:38:46.808817872 +0100 -+++ exercises/solution/exercise-fractures/main.cc 2025-02-26 11:38:46.845816177 +0100 +--- exercises/exercise-fractures/main.cc 2025-03-07 10:42:02.613882973 +0100 ++++ exercises/solution/exercise-fractures/main.cc 2025-03-07 10:42:02.620882929 +0100 @@ -245,4 +245,5 @@ Parameters::print(); @@ -331,8 +331,8 @@ diff -ruN exercises/exercise-fractures/main.cc exercises/solution/exercise-fract + }// end main diff -ruN exercises/exercise-fractures/matrixproblem.hh exercises/solution/exercise-fractures/matrixproblem.hh ---- exercises/exercise-fractures/matrixproblem.hh 2025-03-03 10:40:58.942820843 +0100 -+++ exercises/solution/exercise-fractures/matrixproblem.hh 2025-02-26 11:38:46.845816177 +0100 +--- exercises/exercise-fractures/matrixproblem.hh 2025-03-07 11:30:34.875192028 +0100 ++++ exercises/solution/exercise-fractures/matrixproblem.hh 2025-03-07 10:42:02.621882923 +0100 @@ -65,11 +65,18 @@ : ParentType(gridGeometry, spatialParams, paramGroup) , boundaryOverPressure_(getParamFromGroup<Scalar>(paramGroup, "Problem.BoundaryOverPressure")) @@ -358,7 +358,7 @@ diff -ruN exercises/exercise-fractures/matrixproblem.hh exercises/solution/exerc - // we consider buoancy-driven upwards migration of nitrogen and set - // Dirichlet BCs on the top and bottom boundary -- // TODO dumux-course-task A +- // TODO: dumux-course-task A: - // Change boundary conditions and Dirichlet values! - values.setAllNeumann(); - if (globalPos[1] < 1e-6 || globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) @@ -387,11 +387,11 @@ diff -ruN exercises/exercise-fractures/matrixproblem.hh exercises/solution/exerc // the interior boundary conditions to Dirichlet. // IMPORTANT: Note that you will never be asked to set any values at the interior boundaries! // This simply chooses a different interface condition! -- // TODO dumux-course-task B +- // TODO: dumux-course-task B: - // Change coupling conditions! values.setAllDirichlet(); -- // TODO dumux-course-task additional task +- // TODO: dumux-course-task additional task: - // Set interior boundary condition depending on the domain marker of the fracture domain elements! + if (isExercisePartB_) + values.setAllNeumann(); @@ -422,7 +422,7 @@ diff -ruN exercises/exercise-fractures/matrixproblem.hh exercises/solution/exerc auto values = initialAtPos(globalPos); - // nitrogen is in contact with the domain on the center half of the lower boundary -- // TODO dumux-course-task A +- // TODO: dumux-course-task A: - // Change boundary conditions and Dirichlet values! - if (globalPos[1] < 1e-6 && globalPos[0] > 25.0 && globalPos[0] < 75.0) - values[saturationIdx] = boundarySaturation_; @@ -457,8 +457,8 @@ diff -ruN exercises/exercise-fractures/matrixproblem.hh exercises/solution/exerc } // end namespace Dumux diff -ruN exercises/exercise-fractures/matrixspatialparams.hh exercises/solution/exercise-fractures/matrixspatialparams.hh ---- exercises/exercise-fractures/matrixspatialparams.hh 2025-02-26 11:38:46.808817872 +0100 -+++ exercises/solution/exercise-fractures/matrixspatialparams.hh 2025-02-26 11:38:46.845816177 +0100 +--- exercises/exercise-fractures/matrixspatialparams.hh 2025-03-07 10:42:02.613882973 +0100 ++++ exercises/solution/exercise-fractures/matrixspatialparams.hh 2025-03-07 10:42:02.621882923 +0100 @@ -40,6 +40,7 @@ using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -468,13 +468,13 @@ diff -ruN exercises/exercise-fractures/matrixspatialparams.hh exercises/solution public: diff -ruN exercises/exercise-fractures/params.input exercises/solution/exercise-fractures/params.input ---- exercises/exercise-fractures/params.input 2025-03-03 10:08:54.361892136 +0100 +--- exercises/exercise-fractures/params.input 2025-03-07 11:30:34.875192028 +0100 +++ exercises/solution/exercise-fractures/params.input 2025-02-26 11:38:46.845816177 +0100 @@ -4,8 +4,10 @@ MaxTimeStepSize = 2500 # [s] [Problem] --# TODO dumux-course-task A: switch off gravity +-# TODO: dumux-course-task A: switch off gravity EnableGravity = true +IsExercisePartA = false +IsExercisePartB = false @@ -497,7 +497,7 @@ diff -ruN exercises/exercise-fractures/params.input exercises/solution/exercise- SpatialParams.PermeabilityBarrier = 1e-16 SpatialParams.Porosity = 0.85 SpatialParams.PorosityBarrier = 0.05 --# TODO: set the VGAlpha parameter e.g. to 1e.5 and examine the nitrogen saturation in the fracture tips (then reset to 1e-1 again) +-# TODO: dumux-course-task: set the VGAlpha parameter e.g. to 1e.5 and examine the nitrogen saturation in the fracture tips (then reset to 1e-1 again) -SpatialParams.VanGenuchtenAlpha = 1e-1 -SpatialParams.VanGenuchtenN = 2 -SpatialParams.Swr = 0.0 @@ -514,8 +514,8 @@ diff -ruN exercises/exercise-fractures/params.input exercises/solution/exercise- +SpatialParams.Swr = 0.0 +SpatialParams.SwrBarrier = 0.0 diff -ruN exercises/exercise-fractures/properties.hh exercises/solution/exercise-fractures/properties.hh ---- exercises/exercise-fractures/properties.hh 2025-02-26 11:38:46.808817872 +0100 -+++ exercises/solution/exercise-fractures/properties.hh 2025-02-26 11:38:46.845816177 +0100 +--- exercises/exercise-fractures/properties.hh 2025-03-07 10:42:02.613882973 +0100 ++++ exercises/solution/exercise-fractures/properties.hh 2025-03-07 10:42:02.621882923 +0100 @@ -45,6 +45,7 @@ // with tpfa. #include <dumux/multidomain/facet/cellcentered/tpfa/properties.hh> @@ -534,7 +534,7 @@ diff -ruN exercises/exercise-fractures/properties.hh exercises/solution/exercise struct Grid<TypeTag, TTag::MatrixProblem> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>; }; template<class TypeTag> diff -ruN exercises/exercise-fractures/README.md exercises/solution/exercise-fractures/README.md ---- exercises/exercise-fractures/README.md 2025-03-04 10:55:49.677212273 +0100 +--- exercises/exercise-fractures/README.md 2025-03-07 11:30:34.874192035 +0100 +++ exercises/solution/exercise-fractures/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,216 +0,0 @@ -# Exercise Discrete Fractures (DuMuX Course) @@ -696,7 +696,7 @@ diff -ruN exercises/exercise-fractures/README.md exercises/solution/exercise-fra - // the interior boundary conditions to Dirichlet. - // IMPORTANT: Note that you will never be asked to set any values at the interior boundaries! - // This simply chooses a different interface condition! -- // TODO dumux-course-task C +- // TODO: dumux-course-task B: - // Change coupling conditions! - values.setAllDirichlet(); - diff --git a/.patches/exercise-grids/exercise-grids.patch b/.patches/exercise-grids/exercise-grids.patch index 57d8511dd6c8897f2f1ad1df1c07ec9962163fe5..1b66612384b7769f96dc343fe0922780895f51d0 100644 --- a/.patches/exercise-grids/exercise-grids.patch +++ b/.patches/exercise-grids/exercise-grids.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-grids/CMakeLists.txt exercises/solution/exercise-grids/CMakeLists.txt ---- exercises/exercise-grids/CMakeLists.txt 2025-02-26 11:38:46.808817872 +0100 -+++ exercises/solution/exercise-grids/CMakeLists.txt 2025-02-26 11:38:46.845816177 +0100 +--- exercises/exercise-grids/CMakeLists.txt 2025-03-07 10:42:02.613882973 +0100 ++++ exercises/solution/exercise-grids/CMakeLists.txt 2025-03-07 10:42:02.621882923 +0100 @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later @@ -55,8 +55,8 @@ diff -ruN exercises/exercise-grids/grids/grid_structured.geo exercises/solution/ -Transfinite Volume "*"; - diff -ruN exercises/exercise-grids/main.cc exercises/solution/exercise-grids/main.cc ---- exercises/exercise-grids/main.cc 2025-02-26 11:38:46.809817826 +0100 -+++ exercises/solution/exercise-grids/main.cc 2025-02-26 11:38:46.846816132 +0100 +--- exercises/exercise-grids/main.cc 2025-03-07 10:42:02.614882967 +0100 ++++ exercises/solution/exercise-grids/main.cc 2025-03-07 10:42:02.621882923 +0100 @@ -6,7 +6,7 @@ // /*! @@ -67,8 +67,8 @@ diff -ruN exercises/exercise-grids/main.cc exercises/solution/exercise-grids/mai #include <config.h> diff -ruN exercises/exercise-grids/params.input exercises/solution/exercise-grids/params.input ---- exercises/exercise-grids/params.input 2025-02-26 11:38:46.809817826 +0100 -+++ exercises/solution/exercise-grids/params.input 2025-02-26 11:38:46.846816132 +0100 +--- exercises/exercise-grids/params.input 2025-03-07 11:30:34.875192028 +0100 ++++ exercises/solution/exercise-grids/params.input 2025-03-07 11:30:34.878192008 +0100 @@ -3,13 +3,34 @@ TEnd = 3.154e9 # in seconds, i.e ten years @@ -78,11 +78,11 @@ diff -ruN exercises/exercise-grids/params.input exercises/solution/exercise-grid +# UpperRight = 60 40 +# Cells = 24 16 + - # TODO: Task 1: Globally refine your grid --# TODO: Task 2: Develop grid input parameters that can be split into zones + # TODO: dumux-course-task 1: Globally refine your grid +-# TODO: dumux-course-task 2: Develop grid input parameters that can be split into zones +# Refinement = 2 + -+# TODO: Task 2: Develop even grid input parameters that can be split into zones ++# TODO: dumux-course-task 2: Develop even grid input parameters that can be split into zones +# Positions0 = 0 60 +# Positions1 = 0 40 +# Cells0 = 24 @@ -90,9 +90,9 @@ diff -ruN exercises/exercise-grids/params.input exercises/solution/exercise-grid +# Grading0 = 1.0 +# Grading1 = 1.0 + - # TODO: Task 3: Using the zoning and grading parameters, redevelop your grid to optimize your refinement in the areas that matter. --# TODO: Task 4: Run your simulation with the provided structured grid file ./grids/grid_structured.msh --# TODO: Task 5: Run your simulation with the provided unstructured grid file ./grids/grid_unstructured.msh + # TODO: dumux-course-task 3: Using the zoning and grading parameters, redevelop your grid to optimize your refinement in the areas that matter. +-# TODO: dumux-course-task 4: Run your simulation with the provided structured grid file ./grids/grid_structured.msh +-# TODO: dumux-course-task 5: Run your simulation with the provided unstructured grid file ./grids/grid_unstructured.msh +Positions0 = 0 40 60 +Positions1 = 0 25 30 35 40 +Cells0 = 10 14 @@ -100,18 +100,18 @@ diff -ruN exercises/exercise-grids/params.input exercises/solution/exercise-grid +Grading0 = 1.0 -1.25 +Grading1 = 1.0 -1.2 1.2 1.0 + -+# TODO: Task 4: Run your simulation the provided structured grid file ./grids/grid_structured.msh ++# TODO: dumux-course-task 4: Run your simulation the provided structured grid file ./grids/grid_structured.msh +# File = ./grids/grid_structured.msh +# File = ./grids/grid_structured.dgf + -+# TODO: Task 5: Run your simulation the provided structured grid file ./grids/grid_unstructured.msh ++# TODO: dumux-course-task 5: Run your simulation the provided structured grid file ./grids/grid_unstructured.msh +#File = ./grids/grid_unstructured.msh [Problem] Name = grid_exercise diff -ruN exercises/exercise-grids/properties.hh exercises/solution/exercise-grids/properties.hh ---- exercises/exercise-grids/properties.hh 2025-02-26 11:38:46.809817826 +0100 -+++ exercises/solution/exercise-grids/properties.hh 2025-02-26 11:38:46.846816132 +0100 +--- exercises/exercise-grids/properties.hh 2025-03-07 11:30:34.875192028 +0100 ++++ exercises/solution/exercise-grids/properties.hh 2025-03-07 11:30:34.878192008 +0100 @@ -5,9 +5,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later // @@ -140,23 +140,23 @@ diff -ruN exercises/exercise-grids/properties.hh exercises/solution/exercise-gri +//Set the grid type +// template<class TypeTag> +// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; -+// TODO: Task 2: Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) ++// TODO: dumux-course-task 2: Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) template<class TypeTag> -struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; --// TODO: dumux-course-task 2 +-// TODO: dumux-course-task 2: -//Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) - --// TODO: dumux-course-task 4 +-// TODO: dumux-course-task 4: -// Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) +struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<double, 2> >; }; --// TODO: dumux-course-task 5 +-// TODO: dumux-course-task 5: -// Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) -+// TODO: Task 4: Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) ++// TODO: dumux-course-task 4: Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) +// template<class TypeTag> +// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; + -+// TODO: Task 5: Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) ++// TODO: dumux-course-task 5: Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) +// template<class TypeTag> +// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>; }; diff --git a/.patches/exercise-mainfile/exercise-mainfile.patch b/.patches/exercise-mainfile/exercise-mainfile.patch index e7d1e8d3f21e2ab1ec8b4004db31555a0d1f5c34..a3e6f128c7c5caf9413a54b0e5b5cde34bcd6449 100644 --- a/.patches/exercise-mainfile/exercise-mainfile.patch +++ b/.patches/exercise-mainfile/exercise-mainfile.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-mainfile/CMakeLists.txt exercises/solution/exercise-mainfile/CMakeLists.txt ---- exercises/exercise-mainfile/CMakeLists.txt 2025-02-26 11:38:46.809817826 +0100 -+++ exercises/solution/exercise-mainfile/CMakeLists.txt 2025-02-26 11:38:46.846816132 +0100 +--- exercises/exercise-mainfile/CMakeLists.txt 2025-03-07 10:42:02.614882967 +0100 ++++ exercises/solution/exercise-mainfile/CMakeLists.txt 2025-03-07 10:42:02.621882923 +0100 @@ -2,14 +2,9 @@ # SPDX-License-Identifier: GPL-3.0-or-later @@ -20,7 +20,7 @@ diff -ruN exercises/exercise-mainfile/CMakeLists.txt exercises/solution/exercise # add a symlink for each input file add_input_file_links() diff -ruN exercises/exercise-mainfile/exercise1pamain.cc exercises/solution/exercise-mainfile/exercise1pamain.cc ---- exercises/exercise-mainfile/exercise1pamain.cc 2025-02-26 11:38:46.809817826 +0100 +--- exercises/exercise-mainfile/exercise1pamain.cc 2025-03-07 11:30:34.875192028 +0100 +++ exercises/solution/exercise-mainfile/exercise1pamain.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,130 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -112,7 +112,7 @@ diff -ruN exercises/exercise-mainfile/exercise1pamain.cc exercises/solution/exer - - Dune::Timer timer; - -- // TODO: dumux-course-task 3 +- // TODO: dumux-course-task 3: - // Change the differentiation method to analytic by changing from DiffMethod::numeric to DiffMethod::analytic - - // the assembler for stationary problems @@ -155,7 +155,7 @@ diff -ruN exercises/exercise-mainfile/exercise1pamain.cc exercises/solution/exer -}// end main diff -ruN exercises/exercise-mainfile/exercise1pa_solution_main.cc exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc --- exercises/exercise-mainfile/exercise1pa_solution_main.cc 1970-01-01 01:00:00.000000000 +0100 -+++ exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc 2025-02-26 11:38:46.847816086 +0100 ++++ exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc 2025-03-07 11:30:34.878192008 +0100 @@ -0,0 +1,130 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: @@ -246,7 +246,7 @@ diff -ruN exercises/exercise-mainfile/exercise1pa_solution_main.cc exercises/sol + + Dune::Timer timer; + -+ // TODO: dumux-course-task 3 ++ // TODO: dumux-course-task 3: + // Change the differentiation method to analytic by changing from DiffMethod::numeric to DiffMethod::analytic + + // the assembler for stationary problems @@ -288,7 +288,7 @@ diff -ruN exercises/exercise-mainfile/exercise1pa_solution_main.cc exercises/sol + +}// end main diff -ruN exercises/exercise-mainfile/exercise1pbmain.cc exercises/solution/exercise-mainfile/exercise1pbmain.cc ---- exercises/exercise-mainfile/exercise1pbmain.cc 2025-02-26 11:38:46.810817780 +0100 +--- exercises/exercise-mainfile/exercise1pbmain.cc 2025-03-07 10:42:02.614882967 +0100 +++ exercises/solution/exercise-mainfile/exercise1pbmain.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,120 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -412,7 +412,7 @@ diff -ruN exercises/exercise-mainfile/exercise1pbmain.cc exercises/solution/exer - -}// end main diff -ruN exercises/exercise-mainfile/exercise1pcmain.cc exercises/solution/exercise-mainfile/exercise1pcmain.cc ---- exercises/exercise-mainfile/exercise1pcmain.cc 2025-02-26 11:38:46.810817780 +0100 +--- exercises/exercise-mainfile/exercise1pcmain.cc 2025-03-07 10:42:02.614882967 +0100 +++ exercises/solution/exercise-mainfile/exercise1pcmain.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,146 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -562,7 +562,7 @@ diff -ruN exercises/exercise-mainfile/exercise1pcmain.cc exercises/solution/exer - -}// end main diff -ruN exercises/exercise-mainfile/exercise_mainfile_a.input exercises/solution/exercise-mainfile/exercise_mainfile_a.input ---- exercises/exercise-mainfile/exercise_mainfile_a.input 2025-02-26 13:56:01.169864268 +0100 +--- exercises/exercise-mainfile/exercise_mainfile_a.input 2025-03-07 11:30:34.875192028 +0100 +++ exercises/solution/exercise-mainfile/exercise_mainfile_a.input 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -[Grid] @@ -582,7 +582,7 @@ diff -ruN exercises/exercise-mainfile/exercise_mainfile_a.input exercises/soluti - -[Assembly.NumericDifference] -PriVarMagnitude = 1e5 --# TODO: Task 3: Change BaseEpsilon to a smaller value 1e-15 +-# TODO: dumux-course-task 3: Change BaseEpsilon to a smaller value 1e-15 -BaseEpsilon = 1e-10 diff -ruN exercises/exercise-mainfile/exercise_mainfile_a_solution.input exercises/solution/exercise-mainfile/exercise_mainfile_a_solution.input --- exercises/exercise-mainfile/exercise_mainfile_a_solution.input 1970-01-01 01:00:00.000000000 +0100 @@ -653,12 +653,12 @@ diff -ruN exercises/exercise-mainfile/exercise_mainfile_c.input exercises/soluti -[Assembly.NumericDifference] -PriVarMagnitude = 1e5 diff -ruN exercises/exercise-mainfile/properties.hh exercises/solution/exercise-mainfile/properties.hh ---- exercises/exercise-mainfile/properties.hh 2025-02-26 11:38:46.810817780 +0100 -+++ exercises/solution/exercise-mainfile/properties.hh 2025-02-26 11:38:46.847816086 +0100 +--- exercises/exercise-mainfile/properties.hh 2025-03-07 11:30:34.875192028 +0100 ++++ exercises/solution/exercise-mainfile/properties.hh 2025-03-07 11:30:34.878192008 +0100 @@ -25,8 +25,8 @@ #include <dumux/porousmediumflow/1p/model.hh> - // TODO: dumux-course-task 3 + // TODO: dumux-course-task 3: -// uncomment the incompressiblelocalresidual which is a specialization of the standard immiscible localresidual for one phase incompressible cases and provides an analytic jacobian. -// #include <dumux/porousmediumflow/1p/incompressiblelocalresidual.hh> +// uncomment the incompressiblelocalresidual which is a specialization of the standard immisible localresidual for one phase incompressible cases and provides an analytic jacobian. @@ -668,7 +668,7 @@ diff -ruN exercises/exercise-mainfile/properties.hh exercises/solution/exercise- #include "1pproblem.hh" @@ -68,8 +68,8 @@ - // TODO: dumux-course-task 3 + // TODO: dumux-course-task 3: // set the OneP Incompressible local residual for the OnePIncompressible type tag. This provides an analytic jacobian to be used for the analytic solution. Change that by setting: -// template<class TypeTag> -// struct LocalResidual<TypeTag, TTag::OnePIncompressible> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; @@ -678,7 +678,7 @@ diff -ruN exercises/exercise-mainfile/properties.hh exercises/solution/exercise- // the fluid system for compressible tests diff -ruN exercises/exercise-mainfile/README.md exercises/solution/exercise-mainfile/README.md ---- exercises/exercise-mainfile/README.md 2025-03-04 10:55:49.677212273 +0100 +--- exercises/exercise-mainfile/README.md 2025-03-07 10:34:20.586089939 +0100 +++ exercises/solution/exercise-mainfile/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,196 +0,0 @@ -# Exercise Mainfiles (DuMuX course) diff --git a/.patches/exercise-model/exercise-model.patch b/.patches/exercise-model/exercise-model.patch index 1a7d07eaec995b937a63d9646dd0ab9722550f27..a84dc5827fa776b513b13586e8c569ab7ae2bd76 100644 --- a/.patches/exercise-model/exercise-model.patch +++ b/.patches/exercise-model/exercise-model.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-model/CMakeLists.txt exercises/solution/exercise-model/CMakeLists.txt ---- exercises/exercise-model/CMakeLists.txt 2025-02-26 11:38:46.810817780 +0100 -+++ exercises/solution/exercise-model/CMakeLists.txt 2025-02-26 11:38:46.847816086 +0100 +--- exercises/exercise-model/CMakeLists.txt 2025-03-07 10:42:02.615882961 +0100 ++++ exercises/solution/exercise-model/CMakeLists.txt 2025-03-07 10:42:02.621882923 +0100 @@ -3,5 +3,5 @@ dune_symlink_to_source_files(FILES images params.input) @@ -9,33 +9,31 @@ diff -ruN exercises/exercise-model/CMakeLists.txt exercises/solution/exercise-mo +dumux_add_test(NAME exercise_nonlineardiffusion_sol SOURCES main.cc) diff -ruN exercises/exercise-model/main.cc exercises/solution/exercise-model/main.cc ---- exercises/exercise-model/main.cc 2025-02-28 10:53:32.830702341 +0100 -+++ exercises/solution/exercise-model/main.cc 2025-02-26 11:38:46.847816086 +0100 -@@ -29,7 +29,7 @@ - #include <dumux/nonlinear/newtonsolver.hh> +--- exercises/exercise-model/main.cc 2025-03-07 11:30:34.876192021 +0100 ++++ exercises/solution/exercise-model/main.cc 2025-03-07 11:30:34.878192008 +0100 +@@ -30,6 +30,7 @@ #include <dumux/assembly/fvassembler.hh> --// TODO Task 3.1: Include the header model.hh + // TODO: dumux-course-task 3.1: include the header model.hh +#include "model.hh" /*! * \ingroup NonlinearDiffusion -@@ -79,8 +79,8 @@ +@@ -79,8 +80,8 @@ struct NonlinearDiffusionTest { -- // TODO Task 3.1: We need to set our model by replacing ModelTypeTag +- // TODO: dumux-course-task 3.1: we need to set our model by replacing ModelTypeTag - using InheritsFrom = std::tuple</*ModelTypeTag,*/BoxModel>; -+ // TODO: We need to set our model by replacing ModelTypeTag ++ // TODO: dumux-course-task 3.1: We need to set our model by replacing ModelTypeTag + using InheritsFrom = std::tuple<NonlinearDiffusionModel, BoxModel>; using Scalar = double; using Grid = Dune::YaspGrid<2>; -@@ -138,63 +138,62 @@ - // the problem for the boundary conditions, a solution vector and a grid variables instance. +@@ -139,62 +140,62 @@ auto gridGeometry = std::make_shared<GridGeometry>(gridManager.grid().leafGridView()); -- // TODO Task 3.2: Uncomment when the model is implemented + // TODO: dumux-course-task 3.2: uncomment when the model is implemented - // using Scalar = GetPropType<TypeTag, Properties::Scalar>; - // using Problem = GetPropType<TypeTag, Properties::Problem>; - // using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; @@ -150,7 +148,7 @@ diff -ruN exercises/exercise-model/main.cc exercises/solution/exercise-model/mai }// end main diff -ruN exercises/exercise-model/model.hh exercises/solution/exercise-model/model.hh --- exercises/exercise-model/model.hh 1970-01-01 01:00:00.000000000 +0100 -+++ exercises/solution/exercise-model/model.hh 2025-02-26 11:38:46.847816086 +0100 ++++ exercises/solution/exercise-model/model.hh 2025-03-07 10:42:02.622882916 +0100 @@ -0,0 +1,210 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: @@ -363,7 +361,7 @@ diff -ruN exercises/exercise-model/model.hh exercises/solution/exercise-model/mo + +#endif diff -ruN exercises/exercise-model/README.md exercises/solution/exercise-model/README.md ---- exercises/exercise-model/README.md 2025-03-04 10:55:49.677212273 +0100 +--- exercises/exercise-model/README.md 2025-03-07 11:30:34.876192021 +0100 +++ exercises/solution/exercise-model/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,195 +0,0 @@ -# Exercise Model (DuMuX course) @@ -453,7 +451,7 @@ diff -ruN exercises/exercise-model/README.md exercises/solution/exercise-model/R - -struct NonlinearDiffusionTest -{ -- // TODO: Set new model by replacing ModelTypeTag +- // TODO: dumux-course-task 3.1: Set new model by replacing ModelTypeTag - using InheritsFrom = std::tuple</*ModelTypeTag,*/BoxModel>; - - // Further property definitions diff --git a/.patches/exercise-properties/exercise-properties.patch b/.patches/exercise-properties/exercise-properties.patch index 12096d276204d999eefd34a0251e0a637c71b2a8..05a072c2551e767ba960617e4356c96b65914974 100644 --- a/.patches/exercise-properties/exercise-properties.patch +++ b/.patches/exercise-properties/exercise-properties.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-properties/CMakeLists.txt exercises/solution/exercise-properties/CMakeLists.txt ---- exercises/exercise-properties/CMakeLists.txt 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-properties/CMakeLists.txt 2025-02-26 11:38:46.847816086 +0100 +--- exercises/exercise-properties/CMakeLists.txt 2025-03-07 10:42:02.615882961 +0100 ++++ exercises/solution/exercise-properties/CMakeLists.txt 2025-03-07 10:42:02.622882916 +0100 @@ -1,8 +1,8 @@ # SPDX-FileCopyrightText: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder # SPDX-License-Identifier: GPL-3.0-or-later @@ -13,13 +13,13 @@ diff -ruN exercises/exercise-properties/CMakeLists.txt exercises/solution/exerci # add a symlink for each input file diff -ruN exercises/exercise-properties/mylocalresidual.hh exercises/solution/exercise-properties/mylocalresidual.hh ---- exercises/exercise-properties/mylocalresidual.hh 2025-03-04 10:55:49.677212273 +0100 -+++ exercises/solution/exercise-properties/mylocalresidual.hh 2025-03-04 10:55:49.677212273 +0100 +--- exercises/exercise-properties/mylocalresidual.hh 2025-03-07 11:30:34.876192021 +0100 ++++ exercises/solution/exercise-properties/mylocalresidual.hh 2025-03-07 10:42:02.622882916 +0100 @@ -59,8 +59,6 @@ * \note The volVars can be different to allow computing * the implicit euler time derivative here */ -- // TODO: dumux-course-task 3 +- // TODO: dumux-course-task 3: - // Eliminate density from the storage term NumEqVector computeStorage(const Problem& problem, const SubControlVolume& scv, @@ -36,7 +36,7 @@ diff -ruN exercises/exercise-properties/mylocalresidual.hh exercises/solution/ex * \param scvf The sub control volume face to compute the flux on * \param elemFluxVarsCache The cache related to flux computation */ -- // TODO: dumux-course-task +- // TODO: dumux-course-task 3: - // Eliminate the density from the flux term NumEqVector computeFlux(const Problem& problem, const Element& element, @@ -51,8 +51,8 @@ diff -ruN exercises/exercise-properties/mylocalresidual.hh exercises/solution/ex auto eqIdx = conti0EqIdx + phaseIdx; flux[eqIdx] = fluxVars.advectiveFlux(phaseIdx, upwindTerm); diff -ruN exercises/exercise-properties/problem.hh exercises/solution/exercise-properties/problem.hh ---- exercises/exercise-properties/problem.hh 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-properties/problem.hh 2025-02-26 11:38:46.847816086 +0100 +--- exercises/exercise-properties/problem.hh 2025-03-07 11:30:34.876192021 +0100 ++++ exercises/solution/exercise-properties/problem.hh 2025-03-07 10:42:02.622882916 +0100 @@ -11,6 +11,7 @@ #ifndef DUMUX_INCOMPRESSIBLE_TWOP_TEST_PROBLEM_HH #define DUMUX_INCOMPRESSIBLE_TWOP_TEST_PROBLEM_HH @@ -65,7 +65,7 @@ diff -ruN exercises/exercise-properties/problem.hh exercises/solution/exercise-p */ NumEqVector neumannAtPos(const GlobalPosition &globalPos) const { --// TODO: reformulate the neumann boundary condition's values in terms of volume instead of mass injected per meter and second +-// TODO: dumux-course-task 3: reformulate the neumann boundary condition's values in terms of volume instead of mass injected per meter and second NumEqVector values(0.0); if (onInlet_(globalPos)) - values[contiDNAPLEqIdx] = -0.04; // kg / (m * s) @@ -77,14 +77,14 @@ diff -ruN exercises/exercise-properties/problem.hh exercises/solution/exercise-p return values; } diff -ruN exercises/exercise-properties/properties.hh exercises/solution/exercise-properties/properties.hh ---- exercises/exercise-properties/properties.hh 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-properties/properties.hh 2025-02-26 11:38:46.848816040 +0100 +--- exercises/exercise-properties/properties.hh 2025-03-07 11:30:34.876192021 +0100 ++++ exercises/solution/exercise-properties/properties.hh 2025-03-07 10:42:02.622882916 +0100 @@ -27,9 +27,7 @@ #include "spatialparams.hh" #include "problem.hh" - --// TODO: dumux-course-task 3 +-// TODO: dumux-course-task 3: -// Include the local residual header +#include "mylocalresidual.hh" @@ -94,7 +94,7 @@ diff -ruN exercises/exercise-properties/properties.hh exercises/solution/exercis template<class TypeTag> struct Problem<TypeTag, TTag::TwoPIncompressible> { using type = TwoPTestProblem<TypeTag>; }; --// TODO: dumux-course-task 3 +-// TODO: dumux-course-task 3: -// Use MyLocalResidual as LocalResidual - +template<class TypeTag> diff --git a/.patches/exercise-runtimeparams/exercise-runtimeparams.patch b/.patches/exercise-runtimeparams/exercise-runtimeparams.patch index e2eaa5a58b9bd8d8726d32a75828184a5030082f..cd9047c6185ba7dc10c34daf45a56e3b86299a50 100644 --- a/.patches/exercise-runtimeparams/exercise-runtimeparams.patch +++ b/.patches/exercise-runtimeparams/exercise-runtimeparams.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-runtimeparams/CMakeLists.txt exercises/solution/exercise-runtimeparams/CMakeLists.txt ---- exercises/exercise-runtimeparams/CMakeLists.txt 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-runtimeparams/CMakeLists.txt 2025-02-26 11:38:46.848816040 +0100 +--- exercises/exercise-runtimeparams/CMakeLists.txt 2025-03-07 10:42:02.616882954 +0100 ++++ exercises/solution/exercise-runtimeparams/CMakeLists.txt 2025-03-07 10:42:02.622882916 +0100 @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later @@ -11,37 +11,37 @@ diff -ruN exercises/exercise-runtimeparams/CMakeLists.txt exercises/solution/exe # add a symlink for each input file diff -ruN exercises/exercise-runtimeparams/params.input exercises/solution/exercise-runtimeparams/params.input ---- exercises/exercise-runtimeparams/params.input 2025-02-26 14:09:24.762108833 +0100 -+++ exercises/solution/exercise-runtimeparams/params.input 2025-02-26 11:38:46.848816040 +0100 +--- exercises/exercise-runtimeparams/params.input 2025-03-07 11:30:34.876192021 +0100 ++++ exercises/solution/exercise-runtimeparams/params.input 2025-03-07 11:30:34.878192008 +0100 @@ -12,12 +12,12 @@ AquiferDepth = 2700.0 # m InjectionDuration = 2.628e6 # in seconds, i.e. one month - # TODO: Task 2: Create a parameter called "TotalAreaSpecificInflow" --# TODO: Task 3: Run the case with and without a provided value in the input file for "TotalAreaSpecificInflow" + # TODO: dumux-course-task 2: Create a parameter called "TotalAreaSpecificInflow" +-# TODO: dumux-course-task 3: Run the case with and without a provided value in the input file for "TotalAreaSpecificInflow" +TotalAreaSpecificInflow = -1e-4 # kg/(s m^2) [SpatialParams] PermeabilityAquitard = 1e-15 # m^2 - # TODO: Task 1: Change the Aquitard's Entry Pressure + # TODO: dumux-course-task 1: Change the Aquitard's Entry Pressure -Aquitard.BrooksCoreyPcEntry = 4.5e4 # Pa +Aquitard.BrooksCoreyPcEntry = 4.5e3 # Pa Aquitard.BrooksCoreyLambda = 2.0 Aquitard.Swr = 0.2 Aquitard.Snr = 0.0 diff -ruN exercises/exercise-runtimeparams/problem.hh exercises/solution/exercise-runtimeparams/problem.hh ---- exercises/exercise-runtimeparams/problem.hh 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-runtimeparams/problem.hh 2025-02-26 11:38:46.848816040 +0100 +--- exercises/exercise-runtimeparams/problem.hh 2025-03-07 11:30:34.877192015 +0100 ++++ exercises/solution/exercise-runtimeparams/problem.hh 2025-03-07 11:30:34.879192001 +0100 @@ -81,12 +81,16 @@ injectionDuration_ = getParamFromGroup<Scalar>("Problem","InjectionDuration"); - // TODO: dumux-course-task 2 + // TODO: dumux-course-task 2: // Set a variable "TotalAreaSpecificInflow" to read in a value from the parameter tree via the input file - + totalAreaSpecificInflow_ = getParam<Scalar>("Problem.TotalAreaSpecificInflow"); - // TODO: dumux-course-task 3 + // TODO: dumux-course-task 3: // Set a default value for the above parameter. - + // totalAreaSpecificInflow_ = getParam<Scalar>("Problem.TotalAreaSpecificInflow", -1e-4); - // TODO: dumux-course-task 4 + // TODO: dumux-course-task 4: // Provide output describing where the parameter value comes from using parameter bool functions. + // if (hasParamInGroup("Problem","TotalAreaSpecificInflow")) + // std::cout << "Parameter value is read from the input file." << std::endl; @@ -52,7 +52,7 @@ diff -ruN exercises/exercise-runtimeparams/problem.hh exercises/solution/exercis @@ -149,7 +153,7 @@ // units kg/(s*m^2) - // TODO: dumux-course-task 2 + // TODO: dumux-course-task 2: // Incorporate "totalAreaSpecificInflow_" into the injection boundary condition - values[Indices::conti0EqIdx + FluidSystem::N2Idx]= -1e-4; + values[Indices::conti0EqIdx + FluidSystem::N2Idx] = totalAreaSpecificInflow_; @@ -61,15 +61,15 @@ diff -ruN exercises/exercise-runtimeparams/problem.hh exercises/solution/exercis @@ -204,6 +208,7 @@ Scalar injectionDuration_; //! Duration of the injection in seconds - // TODO: dumux-course-task 2 + // TODO: dumux-course-task 2: // Set a variable "totalAreaSpecificInflow_" to read in a value from the parameter tree via the input file + Scalar totalAreaSpecificInflow_; //! Rate of the Injection in kg/(s m^2) Scalar time_; }; diff -ruN exercises/exercise-runtimeparams/properties.hh exercises/solution/exercise-runtimeparams/properties.hh ---- exercises/exercise-runtimeparams/properties.hh 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-runtimeparams/properties.hh 2025-02-26 11:38:46.848816040 +0100 +--- exercises/exercise-runtimeparams/properties.hh 2025-03-07 10:42:02.616882954 +0100 ++++ exercises/solution/exercise-runtimeparams/properties.hh 2025-03-07 10:42:02.623882910 +0100 @@ -58,6 +58,6 @@ FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true> >; }; @@ -254,8 +254,8 @@ diff -ruN exercises/exercise-runtimeparams/README.md exercises/solution/exercise - -* > __Task 4__: Using one of the bool `hasParam` functions, place an output in the problem file to alert the user where the parameter value comes from. diff -ruN exercises/exercise-runtimeparams/spatialparams.hh exercises/solution/exercise-runtimeparams/spatialparams.hh ---- exercises/exercise-runtimeparams/spatialparams.hh 2025-02-26 11:38:46.811817734 +0100 -+++ exercises/solution/exercise-runtimeparams/spatialparams.hh 2025-02-26 11:38:46.848816040 +0100 +--- exercises/exercise-runtimeparams/spatialparams.hh 2025-03-07 10:42:02.616882954 +0100 ++++ exercises/solution/exercise-runtimeparams/spatialparams.hh 2025-03-07 10:42:02.623882910 +0100 @@ -12,8 +12,8 @@ * fully implicit model. */