All results are zero for simple case when refinement is used

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

Post Reply
User avatar
NewJoker
Veteran
Posts: 3079
Joined: Sun Oct 11, 2020 7:49 pm

All results are zero for simple case when refinement is used

Post by NewJoker »

Hi,

I just installed and started using the CfdOF module and wanted to simulate a simple external flow around a sphere, following this recent tutorial: https://www.youtube.com/watch?v=JVO2kqO3D1Q

The analysis with mesh refinement completes successfully in just 1 iteration but all the results shown in ParaView are zero:

zero.PNG
zero.PNG (37.17 KiB) Viewed 2915 times

The setup of this simulation is as follows:
1) physics model: steady, single phase, incompressible, viscous, laminar
2) fluid properties: air (defaults)
3) initialise fields: specify values (default zeros)
4) boundary conditions:
- front face: inlet with 6e3 mm/s velocity in positive X direction, the rest is 0
- back face: outlet with static pressure type (all zeros)
- side faces: wall, slip (inviscid)
5) mesh: cfMesh with 10 mm base element size, internal volume refinement of 0,75 applied to the sphere

When I remove this refinement, the simulation completes in 112 iterations and the results are non-zero. So the problem is clearly caused by the mesh refinement. Should I use it differently ?

I attached my FreeCAD file:
Sphere test.FCStd
(18.46 KiB) Downloaded 41 times

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Polish/Poland (pl_PL)
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: All results are zero for simple case when refinement is used

Post by thschrader »

NewJoker wrote: Thu Dec 23, 2021 10:49 am ...
4) boundary conditions:
- front face: inlet with 6e3 mm/s velocity in positive X direction, the rest is 0
- back face: outlet with static pressure type (all zeros)
- side faces: wall, slip (inviscid)
...
You forgot to define the sphere as wall too (I used "noSlip" condition).
After doing this, the sim runs fine for me.
Reduce output intervall in solver tab, solver converges very fast.
Otherwise you see no result in paraview.
Have a merry christmas and a happy new year!
Thomas
sphere_cfd.JPG
sphere_cfd.JPG (71.56 KiB) Viewed 2887 times
User avatar
NewJoker
Veteran
Posts: 3079
Joined: Sun Oct 11, 2020 7:49 pm

Re: All results are zero for simple case when refinement is used

Post by NewJoker »

thschrader wrote: Thu Dec 23, 2021 11:33 am You forgot to define the sphere as wall too (I used "noSlip" condition).
After doing this, the sim runs fine for me.
Reduce output intervall in solver tab, solver converges very fast.
Otherwise you see no result in paraview.
Have a merry christmas and a happy new year!
Thomas
sphere_cfd.JPG
Thank you very much but I thought that it’s not necessary to define the wall boundary condition for the sphere since it was created as a cut in the cube and the same workflow is used in the YouTube tutorial that I referenced. Also, the simulation gives correct results when I just remove the refinement (without additional BC for the sphere). That’s somewhat confusing for me. Especially that now I have the same issue with a bit more complex model and I don’t use mesh refinement at all.

Also, how can I select that surface of the sphere when it’s covered by the cube ? I can only hide the entire cut (and thus the whole model) using the model tree.

Thank you very much for the wishes. I also wish you all the best for Christmas and upcoming new year. That more complex case that I’m trying to solve is Christmas related by the way ;-)
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: All results are zero for simple case when refinement is used

Post by thschrader »

NewJoker wrote: Thu Dec 23, 2021 11:54 am ..
Also, how can I select that surface of the sphere when it’s covered by the cube ?
...
Open boundary-dialog, choose "Select from list" option.
Select the sphere, then press "Select components".
Select "Face1", press ok.
New wall-boundary appears in model-tree.
boundary.JPG
boundary.JPG (40.51 KiB) Viewed 2796 times
User avatar
NewJoker
Veteran
Posts: 3079
Joined: Sun Oct 11, 2020 7:49 pm

Re: All results are zero for simple case when refinement is used

Post by NewJoker »

thschrader wrote: Thu Dec 23, 2021 12:55 pm Open boundary-dialog, choose "Select from list" option.
Select the sphere, then press "Select components".
Select "Face1", press ok.
New wall-boundary appears in model-tree.
boundary.JPG
Thanks, I’ll try this way. But it seems that the analysis can work even without the additional wall boundary condition for the internal faces. Except that maybe then it’s more prone to issues like the one discussed here. Anyway, I managed to solve the more complex case. At first, I got the same issue (zero results) but simply reducing the mesh density a bit helped (still without the wall boundary condition for the internal faces). That’s really strange, maybe it should be treated as a bug in the CfdOF module.
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: All results are zero for simple case when refinement is used

Post by oliveroxtoby »

NewJoker wrote: Thu Dec 23, 2021 1:24 pm
thschrader wrote: Thu Dec 23, 2021 12:55 pm Open boundary-dialog, choose "Select from list" option.
Select the sphere, then press "Select components".
Select "Face1", press ok.
New wall-boundary appears in model-tree.
boundary.JPG
Thanks, I’ll try this way. But it seems that the analysis can work even without the additional wall boundary condition for the internal faces.
Yes, the unspecified boundary conditions will default to slip boundaries unless a default boundary condition is specified.
That’s really strange, maybe it should be treated as a bug in the CfdOF module.
Unfortunately I am not able to reproduce the issue - your case runs fine for me.
User avatar
NewJoker
Veteran
Posts: 3079
Joined: Sun Oct 11, 2020 7:49 pm

Re: All results are zero for simple case when refinement is used

Post by NewJoker »

oliveroxtoby wrote: Thu Dec 23, 2021 1:50 pm Unfortunately I am not able to reproduce the issue - your case runs fine for me.
The original file with mesh refinement included ? So it seems to be some occasional issue that happens on my machine for some reason and disappears after remeshing. Have you encountered anything like this before ?
Post Reply