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
Posts: 1394
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Wed Jan 24, 2018 10:19 am

bernd wrote:
Wed Jan 24, 2018 6:16 am
here some code to add all faces of a shape as reference shapes to an FEM object: https://forum.freecadweb.org/viewtopic. ... 10#p211310
Hi Bernd,
thanks for the info. I have seen the passage in the macros from Oliver how to adress the boundaries
to the faces (Falcon = 225 faces). In the cfd boundary dialog theres is an option
"select from list/select all". This could be usefull for FEM too. I tried the same process
with the topography-model below (5669 faces!). After 30 min loading I terminated FC ;)

EDIT: where are the other pics???
The attachment FalconBoundaries.JPG is no longer available
The attachment SelectFromList.JPG is no longer available
FalconBoundaries.JPG
FalconBoundaries.JPG (39.81 KiB) Viewed 665 times
User avatar
bernd
Posts: 7718
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby bernd » Wed Jan 24, 2018 11:21 am

thschrader wrote:
Wed Jan 24, 2018 10:19 am
I have seen the passage in the macros from Oliver how to adress the boundaries
to the faces (Falcon = 225 faces). In the cfd boundary dialog theres is an option
"select from list/select all". This could be usefull for FEM too. I tried the same process
with the topography-model below (5669 faces!). After 30 min loading I terminated FC ;)
Where can I download the shape? I could try to add all faces of the shape by Python on an FEM constraint, just to see if it is a general FreeCAD problem. But it should work AFAIK.
thschrader wrote:
Wed Jan 24, 2018 10:19 am
... This could be usefull for FEM too.
For sure. As well as https://forum.freecadweb.org/viewtopic.php?f=22&t=23307 It is just a matter of time. If you don't mind you could create a Feature Request on mantis in this regard add the links to the forum topics and assign it to me.

Bernd
thschrader
Posts: 1394
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Wed Jan 24, 2018 11:52 am

bernd wrote:
Wed Jan 24, 2018 11:21 am
Where can I download the shape? ...If you don't mind you could create a Feature Request on mantis in this regard add the links to the forum topics and assign it to me.
Complete geodata-file on my dropbox (12MB). See also
https://forum.freecadweb.org/viewtopic. ... 4&start=20
https://www.dropbox.com/s/d4i24cqjihatz ... FCStd?dl=0
Feature request: I dont know how to do that... :shock:
thschrader
Posts: 1394
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Wed Jan 24, 2018 12:26 pm

BTW:
You can use the geodata-wb for importing LIDAR topography as described here:
(for instance: flood simulation)
https://www.youtube.com/watch?v=ivrpvEqTq48
Free testdata (use dgm1):
https://www.lvermgeo.sachsen-anhalt.de/ ... n/main.htm
LIDAR_XYZ-PointCloud.JPG
LIDAR_XYZ-PointCloud.JPG (216.35 KiB) Viewed 641 times
User avatar
Kunda1
Posts: 4331
Joined: Thu Jan 05, 2017 9:03 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby Kunda1 » Wed Jan 24, 2018 12:32 pm

thschrader wrote:
Wed Jan 24, 2018 12:26 pm
BTW:
You can use the geodata-wb for importing LIDAR topography as described here:
(for instance: flood simulation)
https://www.youtube.com/watch?v=ivrpvEqTq48
Free testdata (use dgm1):
https://www.lvermgeo.sachsen-anhalt.de/ ... n/main.htm
LIDAR_XYZ-PointCloud.JPG
Joel_graff wrote:ping
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
bernd
Posts: 7718
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby bernd » Wed Jan 24, 2018 1:24 pm

thschrader wrote:
Wed Jan 24, 2018 11:52 am
bernd wrote:
Wed Jan 24, 2018 11:21 am
Where can I download the shape? ...If you don't mind you could create a Feature Request on mantis in this regard add the links to the forum topics and assign it to me.
Complete geodata-file on my dropbox (12MB). See also
https://www.dropbox.com/s/d4i24cqjihatz ... FCStd?dl=0


do you see the light red on the shape ...

pic1.jpg
pic1.jpg (550.55 KiB) Viewed 629 times

the arrows :D

oic2.JPG
oic2.JPG (637.09 KiB) Viewed 629 times

the code:

Code: Select all

# load your geodataTest.FCStd file
obj = App.ActiveDocument.child001
refele = []
for i, face in enumerate(obj.Shape.Faces):
    if face.Area * 1e-6 < 100:
        # print(face.Area * 1e-6)
        refele.append("Face%d" % (i+1))

#

tmp = (obj, tuple(refele))
print(tmp)


import ObjectsFem
cf = ObjectsFem.makeConstraintFixed(App.ActiveDocument)
cf.References = tmp 
App.ActiveDocument.recompute()
takes aound a minute or two to finish. FreeCAD is not that fast with all these arrows but it does not crash and it is moveable. But I would turn the constraint of move, zoom, rotate and turn them on if I where you ;)
User avatar
bernd
Posts: 7718
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby bernd » Wed Jan 24, 2018 1:26 pm

thschrader wrote:
Wed Jan 24, 2018 11:52 am
Feature request: I dont know how to do that... :shock:
in the forum do you see the little bug (Käfer) beside the search box? Click on it an you will be on FreeCADs bug tracker. There you could make a new issue in FEM.
User avatar
Kunda1
Posts: 4331
Joined: Thu Jan 05, 2017 9:03 pm

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby Kunda1 » Wed Jan 24, 2018 2:56 pm

bernd wrote:
Wed Jan 24, 2018 1:26 pm
thschrader wrote:
Wed Jan 24, 2018 11:52 am
Feature request: I dont know how to do that... :shock:
in the forum do you see the little bug (Käfer) beside the search box? Click on it an you will be on FreeCADs bug tracker. There you could make a new issue in FEM.
Look at my signature ;)
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
thschrader
Posts: 1394
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Wed Jan 24, 2018 3:31 pm

bernd wrote:
Wed Jan 24, 2018 1:24 pm
takes aound a minute or two to finish. FreeCAD is not that fast with all these arrows but it does not crash and it is moveable. But I would turn the constraint of move, zoom, rotate and turn them on if I where you ;)
Yes, macro works. The time to adress the faces as fixed boundaries was 7 min, thats ok for 5600 faces.
For me the problem is my graphics-system. When turning off the visibility of the constraints,
everything is fine. After setting visibility=true, the GUI needed 20 min to show the arrows.
topo2.JPG
topo2.JPG (323.03 KiB) Viewed 608 times
User avatar
bernd
Posts: 7718
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby bernd » Wed Jan 24, 2018 5:00 pm

:shock: Ok I'm not goint to try on my FreeCAD development laptop. Happily I did your example on my work machine which is a quite good one. The modell it is still usable with arrows but slooooow. Thus I deactivated them immediately. The whole arrow system of the constraints could surely be optimized ... We should be happy it is so easy to switch visibility.

I would just be speed up things a lot if we would only display one arrow per face, but this can not be adjusted ATM.