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
oliveroxtoby
Posts: 322
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby oliveroxtoby » Wed Dec 20, 2017 6:32 am

thschrader wrote:
Tue Dec 19, 2017 4:46 pm
Last weekend I tried an installation of the new bluecfdcore 2017 version. When installing cfmesh
via preferences, after 2 min the process stopps with error. No idea why...
Needed some hours and a sixpack beer.
Cheers Thomas
Hi Thomas
We don't support BlueCFD-2017 officially yet as the developers of cfMesh have not yet updated it to compile on OpenFOAM v5. Also it doesn't come bundled with gnuplot anymore, so we probably need to get around to moving away from gnuplot as our plotting solution.
Please provide all the information requested in this post before reporting problems with CfdOF.
User avatar
oliveroxtoby
Posts: 322
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby oliveroxtoby » Wed Dec 20, 2017 6:37 am

KDL wrote:
Tue Dec 19, 2017 7:47 am
Is the dependency checker in the windows version working currently? Running into a couple errors and I'm not sure if it is my system that is the issue or what:

Image

When I try to go into the workbench (I know it isn't properly installed yet, obviously) I get a warning about a workbench failure which is not surprising but the reason is "No module FemCommands".

Not sure what exactly the issue is but I am assuming I am doing something wrong if the problem is not with the dependency checker.
Hi KDL
The issue with installing gnuplot-py is probably a file permissions issue. The workbench needs write access to the FreeCAD install location, and most likely you would need to run FreeCAD as administrator for this to be allowed. The other problem should be sorted now if you update your workbench - sorry about that one!
thschrader wrote:
@thschrader Thank you for all your help with the queries!
Please provide all the information requested in this post before reporting problems with CfdOF.
thschrader
Posts: 1429
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Sun Jan 14, 2018 5:53 pm

@Oliver:
The topography you see is a digital terrain model, which was imported as a point-cloud
in geodata-wb, then converted to mesh and shape. The shape was used to slice the
transparent cube. The upper part of the cube (with the terrain profile at the bottom)
is the simulation domain. Cube length approx 300 m. The goal: simulate an avalanche
going down the hill.
The problem:
When adressing the boundary conditions (for instance "wall no-slip") I explicitly must click
on every single triangle in the boundary dialog. And there are more than 5000 faces! Even if there would
be a possibility to select the faces with an other method, lets say with a rectangular window,
there would be thousands of entrances in the dictionaries. Is that possible? What do you think?
regards Thomas
there is a diskussion about that in german forum:
https://forum.freecadweb.org/viewtopic.php?f=13&t=26334
avalanche.JPG
avalanche.JPG (143.41 KiB) Viewed 1078 times
User avatar
oliveroxtoby
Posts: 322
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby oliveroxtoby » Mon Jan 15, 2018 5:55 am

thschrader wrote:
Sun Jan 14, 2018 5:53 pm
@Oliver:
The topography you see is a digital terrain model, which was imported as a point-cloud
in geodata-wb, then converted to mesh and shape. The shape was used to slice the
transparent cube. The upper part of the cube (with the terrain profile at the bottom)
is the simulation domain. Cube length approx 300 m. The goal: simulate an avalanche
going down the hill.
The problem:
When adressing the boundary conditions (for instance "wall no-slip") I explicitly must click
on every single triangle in the boundary dialog. And there are more than 5000 faces! Even if there would
be a possibility to select the faces with an other method, lets say with a rectangular window,
there would be thousands of entrances in the dictionaries. Is that possible? What do you think?
regards Thomas
there is a diskussion about that in german forum:
https://forum.freecadweb.org/viewtopic.php?f=13&t=26334
avalanche.JPG
Hi Thomas

You should be able to select all the faces with "Select from List" and "Select all". The large number of faces shouldn't be a problem in principal - you may just find meshing a writing the case takes a little longer than usual.

In future we should probably allow a shell to be selected without explicit reference to all its faces. That would allow one to use, e.g. the facebinder object in the draft workbench to join faces together for this purpose. Someone (like you) with more FreeCAD knowledge could perhaps suggest the most elegant way to go about this?
Please provide all the information requested in this post before reporting problems with CfdOF.
User avatar
oliveroxtoby
Posts: 322
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby oliveroxtoby » Mon Jan 15, 2018 7:24 am

oliveroxtoby wrote:
Tue Dec 19, 2017 11:22 pm
ickby wrote:
Mon Dec 04, 2017 6:59 am
Hello Oliver,

On twitter I saw a post stating you calculated the drag coefficient of the Millennium Falcon:
https://twitter.com/ex_mente/status/936562984914210816

could you write a little something about that with a few pictures in the user showcase? I would love to use this on our Facebook site with the release of the new star wars film :)
Sorry for the delay - I'll try to put a few pictures together if it's not too late.
I'm not sure if we will get time to write this up nicely - but the macro files for the simulation are now available at https://opensimsa.github.io/training.html if you would like to have a look yourself.
Please provide all the information requested in this post before reporting problems with CfdOF.
User avatar
oliveroxtoby
Posts: 322
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby oliveroxtoby » Mon Jan 15, 2018 7:34 am

oliveroxtoby wrote:
Fri Jun 23, 2017 7:37 am
HoWil wrote:
Sat Jun 17, 2017 4:35 pm
Hi oliver,
I had some spare time and added some lines into 'CfdRunnableFoam.py' to support plotting with matplotlib under qt. This could make the separate gnuplot package for CFDFoam obsolete since matplotlib isincluded in FC anyway.
Hi HoWil

Thanks very much for this. I have played with it a bit, updating the plot only every second, but it's going to require some more thought...the problem is that the actual draw() call has a noticable delay and I am loath to introduce jitters to the user experience if they are, say, busy dragging the model around while the run is going. Offloading this to another thread 'works', sort of, but sadly it isn't correct to have Qt GUI operations happening in another thread. The only answer I can think of is to have the plotter running in a whole other process, being fed data through stdin, say. It seems a bit of a brute force approach but maybe it is the way to go. We would also very much like to get rid of the extra dependency.
Just to update on this - the gnuplot dependency is now removed, and we are using matplotlib via the plot workbench (as per Qingfeng's suggestion)
Please provide all the information requested in this post before reporting problems with CfdOF.
User avatar
oliveroxtoby
Posts: 322
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby oliveroxtoby » Mon Jan 15, 2018 7:36 am

qingfeng.xia wrote:
Sun Nov 19, 2017 11:12 pm
Great job, the matplotlib plotting, I am just thinking to implement it, via the plot workbench, while you made it.
Thanks, I will integrate it.
A good idea. I wasn't aware of the plot workbench - we are using it now as well.
Please provide all the information requested in this post before reporting problems with CfdOF.
thschrader
Posts: 1429
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Mon Jan 15, 2018 1:37 pm

ickby wrote:
Mon Dec 04, 2017 6:59 am
Hello Oliver,

On twitter I saw a post stating you calculated the drag coefficient of the Millennium Falcon:
https://twitter.com/ex_mente/status/936562984914210816

could you write a little something about that with a few pictures in the user showcase? I would love to use this on our Facebook site with the release of the new star wars film :)
@ickby: please have a look here
https://opensimsa.github.io/training.html
@Oliver: crazy :mrgreen:
Can anybody try to generate the simulation with the macros Oliver posted on git and
post the complete FC-file (maybe on dropbox)? Thanks.
MF.JPG
MF.JPG (88.11 KiB) Viewed 1028 times
User avatar
bernd
Posts: 8470
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby bernd » Mon Jan 15, 2018 4:53 pm

@thomas, FYI
some time ago we had a problem with to much entries in a fixed contraint. Werner fixed the problem and we could have more than 3000 faces as reference shapes. I added them by python.
thschrader
Posts: 1429
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Computational Fluid Dynamics (CFD) workbench using OpenFOAM

Postby thschrader » Mon Jan 15, 2018 8:57 pm

;)
https://github.com/opensimsa/opensim/tr ... niumFalcon
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12940 (Git)
Build type: Release
Branch: master
Hash: 22ed0bce514174558bf09f6d4f0237f2ac382fc6
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
I_did_my_best.JPG
I_did_my_best.JPG (97.36 KiB) Viewed 936 times