Академический Документы
Профессиональный Документы
Культура Документы
SRF
MRF
Moving mesh
Constraint patches
Other
2015-06-30
H
akan Nilsson
2015-06-30
1 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Introduction
H
akan Nilsson
2015-06-30
2 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Introduction
ERCOFTAC
Centrifugal Pump (ECP)
H
akan Nilsson
Timisoara
Swirl Generator (TSG)
2015-06-30
3 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Introduction
Prerequisites
simpleFoam
and
icoFoam
H
akan Nilsson
2015-06-30
4 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Introduction
Learning outcomes
H
akan Nilsson
2015-06-30
5 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Introduction
Necessary:
Utilities for special mesh/case preparation
Solvers that include the effect of rotation of (part(s) of) the domain
Libraries for mesh rotation, or source terms for the rotation
Coupling of rotating and steady parts of the mesh
Useful:
Specialized boundary conditions for rotation and axi-symmetry
A cylindrical coordinate system class
Tailored data extraction and post-processing
H
akan Nilsson
2015-06-30
6 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Introduction
Training organization
The rotation approaches (SRF, MRF, moving mesh) are presented as:
Theory
Solver, compared to basic solver
Classes, called by additions to basic solver
Summary of difference from basic solver
Tutorials - how to set up and run
Dictionaries and utilities
Special boundary conditions
This is followed by:
Constraint patches - cyclic, GGI of different flavours
Other useful information
H
akan Nilsson
2015-06-30
7 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
centrif ugal
~uR = 0
~ ~r
where ~uR = ~uI
See derivation at:
http://openfoamwiki.net/index.php/See_the_MRF_development
H
akan Nilsson
2015-06-30
8 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
autoPtr<SRF::SRFModel> SRF
(
SRF::SRFModel::New(Urel)
);
In UrelEqn of simpleSRFFoam.C: + SRF->Su()
At end of simpleSRFFoam.C, calculate and write also
velocity: Urel + SRF->U()
H
akan Nilsson
SRFModel
the absolute
class?
2015-06-30
9 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Code:
$FOAM_SRC/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel
Reads
constant/SRFProperties
to set:
as
velocity
H
akan Nilsson
2015-06-30
10 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
The
simpleSRFFoam
adding to
UEqn
specifying the
(LHS):
omega
simpleFoam
solver by
vector
H
akan Nilsson
2015-06-30
11 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Run tutorial:
cp -r $FOAM_TUTORIALS/incompressible/simpleSRFFoam/axialTurbine $FOAM_RUN
cd $FOAM_RUN/axialTurbine
./Allrun >& log_Allrun &
Clean up:
./Allclean
H
akan Nilsson
2015-06-30
12 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
2015-06-30
13 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Mesh generation
The mesh is done with m4 and blockMesh
Cylindrical coordinates are utilized (modified angle: 1/20)
The modified angle is transformed back to radians:
transformPoints -scale "(1 20 1)"
setBatchGgi):
In system/decomposeParDict:
globalFaceZones ( RUCYCLIC1Zone RUCYCLIC2Zone );
H
akan Nilsson
VTK
directory
2015-06-30
14 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
constant/SRFProperties:
rpm;
axis (0 0 1);
rpmCoeffs
{
rpm -95.49; //-10 rad/s
}
Currently, the rotational speed can only be specified in rpm, but can easily
be extended starting from:
$FOAM_SRC/finiteVolume/cfdTools/general/SRF/SRFModel/rpm
H
akan Nilsson
2015-06-30
15 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
value
}
RUSHROUD
{
type
inletValue
relative
value
}
Urel:
SRFVelocity;
uniform (0 0 -1);
no; // no means that inletValue is applied as is
// (Urel = inletValue)
// yes means that rotation is subtracted from inletValue
// (Urel = inletValue - omega X r)
// and makes sure that conversion to Uabs
// is done correctly
uniform (0 0 0); // Just for paraFoam
SRFVelocity;
uniform (0 0 0);
yes;
uniform (0 0 0);
2015-06-30
16 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
In
updateCoeffs:
// If relative, include the effect of the SRF
if (relative_)
{
// Get reference to the SRF model
const SRF::SRFModel& srf =
db().lookupObject<SRF::SRFModel>("SRFProperties");
// Determine patch velocity due to SRF
const vectorField SRFVelocity = srf.velocity(patch().Cf());
operator==(-SRFVelocity + inletValue_);
}
else // If absolute, simply supply the inlet value as a fixed value
{
operator==(inletValue_);
}
H
akan Nilsson
2015-06-30
17 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
2015-06-30
18 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Run tutorial:
cp -r $FOAM_TUTORIALS/incompressible/simpleSRFFoam/mixer $FOAM_RUN
cd $FOAM_RUN/mixer
./Allrun >& log_Allrun &
H
akan Nilsson
2015-06-30
19 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
2015-06-30
20 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
2015-06-30
21 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
MRFZones
class?
2015-06-30
22 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Code:
$FOAM_SRC/finiteVolume/cfdTools/general/MRF/MRFZone.C
Reads
constant/MRFZones
to:
Calls
H
akan Nilsson
setMRFFaces()...
2015-06-30
23 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
2015-06-30
24 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
2015-06-30
25 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
UEqn
(minus on the
2015-06-30
26 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
// Included patches
forAll(includedFaces_, patchi)
{
forAll(includedFaces_[patchi], i)
{
label patchFacei = includedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] = 0.0;
}
}
// Excluded patches
forAll(excludedFaces_, patchi)
{
forAll(excludedFaces_[patchi], i)
{
label patchFacei = excludedFaces_[patchi][i];
phi.boundaryField()[patchi][patchFacei] -=
rho.boundaryField()[patchi][patchFacei]
*(Omega ^
(Cf.boundaryField()[patchi][patchFacei]
- origin))
& Sf.boundaryField()[patchi][patchFacei];
}}}
2015-06-30
27 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
MRFSimpleFoam
Omega
simpleFoam
solver by
-V[celli]*(Omega ^ U[celli])
to
UEqn.source()
H
akan Nilsson
2015-06-30
28 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
simpleSRFFoam/axialTurbine
2015-06-30
29 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
GVOUTLET/RUINLET
H
akan Nilsson
and
RUOUTLET/DTINLET
2015-06-30
30 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
2015-06-30
31 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
2015-06-30
32 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
cellZones:
origin [0 1 0 0 0 0 0] (0 0 0);
axis
[0 0 0 0 0 0 0] (0 0 1);
omega [0 0 -1 0 0 0 0] -10; //In radians per second
2015-06-30
33 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Parallel set-up
All GGI interfaces should be listed in
globalFaceZones
in
system/decomposeParDict
2015-06-30
34 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Run tutorial:
cp -r $FOAM_TUTORIALS/incompressible/MRFSimpleFoam/mixerVessel2D $FOAM_RUN
cd $FOAM_RUN/mixerVessel2D
./Allrun >& log_Allrun &
H
akan Nilsson
2015-06-30
35 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
The rotor cellzone is used to define where to apply the additional term
Note that the solution resembles a snap-shot of a specific rotor
orientation. Wakes will become unphysical!
H
akan Nilsson
2015-06-30
36 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
The
makeMesh
file:
H
akan Nilsson
cellZone
must be
2015-06-30
37 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
reads the cellSetDict and in this case uses the rotor cellZone to
write that zone as a cellSet. This was already done by blockMesh, so in
fact it doesnt have to be done again.
cellSet
setsToZones -noFlipMap
cellZone
H
akan Nilsson
2015-06-30
38 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
2015-06-30
39 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
Z
ui~v ~ndS
2015-06-30
40 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
2015-06-30
41 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
dynamicMesh classes
The
dynamicMesh
$FOAM_SRC/dynamicMesh
There are two major branches, bases on how the coupling is done:
GGI (no mesh modifications, i.e. non morphing)
$FOAM_SRC/dynamicMesh/dynamicFvMesh/mixerGgiFvMesh
$FOAM_TUTORIALS/incompressible/icoDyMFoam/mixerGgi
$FOAM_SRC/dynamicMesh/dynamicFvMesh/turboFvMesh
$FOAM_TUTORIALS/incompressible/icoDyMFoam/turboPassageRotating
$FOAM_TUTORIALS/incompressible/pimpleDyMFoam/axialTurbine
No tutorial
We focus on
H
akan Nilsson
turboFvMesh
...
Rotating machinery training at OFW10
2015-06-30
42 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
In $FOAM SRC/dynamicMesh/dynamicFvMesh/turboFvMesh
bool Foam::turboFvMesh::update()
{
movePoints
(
csPtr_->globalPosition
(
csPtr_->localPosition(allPoints())
+ movingPoints()*time().deltaT().value()
)
);
// The mesh is not morphing
return false;
}
Member data csPtr_ is the coordinate system read from the dynamicMeshDict
dictionary. Member function movingPoints() uses the rpm for each rotating
cellZone, specified in the dynamicMeshDict dictionary, and applies it as an
angular rotation in the cylindrical coordinate system.
H
akan Nilsson
2015-06-30
43 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
In $FOAM SRC/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C
void Foam::fvc::makeRelative
(
surfaceScalarField& phi,
const volVectorField& U
)
{
if (phi.mesh().moving())
{
phi -= fvc::meshPhi(U);
}
}
2015-06-30
44 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
In $FOAM SRC/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C
Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
(
const volVectorField& vf
)
{
return fv::ddtScheme<vector>::New
(
vf.mesh(),
vf.mesh().ddtScheme("ddt(" + vf.name() + ')')
)().meshPhi(vf);
}
E.g.
$FOAM_SRC/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C:
template<class Type>
tmp<surfaceScalarField> EulerDdtScheme<Type>::meshPhi
(
const GeometricField<Type, fvPatchField, volMesh>&
)
{
return mesh().phi(); // See $FOAM_SRC/finiteVolume/fvMesh/fvMeshGeometry.C
}
H
akan Nilsson
2015-06-30
45 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
H
akan Nilsson
pimpleDyMFoam
and
pimpleFoam
are similar.
2015-06-30
46 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
Run tutorial:
tut
cp -r incompressible/pimpleDyMFoam/axialTurbine \
$FOAM_RUN/axialTurbine_overlapGgi
cd $FOAM_RUN/axialTurbine_overlapGgi
./Allrun >& log_Allrun &
paraview --state=allBlades.pvsm #Click on Play!
./Allclean
H
akan Nilsson
2015-06-30
47 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
H
akan Nilsson
2015-06-30
48 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
H
akan Nilsson
2015-06-30
49 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
2015-06-30
50 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
overlapGgi
type movingWallVelocity
Rotation is specified in
H
akan Nilsson
constant/dynamicMeshDict
2015-06-30
51 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
The dynamicMeshDict
In
constant/dynamicMeshDict:
dynamicFvMesh
turboFvMesh;
turboFvMeshCoeffs
{
coordinateSystem
{
type
cylindrical;
origin
(0 0 0);
axis
(0 0 1);
direction
(1 0 0);
}
rpm { rotor -95.49578; }
slider
//Probably not needed!
{
RUINLET -95.49578;
RUOUTLET -95.49578;
RUCYCLIC1 -95.49578;
RUCYCLIC2 -95.49578;
}
}
H
akan Nilsson
2015-06-30
52 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
Run tutorial
tut
cp -r incompressible/icoDyMFoam/turboPassageRotating $FOAM_RUN
cd $FOAM_RUN/turboPassageRotating
./Allrun >& log_Allrun &
H
akan Nilsson
2015-06-30
53 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
The
H
akan Nilsson
cellRegion0 cellZone
2015-06-30
54 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
blockMesh:
setsToZones -noFlipMap:
face normals
icoDyMFoam:
I.e. we need a cellZone for the rotating region(s), to specify the rpms in
and faceZones for the GGI interfaces (fix for parallel
simulations). The cellZone could have been generated directly by blockMesh.
dynamicMeshDict
H
akan Nilsson
2015-06-30
55 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
2015-06-30
56 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Moving mesh
surfaceNormalFixedValue;
uniform -10;
uniform (9.6592582628906829 2.5881904510252074 0);
movingWallVelocity;
uniform (0 0 0);
57 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
Constraint patches
We will now have a look at how they should be specified in the cases.
We will also see how they can be analysed.
H
akan Nilsson
2015-06-30
58 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
turboPassageRotating):
cyclic;
100;
31400;
0.9;
2015-06-30
59 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
axialTurbine_ggi):
cyclic;
240;
11940;
0.9;
rotational;
(0 0 1);
(0 0 0);
-72; //Degrees from second half to first half
H
akan Nilsson
cyclic 1;
2015-06-30
60 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
2015-06-30
61 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
ggi;
patch2;
patch1Zone;
false;
are created by
with the
2015-06-30
62 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
overlapGgi;
patch2;
patch1Zone;
(0 0 1);
5;
nCopies specifies how many copies of the segment that fill up a full lap
(360 degrees)
2015-06-30
63 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
rotationAngle
separationOffset
H
akan Nilsson
2015-06-30
64 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
No
bridgeOverlap
H
akan Nilsson
option for
mixingPlane
2015-06-30
65 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
boundary
$FOAM_SRC/foam/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.C
H
akan Nilsson
2015-06-30
66 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
mixingPlane
areaAveraging;
areaAveraging;
areaAveraging;
fluxAveraging; //Transported variable
fluxAveraging; //Transported variable
areaAveraging:
See:
$FOAM_SRC/finiteVolume/fields/fvPatchFields/constraint/mixingPlane/mixingPlaneFvPatchField.C
2015-06-30
67 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
H
akan Nilsson
2015-06-30
68 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
boundary
ggi;
overlapGgi;
cyclicGgi;
mixingPlane;
The
mixingPlane
method patchConstrained;
H
akan Nilsson
2015-06-30
69 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
Output example:
Cyclic GGI pair (patch1, patch2) : 0.0006962669457 0.0006962669754
Diff = 8.879008314e-12 or 1.27523048e-06 %
H
akan Nilsson
2015-06-30
70 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
Output example:
Mixing plane pair (patch1, patch2) : 0.00470072382366 -0.00470072382373
Diff = -6.73142097618e-14 or 1.43199669427e-09 %
H
akan Nilsson
2015-06-30
71 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
2;
2;
Creates:
VTK/mixingPlaneMaster*
VTK/mixingPlaneRibbon*
VTK/mixingPlaneShadow*
Load all at the same time in ParaView. You will most likely have to
rescale the y-component (angle: or 180 180).
Make sure that they overlap as they should.
Make sure that they are flat enough (no wrinkles or wavyness).
Make sure that the ribbons resolve both sides of the interface.
H
akan Nilsson
2015-06-30
72 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
H
akan Nilsson
2015-06-30
73 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
H
akan Nilsson
2015-06-30
74 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
H
akan Nilsson
2015-06-30
75 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
H
akan Nilsson
2015-06-30
76 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Constraint patches
H
akan Nilsson
2015-06-30
77 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
blockMesh
regionCellSets
and
setsToZones -noFlipMap
using the
cellSet
utility, the
cylinderToCell
cellSource, and
setsToZones -noFlipMap
fluent3DMeshToFoam
Zones,
or
foamToVTK)
H
akan Nilsson
2015-06-30
78 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
$FOAM_SRC/finiteVolume/fields/fvPatchFields/derived:
movingWallVelocity
rotatingWallVelocity
flowRateInletVelocity
surfaceNormalFixedValue
rotatingPressureInletOutletVelocity
rotatingTotalPressure
C.f.
C.f.
pressureInletOutletVelocity
totalPressure
At http://openfoamwiki.net/index.php/Sig_Turbomachinery_Library_OpenFoamTurbo,
e.g.:
profile1DfixedValue
H
akan Nilsson
2015-06-30
79 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
H
akan Nilsson
2015-06-30
80 / 81
Introduction
SRF
MRF
Moving mesh
Constraint patches
Other
Questions?
Further information
http://openfoamwiki.net/index.php/Sig_Turbomachinery
http://www.extend-project.de/user-groups/11/viewgroup/groups
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD
(if you want to link, please add the year as e.g.: OS_CFD_2012)
H
akan Nilsson
2015-06-30
81 / 81