Commit 8e9cafe8 by Thomas Fetzer

 ... ... @@ -195,9 +195,15 @@ In this part of the exercise, the coupled system will be extended such that the in both parts is included and the presence of a second phase in the porous medium is considered. This enables the simulation of the drying of a porous medium (however no energy balance is included yet). This part of the exercise consists of the following steps: * replacing the 1pnc porous-medium model by a 2pnc porous-medium model, * adding the output for fluxes and storage terms (having gnuplot is recommended), * enable a variable switch for a complete drying. We start with an example in which the transport of water vapor in the gas phase is considered. The porous medium is filled with gas, initially the mole fraction of water vapor is $x^w_g = 0.1$. Above the porous medium, a dry gas flows and by diffusion, the porous medium dries out. (Don't mind the compiler warning, we will deal with it in task B.) __Task A: Change the model__: ... ... @@ -233,9 +239,6 @@ In this case, the chosen formulation will set the given value as the mole fracti a gas-phase only (hint: the numbering of phase indices begins with 0, the numbering of the phase presence states begins with 1. Take a look at your formulation to find out which phase index to use for the gas phase.) Compile and run the new simulation. (Don't mind the compiler warning, we will deal with it in the next task.) __Task B: Add output__: In the next step, we want to add some output to the simulation. ... ... @@ -271,11 +274,11 @@ In this exercise we want to completely dry an initial water-filled porous medium - Change the initial condition such that it is started with a two-phase system. Set the initial saturation to $S_\text{l} = 0.1$. If one wants to simulate the complete drying of a porous medium, the standard capillary pressure--saturation If one wants to simulate the complete drying of a porous medium, the standard capillary pressure-saturation relationships have to be regularized. If no regularization is used, then the capillary pressure would approach infinity when the liquid saturation goes to zero. This means that water can flow to the interface from any region of the porous medium and of course this poses numerical problems. Therefore, the capillary pressure--saturation relationship has to be regularized for low saturations. Therefore, the capillary pressure-saturation relationship has to be regularized for low saturations. The regularization has a strong influence on how long liquid water is present at the interface, see [Mosthaf (2014)](http://dx.doi.org/10.18419/opus-519). * Take a look at how the regularization is set in the 2pspatialparams.hh and see how adapating ... ... @@ -303,7 +306,7 @@ This part of the exercise consists of the following steps: * applying a grid refinement towards the interface, * subsequently refining the grid (convergence study). We will work with a 1p2cni/2p2cni coupled problem, where ni stands for non-isothermal, and take the inertial forces into account. We will work with a 1p2cni/2p2cni coupled problem, where ni stands for non-isothermal. All the prepared files can be found in the subfolder exercise-coupling-ff-pm/turbulence. __Task A__: ... ... @@ -323,14 +326,11 @@ Make sure your free flow problem inherits from the correct parent type: Take a look into the two headers included above to see how the correct TypeTag and the Problem class the inherit from are called. Additionally, you have to update the static and dynamic wall properties with c++ stokesProblem->updateStaticWallProperties(); stokesProblem->updateDynamicWallProperties(stokesSol);  after applying the initial solution to the Stokes problem in the main file. In order to update these properties, the Stokes problem file needs to be extended to provide an isOnWall() method: 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 an isOnWall() function: c++ bool isOnWall(const GlobalPosition& globalPos) const { ... ... @@ -338,17 +338,23 @@ bool isOnWall(const GlobalPosition& globalPos) const }  Since the dynamic wall properties can change during the simulation and depend on the solution, they have to be updated in each time step. Include the following lines into your main file (after // update dynamic wall properties): c++ stokesProblem->updateDynamicWallProperties(stokesSol);  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 stokesProblem->updateStaticWallProperties() in ex_turbulence_coupling_ff-pm.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 stokesProblem->updateDynamicWallProperties(stokesSol) in the time loop (after // update dynamic wall properties). 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 choose turbulence model specific quantities (e.g. the turbulent viscosity nu_t) for the free flow domain. In addition to the standard variables and parameters, you can now analyze turbulence model specific quantities (e.g. the turbulent viscosity nu_\textrm{t} or the turbulent diffusivity D_\textrm{t}) for the free flow domain. In paraview you may compare the magnitude of D and D_\textrm{t} to see where the transport is affected by turbulence. The result for the turbulent viscosity should look like this: ![](../extradoc/ex_ff-pm-turb_viscosity.png) ![](../extradoc/ex_ff-pm-turb_diffusivity.png) __Task B__: ... ...