Hey all. This is my first post here, so Hi!
First of all thanks to everyone putting time into FreeCAD, its a great tool
Ok, now my problem: I'm planning on setting up part of an automated cfd-analysis workflow based on freecad, snappyhexmesh and openfoam. It uses a parametric geometry and ideally pre-defined boundary patches. The output of my part shall be an stl-file with the patches available for reference in OpenFoam.
The part with the parametric geometry is solved. My model adjusts just as I change the parameters set within a spreadsheet. The obstacle is arising within the CfdOFWorkbench: the geometry of the patches are not automatically updated with the geometry by App.ActiveDocument.recompute().
I have no time to provide an example at this time (maybe tomorrow). So imagine this: I have a cube 1m x 1m x 1m. So the inlet patch (one of the faces) is 1m x 1m. Now I change the size to 2m x 2m. -> patch is not updated UNTIL: I use the GUI, double click the boundary to get into the properties. The moment the property window opens, the patch geometry is updated as desired. Unfortunately there is no Python console output belonging to that step which I could just call inside my script.
Any hints on how to tackle this issue are very much appreciated.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
CfdOFWorkbench - update patches with Geometry
Moderator: oliveroxtoby
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: CfdOFWorkbench - update patches with Geometry
Moved to CFD forum
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: CfdOFWorkbench - update patches with Geometry
I was able to figure out a way: the CfdFluidBoundary-Class has a method enforceRecompute. By calling it for each boundary, their recomputation is forced on the next document recompute:
The patch is updated according to the current geometry it is based on.
Code: Select all
App.ActiveDocument.CfdFluidBoundary.enforceRecompute()
App.activeDocument().recompute()
- oliveroxtoby
- Posts: 840
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
Re: CfdOFWorkbench - update patches with Geometry
Nice to see the workbench being used in this wayAtD wrote: ↑Tue Aug 20, 2019 3:18 pm Hey all. This is my first post here, so Hi!
First of all thanks to everyone putting time into FreeCAD, its a great tool
Ok, now my problem: I'm planning on setting up part of an automated cfd-analysis workflow based on freecad, snappyhexmesh and openfoam. It uses a parametric geometry and ideally pre-defined boundary patches. The output of my part shall be an stl-file with the patches available for reference in OpenFoam.
The part with the parametric geometry is solved. My model adjusts just as I change the parameters set within a spreadsheet. The obstacle is arising within the CfdOFWorkbench: the geometry of the patches are not automatically updated with the geometry by App.ActiveDocument.recompute().
I have no time to provide an example at this time (maybe tomorrow). So imagine this: I have a cube 1m x 1m x 1m. So the inlet patch (one of the faces) is 1m x 1m. Now I change the size to 2m x 2m. -> patch is not updated UNTIL: I use the GUI, double click the boundary to get into the properties. The moment the property window opens, the patch geometry is updated as desired. Unfortunately there is no Python console output belonging to that step which I could just call inside my script.
Any hints on how to tackle this issue are very much appreciated.
This is actually something I've been meaning to sort out for a while. My latest commit should, I hope, fix the issue without the need for your workaround.
Re: CfdOFWorkbench - update patches with Geometry
hi oliveroxtoby
Thanks for your effort, I will try it out at some point and give you feedback.
Thanks for your effort, I will try it out at some point and give you feedback.
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: CfdOFWorkbench - update patches with Geometry
I am also interested in automate CAE,
here is my example, different tools:
https://github.com/qingfengxia/CAE_pipeline
here is my example, different tools:
https://github.com/qingfengxia/CAE_pipeline
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: CfdOFWorkbench - update patches with Geometry
@oliveroxtoby:
I tried it again with the recent version of the workbench and it works perfectly. Thanks!
I tried it again with the recent version of the workbench and it works perfectly. Thanks!
- oliveroxtoby
- Posts: 840
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa