Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Moderator: oliveroxtoby
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
### status
Team of CSIR South Africa, 2016 has forked my CFD repo https://github.com/qingfengxia/Cfd ,into CfdFoam workbench, see https://github.com/jaheyns/CfdFoam, focusing on OpenFOAM and usability.
see their progress on post: Computational Fluid Dynamics (CFD) workbench using OpenFOAM https://forum.freecadweb.org/viewtopic.php?f=18&t=21576
Recent work in Fem has broken Cfd workbench, I am fixing this now.
### I will carry on commit the original CFD repo, https://github.com/qingfengxia/Cfd I will try to:
* add more CFD solvers other than OpenFOAM, like Fenics.
I will work only on solvers without a free GUI preprocessor to help new user to get started. With ultimate goal of multiphysics modeling using Fem and Cfd workbench.
* infrastructure shared by CFD solvers and FEM solvers.
I will commit some features directly into FEM workbench, to share the code extensively. I will work only on solvers without a free GUI preprocessor to help new user to get started. I will also notice new features usable to CfdFoam.
* incorporate some features developed by CfdFOAM team
recently, I will not develop new feature on OpenFOAM, but bugfix and develop testing case
* develop my own CFD solver based on Fenics, especially for 2D case https://github.com/qingfengxia/FenicsSolver
### After next release of FreeCAD, this CFD workbench will stick to stable FEM API.
This Cfd workbench tries to share Fem module as large as possible (meshing, boundary condition, material), thereby, progress of FemWorkbench can easily break this workbench. I will check regularly on Fem module to maintain compatible. I will develop some example file, if you find it is outdated, please let me know by private message or email me directly.
Currently, I found I can not install both Cfd and CfdFoam workbenches. Actually, case files developed in each workbench is not compatible. So install the CfdFOAM before release of next version of FreeCAD, I will fix broken names in Cfd.
### Readme and roadmap
https://github.com/qingfengxia/Cfd/blob ... Roadmap.md will be updated directly to https://github.com/qingfengxia/Cfd. I will reply this post to alert new feature.
### developer manual, please help
Finally but not the least, please also contribute/keep-alive this FreeCAD related project.
https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
a gitbook "Module developer's guide to FreeCAD 's source code ", to help new developer to code, in particularly Fem and Cfd workbenches.
it is a by-product of my CFD workbench, recording some note and process to develop this workbench. I am trying to provide some overview of FreeCAD source code. As FreeCAD evolves very fast, code snippets get out-dated quickly.
I have been tangled by my family liability and research responsibility as a contracted postdoc researcher. My recent commit to those 2 projects have been slowing down. without community's help, those project will not reach a beta version soon.
Thanks
Team of CSIR South Africa, 2016 has forked my CFD repo https://github.com/qingfengxia/Cfd ,into CfdFoam workbench, see https://github.com/jaheyns/CfdFoam, focusing on OpenFOAM and usability.
see their progress on post: Computational Fluid Dynamics (CFD) workbench using OpenFOAM https://forum.freecadweb.org/viewtopic.php?f=18&t=21576
Recent work in Fem has broken Cfd workbench, I am fixing this now.
### I will carry on commit the original CFD repo, https://github.com/qingfengxia/Cfd I will try to:
* add more CFD solvers other than OpenFOAM, like Fenics.
I will work only on solvers without a free GUI preprocessor to help new user to get started. With ultimate goal of multiphysics modeling using Fem and Cfd workbench.
* infrastructure shared by CFD solvers and FEM solvers.
I will commit some features directly into FEM workbench, to share the code extensively. I will work only on solvers without a free GUI preprocessor to help new user to get started. I will also notice new features usable to CfdFoam.
* incorporate some features developed by CfdFOAM team
recently, I will not develop new feature on OpenFOAM, but bugfix and develop testing case
* develop my own CFD solver based on Fenics, especially for 2D case https://github.com/qingfengxia/FenicsSolver
### After next release of FreeCAD, this CFD workbench will stick to stable FEM API.
This Cfd workbench tries to share Fem module as large as possible (meshing, boundary condition, material), thereby, progress of FemWorkbench can easily break this workbench. I will check regularly on Fem module to maintain compatible. I will develop some example file, if you find it is outdated, please let me know by private message or email me directly.
Currently, I found I can not install both Cfd and CfdFoam workbenches. Actually, case files developed in each workbench is not compatible. So install the CfdFOAM before release of next version of FreeCAD, I will fix broken names in Cfd.
### Readme and roadmap
https://github.com/qingfengxia/Cfd/blob ... Roadmap.md will be updated directly to https://github.com/qingfengxia/Cfd. I will reply this post to alert new feature.
### developer manual, please help
Finally but not the least, please also contribute/keep-alive this FreeCAD related project.
https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
a gitbook "Module developer's guide to FreeCAD 's source code ", to help new developer to code, in particularly Fem and Cfd workbenches.
it is a by-product of my CFD workbench, recording some note and process to develop this workbench. I am trying to provide some overview of FreeCAD source code. As FreeCAD evolves very fast, code snippets get out-dated quickly.
I have been tangled by my family liability and research responsibility as a contracted postdoc researcher. My recent commit to those 2 projects have been slowing down. without community's help, those project will not reach a beta version soon.
Thanks
Last edited by qingfeng.xia on Sun Nov 19, 2017 11:28 pm, edited 6 times in total.
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
New Features planned in 2017 (will be updated regularly)
1. gmsh boundary layer (accepted by master)
2. mapplotlib plot residual in addition to gnuplot
3. turbulence flow (Foam only, done Oct 2017)
4. 2D mesh export (Fenics Solver only)
5. fenics CFD solver (incompresible laminar flow only 2D and 3D)
2018
1. cfMesh function manually merged from Joha2's fork
2. python3 support
3. multi-region meshing, preparation for multi-physics coupling
1. gmsh boundary layer (accepted by master)
2. mapplotlib plot residual in addition to gnuplot
3. turbulence flow (Foam only, done Oct 2017)
4. 2D mesh export (Fenics Solver only)
5. fenics CFD solver (incompresible laminar flow only 2D and 3D)
2018
1. cfMesh function manually merged from Joha2's fork
2. python3 support
3. multi-region meshing, preparation for multi-physics coupling
Last edited by qingfeng.xia on Sun Nov 19, 2017 11:31 pm, edited 2 times in total.
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Your and CSIR work is amazing, a very great part that characterize Freecad. I hope you can find time to continue the developing. I find this workbench very useful and the integration in the Fem WB is the right way, also the capability to use the internal post processing tools. I hope to help you and CSIR as tester for now, but I really want to help in coding a day.
Don't lost the belief in this project, despite the low access in this forum, the voice of your work is growing in the underground
Don't lost the belief in this project, despite the low access in this forum, the voice of your work is growing in the underground

Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
I agree with Worufu, but I have a problem to install both workbenches parallel due using same parameter in the installation path of preferences.
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Sep 04, Further coding for FemConstraintFluidBoundary
Previously, only 3D case is supported by OpenFOAM solver, now 2D Fenics solver is nearly finished. Selecting of Edges as boundary for 2D case is enabled.
Also, thermal and turbulence UI, previously just for UI design review, is now fully functional.
Previously, only 3D case is supported by OpenFOAM solver, now 2D Fenics solver is nearly finished. Selecting of Edges as boundary for 2D case is enabled.
Also, thermal and turbulence UI, previously just for UI design review, is now fully functional.
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Gmsh mesh with a boundary layer support has been merge into master, boundary layer is essential for turbulent flow simulation
see the forum post
https://forum.freecadweb.org/viewtopic.php?f=18&t=22968
see the forum post
https://forum.freecadweb.org/viewtopic.php?f=18&t=22968
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Recently, I tested Gmsh3, it iseems the boundary layer setup for 3D mesh has changed.
FacesList option is gon, It could be a bug in the future
=====================================
BoundaryLayer
hwall * ratio^(dist/hwall)
Options:
AnisoMax
Threshold angle for creating a mesh fan in the boundary layer
type: float
default value: 10000000000
EdgesList
Indices of curves in the geometric model for which a boundary layer is needed
type: list
default value: {}
FanNodesList
Indices of vertices in the geometric model for which a fan is created
type: list
default value: {}
IntersectMetrics
Intersect metrics of all faces
type: integer
default value: 0
NodesList
Indices of vertices in the geometric model for which a BL ends
type: list
default value: {}
Quads
Generate recombined elements in the boundary layer
type: integer
default value: 0
hfar
Element size far from the wall
type: float
default value: 1
hwall_n
Mesh Size Normal to the The Wall
type: float
default value: 0.1
hwall_n_nodes
Mesh Size Normal to the The Wall at nodes (overwrite hwall_n when defined)
type: list_double
default value: {}
ratio
Size Ratio Between Two Successive Layers
type: float
default value: 1.1
thickness
Maximal thickness of the boundary layer
type: float
default value: 0.01
FacesList option is gon, It could be a bug in the future
=====================================
BoundaryLayer
hwall * ratio^(dist/hwall)
Options:
AnisoMax
Threshold angle for creating a mesh fan in the boundary layer
type: float
default value: 10000000000
EdgesList
Indices of curves in the geometric model for which a boundary layer is needed
type: list
default value: {}
FanNodesList
Indices of vertices in the geometric model for which a fan is created
type: list
default value: {}
IntersectMetrics
Intersect metrics of all faces
type: integer
default value: 0
NodesList
Indices of vertices in the geometric model for which a BL ends
type: list
default value: {}
Quads
Generate recombined elements in the boundary layer
type: integer
default value: 0
hfar
Element size far from the wall
type: float
default value: 1
hwall_n
Mesh Size Normal to the The Wall
type: float
default value: 0.1
hwall_n_nodes
Mesh Size Normal to the The Wall at nodes (overwrite hwall_n when defined)
type: list_double
default value: {}
ratio
Size Ratio Between Two Successive Layers
type: float
default value: 1.1
thickness
Maximal thickness of the boundary layer
type: float
default value: 0.01
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Initial commit to write 2D and 3D case for my FenincsSolver in Cfd Workbench.qingfeng.xia wrote: ↑Sun Jun 18, 2017 12:02 pm New Features planned in 2017 (will be updated regularly)
1. gmsh boundary layer
2. mapplotlib plot residual in addition to gnuplot
3. turbulence flow
4. 2D mesh export
5. fenics CFD solver
Solver is not limited to CFD, but multi-physics, see my repo
https://github.com/qingfengxia/FenicsSolver
And can anyone teach me to make a 2D plane part, elbow, to test my code?
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Veteran
- Posts: 3064
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Please see here:qingfeng.xia wrote: ↑Sun Nov 19, 2017 11:20 pm And can anyone teach me to make a 2D plane part, elbow, to test my code?
https://opensimsa.github.io/training.html
regards Thomas
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: Progress of the general Computational Fluid Dynamics (CFD) workbench: CfdWorkbench
Thanks for pointing me to those useful tutorial, the Elbow case for OpenFOAM is still 3D mesh with only 1 layer in the third direction. From the tutorial, I can not see whether it is 2D or 3D?
For Fenics, I would need a pure 2D mesh. Any idea?
For Fenics, I would need a pure 2D mesh. Any idea?
thschrader wrote: ↑Mon Nov 20, 2017 12:33 pmPlease see here:qingfeng.xia wrote: ↑Sun Nov 19, 2017 11:20 pm And can anyone teach me to make a 2D plane part, elbow, to test my code?
https://opensimsa.github.io/training.html
regards Thomas
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
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd