cfmeshing hell - 30P-30N Validation Case

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

I am trying to validate FreeCAD/cfmesh/OpenFOAM against Wolf Dynamic's 30P-30N OpenFOAM validation case.
http://www.wolfdynamics.com/tutorials.html?id=119

I have created a github repository that has the necessary files to perform this validation, including a FreeCAD model with a 30P-30N wing and windtunnel and a CfdOF analysis object.
https://github.com/linuxguy123/30P-30N-Validation-Case
https://github.com/linuxguy123/30P-30N- ... tion.FCStd

The later file can be obtained locally with

Code: Select all

 $git clone https://github.com/linuxguy123/30P-30N-Validation-Case/blob/main/30P-30N-Validation.FCStd 
It was not possible to upload this file to the FreeCAD forum due to its size (1.1MB).

I have not been able to achieve validation of the 30P-30N airfoil with the CfdOF workbench after many tries. I believe this to be due to the mesh quality. Either the mesh is too coarse and I achieve a Cl of 1.8-1.9 or the mesh is too fine and cfmesh crashes due to lack of memory (64GB) or the solver crashes due to being unable to apply a patch or a divide by zero error due to ?.

I am hoping that the cfmesh wizards can show me/us how to achieve accurate results using CfdOF.

Thank you.
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

So why does this happen ?
bad mesh.png
bad mesh.png (285.61 KiB) Viewed 1588 times
The rest of the mesh looks good. I'd share images of the mesh, but the file sizes are too large.
mesh4.png
mesh4.png (467.61 KiB) Viewed 1584 times

Code: Select all

 Executing: checkMesh -meshQuality in /home/me/CFD/_0P_30N_Validation/meshCase
21:45:42  /*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2206                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _8993af73-20221106 OPENFOAM=2206 patch=221104 version=2206
Arch   : "LSB;label=32;scalar=64"
Exec   : checkMesh -meshQuality
Date   : Apr 05 2023
Time   : 21:45:42
Host   : workstation1
PID    : 412176
I/O    : uncollated
21:45:42  Case   : /home/me/CFD/_0P_30N_Validation/meshCase
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning : 
    From static Foam::instantList Foam::timeSelector::select0(Foam::Time&, const Foam::argList&)
    in file db/Time/timeSelector.C at line 252
    No time specified or available, selecting 'constant'
21:45:42  Create mesh for time = constant

Enabling user-defined geometry checks.

21:45:43  Time = constant

21:45:43  Mesh stats 
    points:           636874
    internal points:  0
    faces:            1265002
    internal faces:   629956
    cells:            315521
    faces per cell:   6.00580626963023
    boundary patches: 6
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     311930
    prisms:        1062
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     2529
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            7   2167
            8   359
            9   3

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
21:45:43      Point usage OK.
21:45:43      Upper triangular ordering OK.
21:45:43      Face vertices OK.
21:45:43      Number of regions: 1 (OK).
21:45:43  
Checking patch topology for multiply connected surfaces...
                   Patch    Faces   Points                  Surface topology
               patch_0_0        0        0                        ok (empty)
21:45:43                 patch_0_1   631042   636874  ok (non-closed singly connected)
21:45:44                 patch_1_0      202      406  ok (non-closed singly connected)
21:45:44                 patch_2_0      202      406  ok (non-closed singly connected)
21:45:44                 patch_3_0     1004     2012  ok (non-closed singly connected)
               patch_4_2     2596     5192  ok (non-closed singly connected)

Checking faceZone topology for multiply connected surfaces...
    No faceZones found.

Checking basic cellZone addressing...
    No cellZones found.

Checking geometry...
    Overall domain bounding box (-3.87471 0.0998157972098515 -2) (6.12529 0.200008659756304 2)
    Mesh has 2 geometric (non-empty/wedge) directions (1 0 1)
    Mesh has 2 solution (non-empty) directions (1 0 1)
21:45:44   ***Number of edges not aligned with or perpendicular to non-empty directions: 10733
21:45:44    <<Writing 21466 points on non-aligned edges to set nonAlignedEdges
    Boundary openness (6.65346051249651e-19 2.95605147460864e-15 -1.2758825567326e-17) OK.
21:45:44      Max cell openness = 2.78205656681319e-16 OK.
    Max aspect ratio = 6.43819710037781 OK.
21:45:44      Minimum face area = 2.23734501388981e-08. Maximum face area = 0.00217170706133672.  Face area magnitudes OK.
 ***Zero or negative cell volume detected.  Minimum negative volume: -4.90348688473621e-06, Number of negative volume cells: 28
  <<Writing 28 zero volume cells to set zeroVolumeCells
21:45:44      Mesh non-orthogonality Max: 163.498734917321 average: 2.65288926061712
   *Number of severely non-orthogonal (> 70 degrees) faces: 112.
 ***Number of non-orthogonality errors: 52.
  <<Writing 164 non-orthogonal faces to set nonOrthoFaces
21:45:44   ***Error in face pyramids: 140 faces are incorrectly oriented.
  <<Writing 112 faces with incorrect orientation to set wrongOrientedFaces
21:45:44   ***Max skewness = 47.7655489604363, 3 highly skew faces detected which may impair the quality of the results
  <<Writing 3 skew faces to set skewFaces
21:45:44      Coupled point location match (average 0) OK.
Checking faces in error :
21:45:44      non-orthogonality >  90 degrees                        : 52
21:45:44      faces with face pyramid volume <     0                 : 60
21:45:44      faces with concavity >  90 degrees                     : 0
21:45:44      faces with area <     0 m^2                            : 0
21:45:44      faces with skewness >  50 (internal) or 100 (boundary) : 0
21:45:44      faces with interpolation weights (0..1)  < 0.0001       : 0
21:45:44      faces with volume ratio of neighbour cells < 0.0001     : 0
21:45:44      faces on cells with determinant <     0                : 0
  <<Writing 112 faces in error to set meshQualityFaces
21:45:44  
Failed 6 mesh checks.

End
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

I got the mesh to work by juggling the meshing parameters. This allowed the solver to run properly and gave really good results.

Cl experimental is 2.167. I got 2.1338. Cd experimental is 0.0332. I got 0.0355.


Finally a good mesh.png
Finally a good mesh.png (723.37 KiB) Viewed 1569 times
Good results.png
Good results.png (42.9 KiB) Viewed 1569 times
Good surface mesh parameters.png
Good surface mesh parameters.png (46.5 KiB) Viewed 1569 times
Good Extrusion mesh parameters.png
Good Extrusion mesh parameters.png (19.41 KiB) Viewed 1569 times
Good residuals.png
Good residuals.png (67.04 KiB) Viewed 1569 times
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

However, when I change the AoA to 14 degrees and do another mesh with the very same parameters, this happens.

How does one prevent this from happening ?
Bad mesh at 14 AoA.png
Bad mesh at 14 AoA.png (254.91 KiB) Viewed 1565 times
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

I tried to simulate a 14 degree AoA by leaving the wing at 0 degrees and tiling the incoming flow up by 14 degrees, but that resulted in really bad residuals and force coefficients. It makes sense that it would because the flow is no longer aligned with the outlet.

I'm sharing this in case I'm doing it wrong. Otherwise other people can learn from my experience.


Inlet tilted 14 degrees.png
Inlet tilted 14 degrees.png (59.71 KiB) Viewed 1550 times
Tilted inlet residuals.png
Tilted inlet residuals.png (125.11 KiB) Viewed 1550 times
Tilted inlet coefficients.png
Tilted inlet coefficients.png (23.37 KiB) Viewed 1550 times
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: cfmeshing hell - 30P-30N Validation Case

Post by herbk »

Same result if you change the AoA a little bit ?
Gruß Herbert
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: cfmeshing hell - 30P-30N Validation Case

Post by oliveroxtoby »

techGuy wrote: Thu Apr 06, 2023 3:43 am So why does this happen ?
There was an issue with the extrusion. I have pushed a fix.
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: cfmeshing hell - 30P-30N Validation Case

Post by oliveroxtoby »

techGuy wrote: Thu Apr 06, 2023 5:33 am I tried to simulate a 14 degree AoA by leaving the wing at 0 degrees and tiling the incoming flow up by 14 degrees, but that resulted in really bad residuals and force coefficients. It makes sense that it would because the flow is no longer aligned with the outlet.
That shouldn't be an issue. It should work if you make the left and bottom patches both inlets, and right and top patches both outlets. See the UAV demo case.
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

oliveroxtoby wrote: Thu Apr 06, 2023 3:11 pm
techGuy wrote: Thu Apr 06, 2023 3:43 am So why does this happen ?
There was an issue with the extrusion. I have pushed a fix.
Thank you for this and all the other work you do in this community.
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: cfmeshing hell - 30P-30N Validation Case

Post by techGuy »

oliveroxtoby wrote: Thu Apr 06, 2023 3:12 pm
techGuy wrote: Thu Apr 06, 2023 5:33 am I tried to simulate a 14 degree AoA by leaving the wing at 0 degrees and tiling the incoming flow up by 14 degrees, but that resulted in really bad residuals and force coefficients. It makes sense that it would because the flow is no longer aligned with the outlet.
That shouldn't be an issue. It should work if you make the left and bottom patches both inlets, and right and top patches both outlets.
I was wondering about doing that. If making multiple patches inlets and multiple patches outlets works, why would one ever need a wall patch ? Wouldn't conventional 1 patch inlet simulations be more accurate if all the other patches were outlets ?

I can save a lot of meshing headache and time if I can build one good mesh and just change the inlet velocity vector.

BTW, openfoam has a command for rotating meshes as well.

Code: Select all

rotateMesh
Rotates the mesh and fields from the direction n1 to direction n2 


https://www.openfoam.com/documentation/ ... -utilities

I've never used it.

I'm really glad I shared my attempt to make this work because it generated this discussion.
See the UAV demo case.
I really like how the demo case was done with a macro rather than as a FCStd file. Much easier to see what is being done/set than looking through FreeCAD GUIs. Good work.
Post Reply