Exercise 1
We will first explore a simple setup of 2-D flow along a pressure gradient in the presence of permeability contrasts.
Goals
explore porous flow along prescribed pressure gradient
use
setFields
utility to modify the permeability structureUnderstand how permeability contrasts affect flow
Step 1
We will explore the following case: A 2-D box of dimensions 1500 m by 1000 m. Flow is driven by a prescribed pressure gradient. Within the box, variations in permeability affect the flow field.
A good starting point for setting up new case is always to take an existing similar case. Here we can use one of HydrothermalFoam benchmark cases. It’s located in $HOME/hydrothermalfoam-master/benchmarks/HydrothermalFoam/1d/h1
.
Copy the case into your working directory.
cd $HOME/HydrothermalFoam_runs
cp -r /home/openfoam/hydrothermalfoam-master/benchmarks/HydrothermalFoam/1d/h1 ./h1_class
Step 2
Now we need to modify the case. These are the necessary steps:
Goals
modify the mesh by chnanging
blockMeshDict
check that gravity is zero in
constant/g
update boundary conditions for pressure and temperature (and permeability)
use the
setFields
utility and the controllingsystem/setFieldsDict
to modify the permeability structurethe exact of dimensions of the permeability blocks don’t matter
modify
system/controlDict
so that we only make one time step. Easiest way is to set endTime, deltaT and writeInterval all to 864000.
Tip
You might have noticed that the benchmarks/HydrothermalFoam/1d/h1
case does not contain a setFieldsDict
. This is common “problem” that a dictionary file is missing when starting from an existing case file. You can easily fix this by copying the respective dictionary from another case and then modify it. If you don’t know which case has the missing dictionary, you can just search for it (inside the docker container). For example like this:
find $HOME -type f -name "setFieldsDict"
Now that we have the setFieldsDict, we need to modify it. Do you remember Assign properties part the two-layered convection Excercises in lecture 3? There we used the boxToCell function within setFieldsDict
as an alternative way of making a layerd permeability structure. Now we can do the same here, just that we need several boxes.
This is how the code snippit looked like in lecture 3; take it as a starting point!
regions
(
boxToCell
{
box (0 -500 0) (1000 0 1); //(xmin,ymin,zmin) (xmax,ymax,zmax)
fieldValues
(
volScalarFieldValue permeability 1e-13
);
}
);
You can also play with different shapes, like cylinder or rotated box. Check the documentation!
Step 3
Explore the results in paraview!