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

Post Reply
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 »

Quick question: how does CFDFoam relate to issue #2459 in regards to what has been implemented?
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
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by oliveroxtoby »

Kunda1 wrote: Fri May 26, 2017 1:09 pm Quick question: how does CFDFoam relate to issue #2459 in regards to what has been implemented?
If I understand the report correctly, we have implemented an equivalent of this in most respects:
his is a proposal to add a couple of features to ease the use of transferring Part-based geometry from FreeCAD to openFOAM. It would include basically:

- An OpenFOAM object that can
- hold regions (groups of faces), and associate a tag/label and a color with each region
- display the tags in the 3D view
- offer graphical tools to select and manage the regions
I think this is catered for by our CFD boundary conditions where groups of faces can be selected, assigned a boundary condition, and are coloured accordingly.
- An alternative OBJ exporter that
- scales everything in meters
- exports the different regions as OBJ groups
In the course of the present work interfacing with the cartesian meshers cfMesh and snappyHexMesh, this has been done but using stl rather than obj format.
Please provide all the information requested in this post before reporting problems with CfdOF.
johan
Posts: 14
Joined: Tue Nov 29, 2016 8:37 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by johan »

Just to add to Oliver, for the cut-cell Cartesian mesh generators the CFD WB write a multi-element stl which contains all the faces of the mesh object and the points are scaled to meters when the STL is written. The WB then performs a similarity check which generates a createPatchDict to rename the patches using the prescribed boundary condition names.
wafi
Posts: 82
Joined: Sat Oct 15, 2016 8:45 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by wafi »

Back from testing 1:1 fluid dynamics ;) I am impressed of what happened during one week.
Of cause I tried to test it out, but cartesian meshing creates some problems. It is running, but without result. A failure message is showing:

File "/home/peter/.FreeCAD/Mod/CfdFoam/_TaskPanelCfdMeshCart.py", line 236, in meshFinished
cart_mesh.read_and_set_new_mesh() # Only read once meshing has finished
File "/home/peter/.FreeCAD/Mod/CfdFoam/CfdCartTools.py", line 343, in read_and_set_new_mesh
mesh = Mesh.Mesh(os.path.join(self.meshCaseDir, 'mesh_outside.stl'))
Base.FreeCADError: File does not exist: /tmp/meshCase/mesh_outside.stl

Ubuntu 16.04, FreeCAD daily version



Ah .... found the failure .... I thought cfMesh is already included in openfoam 4, but it is not.
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by oliveroxtoby »

wafi wrote: Sun Jun 04, 2017 2:02 pm Ah .... found the failure .... I thought cfMesh is already included in openfoam 4, but it is not.
Sorry, it's not very clear at the moment. As soon as we're done with the current development sprint we will update Readmes etc. with latest installation instructions and requirements.
Please provide all the information requested in this post before reporting problems with CfdOF.
wafi
Posts: 82
Joined: Sat Oct 15, 2016 8:45 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by wafi »

Hi Oliver

that was not your fault. I have read in a CfD forum, that cfMesh would be implemented in the new openfoam, but it is not. To install cfMesh to openfoam is .... tricky ... perhaps it would be a good idea to give users some comments how to do it. On my Linux computer I had minor problems, on my window computer I failed.

But in general I impressed. specially the way to mesh the boundary layers with refinement. One idea would be to change from picking the single faces to picking all faces of an object and if necessary to remove single faces from the list. Would make life easier, i.e. a rudder of a sailboat has 41 faces, keel some more, the hull three faces, where I need 2, so to kill this one not necessary face is easier than to pick the huge amount of faces.
wafi
Posts: 82
Joined: Sat Oct 15, 2016 8:45 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by wafi »

after testing and play around a little bit, I think there are some bugs:
1. as mentioned earlier not only the figures of fluid properties are not correctly shown, if edit the values again, also the figures of turbulence etc will change due to scaling and one has to be careful, not to miss the change, otherwise the results are not correct.
2. also mentioned earlier, to choose the references to create the mesh regions have to be clicked at the screen, no chance to use a list
3. MAIN PROBLEM: in the boundary conditions of a non viscose wall it is possible to select from a list the faces, but one have to click one by one, not able to select a larger number in one go, that`s not the real problem, but writing the case some of these faces will be stored under default faces. I have tried several ways to avoid this, i.e. collecting the different parts in one boundary (keel, rudder, hull), creating single boundary conditions for keel, hull, rudder, creating one fusion of keel, hull, rudder and having one boundary condition ... always same problem, they are stored in the boundary condition(s), but writing the case some faces will be default faces. It`s not even clear why some will be default conditions... one time the port side face of the hull is in the default faces, next time, the starboard side ... or faces of keel, sometimes some from port side, sometimes the bottom plate is missing, sometimes all faces exclusive bottom face ... whatever.
This is only for the boundary conditions, meshing is working perfect, even if it`s a problem to select the references. But one time collected references, it is cool to turn the boat, to trim or to heel the boat, re- mesh and be happy with the result. That`s perfect. Of cause I am aware that simple foam is not a real solution to look for a cfd problem on a boat, but if boundary conditions and meshing is working, I think there will be less problems to go for interfoam or other solvers.
qingfeng.xia
Posts: 227
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford UK/Shenzhen China
Contact:

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by qingfeng.xia »

For near wall boundary layer refining, I once consider using GMSH, but I do not know how to reference the face by number in the solid (which seems exported as brep file). I stuck there without any progress.

https://github.com/FreeCAD/FreeCAD/blob ... shTools.py
wafi wrote: Wed Jun 07, 2017 7:04 am Hi Oliver

that was not your fault. I have read in a CfD forum, that cfMesh would be implemented in the new openfoam, but it is not. To install cfMesh to openfoam is .... tricky ... perhaps it would be a good idea to give users some comments how to do it. On my Linux computer I had minor problems, on my window computer I failed.

But in general I impressed. specially the way to mesh the boundary layers with refinement. One idea would be to change from picking the single faces to picking all faces of an object and if necessary to remove single faces from the list. Would make life easier, i.e. a rudder of a sailboat has 41 faces, keel some more, the hull three faces, where I need 2, so to kill this one not necessary face is easier than to pick the huge amount of faces.
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
wafi
Posts: 82
Joined: Sat Oct 15, 2016 8:45 am

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by wafi »

qingfeng.xia wrote: Mon Jun 12, 2017 12:59 pm by qingfeng.xia » Mon Jun 12, 2017 2:59 pm
For near wall boundary layer refining, I once consider using GMSH, but I do not know how to reference the face by number in the solid (which seems exported as brep file). I stuck there without any progress.
I disagree. The problem is not the meshing, that works fine, with the exception of difficult way of clicking on each face. The problem is the boundary condition, where i.e. vessels hull starboard side as one face, connected with the upper boundary of the box, will be placed as default boundary condition instead of hull with non viscose boundary condition. In the meshing itself this wall works fine, but if placed in the boundary conditions I think the main problem is the numbering of the faces, because they are only named face... but clicking on a face it`s called rumpf.face98. So maybe one solution could be to change the numbering i.e. the box in the BooleanFragments would get the no. 1000 and faces of this box, face1001, face1002 ... the hull i.e. would get the 2000 ... with face2001, face2002 .... instead of i.e. Part__Feature002:Face1, which is ok for FreeCAD but not for openfoam. In this case the numbers should be clear. Only one idea to solve this problem.
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Post by oliveroxtoby »

wafi wrote: Wed Jun 07, 2017 7:04 am that was not your fault. I have read in a CfD forum, that cfMesh would be implemented in the new openfoam, but it is not. To install cfMesh to openfoam is .... tricky ... perhaps it would be a good idea to give users some comments how to do it. On my Linux computer I had minor problems, on my window computer I failed.
Tomorrow there should be new commits in master to make this easy via a button in the Preferences page for CFD. Under blueCFD some transformations are needed to the source and this is catered for automatically.
But in general I impressed. specially the way to mesh the boundary layers with refinement. One idea would be to change from picking the single faces to picking all faces of an object and if necessary to remove single faces from the list. Would make life easier, i.e. a rudder of a sailboat has 41 faces, keel some more, the hull three faces, where I need 2, so to kill this one not necessary face is easier than to pick the huge amount of faces.
An excellent idea, we'll put that on the list. Probably won't get to it very soon so you are welcome to submit a patch if you would like to.
Please provide all the information requested in this post before reporting problems with CfdOF.
Post Reply