recurrence tutorial: laminar vortex shedding
This 2D case of vortex shedding in laminar cross-flow demonstrates the concept of recurrence. This is a bit work-in-progress: please check whether this tutorial runs with the recurrence model and tools of CFDEMcoupling, namely rStatAnalysis. The simulation roughly goes through three stages: * The initial solution computed by potentialFoam * A period of symmetric, steady-state flow * Finally, periodic vortex shedding These three stages are clearly visible in the recurrence plot. * We see how not one of the later velocity fields is similar to the initial one * We see the intermediate stage with a symmetric flow field * We see the periodic vortex shedding
51
tutorials/rStatAnalysis/laminarFlowOvercylinder/0.org/U
Normal file
@ -0,0 +1,51 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format binary;
|
||||
class volVectorField;
|
||||
location "0";
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
cylinder
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0.0040120 0 0); // Re = 200
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type inletOutlet;
|
||||
inletValue uniform (0 0 0);
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
"side.*"
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
frontBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
48
tutorials/rStatAnalysis/laminarFlowOvercylinder/0.org/p
Normal file
@ -0,0 +1,48 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format binary;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
cylinder
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0;
|
||||
}
|
||||
"side.*"
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
frontBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
23
tutorials/rStatAnalysis/laminarFlowOvercylinder/Allclean
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# clean the case
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
# remove mesh
|
||||
rm -rf constant/polyMesh/*
|
||||
|
||||
rm -rf 0 > /dev/null 2>&1
|
||||
|
||||
cleanCase
|
||||
|
||||
rm rec_jump.dat
|
||||
rm recurrenceMatrix
|
||||
rm recurrencePath
|
||||
|
||||
cd recMat
|
||||
|
||||
./clean.sh
|
||||
9
tutorials/rStatAnalysis/laminarFlowOvercylinder/Allrun
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# run the case
|
||||
|
||||
./meshIt
|
||||
|
||||
./run
|
||||
|
||||
./post
|
||||
157
tutorials/rStatAnalysis/laminarFlowOvercylinder/ReadMe.md
Normal file
@ -0,0 +1,157 @@
|
||||
# Laminar flow over cylinder - recurrent flow
|
||||
|
||||
This OpenFOAM case demonstrates the recurring flow patterns of vortex sheding
|
||||
of a cylinder in laminar cross flow. Apart from judging the recurrence using
|
||||
the eyeball norm, i.e. by looking at the solution, we are computing the
|
||||
recurrence matrix from the computed time steps.
|
||||
|
||||
The recurrence plot [1], a graphical representation of the recurrence matrix,
|
||||
allows us to clearly distinguish between the initial phase of the solution and
|
||||
the quasi steady state, which exhibits a nice periodic flow.
|
||||
|
||||
|
||||
## Case description
|
||||
|
||||
The mesh is created with blockMesh using a simple blocking strategy with 6
|
||||
blocks. The domain is meshed using one cell in z direction, thus the flow
|
||||
simulation is a 2D simulation. The patch on the left acts as inlet, the patch
|
||||
on the right is an outlet. The top and bottom patches are frictionless walls.
|
||||
The cylindrical void in the domain employs wall boundary conditions.
|
||||
|
||||
|
||||
## Results
|
||||
|
||||
The image below, is the recurrence plot of this simulation. The recurrence plot
|
||||
is based on the recurrence matrix, which in turn was computed from the velocity
|
||||
fields of this simulation.
|
||||
|
||||
Each entry in the recurrence matrix is computed by comparing two states of the
|
||||
simulation, i.e. time steps. In this case the velocity fields of all written
|
||||
time steps were compared to each other. For each entry, the magnitude of the
|
||||
difference of two velocity fields was computed. This magnitude, which itself is
|
||||
still a field quantity was summed up over all cell values, and finally
|
||||
normalized. Consequently, the values along the main diagonal, i.e. both indices
|
||||
for x and y, are zero, as the corresponding state is compared to itself.
|
||||
|
||||

|
||||
|
||||
As the simulation is initialized using *potentialFoam*, we have an initial
|
||||
velocity field, which is closer to reality than a trivial initial field, i.e.
|
||||
zero velocity everywhere. However, the initial velocity field is quite
|
||||
unphysical as it contains artifacts due to the mesh, as shown below.
|
||||
Notice, in the recurrence plot, the red bands along the x-axis for low values
|
||||
of y, and along the y-axis for low values of x. This is a result of the initial
|
||||
velocity field bearing no resemblance to all subsequent velocity fields.
|
||||
Thus, a horizonal or vertical high-value band is the result of a state, which
|
||||
does not re-occur.
|
||||
|
||||
Thus, a low value indicates great similarity between two time steps. E.g. the
|
||||
value at (500,1000) is very low (shown in blue in the plot), which means that
|
||||
the velocity fields at the time 500 s and 1000 s are very similar, as shown
|
||||
below.
|
||||
The whole blue square in the recurrence plot indicates a certain period in
|
||||
which the solution changes very little over time. Thus, one could assume, if
|
||||
the simulation were to stop aroung t = 1000 s, that the flow field in the
|
||||
simulation had entered its steady state.
|
||||
|
||||
However, as the simulation progresses, vortex shedding kicks in, and we end up
|
||||
having a nice, periodic solution. This is indicated by the narrow bands
|
||||
parallel to the main diagonal in the upper right corner of the recurrence plot.
|
||||
A low-value band parallel to the main diagonal means that the same sequence of
|
||||
states can be observed with a certain time shift. A purely periodic system will
|
||||
show the exactly same state after completing a full cycle.
|
||||
|
||||
The narrow bands in this recurrence plot strongly suggests that the laminar
|
||||
vortex shedding exhibits periodic behaviour.
|
||||
|
||||
|
||||
### Initial velocity field
|
||||
|
||||

|
||||
t = 0 s
|
||||
|
||||
### Velocity fields at t = 500 s and t = 1000 s
|
||||
|
||||
The following two velocity fields are very similar to each other. In the
|
||||
recurrence matrix the value for indicating the similarity of these two velocity
|
||||
fields is 0.001.
|
||||
|
||||

|
||||
t = 500 s
|
||||
|
||||

|
||||
t = 1000 s
|
||||
|
||||
### Velocity fields at t = 1500 s, t = 1850 s and t = 1950 s
|
||||
|
||||
The following two velocity fields are very similar to each other. In the
|
||||
recurrence matrix the value for indicating the similarity of these two velocity
|
||||
fields is 0.047.
|
||||
|
||||

|
||||
t = 1500 s
|
||||
|
||||

|
||||
t = 1850 s
|
||||
|
||||
The following velocity field is very dissimilar to the preceeding two, although
|
||||
it looks very alike. However, whereas the fields at t = 1500 s and t = 1850 s
|
||||
are nearly at the same part of the cycle, these two fields and the field at
|
||||
t = 1950 s are on opposite sides of the cycle. The value of the recurrence
|
||||
matrix, which indicates similarity is 0.496, respectively 0.488.
|
||||
|
||||

|
||||
t = 1950 s
|
||||
|
||||
|
||||
### Additional notes
|
||||
|
||||
Apart from running the meshing tools *blockMesh* and *renumberMesh*, the solvers
|
||||
*pimpleFoam* and *potentialFoam*, this case runs the tool *rStatAnalysis*, which
|
||||
is part of the recurrence model.
|
||||
|
||||
|
||||
## Post-processing
|
||||
|
||||
This tutorial uses a number of third party software tools for post-processing.
|
||||
|
||||
[Octave](https://www.gnu.org/software/octave/) is open source under the GPL and
|
||||
is available for all platforms. Octave is widely compatible to MATLAB, so you
|
||||
can run the post-processing script also with MATLAB.
|
||||
|
||||
[gnuplot](http://www.gnuplot.info/) is a portable command-line driven graphing
|
||||
utility for Linux, MS Windows, OSX, and many other platforms. It is open source
|
||||
under its own licence.
|
||||
|
||||
[TeX Live](https://www.tug.org/texlive/) is an easy way to get up and running
|
||||
with the TeX document production system. It provides a comprehensive TeX system
|
||||
with binaries for most flavors of Unix, including GNU/Linux, and also Windows.
|
||||
It includes all the major TeX-related programs, macro packages, and fonts that
|
||||
are free software, including support for many languages around the world.
|
||||
|
||||
[pdfCrop](https://ctan.org/pkg/pdfcrop) is part of a larger collection
|
||||
[texlive-extra-utils](https://launchpad.net/ubuntu/+source/texlive-extra) of
|
||||
auxiliary tools for the TeX system. This tool, however, is non essential to
|
||||
the functioning of this tutorial. If it is not present or available on your
|
||||
system, simply comment out the call to it.
|
||||
|
||||
The post-processing script has been tested with:
|
||||
|
||||
* GNU Octave, version 4.0.0
|
||||
* gnuplot 5.0
|
||||
* pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
|
||||
* texlive-extra-utils 2015.20160320-1
|
||||
|
||||
|
||||
## Tested
|
||||
|
||||
This collection of cases has been tested with:
|
||||
|
||||
* OpenFOAM-5.0
|
||||
|
||||
|
||||
## References
|
||||
|
||||
[1] T. Lichtenegger and S. Pirker. Recurrence CFD – A novel approach to simulate
|
||||
multiphase flows with strongly separated time scales. Chemical Engineering Science,
|
||||
153:394-410, 2016.
|
||||
@ -0,0 +1,82 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object recProperties;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//===========================================================================//
|
||||
// sub-models & settings
|
||||
|
||||
|
||||
recModel standardRecModel;
|
||||
|
||||
verbose false;
|
||||
|
||||
recNorm sqrDiffNorm;
|
||||
|
||||
recPath simpleRandomPath;
|
||||
|
||||
|
||||
volScalarFields
|
||||
(
|
||||
);
|
||||
|
||||
volVectorFields
|
||||
(
|
||||
U
|
||||
);
|
||||
|
||||
surfaceScalarFields
|
||||
(
|
||||
);
|
||||
|
||||
//verbose;
|
||||
|
||||
|
||||
|
||||
//===========================================================================//
|
||||
// sub-model properties
|
||||
|
||||
standardRecModelProps
|
||||
{
|
||||
dataBase ".";
|
||||
|
||||
skipZero on;
|
||||
}
|
||||
|
||||
sqrDiffNormProps
|
||||
{
|
||||
fieldType "volVectorField";
|
||||
fieldName U;
|
||||
|
||||
//verbose false;
|
||||
}
|
||||
|
||||
simpleRandomPathProps
|
||||
{
|
||||
}
|
||||
|
||||
noRecStatAnalysis
|
||||
{
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,25 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object transportProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
transportModel Newtonian;
|
||||
|
||||
// water, 20°C, VDI Wärmeatlas
|
||||
nu nu [ 0 2 -1 0 0 0 0 ] 1.003e-06;
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,20 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object turbulenceProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType laminar;
|
||||
|
||||
// ************************************************************************* //
|
||||
|
After Width: | Height: | Size: 25 KiB |
BIN
tutorials/rStatAnalysis/laminarFlowOvercylinder/doc/vel000.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
tutorials/rStatAnalysis/laminarFlowOvercylinder/doc/vel050.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
tutorials/rStatAnalysis/laminarFlowOvercylinder/doc/vel100.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
tutorials/rStatAnalysis/laminarFlowOvercylinder/doc/vel150.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
tutorials/rStatAnalysis/laminarFlowOvercylinder/doc/vel185.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
tutorials/rStatAnalysis/laminarFlowOvercylinder/doc/vel195.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
6
tutorials/rStatAnalysis/laminarFlowOvercylinder/meshIt
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
blockMesh 2>&1 | tee log.blockMesh 2>&1
|
||||
|
||||
# renumber the mesh
|
||||
renumberMesh -overwrite 2>&1 | tee log.renumberMesh 2>&1
|
||||
10
tutorials/rStatAnalysis/laminarFlowOvercylinder/post
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# run the post-processing
|
||||
|
||||
rStatAnalysis 2>&1 | tee log.rStatAnalysis 2>&1
|
||||
|
||||
cd recMat
|
||||
|
||||
./plot.sh
|
||||
|
||||
7
tutorials/rStatAnalysis/laminarFlowOvercylinder/recMat/clean.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -f *.log
|
||||
rm -f *.aux
|
||||
rm -f *.txt
|
||||
rm -f *.pdf
|
||||
rm -f myDistMatrix.tex
|
||||
@ -0,0 +1,75 @@
|
||||
% open files
|
||||
fid1 = fopen('../recurrenceMatrix');
|
||||
|
||||
% read dimensions
|
||||
A1 = fscanf(fid1, '%g %g');
|
||||
|
||||
% skip the first two lines
|
||||
tline = fgetl(fid1);
|
||||
tline = fgetl(fid1);
|
||||
|
||||
% get dimensions
|
||||
N1 = A1(1)
|
||||
M1 = A1(2)
|
||||
|
||||
% allocate space
|
||||
B0 = zeros(M1,N1);
|
||||
|
||||
% read data
|
||||
for i=1:N1
|
||||
B0(:,i) = fscanf(fid1, '%g', inf);
|
||||
tline = fgetl(fid1);
|
||||
tline = fgetl(fid1);
|
||||
end
|
||||
|
||||
% close files
|
||||
fclose(fid1);
|
||||
|
||||
|
||||
% skip this many leading entries
|
||||
sle = 0;
|
||||
|
||||
B1 = zeros(M1-sle,N1-sle);
|
||||
|
||||
B1 = B0(1+sle:M1,1+sle:N1);
|
||||
|
||||
maxval=0.0;
|
||||
%for i=1:M1
|
||||
% for j=1:N1
|
||||
% if(B1(i,j)>maxval)
|
||||
% maxval=B1(i,j);
|
||||
% endif
|
||||
% end
|
||||
%end
|
||||
|
||||
maxval = 1.0;
|
||||
for i=1:M1-sle
|
||||
for j=1:N1-sle
|
||||
B1(i,j)=1-B1(i,j)/maxval;
|
||||
% B1(i,j)=B1(i,j)/maxval;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
% write full matrix to simple text file
|
||||
dlmwrite('myMatrix.txt',B1,'delimiter','\t','precision',3)
|
||||
|
||||
|
||||
|
||||
%plot(C1)
|
||||
%saveas(gcf,'Plot','png')
|
||||
|
||||
%B1=B1*1;
|
||||
|
||||
|
||||
%hold on
|
||||
|
||||
|
||||
%colormap(jet(50))
|
||||
%imagesc(B1)
|
||||
%colorbar
|
||||
|
||||
%saveas(gcf,'Figure','png')
|
||||
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
\documentclass[preview]{standalone}
|
||||
\usepackage{graphicx}
|
||||
\begin{document}
|
||||
\begin{figure}
|
||||
\input{myDistMatrix}
|
||||
\end{figure}
|
||||
\end{document}
|
||||
4
tutorials/rStatAnalysis/laminarFlowOvercylinder/recMat/plot.sh
Executable file
@ -0,0 +1,4 @@
|
||||
octave getRecMat.m
|
||||
gnuplot plotDistMat.gnu
|
||||
pdflatex makePlot.tex
|
||||
pdfcrop makePlot.pdf distMatrix.pdf
|
||||
@ -0,0 +1,48 @@
|
||||
reset
|
||||
clear
|
||||
|
||||
set terminal cairolatex pdf dash dl 1
|
||||
|
||||
set pm3d map
|
||||
set contour surface
|
||||
set cntrparam levels discr 10
|
||||
set samples 50
|
||||
set isosamples 50
|
||||
|
||||
set palette maxcolors 8
|
||||
set palette defined(\
|
||||
0 0.2314 0.2980 0.7529,\
|
||||
0.125000 0.384300 0.509800 0.917600,\
|
||||
0.250000 0.552900 0.690200 0.996100,\
|
||||
0.375000 0.721600 0.815700 0.976500,\
|
||||
0.500000 0.866700 0.866700 0.866700,\
|
||||
0.625000 0.960800 0.768600 0.678400,\
|
||||
0.750000 0.956900 0.603900 0.482400,\
|
||||
0.875000 0.870600 0.376500 0.302000,\
|
||||
1 0.7059 0.0157 0.1490\
|
||||
)
|
||||
|
||||
set cbtics 0.6
|
||||
set mcbtics 8
|
||||
#set cblabel 'distance'
|
||||
#unset cbtics
|
||||
set cbrange [0:0.6]
|
||||
set format cb "%.1f"
|
||||
|
||||
#set xrange[0:3]
|
||||
#set yrange[0:3]
|
||||
|
||||
set xlabel 't [s]'
|
||||
set ylabel 't [s]'
|
||||
|
||||
# evil manual meddling with axes tics
|
||||
set xtics ("0" 0, "500" 50, "1000" 100, "1500" 150, "2000" 199)
|
||||
set ytics ("0" 0, "500" 50, "1000" 100, "1500" 150, "2000" 199)
|
||||
#set mxtics 2
|
||||
#set mytics 2
|
||||
|
||||
set size square
|
||||
|
||||
|
||||
set out 'myDistMatrix.tex'
|
||||
splot 'myMatrix.txt' matrix using ($1):($2):(1-$3) with image notitle
|
||||
12
tutorials/rStatAnalysis/laminarFlowOvercylinder/run
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# run the simulation
|
||||
|
||||
rm -rf 0
|
||||
cp -r 0.org 0
|
||||
|
||||
# initialise solution
|
||||
potentialFoam 2>&1 | tee log.potentialFoam 2>&1
|
||||
|
||||
# run simulation
|
||||
pimpleFoam 2>&1 | tee log.pimpleFoam 2>&1
|
||||
@ -0,0 +1,145 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \ / O peration | Version: 2.1.x |
|
||||
| \ / A nd | Web: www.OpenFOAM.org |
|
||||
| \/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
|
||||
|
||||
convertToMeters 1.0;
|
||||
|
||||
|
||||
vertices
|
||||
(
|
||||
( 0.0 -0.25 0.0 ) // x0y0z0 = 0
|
||||
( 0.0 -0.25 0.01 ) // x0y0z1 = 1
|
||||
( 0.0 0.25 0.0 ) // x0y1z0 = 2
|
||||
( 0.0 0.25 0.01 ) // x0y1z1 = 3
|
||||
( 0.15000000000000002 -0.25 0.0 ) // x1y0z0 = 4
|
||||
( 0.15000000000000002 -0.25 0.01 ) // x1y0z1 = 5
|
||||
( 0.15000000000000002 0.25 0.0 ) // x1y1z0 = 6
|
||||
( 0.15000000000000002 0.25 0.01 ) // x1y1z1 = 7
|
||||
( 0.65 -0.25 0.0 ) // x2y0z0 = 8
|
||||
( 0.65 -0.25 0.01 ) // x2y0z1 = 9
|
||||
( 0.65 0.25 0.0 ) // x2y1z0 = 10
|
||||
( 0.65 0.25 0.01 ) // x2y1z1 = 11
|
||||
( 1.5 -0.25 0.0 ) // x3y0z0 = 12
|
||||
( 1.5 -0.25 0.01 ) // x3y0z1 = 13
|
||||
( 1.5 0.25 0.0 ) // x3y1z0 = 14
|
||||
( 1.5 0.25 0.01 ) // x3y1z1 = 15
|
||||
|
||||
( 0.41767766952966373 0.017677669529663688 0.0 ) // a0h0 = 16
|
||||
( 0.3823223304703363 0.01767766952966369 0.0 ) // a1h0 = 17
|
||||
( 0.3823223304703363 -0.017677669529663688 0.0 ) // a2h0 = 18
|
||||
( 0.41767766952966373 -0.01767766952966369 0.0 ) // a3h0 = 19
|
||||
( 0.41767766952966373 0.017677669529663688 0.01 ) // a0h1 = 20
|
||||
( 0.3823223304703363 0.01767766952966369 0.01 ) // a1h1 = 21
|
||||
( 0.3823223304703363 -0.017677669529663688 0.01 ) // a2h1 = 22
|
||||
( 0.41767766952966373 -0.01767766952966369 0.01 ) // a3h1 = 23
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
blocks
|
||||
(
|
||||
hex ( 0 4 6 2 1 5 7 3 ) ( 6 20 1 ) simpleGrading ( 1 1 1 ) // 0 ['x0y0z0', 'x1y0z0', 'x1y1z0', 'x0y1z0']
|
||||
hex ( 8 12 14 10 9 13 15 11 ) ( 34 20 1 ) simpleGrading ( 1 1 1 ) // 1 ['x2y0z0', 'x3y0z0', 'x3y1z0', 'x2y1z0']
|
||||
// cylinder block
|
||||
hex ( 16 10 6 17 20 11 7 21 ) ( 18 20 1 ) simpleGrading ( 1 1 1 ) // 2 ['a0h0', 'b0h0', 'b1h0', 'a1h0']
|
||||
hex ( 17 6 4 18 21 7 5 22 ) ( 18 20 1 ) simpleGrading ( 1 1 1 ) // 3 ['a1h0', 'b1h0', 'b2h0', 'a2h0']
|
||||
hex ( 18 4 8 19 22 5 9 23 ) ( 18 20 1 ) simpleGrading ( 1 1 1 ) // 4 ['a2h0', 'b2h0', 'b3h0', 'a3h0']
|
||||
hex ( 19 8 10 16 23 9 11 20 ) ( 18 20 1 ) simpleGrading ( 1 1 1 ) // 5 ['a3h0', 'b3h0', 'b0h0', 'a0h0']
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
edges
|
||||
(
|
||||
arc 16 17 ( 0.4 0.025 0.0 )// cyl block
|
||||
arc 17 18 ( 0.375 3.061616997868383e-18 0.0 )// cyl block
|
||||
arc 18 19 ( 0.4 -0.025 0.0 )// cyl block
|
||||
arc 19 16 ( 0.42500000000000004 -6.123233995736766e-18 0.0 )// cyl block
|
||||
arc 20 21 ( 0.4 0.025 0.01 )// cyl block
|
||||
arc 21 22 ( 0.375 3.061616997868383e-18 0.01 )// cyl block
|
||||
arc 22 23 ( 0.4 -0.025 0.01 )// cyl block
|
||||
arc 23 20 ( 0.42500000000000004 -6.123233995736766e-18 0.01 )// cyl block
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
boundary
|
||||
(
|
||||
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
( 0 2 3 1 ) // ['x0y0z0', 'x0y1z0', 'x0y1z1', 'x0y0z1']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
( 12 14 15 13 ) // ['x3y0z0', 'x3y1z0', 'x3y1z1', 'x3y0z1']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
cylinder
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
( 16 17 21 20 ) // ['a0h0', 'a1h0', 'a1h1', 'a0h1']
|
||||
( 17 18 22 21 ) // ['a1h0', 'a2h0', 'a2h1', 'a1h1']
|
||||
( 18 19 23 22 ) // ['a2h0', 'a3h0', 'a3h1', 'a2h1']
|
||||
( 19 16 20 23 ) // ['a3h0', 'a0h0', 'a0h1', 'a3h1']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sides
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
( 0 4 5 1 ) // ['x0y0z0', 'x1y0z0', 'x1y0z1', 'x0y0z1']
|
||||
( 2 6 7 3 ) // ['x0y1z0', 'x1y1z0', 'x1y1z1', 'x0y1z1']
|
||||
( 4 8 9 5 ) // ['x1y0z0', 'x2y0z0', 'x2y0z1', 'x1y0z1']
|
||||
( 6 10 11 7 ) // ['x1y1z0', 'x2y1z0', 'x2y1z1', 'x1y1z1']
|
||||
( 8 12 13 9 ) // ['x2y0z0', 'x3y0z0', 'x3y0z1', 'x2y0z1']
|
||||
( 10 14 15 11 ) // ['x2y1z0', 'x3y1z0', 'x3y1z1', 'x2y1z1']
|
||||
);
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -0,0 +1,90 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.1.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application twoPhaseEulerFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0.1;
|
||||
|
||||
stopAt endTime;
|
||||
//stopAt writeNow;
|
||||
|
||||
endTime 2000;
|
||||
|
||||
deltaT 1.0e-2;
|
||||
|
||||
writeControl adjustableRunTime;
|
||||
|
||||
writeInterval 10;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat binary;
|
||||
|
||||
writePrecision 6;
|
||||
|
||||
writeCompression uncompressed;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
maxCo 0.25;
|
||||
|
||||
maxDeltaT 1;
|
||||
|
||||
|
||||
functions
|
||||
{
|
||||
forces
|
||||
{
|
||||
type forceCoeffs;
|
||||
functionObjectLibs ( "libforces.so" );
|
||||
|
||||
writeControl timeStep;
|
||||
writeInterval 1;
|
||||
|
||||
patches
|
||||
(
|
||||
cylinder
|
||||
);
|
||||
directForceDensity no;
|
||||
|
||||
pName p;
|
||||
UName U;
|
||||
rhoName rhoInf;
|
||||
//log true;
|
||||
rhoInf 994.5;
|
||||
rho rhoInf;
|
||||
CofR ( 0 0 0 );
|
||||
liftDir ( 0 1 0 );
|
||||
dragDir ( 1 0 0 );
|
||||
pitchAxis ( 0 0 1 );
|
||||
magUInf 10.0;
|
||||
lRef 0.04;
|
||||
Aref 0.0157;
|
||||
Aref1 0.004;
|
||||
rhoRef 994.5;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,62 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default Euler;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(U) cellLimited Gauss linear 1;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) bounded Gauss linearUpwindV grad(U);
|
||||
|
||||
|
||||
div((nuEff*dev2(T(grad(U))))) Gauss linear;
|
||||
div((nuEff*dev(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear limited corrected 0.33;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p ;
|
||||
Phi ;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,105 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
{
|
||||
solver GAMG;
|
||||
tolerance 1e-08;
|
||||
relTol 0.0001;
|
||||
maxIter 100;
|
||||
smoother DIC;
|
||||
nPreSweeps 1;
|
||||
nPostSweeps 2;
|
||||
nFinestSweeps 2;
|
||||
scaleCorrection true;
|
||||
directSolveCoarsestLevel false;
|
||||
cacheAgglomeration true;
|
||||
nCellsInCoarsestLevel 330;
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
}
|
||||
|
||||
pFinal
|
||||
{
|
||||
$p;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
U
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-08;
|
||||
relTol 0.001;
|
||||
}
|
||||
|
||||
/*U
|
||||
{
|
||||
type coupled;
|
||||
solver PBiCICG;
|
||||
preconditioner DILU;
|
||||
tolerance (1e-08 1e-08 1e-08);
|
||||
relTol (0 0 0);
|
||||
}*/
|
||||
|
||||
UFinal
|
||||
{
|
||||
$U;
|
||||
}
|
||||
|
||||
Phi
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-08;
|
||||
relTol 0.001;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
nOuterCorrectors 10;
|
||||
nCorrectors 1;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
|
||||
residualControl
|
||||
{
|
||||
U
|
||||
{
|
||||
relTol 0;
|
||||
tolerance 0.00001;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
/*equations
|
||||
{
|
||||
p 0.4;
|
||||
U 0.6;
|
||||
}*/
|
||||
}
|
||||
|
||||
potentialFlow
|
||||
{
|
||||
nNonOrthogonalCorrectors 20;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||