solvers::incompressibleFluid: New solver module for incompressible fluid flow

executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces pimpleFoam, pisoFoam and simpleFoam and all
the corresponding tutorials have been updated and moved to
tutorials/modules/incompressibleFluid.

Class
    Foam::solvers::incompressibleFluid

Description
    Solver module for steady or transient turbulent flow of incompressible
    isothermal fluids with optional mesh motion and change.

    Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
    pseudo-transient and steady simulations.

    Optional fvModels and fvConstraints are provided to enhance the simulation
    in many ways including adding various sources, constraining or limiting
    the solution.

    Reference:
    \verbatim
        Greenshields, C. J., & Weller, H. G. (2022).
        Notes on Computational Fluid Dynamics: General Principles.
        CFD Direct Ltd.: Reading, UK.
    \endverbatim

SourceFiles
    incompressibleFluid.C

See also
    Foam::solvers::fluidSolver
    Foam::solvers::isothermalFluid
This commit is contained in:
Henry Weller
2022-08-08 22:46:51 +01:00
parent 80d869974e
commit ca89189ecd
714 changed files with 1574 additions and 796 deletions

View File

@ -0,0 +1,80 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
xMin -10;
xMax 30;
yMin -5;
yMax 5;
zMin 0;
zMax 8;
xCells 40;
yCells 10;
zCells 8;
convertToMeters 1;
vertices
(
($xMin $yMin $zMin)
($xMax $yMin $zMin)
($xMax $yMax $zMin)
($xMin $yMax $zMin)
($xMin $yMin $zMax)
($xMax $yMin $zMax)
($xMax $yMax $zMax)
($xMin $yMax $zMax)
);
blocks
(
hex (0 1 2 3 4 5 6 7) ($xCells $yCells $zCells) simpleGrading (1 1 1)
);
boundary
(
inlet
{
type patch;
faces
(
(0 3 7 4)
);
}
freestream
{
type patch;
faces
(
(1 5 6 2)
(4 7 6 5)
(3 2 6 7)
(0 4 5 1)
);
}
ground
{
type wall;
faces
(
(0 1 2 3)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application simpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1000;
deltaT 1;
writeControl timeStep;
writeInterval 250;
purgeWrite 0;
writeFormat binary;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// adjustTimeStep yes;
// maxCo 1;
functions
{
#includeFunc forceCoeffsIncompressible
#includeFunc time
#includeFunc streamlinesSphere
(
funcName=streamlines,
centre=(4 0 0.7),
radius=1,
nPoints=30,
fields=(U)
)
#includeFunc cutPlaneSurface
(
funcName=xNormal,
point=(4 0 1),
normal=(1 0 0),
fields=(p U)
)
#includeFunc cutPlaneSurface
(
funcName=yNormal,
point=(-5 0.02 1),
normal=(0 1 0),
fields=(p U)
)
#includeFunc patchSurface(funcName=car, patch=".*(body|Wheels)", p)
}
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method scotch;
//method hierarchical;
hierarchicalCoeffs
{
n (4 2 1);
order xyz;
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Calculates lift, drag and moment coefficients by summing forces on
specified patches for a case where the solver is incompressible; i.e.,
pressure is kinematic and has units of m^2/s^2.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg"
#include "$FOAM_CASE/0/U"
patches (".*(body|Wheels)"); // Patches on which to calculate forces
magUInf $Uinlet; // Far field velocity magnitude; e.g., 20 m/s
lRef $wheelBase; // Reference length scale for moment calculations;
// e.g., 1 m
Aref 2.154; // Reference area; e.g., 1 m^2
CofR (1.391 0 0); // Centre of rotation; e.g., (0 0 0)
liftDir (0 0 1); // Direction of lift force; e.g., (0 0 1)
dragDir (1 0 0); // Direction of drag force; e.g., (1 0 0)
pitchAxis (0 1 0); // Pitch axis; e.g., (0 1 0)
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
// For transient, replace steadyState, e.g. with Euler
default steadyState;
}
gradSchemes
{
default Gauss linear;
limited cellLimited Gauss linear 1;
grad(U) $limited;
grad(k) $limited;
grad(omega) $limited;
}
divSchemes
{
default none;
// For transient, remove "bounded"
div(phi,U) bounded Gauss linearUpwind limited;
// For transient, remove "bounded"
turbulence bounded Gauss limitedLinear 1;
div(phi,k) $turbulence;
div(phi,omega) $turbulence;
div(phi,epsilon) $turbulence;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
wallDist
{
method meshWave;
}
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
smoother GaussSeidel;
tolerance 1e-6;
relTol 0.1;
}
pFinal
{
$p;
relTol 0;
}
Phi
{
$p;
}
"(U|k|omega|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0.1;
}
"(U|k|omega|epsilon)Final"
{
$U;
relTol 0;
}
}
SIMPLE
{
residualControl
{
p 1e-4;
U 1e-4;
"(k|omega|epsilon)" 1e-4;
}
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
potentialFlow
{
nNonOrthogonalCorrectors 10;
}
relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
"(k|omega|epsilon)" 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg"
//- minFaceWeight (0 -> 0.5)
//minFaceWeight 0.02;
// ************************************************************************* //

View File

@ -0,0 +1,138 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"
castellatedMesh on;
snap on;
addLayers on;
geometry
{
body
{
type triSurfaceMesh;
file "body.obj";
}
frontWheels
{
type triSurfaceMesh;
file "frontWheels.obj";
}
rearWheels
{
type triSurfaceMesh;
file "rearWheels.obj";
}
upstream
{
type searchableBox;
min (-10 -1.5 0);
max ( 3 1.5 0.8);
}
underbody
{
type searchableBox;
min (-10 -1.5 0);
max ( 3 1.5 0.15);
}
wake
{
type searchableBox;
min ( 3 -1.2 0);
max ( 6 1.2 1.4);
}
downstream
{
type searchableBox;
min ( 3 -1.5 0);
max (30 1.5 1.8);
}
};
castellatedMeshControls
{
features ();
refinementSurfaces
{
body
{
level (5 5);
patchInfo { type wall; }
}
".*Wheels" // level 5 needed to avoid single cells in treads
{
level (4 5);
patchInfo { type wall; }
}
}
refinementRegions
{
body
{
mode distance;
levels ((0.2 5));
}
"(wake|underbody)"
{
mode inside;
level 4;
}
".*stream"
{
mode inside;
level 3;
}
}
insidePoint (0 0 3);
nCellsBetweenLevels 5;
}
snapControls {}
addLayersControls
{
layers
{
body
{
nSurfaceLayers 2;
}
}
relativeSizes on;
expansionRatio 1.2;
finalLayerThickness 0.5;
minThickness 1e-3;
maxThicknessToMedialRatio 0.6;
}
writeFlags ();
mergeTolerance 1e-6;
// ************************************************************************* //