Commit b325cb86 authored by Andrew Heather's avatar Andrew Heather

TUT: added mixerVesselAMI2DRefined to show example of AMI with topology change

parent 2ba62438
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
rotor
{
type movingWallVelocity;
value uniform (0 0 0);
}
stator
{
type movingWallVelocity;
value uniform (0 0 0);
}
front
{
type movingWallVelocity;
value uniform (0 0 0);
}
back
{
type movingWallVelocity;
value uniform (0 0 0);
}
AMI1
{
type cyclicAMI;
value $internalField;
}
AMI2
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 20;
boundaryField
{
rotor
{
type epsilonWallFunction;
value $internalField;
}
stator
{
type epsilonWallFunction;
value $internalField;
}
front
{
type epsilonWallFunction;
value $internalField;
}
back
{
type epsilonWallFunction;
value $internalField;
}
AMI1
{
type cyclicAMI;
value $internalField;
}
AMI2
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1;
boundaryField
{
rotor
{
type kqRWallFunction;
value uniform 0;
}
stator
{
type kqRWallFunction;
value uniform 0;
}
front
{
type kqRWallFunction;
value uniform 0;
}
back
{
type kqRWallFunction;
value uniform 0;
}
AMI1
{
type cyclicAMI;
value $internalField;
}
AMI2
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / 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
{
rotor
{
type nutkWallFunction;
value uniform 0;
}
stator
{
type nutkWallFunction;
value uniform 0;
}
front
{
type nutkWallFunction;
value uniform 0;
}
back
{
type nutkWallFunction;
value uniform 0;
}
AMI1
{
type cyclicAMI;
value $internalField;
}
AMI2
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
rotor
{
type zeroGradient;
}
stator
{
type zeroGradient;
}
front
{
type zeroGradient;
}
back
{
type zeroGradient;
}
AMI1
{
type cyclicAMI;
value $internalField;
}
AMI2
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
./makeMesh
#runApplication $(getApplication)
runApplication decomposePar
runParallel $(getApplication)
runParallel redistributePar -reconstruct
#------------------------------------------------------------------------------
Refined version that includes wall layers.
- this causes significant pressure spikes using the default AMI
dynamicFvMesh dynamicMotionSolverFvMesh;
- enabling topology change where a 1-to-1 connectivity is established across
the AMI leads to a much smoother pressure trace. Ony change needed is to the
motion solver:
dynamicFvMesh dynamicMotionSolverFvMeshAMI;
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMeshAMI;
//dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolver solidBody;
cellZone rotor;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu 1e-05;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
m4 < system/blockMeshDict.m4 > system/blockMeshDict
runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------
set terminal pngcairo
set output "plot.png"
set yrange [-0.001 : 0.001]
plot "postProcessing/forces/0/moment.dat" u 1:4 w lines
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.2; // 5;
deltaT 1e-3;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
adjustTimeStep yes;
maxCo 0.5;
functions
{
AMI1
{
type surfaceFieldValue;
functionObjectLibs ("libfieldFunctionObjects.so");
log true;
executeControl timeStep;
executeInterval 1;
writeFields true;
regionType patch;
name AMI1;
operation sum;
surfaceFormat none;
fields (phi);
}
AMI2
{
type surfaceFieldValue;
functionObjectLibs ("libfieldFunctionObjects.so");
log true;
executeControl timeStep;
executeInterval 1;
writeFields true;
regionType patch;
name AMI2;
operation sum;
surfaceFormat none;
fields (phi);
}
forces
{
type forces;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
timeInterval 1;
log yes;
patches ( "rotor" );
pName p;
UName U;
rho rhoInf; // Indicates incompressible
log true;
rhoInf 997; // Redundant for incompressible
CofR (0 0 0); // Rotation around centre line of propeller
pitchAxis (0 0 1);
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Force AMI to be on single processor. Can cause imbalance with some
// decomposers.
//singleProcessorFaceSets ((AMI -1));
numberOfSubdomains 4;
method scotch;
distributed no;
roots ( );
// ************************************************************************* //