Steady-state CFD simulation of a car, Part 1 of 3 (Modeling, Meshing)

This is my first CFD case on this blog.

In this post, I introduce the 3D model of a car I created, and explain how I generated a grid of the car for OpenFOAM.

Pictures below are the screenshots of Rhino5, wheels are off in this case.

Commands used here are network surface, 1-rail and 2-rail sweep, loft, extrude, blend surface, and boolean operations like trim.




I exported this model as an STL file and generated a grid for OpenFOAM using snappyHexMesh.

The number of cells of the generated grid is approximately 11 million.
Mesh non-orthogonality Max: 65.0233 average: 11.26724
Max skewness is 4.914069, and there are 9 highly skew faces.

Surface of the car:



Grid refinement:


Cell aspect ratio of the initial grid generated by blockMesh is 2:1:1 (X:Y:Z).

I didn't use addLayer feature because snappyHexMesh failed to add layer cells on almost 60% of the faces of the car, and adding layer cells reduced the mesh quality.

================================

checkMesh output:
Mesh stats
    points:           13105520
    faces:            35361740
    internal faces:   33577902
    cells:            11186207
    faces per cell:   6.162915
    boundary patches: 5
    point zones:      0
    face zones:       0
    cell zones:       0
Overall number of cells of each type:
    hexahedra:     10002946
    prisms:        241634
    wedges:        0
    pyramids:      0
    tet wedges:    39
    tetrahedra:    0
    polyhedra:     941588
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            4   104378
            5   83578
            6   160281
            9   439123
           12   116654
           15   37250
           18   319
           21   5
Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).
Checking patch topology for multiply connected surfaces...
                   Patch    Faces   Points                  Surface topology
                   inlet     6272     6441  ok (non-closed singly connected)
                    side    25088    25425  ok (non-closed singly connected)
                  ground    36028    36527  ok (non-closed singly connected)
                  outlet     6272     6441  ok (non-closed singly connected)
              car_OBJECT  1710178  1825844      ok (closed singly connected)
Checking geometry...
    Overall domain bounding box (-5 -5 0) (15 5 5)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-1.627378e-15 5.611724e-16 9.294758e-15) OK.
    Max cell openness = 5.438062e-16 OK.
    Max aspect ratio = 24.62618 OK.
    Minimum face area = 3.688818e-07. Maximum face area = 0.01600377.  Face area magnitudes OK.
    Min volume = 1.28577e-09. Max volume = 0.001428543.  Total volume = 994.9094.  Cell volumes OK.
    Mesh non-orthogonality Max: 65.0233 average: 11.26724
    Non-orthogonality check OK.
    Face pyramids OK.
 ***Max skewness = 4.914069, 9 highly skew faces detected which may impair the quality of the results
  <<Writing 9 skew faces to set skewFaces
    Coupled point location match (average 0) OK.
Failed 1 mesh checks.
End

blockMeshDict:
convertToMeters 1;
vertices      
(
    (-5 -5 0)
    (15 -5 0)
    (15  5 0)
    (-5  5 0)
    (-5 -5 5)
    (15 -5 5)
    (15  5 5)
    (-5  5 5)
);
blocks        
(
    hex (0 1 2 3 4 5 6 7) (112 112 56) simpleGrading (1 1 1)
);
edges        
(
);
patches      
(
    patch inlet
    (
        (4 0 3 7)
    )
    patch side
    (
        (3 2 6 7)
        (7 4 5 6)
        (4 0 1 5)
    )
    wall ground
    (
        (0 1 2 3)
    )
    patch outlet
    (
        (5 1 2 6)
    )
);
mergePatchPairs
(
);

snappyHexMeshDict:
castellatedMesh true;
snap            true;
addLayers       false;

geometry
{
    car_full_scaled.stl
    {
        type triSurfaceMesh;
        name car;
    }
    refinementBox
    {
        type searchableBox;
        min (-2.5 -1.2   0);
        max ( 7.5  1.2 1.5);
    }
};

castellatedMeshControls
{
    maxLocalCells 100000000;
    maxGlobalCells 100000000;
    minRefinementCells 0;
    maxLoadUnbalance 0; //0.1;
    nCellsBetweenLevels 4;

    features
    (
    );

    refinementSurfaces
    {
        car
        {
            level (5 5);
            patchInfo
            {
                type wall;
                inGroups (car);
            }
        }
    }
    resolveFeatureAngle 30;

    refinementRegions
    {
        refinementBox
        {
            mode inside;
            levels ((1E15 2));
        }
    }

    locationInMesh (-3.1 0.1 1.1);

    allowFreeStandingZoneFaces true;
}

snapControls
{
    nSmoothPatch 10;
    tolerance 2.0;
    nSolveIter 300;
    nRelaxIter 10;
    // Feature snapping
        nFeatureSnapIter 30;
        implicitFeatureSnap true;
        explicitFeatureSnap false;
        multiRegionFeatureSnap false;
}

meshQualityControls
{
    maxNonOrtho 65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minVol 1e-13;
    minTetQuality 1e-9;
    minArea -1;
    minTwist 0.02;
    minDeterminant 0.001;
    minFaceWeight 0.02;
    minVolRatio 0.01;
    minTriangleTwist -1;

    nSmoothScale 4;
    errorReduction 0.75;
}

debug 0;

mergeTolerance 1E-6;

Comments