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

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

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Crossleyuk »

Thanks TH but sorry,

All far beyond my current limited understanding. But I think your comment about a broken body ties in with my thoughts. I built previus successful models using Part Design Workbench. I could add the next sketch to a previous face ensuring a clear connection. Now, with the Part Workbench, I had to ensure I relocated each sketch and hence part by editing its Position in the Y axis. My though was that I had messed up there but I can't find anything wrong.

Many thanks once more.

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

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Crossleyuk »

As ever, any thoughts massively welcome. I decided to start from scratch and investigate the use of Part workbench more. Discovered that in fact I could follow my old Part Design workbench approach by selecting the next face and applying a sketch from Sketcher workbench and generating the solid via Part workbench.

All was fine until I added the final narrow, simplified exit port. I added each section, on at a time and all was well until the final one.

Failed_Exit_Mesh_Rev_P3.png
Failed_Exit_Mesh_Rev_P3.png (123.95 KiB) Viewed 2368 times

As seen, I cannot include the final exit cylinder in the mesh. I've tried everything over and over, Revolve, Extend, check location against previous (cross) section. I just cannot add the cylinder exit port.

Sorry ALL, I am learning so much at the moment but a little help would be fantastic. Because If I can solve these problems, I can take the next step in my Third Generation Physics development approach.

Many thanks, with apologies

Michael
Attachments
Radial_Diffuser_Fusion_Rev_P13.FCStd
(72.02 KiB) Downloaded 60 times
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Syres »

Crossleyuk wrote: Fri Jul 15, 2022 9:06 pm All was fine until I added the final narrow, simplified exit port. I added each section, on at a time and all was well until the final one.
This is a perfect example why we ask for the full FreeCAD info, I opened your file and instantly saw the root cause (Fusion.Face29). I'm guessing you are using a version of OCC that is newer than mine and it looks like there maybe a bug in it. As a principle and not a hard & fast rule, I try to Cut/XOR material away from a large billet rather than Unioning/Fusing lots of small pieces.

I've attached the modified model but you'll need to redo the CfdOF inlet, outlet, etc because I had to delete the Fusion. If this still doesn't work for you then I'll have a go at modelling the way I would in real life.

Code: Select all

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.29555 (Git)
Build type: Release
Branch: master
Hash: 42b519a90a9688c0915f22ac4084af766c11d71c
Python 3.6.9, Qt 5.9.5, Coin 4.0.0a, Vtk 7.1.1, OCC 7.3.0
Locale: English/UnitedKingdom (en_GB)
Installed mods: 
  * fasteners 0.3.45
  * Silk 1.0.0
  * Plot 2022.4.17
  * CfdOF 1.16.1
  * BIM 2021.12.0
  * FeedsAndSpeeds 0.4.0
  * dodo
  * Curves 0.5.0
  * Manipulator 1.4.5
  * fcgear 1.0.0
  * ThreadProfile 1.81.0
  * A2plus 0.4.56a
  * sheetmetal 0.2.49
Attachments
Radial_Diffuser_Fusion_Rev_P13_Syres.FCStd
(77.34 KiB) Downloaded 66 times
User avatar
Crossleyuk
Posts: 165
Joined: Wed Jun 20, 2018 7:47 am
Location: United Kingdom
Contact:

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Crossleyuk »

Hello Syres,

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: English/United States (en_US)
How do I access my OCC version?


Once again I have to apologise for my inexperience. Your suggestion meens little to me at the moment so I need to do a lot of investigation. The Fusion pieces are still there with my Fusion Mesh that of course I cannot open and add a visible mesh. I applied my required Inlet and Outlet information to your model and ran it as you sent it.

Your case failed after I added the I/Os and this was the Status report.

________________________________
0.0: Checking dependencies...
0.0: Case writer called
0.0: Matching boundary conditions ...
0.1: Case written successfully
0.0: Solver started
26.0: OpenFOAM IO error: Cannot find patchField entry for patch_3_0 file: C:/Users/Michael Crossley/AppData/Local/Body_Cylinder/case/0/U/boundaryField from line 26 to line 19.
26.1: Simulation exited with error

________________________________

Sorry, I'm still in a massive learning mode here after great success with my previous Part Design worksheet models.

Regards and sorry to trouble you.

Michael
david69
Veteran
Posts: 1773
Joined: Wed Jan 01, 2014 7:48 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by david69 »

first of all, may be worth to move to the stable 0.20.
you may give a look to these wiki pages PythonOCC & OpenCASCADE

I am with the dev version, and here it is what I've got:

Code: Select all

OS: Ubuntu 18.04.6 LTS (LXDE/Lubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.
Build type: Release
Branch: unknown
Hash: e2e58f7bffc6012e757181af57272383677d3d91
Python 3.6.9, Qt 5.9.5, Coin 4.0.0a, Vtk 7.1.1, OCC 7.5.2
Locale: French/France (fr_FR)
Installed mods: 
  * Help 1.0.3
--> OCC 7.5.2

so I guess if you move to the 0.20, then you got the same level of information.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Syres »

Crossleyuk wrote: Sat Jul 16, 2022 8:41 am 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: English/United States (en_US)
How do I access my OCC version?
I'll remodel it completely this afternoon after I've sorted through my list of jobs, so it probably will be this evening (UK time) before I get back to you. In them meantime I've no problem with you staying on FreeCAD version 0.19 but please upgrade to the 0.19.4 which has a significant number of bugfixes in it as well as using OCC 7.5.3. It's available from (direct link to the downloader) https://github.com/FreeCAD/FreeCAD/rele ... ller-2.exe (it's larger than normal). You can install it in another folder (called for example FreeCAD0194) or upgrade your existing version in it's current folder, it doesn't matter because they both share the same config files held in your user area.

I really hope you've not stumbled across a bizarre issue that I've not seen before!! If I do get it to behave then I'll try to document a step by step guide of how it was achieved so you have something to reference in future.


OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +148 (Git)
Build type: Release
Branch: Branch_0.19.4
Hash: 476ecf091941bead59b14e44afa6064d5a66afa3
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United Kingdom (en_GB)

CfdOF Wb version 0.17.0
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Kunda1 »

Out of curiosity, @Crossleyuk, why haven't you migrated to v0.20 yet ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by Syres »

Michael, this is looking like a Cfmesh issue, I'm not sure whether Gmsh (either one) is acceptable for this type of simulation but that's the best I can come up with, sorry.
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by oliveroxtoby »

oliveroxtoby wrote: Thu Jul 07, 2022 8:46 pm
thschrader wrote: Thu Jul 07, 2022 3:16 pm When re-running an airfoil simulation, I realized that the generated stl
is too rough. The edges 1+2 are in fact straight lines, wich gives a weird result.
When reimporting the stl, you can see that the triangulation is to bad.
How can i get a finer stl mesh?
File for testing:
naca4415ts.FCStd
stl_too_rough.JPG
You can reduce the STLRelativeLinearDeflection in the properties of the mesh object. You have to reduce it to 0.001 in this case to see any improvement. Not sure what's happening there - I'll have to look into it.
I have reduced the default value for this to 0.001. For existing cases it will have to be reduced manually.
justwanttoknow
Posts: 27
Joined: Fri Oct 08, 2021 9:21 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by justwanttoknow »

Thanks Oliver for this improvement and Thorsten for picking the NACA4415 up, as this is a leap forward to my understanding.

As there is a conversion to an *.stl anyway, it is possible to import it directly (so no re-do in FreeCAD required), but some quality control is needed.

Off to experimenting...
Post Reply