Skip to content
Snippets Groups Projects
Commit 5de8a84b authored by Martin Schneider's avatar Martin Schneider
Browse files

[params] Update patch

parent ade0be3d
No related branches found
No related tags found
1 merge request!258[params] Update patch
Pipeline #46972 passed
Pipeline: dumux-course

#46974

    diff -ruN exercises/exercise-runtimeparams/CMakeLists.txt exercises/solution/exercise-runtimeparams/CMakeLists.txt
    --- exercises/exercise-runtimeparams/CMakeLists.txt 2024-07-08 09:06:59.589159960 +0200
    +++ exercises/solution/exercise-runtimeparams/CMakeLists.txt 2024-07-08 09:06:59.617159848 +0200
    --- exercises/exercise-runtimeparams/CMakeLists.txt 2023-03-31 13:48:56.162686698 +0200
    +++ exercises/solution/exercise-runtimeparams/CMakeLists.txt 2023-03-31 13:48:56.186686600 +0200
    @@ -1,5 +1,5 @@
    # the runtime parameter exercise simulation program
    -dumux_add_test(NAME exercise_runtimeparams
    ......@@ -9,8 +9,8 @@ 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 2024-07-08 09:06:59.589159960 +0200
    +++ exercises/solution/exercise-runtimeparams/params.input 2024-07-08 09:06:59.617159848 +0200
    --- exercises/exercise-runtimeparams/params.input 2023-03-31 13:48:56.162686698 +0200
    +++ exercises/solution/exercise-runtimeparams/params.input 2023-03-31 13:48:56.186686600 +0200
    @@ -12,11 +12,12 @@
    AquiferDepth = 2700.0 # m
    InjectionDuration = 2.628e6 # in seconds, i.e. one month
    ......@@ -31,27 +31,22 @@ diff -ruN exercises/exercise-runtimeparams/params.input exercises/solution/exerc
    Aquifer.Swr = 0.2
    -Aquifer.Snr = 0.0
    +Aquifer.Snr = 0.0
    \ Kein Zeilenumbruch am Dateiende.
    \ No newline at end of file
    diff -ruN exercises/exercise-runtimeparams/problem.hh exercises/solution/exercise-runtimeparams/problem.hh
    --- exercises/exercise-runtimeparams/problem.hh 2024-07-08 09:06:59.589159960 +0200
    +++ exercises/solution/exercise-runtimeparams/problem.hh 2024-07-08 09:06:59.617159848 +0200
    @@ -91,14 +91,15 @@
    aquiferDepth_ = getParam<Scalar>("Problem.AquiferDepth");
    // the duration of the injection, units: second
    --- exercises/exercise-runtimeparams/problem.hh 2024-07-16 17:37:37.476023284 +0200
    +++ exercises/solution/exercise-runtimeparams/problem.hh 2024-07-16 17:37:37.476023284 +0200
    @@ -93,12 +93,16 @@
    injectionDuration_ = getParamFromGroup<Scalar>("Problem","InjectionDuration");
    - // TODO: dumux-course-task 2
    - // Set a variable "TotalAreaSpecificInflow" to read in a value from the parameter tree via the input file
    -
    - // TODO: dumux-course-task 3
    - // Set a default value for the above parameter.
    // TODO: dumux-course-task 2
    // Set a variable "TotalAreaSpecificInflow" to read in a value from the parameter tree via the input file
    -
    - // TODO: dumux-course-task 4
    - // Provide output describing where the parameter value comes from using parameter bool functions.
    + //TODO: 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: Task 3: Set a default value for the above parameter.
    // TODO: dumux-course-task 3
    // Set a default value for the above parameter.
    -
    + // totalAreaSpecificInflow_ = getParam<Scalar>("Problem.TotalAreaSpecificInflow", -1e-4);
    + //TODO: Task 4: Provide output describing where the parameter value comes from using parameter bool functions.
    // 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;
    + // else
    ......@@ -59,32 +54,26 @@ diff -ruN exercises/exercise-runtimeparams/problem.hh exercises/solution/exercis
    }
    @@ -160,9 +161,8 @@
    {
    // inject nitrogen. negative values mean injection
    @@ -161,7 +165,7 @@
    // units kg/(s*m^2)
    - // TODO: dumux-course-task 2
    - // Incorporate "totalAreaSpecificInflow_" into the injection boundary condition
    - values[Indices::conti0EqIdx + FluidSystem::N2Idx]= -1e-4/FluidSystem::molarMass(FluidSystem::N2Idx);
    + //TODO: Task 2: incorporate "totalAreaSpecificInflow_" into the injection boundary condition
    + values[Indices::conti0EqIdx + FluidSystem::N2Idx] = totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::N2Idx);
    // 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_;
    values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
    }
    @@ -203,8 +203,8 @@
    std::string name_; //! Problem name
    Scalar aquiferDepth_; //! Depth of the aquifer in m
    @@ -216,6 +220,7 @@
    Scalar injectionDuration_; //! Duration of the injection in seconds
    - // TODO: dumux-course-task 2
    - // Set a variable "totalAreaSpecificInflow_" to read in a value from the parameter tree via the input file
    + //TODO: Task 2: Set a variable "totalAreaSpecificInflow_" to read in a value from the parameter tree via the input file
    // 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 2024-07-08 09:06:59.589159960 +0200
    +++ exercises/solution/exercise-runtimeparams/properties.hh 2024-07-08 09:06:59.617159848 +0200
    --- exercises/exercise-runtimeparams/properties.hh 2023-03-31 13:48:56.162686698 +0200
    +++ exercises/solution/exercise-runtimeparams/properties.hh 2023-03-31 13:48:56.186686600 +0200
    @@ -70,6 +70,6 @@
    FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true> >;
    };
    ......@@ -94,7 +83,7 @@ diff -ruN exercises/exercise-runtimeparams/properties.hh exercises/solution/exer
    #endif
    diff -ruN exercises/exercise-runtimeparams/README.md exercises/solution/exercise-runtimeparams/README.md
    --- exercises/exercise-runtimeparams/README.md 2024-07-08 09:06:59.589159960 +0200
    --- exercises/exercise-runtimeparams/README.md 2024-07-16 17:37:37.476023284 +0200
    +++ exercises/solution/exercise-runtimeparams/README.md 1970-01-01 01:00:00.000000000 +0100
    @@ -1,171 +0,0 @@
    -# Exercise Runtime Parameters (DuMuX course)
    ......@@ -268,83 +257,9 @@ diff -ruN exercises/exercise-runtimeparams/README.md exercises/solution/exercise
    -Using these functions we can better check which parameter values are being included in our program.
    -
    -* > __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/params.input exercises/solution/exercise-runtimeparams/params.input
    --- exercises/exercise-runtimeparams/params.input 2024-02-08 11:19:46.419932806 +0100
    +++ exercises/solution/exercise-runtimeparams/params.input 2024-02-08 11:19:46.449932806 +0100
    @@ -12,11 +12,12 @@
    AquiferDepth = 2700.0 # m
    InjectionDuration = 2.628e6 # in seconds, i.e. one month
    # TODO: Task 2: Create a parameter called "TotalAreaSpecificInflow"
    +TotalAreaSpecificInflow = -1e-4 # kg/(s m^2)
    [SpatialParams]
    PermeabilityAquitard = 1e-15 # m^2
    # TODO: 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
    @@ -24,4 +25,4 @@
    Aquifer.BrooksCoreyPcEntry = 1e4 # Pa
    Aquifer.BrooksCoreyLambda = 2.0
    Aquifer.Swr = 0.2
    -Aquifer.Snr = 0.0
    +Aquifer.Snr = 0.0
    \ No newline at end of file
    diff -ruN exercises/exercise-runtimeparams/problem.hh exercises/solution/exercise-runtimeparams/problem.hh
    --- exercises/exercise-runtimeparams/problem.hh 2024-07-16 14:19:19.027763434 +0200
    +++ exercises/solution/exercise-runtimeparams/problem.hh 2024-07-16 14:19:19.027763434 +0200
    @@ -93,12 +93,16 @@
    injectionDuration_ = getParamFromGroup<Scalar>("Problem","InjectionDuration");
    // 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
    // Set a default value for the above parameter.
    -
    + // totalAreaSpecificInflow_ = getParam<Scalar>("Problem.TotalAreaSpecificInflow", -1e-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;
    + // else
    + // std::cout << "Using the default parameter value." << std::endl;
    }
    @@ -161,7 +165,7 @@
    // units kg/(s*m^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_;
    values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
    }
    @@ -216,6 +220,7 @@
    Scalar injectionDuration_; //! Duration of the injection in seconds
    // 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 2024-02-08 11:19:46.419932806 +0100
    +++ exercises/solution/exercise-runtimeparams/properties.hh 2024-02-08 11:19:46.449932806 +0100
    @@ -70,6 +70,6 @@
    FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true> >;
    };
    -} //end namespace Dumux::Properties
    +} // end namespace Dumux::Properties
    #endif
    diff -ruN exercises/exercise-runtimeparams/spatialparams.hh exercises/solution/exercise-runtimeparams/spatialparams.hh
    --- exercises/exercise-runtimeparams/spatialparams.hh 2024-07-08 09:06:59.589159960 +0200
    +++ exercises/solution/exercise-runtimeparams/spatialparams.hh 2024-07-08 09:06:59.617159848 +0200
    --- exercises/exercise-runtimeparams/spatialparams.hh 2023-03-31 13:48:56.162686698 +0200
    +++ exercises/solution/exercise-runtimeparams/spatialparams.hh 2023-03-31 13:48:56.186686600 +0200
    @@ -24,8 +24,8 @@
    * fully implicit model.
    */
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment