TUT: Modified tutorials and added cyclic test case.

This commit is contained in:
Johan Roenby 2018-06-12 14:01:25 +02:00 committed by Andrew Heather
parent 25a7e4da7b
commit 83b8032dcc
23 changed files with 639 additions and 17 deletions

View File

@ -26,7 +26,9 @@ solvers
clip true;
nAlphaSubCycles 1;
cAlpha 1;
cAlpha 1; // Note: cAlpha is not used by isoAdvector but must
// be specified because interfacePropertes object
// reads it during construction.
}
"pcorr.*"

View File

@ -10,8 +10,8 @@ runApplication blockMesh
runApplication topoSet
runApplication subsetMesh -overwrite c0 -patch walls
runApplication setFields
#runApplication decomposePar
#runParallel `getApplication`
runApplication `getApplication`
runApplication decomposePar
runParallel `getApplication`
#runApplication `getApplication`
#------------------------------------------------------------------------------

View File

@ -37,7 +37,7 @@ nBufferLayers 1;
maxRefinement 2;
// Stop refinement if maxCells reached
maxCells 15000000;
maxCells 1500000;
// Flux field and corresponding velocity field. Fluxes on changed
// faces get recalculated by interpolating the velocity. Use 'none'

View File

@ -19,7 +19,7 @@ solvers
{
"alpha.water.*"
{
isoFaceTol 1e-6;
isoFaceTol 1e-10;
surfCellTol 1e-6;
nAlphaBounds 3;
snapTol 1e-12;

View File

@ -19,8 +19,8 @@ scale 1;
L 5;
nx 100;
y1 -.5;
y2 .5;
y1 -.05;
y2 .05;
ny 1;
H 3;

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / 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 (-.2 0 -.05);
boundaryField
{
right
{
type cyclic;
}
left
{
type cyclic;
}
top
{
type cyclic;
}
bottom
{
type cyclic;
}
"(front|back)"
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
right
{
type cyclic;
}
left
{
type cyclic;
}
top
{
type cyclic;
}
bottom
{
type cyclic;
}
"(front|back)"
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
right
{
type cyclic;
}
left
{
type cyclic;
}
top
{
type cyclic;
}
bottom
{
type cyclic;
}
"(front|back)"
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase0
#------------------------------------------------------------------------------

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
restore0Dir
runApplication blockMesh
runApplication setAlphaField
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh staticFvMesh;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81 );
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-06;
rho [1 -3 0 0 0 0 0] 1000;
}
air
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.48e-05;
rho [1 -3 0 0 0 0 0] 1;
}
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.00;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
L 1;
nx 50;
y1 -.05;
y2 .05;
ny 1;
H 1;
nz 50;
vertices
(
(0 $y1 0)
($L $y1 0)
($L $y2 0)
(0 $y2 0)
(0 $y1 $H)
($L $y1 $H)
($L $y2 $H)
(0 $y2 $H)
);
blocks
(
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
left
{
type cyclic;
neighbourPatch right;
faces
(
(0 4 7 3)
);
}
right
{
type cyclic;
neighbourPatch left;
faces
(
(1 2 6 5)
);
}
top
{
type cyclic;
neighbourPatch bottom;
faces
(
(4 5 6 7)
);
}
bottom
{
type cyclic;
neighbourPatch top;
faces
(
(0 3 2 1)
);
}
front
{
type empty;
faces
(
(0 1 5 4)
);
}
back
{
type empty;
faces
(
(2 3 7 6)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interIsoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 20;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval .5;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.5;
maxAlphaCo 0.5;
maxDeltaT 1;
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 1;
method simple;
simpleCoeffs
{
n ( 2 1 2 );
delta 0.001;
}
hierarchicalCoeffs
{
n ( 1 1 1 );
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.water.*"
{
isoFaceTol 1e-6;
surfCellTol 1e-6;
snapTol 1e-10;
nAlphaBounds 3;
clip true;
nAlphaCorr 2;
nAlphaSubCycles 1;
cAlpha 1;
MULESCorr yes;
nLimiterIter 3;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
}
"pcorr.*"
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-07;
relTol 0;
}
U
{
prescribedU true;
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
}
PIMPLE
{
frozenFlow yes;
momentumPredictor no;
nCorrectors -1;
nNonOrthogonalCorrectors -1;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setAlphaFieldDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
field "alpha.water";
type cylinder;
direction (0 1 0);
radius 0.15;
centre (.5 0 .75);
// ************************************************************************* //

View File

@ -32,6 +32,6 @@ air
rho [1 -3 0 0 0 0 0] 1;
}
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.00;
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
// ************************************************************************* //

View File

@ -19,8 +19,8 @@ scale 1;
L 1;
nx 50;
y1 -.01;
y2 .01;
y1 -.005;
y2 .005;
ny 1;
H 1;

View File

@ -20,9 +20,9 @@ solvers
"alpha.*"
{
isoFaceTol 1e-6;
isoFaceTol 1e-10;
surfCellTol 1e-6;
nAlphaBounds 2;
nAlphaBounds 3;
snapTol 1e-12;
clip true;
@ -34,7 +34,7 @@ solvers
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
tolerance 1e-8;
relTol 0;
}
@ -49,7 +49,7 @@ solvers
p_rghFinal
{
$p_rgh;
tolerance 1e-07;
tolerance 1e-09;
relTol 0;
}
@ -57,7 +57,7 @@ solvers
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
tolerance 1e-08;
relTol 0;
}
}
@ -66,7 +66,6 @@ PIMPLE
{
momentumPredictor no;
nCorrectors 3;
nOuterCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;