Computational Fluid Dynamics (CFD) workbench using OpenFOAM

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

thschrader
Veteran
Posts: 2644
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by thschrader »

It seems that cfmesh does not like bodys from Part-Design wb.
I used your sketches and rebuilt the chamber with Part-wb.
Now cfmesh works. Meshing goes superfast, under 1 minute.
See file:
vortexChamber_ts.FCStd
(64.28 KiB) Downloaded 12 times
cfmesh_vortexChamber.JPG
cfmesh_vortexChamber.JPG (226.39 KiB) Viewed 726 times
User avatar
Kunda1
Veteran
Posts: 12748
Joined: Thu Jan 05, 2017 9:03 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Kunda1 »

thschrader wrote: Wed May 25, 2022 2:41 pm It seems that cfmesh does not like bodys from Part-Design wb.
What specifically ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
thschrader
Veteran
Posts: 2644
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by thschrader »

Kunda1 wrote: Wed May 25, 2022 3:16 pm
thschrader wrote: Wed May 25, 2022 2:41 pm It seems that cfmesh does not like bodys from Part-Design wb.
What specifically ?
Correct answer: I dont know.

All 3 meshers have problems with the Part-Design bodies, in this case.
When using the exact same sketches (I copied them, no redrawing!) and Part-wb,
meshing works.

openFoam uses an stl as base-part, generated from FC. Maybe the stl generator has some
problems with part-Design bodies. Sorry, only a guess...
KAKM
Posts: 85
Joined: Tue May 04, 2021 12:17 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by KAKM »

Kunda1 wrote: Wed May 25, 2022 3:16 pm What specifically ?
I think the issue is something like the exporter is failing to move down one tree level when trying to export a body. There was someone a while back who was trying to export a FreeCAD brep file to gmsh and when they had the body selected upon clicking "export", it just put out an empty file (no errors), but if they selected the three objects (I think they were surfaces) that made up the body instead, it exported as expected.

It was also true the last time I tried to mesh something using CfdOF that I had to use a shell instead of a solid or it wouldn't mesh. That may have since been fixed though–it was a year or two ago and I feel like I've seen successful meshing from solids since then.
User avatar
Crossleyuk
Posts: 153
Joined: Wed Jun 20, 2018 7:47 am
Location: United Kingdom
Contact:

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Crossleyuk »

Hi TH,

I tried your case and sure it meshed in cfMesh and gmsh but could not get it to run at all. So I've continued with my rebuild using gmsh and note that the case fails every time the Residuals climb higher. Here is what I'm getting every time.
Body_Cyl_Axial_Complete_Rev_P2_Large_Residual.png
Body_Cyl_Axial_Complete_Rev_P2_Large_Residual.png (58.1 KiB) Viewed 623 times

Cheers and thanks for the contact again.

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

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by oliveroxtoby »

thschrader wrote: Wed May 25, 2022 2:41 pm It seems that cfmesh does not like bodys from Part-Design wb.
I used your sketches and rebuilt the chamber with Part-wb.
Now cfmesh works. Meshing goes superfast, under 1 minute.
See file:
vortexChamber_ts.FCStd
cfmesh_vortexChamber.JPG
I don't think CfdOF has an issue with Part Design per se. Looking carefully at the 'Flows' body, there is a whole face missing where the diffuser should meet the part (the diffuser is 'floating' in mid-air):
Screenshot (4).png
Screenshot (4).png (332.1 KiB) Viewed 581 times
I don't know much about how this works but presumably one would need to cut a hole out of the plane where the diffuser joins it. I guess that simply having the two surfaces abutting each other in the body does not allow them to merge correctly. The mesher needs a continuous, enclosed void in which to produce the mesh. @thschrader's apprach of fusing different solids together is a nice way to get that.
thschrader
Veteran
Posts: 2644
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by thschrader »

Crossleyuk wrote: Wed May 25, 2022 7:58 pm ...
I tried your case and sure it meshed in cfMesh and gmsh but could not get it to run at all.
Good to hear that meshing works for you.
For me the case runs. I am writing from private PC,
next simulation is friday on company PC.
Tomorrow I am on holiday.
In Germany is "Vatertag" (fathers day)
That means: get drunk and talk BS :lol:

But first things first. Lets concentrate on the meshing process.
trijonb
Posts: 9
Joined: Mon May 24, 2021 1:07 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by trijonb »

I got almost exactly the same behaviour (after remeshing with gsmh (tets and poly's)). Inviscid, viscous laminar, viscous k-omega, with multiple combinations of URF's, as well as very low values, and got the same divergence in the pressure residual. Assumed it was either BC's or a mesh problem.

Incidently, to @oliveroxtoby point, you do need to ensure the bodies are connected for the mesh to 'propagate' contiguously across part 'boundaries'. I found this in a couple of instances, and as per the comments above, solved mostly with the boolean fuse option.
Crossleyuk wrote: Wed May 25, 2022 7:58 pm Hi TH,

I tried your case and sure it meshed in cfMesh and gmsh but could not get it to run at all. So I've continued with my rebuild using gmsh and note that the case fails every time the Residuals climb higher. Here is what I'm getting every time.

Body_Cyl_Axial_Complete_Rev_P2_Large_Residual.png

Cheers and thanks for the contact again.

Michael
User avatar
Crossleyuk
Posts: 153
Joined: Wed Jun 20, 2018 7:47 am
Location: United Kingdom
Contact:

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Crossleyuk »

As the naive outsider can I say, WOW and thank you guys. The thanks for a fantastic lessons package that I need to read again to start to understand. The connection beween items has always been a question of mine and I usually start a new item by selecting the connecting face, adding a sketch and changing the direction if required. I'll take another look to see if I can add anything that may be relevant :lol: :oops:

Million thanks

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

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by oliveroxtoby »

@thschrader's case works for me, as does the attached which has been modified to have the same boundary conditions as your original case. This is using cfMesh - I get mesh quality issues when using gmsh, probably due to a small gap or misalignment somewhere (which cfMesh and snappyHexMesh tend to be more robust to by their design).
Crossleyuk wrote: Wed May 25, 2022 7:58 pm Hi TH,

I tried your case and sure it meshed in cfMesh and gmsh but could not get it to run at all. So I've continued with my rebuild using gmsh and note that the case fails every time the Residuals climb higher. Here is what I'm getting every time.

Body_Cyl_Axial_Complete_Rev_P2_Large_Residual.png

Cheers and thanks for the contact again.

Michael
Don't forget to look at the checkMesh output - I suspect you will find it is poor in the gmsh case. Otherwise, uploading the exact case that is giving you an issue should make it possible for someone to assist.
Attachments
vortexChamber_ts_oo.FCStd
(64.23 KiB) Downloaded 8 times
Post Reply