Getting Wrong Answer For Drag And Lift Flow Around A Car

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

EveningSkyPerson
Posts: 7
Joined: Thu Oct 20, 2022 10:45 pm

Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by EveningSkyPerson »

Thank You to Tech Bernd for making such a great step by step video ( Video #6 Flow Around A Car). I have tried to reproduce this to the best of my abilities using Freecad 0.20.1. In The Solver/Edit/Post Processing/Force.Dat, for iteration 287 (the first column on the left) for what I assume to be the (drag) X direction (the columns aren't marked), I get -2.1e +02 (Newtons I assume - also not marked),but in the video the answer is -3.9061e +02. For the second column which I assume to be the Y direction (Lift) I get 1.10e +03, but in the video the answer is 6.06e +02. Could someone please take a look at this to see what I did wrong?

Code: Select all

OS: CAElinux2020 (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * CfdOF 1.20.4
  * Help 1.0.3
  * Plot 2022.4.17
flow around car.FCStd
(523.17 KiB) Downloaded 99 times
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by thschrader »

Have you checked the mesh?
When running checkMesh I get several errors. I guess the problematic zone
is the point contact between the tires and the street. Meshers dont like that.
For the reporting function you must define the far-field pressure at 33 m/s inlet speed,
which gives 680N/m^2 at rho_air=1,25 kg/m^3.
You should use a bigger computing domain.
Rule of thumb: the car (projected front area) should block the channel area with less than 5%.
The volume-refinement cube for the mesh should extend over the domain, to capture all cells.
Thomas
carCFD.JPG
carCFD.JPG (114.88 KiB) Viewed 3945 times
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by thschrader »

I lifted the channel up with 20 mm to avoid point contact between tires and street.
Now meshing works, no boundary elements.
At a first shot I get 200 N drag, 700 N lift, 3600 N (?) side-force (paraview says 900 N...)
The projected front-area of the half car is approx 1,2 m^2, which gives a drag-coefficient of 0,24.
Seems reasonable.
File:
flow_around_car_ts.FCStd
(284.29 KiB) Downloaded 92 times
Meshing goes fast, simulation runs 36 min on intel i7 cpu.
Check number of cpu before re-running on your machine.
You must multiply the paraview pressure by the fluid density to get the "real" pressure",
see definition of p-field in case files (the dimensions).
carCFD2.JPG
carCFD2.JPG (85.02 KiB) Viewed 3924 times
EveningSkyPerson
Posts: 7
Joined: Thu Oct 20, 2022 10:45 pm

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by EveningSkyPerson »

Hello THSchrader -- I can't Thank You enough for what you have done here, giving a beginner such as myself a step by step path to follow to get an answer in numbers. Being able to download a file to see how it is done is new to me and I am amazed at how much information can be transferred using this method. I would never in a million years have been able to figure out the solution for the mesh errors -- raising the domain 20mm to let the tires hang out the bottom, I guess to reduce sharp angle somewhat where the tire meets the road. And to extend the volume refinement out beyond the primary domain -- I haven't seen that before. I tried to copy what you have done as accurately as I could but for some reason I still get non-orthogonality errors when I checked the mesh. Solved that by changing the relative mesh size (.15 to .3) a little for the second refinement and finally got 'mesh ok'. Thank You So Much!

Michael Farneti
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by thschrader »

EveningSkyPerson wrote: Tue Dec 27, 2022 8:27 pm ...
Being able to download a file to see how it is done is new to me and I am amazed at how much information can be transferred using this method.
...
Because it is FreeCAD...
Dont hesitate to post your questions and results.
There is a lot of work to do.
EveningSkyPerson
Posts: 7
Joined: Thu Oct 20, 2022 10:45 pm

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by EveningSkyPerson »

Thank You for the invitation -- I will posting questions and results!
User avatar
Raedchen_im_System
Posts: 95
Joined: Sun Oct 27, 2019 5:22 pm
Location: In der Nähe von Stuttgart
Contact:

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by Raedchen_im_System »

Hello EveningSkyPerson,

many thanks for attaching your Freecad-File (*.FCStd). I have checked your file, it took me some time, that is one of the reasons that my answer is so late. After checking your model, I can say that you have build your model according to my video, there are no significant deviations. With the original file that I used for my video, I get now the same results as you.

The answer from thschrader concerning the mesh is correct: There is an issue with the meshing with cfMesh. In my original video, meshing lasted 1:28 minutes, now it takes me only 0:33 Seconds. The reason for faster meshing is that the area under the car is not meshed.

First the mesh generated with V0.19, taken from my video at 24:00:
Meshing with V019.JPG
Meshing with V019.JPG (71.07 KiB) Viewed 3391 times
###############################################
And here the mesh with V0.20:
Meshing with V020.JPG
Meshing with V020.JPG (290.98 KiB) Viewed 3391 times
###############################################

I assume that this is an issue with cfMesh, I switched the mesher to gmesh, and all areas are meshed. For the video tutorial, I used cfMesh because cfMesh offers more options for MeshRefinement. If possible, I prefer gmesh because algorithms in gmesh are according to my experience more stable.

###############################################

The "check Mesh" function presented in the answer by thschrader is a new feature in V0.20 / CfdOF 1.21.0. In Version V0.19, this function was not available. The "check Mesh" is a very useful function. Thank you very much for showing.
EveningSkyPerson
Posts: 7
Joined: Thu Oct 20, 2022 10:45 pm

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by EveningSkyPerson »

Wow! Thank You Raedchen_im_System for replying to my post -- I was hoping that you would. It makes sense now, knowing that 'Check Mesh' was not available in the earlier version. I was looking for an explanation of how to get numbers for lift and drag in Freecad CFDof and your video 'Flow Around A Car' was the answer. Your videos have been so helpful to me. What a Gift To Humanity! Thank You so much for your videos and your reply!

Michael Farneti
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by oliveroxtoby »

Raedchen_im_System wrote: Tue Jan 10, 2023 8:28 pm I assume that this is an issue with cfMesh, I switched the mesher to gmesh, and all areas are meshed. For the video tutorial, I used cfMesh because cfMesh offers more options for MeshRefinement. If possible, I prefer gmesh because algorithms in gmesh are according to my experience more stable.
I think that when you created the first mesh, there was a bug in CfdOF which caused an extra level of refinement to be used. You can see that the refinement box has two levels of refinement compared to the background mesh, despite a relative element size of 0.5 being specified. This bug was recently fixed, so to generate the same mesh as you had before, you should specify a relative element size of 0.25.
User avatar
Raedchen_im_System
Posts: 95
Joined: Sun Oct 27, 2019 5:22 pm
Location: In der Nähe von Stuttgart
Contact:

Re: Getting Wrong Answer For Drag And Lift Flow Around A Car

Post by Raedchen_im_System »

oliveroxtoby wrote: Wed Jan 11, 2023 7:49 pmThis bug was recently fixed, so to generate the same mesh as you had before, you should specify a relative element size of 0.25.
@oliveroxtoby : Great Help, thank you very much !

I changed the mesh size in the 2nd refinement specification from 0.5 to 0.25, and now it works.
Mesh Refinement #1.jpg
Mesh Refinement #1.jpg (19.52 KiB) Viewed 3232 times
Mesh Refinement #2.jpg
Mesh Refinement #2.jpg (33 KiB) Viewed 3232 times
.
###################################

I used the new reporting function, I nearly get the same forces as in version V0.19:
Tutorial: Fx: -389.83 N Fy: 554.30 N Fz: -988.95 N
V0.20: Fx: -390.61 N Fy: 606.00 N Fz: -996.93 N
Post Reply