diff --git a/exercises/exercise-coupling-ff-pm/README.md b/exercises/exercise-coupling-ff-pm/README.md index 13dc47c7ea40c366e8eff5ca59112f93a7295569..1faa342529f5e560b36115583f664ce207341197 100644 --- a/exercises/exercise-coupling-ff-pm/README.md +++ b/exercises/exercise-coupling-ff-pm/README.md @@ -260,7 +260,7 @@ In this case, the chosen formulation will set the given value as the mole fracti __Task B: Add output__: -In the next step, we want to add some output to the simulation. The standard method for providing simulation output for visualization is via a VtkWriter. These tools take the grid geometries of each domain, as well as the solutions and write spatial output that one can view in visualization tools such as paraview. +In the next step, we want to add some output to the simulation. The standard method for providing simulation output for visualization is via a `VtkWriter`. These tools take the grid geometries of each domain, as well as the solutions and write spatial output that one can view in visualization tools such as paraview. Although this Vtk output is very useful, some output is more suited for other forms of visualization. Two examples of data ouput formats are `.csv` files and `.json` files. @@ -327,7 +327,7 @@ Now you are able to simulate a complete drying of the porous medium. Several RANS turbulence models are implemented in DuMu<sup>x</sup>. This part of the exercise consists of the following steps: -* replacing the Navier-Stokes model by the zero equation turbulence model, +* replacing the Navier-Stokes model by the K-Omega SST turbulence model, * switching to a symmetry boundary condition, * applying a grid refinement towards the interface, * subsequently refining the grid (convergence study). @@ -342,46 +342,55 @@ The file `freeflowsubproblem.hh` is your free flow problem file and `properties For using the compositional zero equation turbulence model, the following header files need to be included in properties file: ``` -#include <dumux/freeflow/compositional/zeroeqncmodel.hh> +#include <dumux/freeflow/compositional/sstncmodel.hh> ``` and in problem file: ``` -#include <dumux/freeflow/rans/problem.hh> +#include <dumux/freeflow/turbulencemodel.hh> +#include <dumux/freeflow/turbulenceproperties.hh> +#include <dumux/freeflow/rans/twoeq/sst/problem.hh> #include <dumux/freeflow/rans/boundarytypes.hh> ``` The includes for the NavierStokesNC model and the NavierStokesProblem are no longer needed and can be removed. Make sure your free flow problem inherits from the correct parent type: -* Change the entry in the `FreeflowModel` definition accordingly (non-isothermal zero equation model, ZeroEqNCNI) in the properties file, -* Adapt the inheritance of the problem class in problem file. - -Take a look into the two headers included above to see how the correct TypeTag and the Problem class the inherit from are called. - -Here, the turbulent free flow is wall bounded which means that the main reason for the development -of turbulent flow is the presence of walls. -The porous medium at the bottom and also the channel wall are such walls. -Inside the problem you have to tell the turbulence model, where these walls are located -by providing boundary conditions at the wall. For that, use - ```cpp +* Change the entry in the `FreeflowModel` definition accordingly (multi-component non-isothermal K-Omega SST model, SSTNCNI) in the properties file, +* Adapt the inheritance of the problem class in problem file (Use `RANSProblem<TypeTag>` rather than `NavierStokesStaggeredProblem<TypeTag>`). + Take a look into the two headers included above to see how the correct TypeTag and the Problem class the inherit from are called. + +Here, the turbulent free-flow is wall-bounded, meaning shear stress and turbulence in the flow develop primarily due to the walls. +The porous medium at the bottom and also the channel wall are examples of such walls. +Within the problem the location of boundaries representing walls need to be defined. +To do this, add the following function to the correct locations within the `boundaryTypes` function: +```cpp values.setWall(); - ``` +``` -In addition, especially for the zero-equation models, any element in the free-flow domain interacts with the walls, -e.g. this defines the wall distance which is needed to calculate the eddy viscosity. -To get all these interactions, you have to call - ```cpp +With the locations of the wall designated, and the problem initialized, a series of constant spatial properties, +in particular the distance to the nearest wall from each cell center, should be initialized. +To do this, add the following to the `main.cc` file. +```cpp freeflowProblem->updateStaticWallProperties(); - ``` -in `main.cc`. -However, there is also a solution-dependent component of these interactions, e.g. for a correct -damping of the eddy viscosity toward the wall, the velocity gradient at the wall and inside the -cells is needed. -These dynamic interactions are to be updated by calling +``` + +In addition, there is also a non-local solution-dependent aspect of the turbulence models which is to be updated at the end of each step. +An example of this is a stencil extended velocity gradient, and other flow properties in relation to the wall. +These dynamic interactions are to be initialized in the mainfile directly after the `updateStaticWallProperties()` call, +as well as in the time loop after `// Update dynamic wall properties`: ```cpp freeflowProblem->updateDynamicWallProperties(freeflowSol); ``` -in the time loop (after `// Update dynamic wall properties`). + +In addition to designating the locations of walls, +additional boundary conditions and initial conditions need to be set for the two new primary variables $k$ and $\omega$. +In the `boundaryTypes` function, set both variables on all walls to be dirichlet, except for the right boundary, which should have outflow conditions. +For the initial conditions, reynolds number specific base conditions should be applied everywhere. +In the problem constructor, uncomment the code calcualting these terms, +then apply the `turbulentKineticEnergy_`and `dissipation_` variables to their primary variables in all locations, +except for on the wall boundaries, where these values can be set to zero. +In addition, dirichlet constraints for the dissipation or $\omega$ variable will be set for all wall adjacent cells. +This is done in the `isDirichletCell` function, as well as the `dirichlet` function already, and requires no further changes. Compile and run your new coupled problem and take a look at the results in Paraview. In addition to the standard variables and parameters, you can now analyze turbulence model specific quantities @@ -393,13 +402,13 @@ The result for the turbulent viscosity should look like this: __Task B__: -Instead of computing the whole cross-section of a channel, you can use symmetric boundary conditions at the top boundary of your free flow domain by replacing all previous boundary conditions with +Instead of computing the whole cross-section of a channel, +you can use symmetric boundary conditions at the top boundary of your free flow domain by replacing all previous boundary conditions at the top with ```c++ values.setAllSymmetry(); ``` -In addition, you have to remove the condition `onUpperBoundary_(globalPos)` from the `isOnWallAtPos(globalPos)` -and `initialAtPos(globalPos)` method. +In addition, you have to remove the condition `onUpperBoundary_(globalPos)` from the `initialAtPos(globalPos)` method. __Task C__: diff --git a/exercises/extradoc/ex_ff-pm-turb_diffusivity.png b/exercises/extradoc/ex_ff-pm-turb_diffusivity.png index c7173d0e3bfc0146d77f5a4401005cf9c7df215b..796c223d467c9ab722c2128dae7976f5ea4c1015 100644 Binary files a/exercises/extradoc/ex_ff-pm-turb_diffusivity.png and b/exercises/extradoc/ex_ff-pm-turb_diffusivity.png differ