drivaerFastback: example case of automotive aerodynamics

This commit is contained in:
Chris Greenshields
2021-02-18 19:43:45 +00:00
parent 0e13649996
commit c8e35a2f67
23 changed files with 626636 additions and 0 deletions

View File

@ -0,0 +1,70 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Uinlet 16;
wheelRadius 0.318;
wheelBase 2.786;
wheelSpeed #calc "$Uinlet / $wheelRadius";
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform ($Uinlet 0 0);
}
ground { $inlet; }
freestream
{
type freestreamVelocity;
freestreamValue uniform ($Uinlet 0 0);
}
wall
{
type noSlip;
}
frontWheels
{
type rotatingWallVelocity;
origin (0 0 $wheelRadius);
axis (0 -1 0);
omega $wheelSpeed;
}
rearWheels
{
$frontWheels;
origin ($wheelBase 0 $wheelRadius);
}
processor
{
type processor;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
kInlet 0.002;
dimensions [0 2 -2 0 0 0 0];
internalField uniform $kInlet;
boundaryField
{
inlet
{
type fixedValue;
value uniform $kInlet;
}
freestream
{
type inletOutlet;
inletValue uniform $kInlet;
value uniform $kInlet;
}
wall
{
type kqRWallFunction;
value uniform $kInlet;
}
processor
{
type processor;
value uniform $kInlet;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
freestream
{
type calculated;
value uniform 0;
}
wall
{
type nutUSpaldingWallFunction;
value uniform 0;
}
processor
{
type processor;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
omegaInlet 1.0;
dimensions [0 0 -1 0 0 0 0];
internalField uniform $omegaInlet;
boundaryField
{
inlet
{
type fixedValue;
value uniform $omegaInlet;
}
freestream
{
type inletOutlet;
inletValue uniform $omegaInlet;
value uniform $omegaInlet;
}
wall
{
type omegaWallFunction;
value uniform $omegaInlet;
}
processor
{
type processor;
value uniform $omegaInlet;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
freestream
{
type freestreamPressure;
freestreamValue uniform 0;
value uniform 0;
}
wall
{
type zeroGradient;
}
processor
{
type processor;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,17 @@
#!/bin/sh
# Run from this directory
cd "${0%/*}" || exit 1
# Source tutorial clean functions
. "$WM_PROJECT_DIR/bin/tools/CleanFunctions"
# Delete the following:
# - time directories
# - constant/polyMesh directory
# - postProcessing and VTK directories
# - log files
# - field files with a ".orig" backup
cleanCase
#------------------------------------------------------------------------------

View File

@ -0,0 +1,23 @@
#!/bin/sh
# Run from this directory
cd "${0%/*}" || exit 1
# Source tutorial run functions
. "$WM_PROJECT_DIR/bin/tools/RunFunctions"
runApplication blockMesh
runApplication decomposePar -copyZero
# echo "Switching to ptscotch for dynamic load balancing with snappyHexMesh"
# foamDictionary \
# -entry method -set ptscotch system/decomposeParDict > /dev/null
runParallel snappyHexMesh -overwrite
runParallel checkMesh
runParallel "$(getApplication)"
#------------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object momentumTransport;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
model kOmegaSST;
turbulence on;
printCoeffs on;
}
LES
{
model SpalartAllmarasDDES;
delta cubeRootVol;
turbulence on;
printCoeffs on;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
}
// ************************************************************************* //

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
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.5e-05;
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
xMin -10;
xMax 30;
yMin -5;
yMax 5;
zMin 0;
zMax 8;
xCells 80; // 40
yCells 20; // 10
zCells 16; // 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)
);
edges
(
);
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)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Writes out surface files with interpolated field data in VTK format, e.g.
cutting planes, iso-surfaces and patch boundary surfaces.
This file includes a selection of example surfaces, each of which the user
should configure and/or remove.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/visualization/surfaces.cfg"
fields (p);
surfaces
(
car
{
$patchSurface;
patches ( ".*(body|Wheels)" );
}
);
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
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 car
#includeFunc streamlines
#includeFunc slices
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,31 @@
/*--------------------------------*- 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 (pressure
is kinematic, e.g. m^2/s^2).
\*---------------------------------------------------------------------------*/
#include "$FOAM_CASE/0/U"
patches ( ".*(body|Wheels)" );
magUInf $Uinlet;
lRef $wheelBase;
Aref 2.154;
liftDir (0 0 1);
dragDir (1 0 0);
CofR (1.391 0 0);
pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg"
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Writes out surface files with interpolated field data in VTK format, e.g.
cutting planes, iso-surfaces and patch boundary surfaces.
This file includes a selection of example surfaces, each of which the user
should configure and/or remove.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/visualization/surfaces.cfg"
fields (p U);
surfaces
(
xNormal
{
$cuttingPlane;
pointAndNormalDict
{
point (4 0 1);
normal $x;
}
filtering full;
}
yNormal
{
$cuttingPlane;
pointAndNormalDict
{
point (-5 0.02 1);
normal $y;
}
filtering full;
}
);
// ************************************************************************* //

View File

@ -0,0 +1,139 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
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;
levels ((1E15 4));
}
".*stream"
{
mode inside;
levels ((1E15 3));
}
}
locationInMesh (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;
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Writes out files of streamlines with interpolated field data in VTK format.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/visualization/streamlines.cfg"
fields (U);
direction both;
seedSampleSet
{
type sphereRandom;
centre (4 0 0.7);
radius 1;
nPoints 30;
axis x;
}
// ************************************************************************* //