Commit 14a2a8bf authored by Kutalmis Bercin's avatar Kutalmis Bercin Committed by Andrew Heather
Browse files

TUT: add new tutorial case for turbulent inflow BCs

The following three synthetic turbulence inflow boundary conditions are
examined through single-cell-domain smooth-wall plane channel flow setup:

- turbulentDFSEMInlet
- turbulentDigitalFilterInlet variant=digitalFilter
- turbulentDigitalFilterInlet variant=reducedDigitalFilter

The examinations are performed in terms of the first-/second-order turbulence
statistics provided by (Moser et al., (1999)) doi.org/10.1063/1.869966
from smooth-wall plane channel flow direct numerical simulations at Re=395.

Serial executing:

./Allrun

Parallel (decompositionMethod=scotch) executing:

./Allrunparallel
parent 33ef139a
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
bottomWall
{
type fixedValue;
value uniform (0 0 0);
}
topWall
{
type fixedValue;
value uniform (0 0 0);
}
sides_half0
{
type cyclic;
}
sides_half1
{
type cyclic;
}
inlet
{
type turbulentDFSEMInlet;
delta 2;
nCellPerEddy 1;
mapMethod nearestCell;
value uniform (0 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
bottomWall
{
type fixedValue;
value uniform (0 0 0);
}
topWall
{
type fixedValue;
value uniform (0 0 0);
}
sides_half0
{
type cyclic;
}
sides_half1
{
type cyclic;
}
inlet
{
type turbulentDigitalFilterInlet;
variant digitalFilter;
planeDivisions ( 64 70 );
L ( 0.78035508 0.31085352 0.342261 0.1728125 0.171875
0.22459375 0.172787596 0.171889998 0.224578995 );
patchNormalSpeed 20.133;
value uniform (0 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
bottomWall
{
type fixedValue;
value uniform (0 0 0);
}
topWall
{
type fixedValue;
value uniform (0 0 0);
}
sides_half0
{
type cyclic;
}
sides_half1
{
type cyclic;
}
inlet
{
type turbulentDigitalFilterInlet;
variant reducedDigitalFilter;
planeDivisions ( 64 70 );
L ( 0.78035508 0.31085352 0.342261 0.1728125 0.171875
0.22459375 0.172787596 0.171889998 0.224578995 );
patchNormalSpeed 20.133;
value uniform (0 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
bottomWall
{
type zeroGradient;
}
topWall
{
type zeroGradient;
}
sides_half0
{
type cyclic;
}
sides_half1
{
type cyclic;
}
inlet
{
type calculated;
value uniform 1e-08;
}
outlet
{
type calculated;
value uniform 1e-08;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
bottomWall
{
type zeroGradient;
}
topWall
{
type zeroGradient;
}
sides_half0
{
type cyclic;
}
sides_half1
{
type cyclic;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
}
// ************************************************************************* //
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase0
\rm -r results
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
# Compute test case with different synthetic inflow models
declare -a Models=(
"reducedDigitalFilter"
"digitalFilter"
"DFSEM"
)
# Collect data in 'results' directory
[ -d "results" ] || mkdir results
restore0Dir
runApplication blockMesh
# Compute and collect data
for val in ${Models[@]}; do
echo "Running the case with the model: $val"
\cp 0/U.$val 0/U
\rm -r constant/boundaryData/inlet
\cp -r constant/boundaryData/inlet.$val constant/boundaryData/inlet
runApplication pimpleFoam
gnuplot plot.patch
gnuplot plot.cell
mv postProcessing results/postProcessing.$val
mv stress* results/postProcessing.$val/.
mv log* results/postProcessing.$val/.
cleanTimeDirectories
done
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
# Compute test case with different synthetic inflow models
declare -a Models=(
"reducedDigitalFilter"
"digitalFilter"
"DFSEM"
)
# Collect data in 'results' directory
[ -d "results" ] || mkdir results
restore0Dir
runApplication blockMesh
# Compute parallel and collect data
for val in ${Models[@]}; do
echo "Running the case with the model: $val"
\rm 0/U*
\cp 0.orig/U.$val 0/U
\rm -r constant/boundaryData/inlet
\cp -r constant/boundaryData/inlet.$val constant/boundaryData/inlet
runApplication decomposePar
runParallel pimpleFoam
gnuplot plot.patch
gnuplot plot.cell
mv postProcessing results/postProcessing.$val
mv stress* results/postProcessing.$val/.
mv log* results/postProcessing.$val/.
cleanTimeDirectories
\rm -rf processor* > /dev/null 2>&1
done
Synthetic turbulence inflow tests
======================
The following three synthetic turbulence inflow boundary conditions are
examined through a single-cell-domain smooth-wall plane channel flow setup:
- turbulentDFSEMInlet
- turbulentDigitalFilterInlet variant=digitalFilter
- turbulentDigitalFilterInlet variant=reducedDigitalFilter
The input statistics are obtained from:
Moser, Kim & Mansour
"DNS of Turbulent Channel Flow up to Re_tau=590",
Physics of Fluids (1999) vol 11, 943-945.
doi.org/10.1063/1.869966
from which the input first-/second-order turbulence statistics data for the
smooth-wall plane channel flow at Re=395 were used.
The data is available online from (Retrieved: 21-06-2019):
http://turbulence.ices.utexas.edu/MKM_1999.html
Serial executing:
./Allrun
Parallel (decompositionMethod=scotch) executing:
./Allrunparallel
Both scripts run the test case, and collect the OpenFOAM samples, and plots into
the 'results' directory.
(
0
1.76693e-06
1.06447e-07
2.85582e-08
1.73393e-08
3.56243e-08
3.79499e-08
1.50479e-07
1.55614e-07
1.93408e-07
4.50118e-08
2.6295e-10
6.18128e-08
4.4709e-08
5.98657e-07
2.25711e-06
4.20946e-06
6.292e-06
7.5414e-06
9.02814e-06
1.04737e-05
1.25187e-05
1.37559e-05
1.40338e-05
1.24681e-05
1.08272e-05
9.10144e-06
7.81661e-06
6.08627e-06
4.68729e-06
3.01241e-06
1.93855e-06
1.03945e-06
2.49601e-07
2.33919e-07
3.47823e-08
3.05604e-06
8.25413e-06
1.04748e-05
1.36651e-05
2.35252e-05
3.87371e-05
5.21582e-05
6.71737e-05
6.89399e-05
4.57512e-05
1.94891e-05
9.7778e-06
1.47858e-05
3.40409e-05
6.06823e-05
8.59513e-05
8.29571e-05
5.42278e-05
3.46015e-05
2.20432e-05
1.73878e-05
1.05749e-05
4.67814e-06
8.66793e-06
1.79361e-05
1.22464e-05
3.93103e-06
1.00778e-06
1.81983e-06
2.70815e-05
9.56468e-05
0.000139304
0.00012493
9.50459e-05
4.78307e-05
8.71962e-06
1.24275e-05
4.91383e-05
8.77264e-05
0.000114449
0.00014567
0.000201758
0.000251863
0.000272594
0.000213599
0.000145126
0.000115603
0.000122779
0.000116865
8.36843e-05
4.06009e-05
3.49149e-05
5.22978e-05
5.07525e-05
2.5995e-05
2.6683e-06
9.29144e-06
1.14821e-05
9.41939e-06
1.01946e-05
6.64024e-06
1.1913e-06
3.25066e-06
8.47834e-06
1.42023e-06
4.30742e-05
0.000106228
0.000115468
9.07632e-05
7.04511e-05
9.21776e-05
0.000104486
0.000111678
0.000109852
0.000111867
9.10747e-05
6.82206e-05
4.09085e-05
2.3961e-05
2.0467e-06
7.74345e-06
1.66716e-05
1.54967e-05
2.95089e-05
4.82299e-05
6.99781e-05
7.16947e-05
7.33475e-05
7.40551e-05
9.45846e-05
0.000107202
0.000120068
0.000122517
0.000120068
0.000107202
9.45846e-05
7.40551e-05
7.33475e-05
7.16947e-05
6.99781e-05
4.82299e-05
2.95089e-05
1.54967e-05
1.66716e-05
7.74345e-06
2.0467e-06
2.3961e-05
4.09085e-05
6.82206e-05
9.10747e-05
0.000111867
0.000109852
0.000111678
0.000104486
9.21776e-05
7.04511e-05
9.07632e-05
0.000115468
0.000106228
4.30742e-05
1.42023e-06
8.47834e-06
3.25066e-06
1.1913e-06
6.64024e-06
1.01946e-05
9.41939e-06
1.14821e-05
9.29144e-06
2.6683e-06
2.5995e-05
5.07525e-05
5.22978e-05
3.49149e-05
4.06009e-05
8.36843e-05
0.000116865
0.000122779
0.000115603
0.000145126
0.000213599
0.000272594
0.000251863
0.000201758
0.00014567
0.000114449
8.77264e-05
4.91383e-05
1.24275e-05
8.71962e-06
4.78307e-05
9.50459e-05
0.00012493
0.000139304
9.56468e-05
2.70815e-05
1.81983e-06
1.00778e-06
3.93103e-06
1.22464e-05
1.79361e-05
8.66793e-06
4.67814e-06
1.05749e-05