jaheyns / CfdOF

Computational Fluid Dynamics (CFD) for FreeCAD based on OpenFOAM solver
GNU Lesser General Public License v3.0
449 stars 85 forks source link

MacOSx #15

Closed fpiergen closed 5 years ago

fpiergen commented 5 years ago

Any plans to put in instructions to get this working with MAC? Can't figure out how to integrate in the Docker container to have openFoam installation available to Freecad on MAC

oliveroxtoby commented 5 years ago

We would need someone to contribute this, as the developers don't have access to Mac.

If it is an issue with OpenFOAM installation, there should be information out there, as there are a huge number of OpenFOAM users.

olesenm commented 5 years ago

As @oliveroxtoby points out we rely on external enthusiasts for OSX testing. I thus don't know if there are any osx-related problems in the last version, but OpenFOAM -v1806 added native OSX support. By native I mean compilation from source.

See the portability section: https://www.openfoam.com/releases/openfoam-v1806/build.php#build-configuration

fpiergen commented 5 years ago

I will give that a try and report back. Thank you for information.

On Feb 27, 2019, at 8:03 AM, Mark Olesen notifications@github.com wrote:

As @oliveroxtoby https://github.com/oliveroxtoby points out we rely on external enthusiasts for OSX testing. I thus don't know if there are any osx-related problems in the last version, but OpenFOAM -v1806 added native OSX support. By native I mean compilation from source.

See the portability section: https://www.openfoam.com/releases/openfoam-v1806/build.php#build-configuration https://www.openfoam.com/releases/openfoam-v1806/build.php#build-configuration — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jaheyns/CfdOF/issues/15#issuecomment-467853696, or mute the thread https://github.com/notifications/unsubscribe-auth/ADBrXH-JQVrTaJdvOI5FuNRelClO_z8Aks5vRoIGgaJpZM4bOxRE.

fpiergen commented 5 years ago

Got this compiled on MAC and almost working. When I try to run a set up case CfDof is looking for a python module that does not exist in Freecad.

matplotlib not found, so Plot module can not be loaded Traceback (most recent call last): File "/Users/fabio/Library/Preferences/FreeCAD/Mod/CfdOF/_ViewProviderCfdSolverFoam.py", line 81, in setEdit from CfdRunnableFoam import CfdRunnableFoam File "/Users/fabio/Library/Preferences/FreeCAD/Mod/CfdOF/CfdRunnableFoam.py", line 44, in <module> from CfdResidualPlot import ResidualPlot File "/Users/fabio/Library/Preferences/FreeCAD/Mod/CfdOF/CfdResidualPlot.py", line 30, in <module> from freecad.plot import Plot <type 'exceptions.ImportError'>: No module named plot

Having a hard time trying to import the python module matplotlib into Freecad. Any suggestions? Thanks.

oliveroxtoby commented 5 years ago

Good to hear!

On my Linux machine I recall having to install matplotlib through my system package manager. (It wasn't sufficient just to install the python module using e.g. pip.)

I think this should be as much of an issue with the Plot module as with CfdOF, and that presumably has been tested on Mac. This thread suggests matplotlib should be included in the AppImage - are you using it or compiling from source?

fpiergen commented 5 years ago

No I am using version 0.17 latest free cad. I was able to get matplotlib module but now I get a different error. Traceback (most recent call last): File "/Users/fabio/Library/Preferences/FreeCAD/Mod/CfdOF/_ViewProviderCfdSolverFoam.py", line 81, in setEdit from CfdRunnableFoam import CfdRunnableFoam File "/Users/fabio/Library/Preferences/FreeCAD/Mod/CfdOF/CfdRunnableFoam.py", line 44, in <module> from CfdResidualPlot import ResidualPlot File "/Users/fabio/Library/Preferences/FreeCAD/Mod/CfdOF/CfdResidualPlot.py", line 28, in <module> import Plot File "/Applications/FreeCAD.app/Contents/Mod/Plot/Plot.py", line 32, in <module> matplotlib.use('Qt4Agg') <type 'exceptions.AttributeError'>: 'module' object has no attribute 'use'

Progress...:)

fpiergen commented 5 years ago

Ok I got passed that. I was using the wrong version . Need to use 2.7 python. Will keep you posted.

fpiergen commented 5 years ago

This is what I used as a guide to compile on MAC https://github.com/mrklein/openfoam-os-x/wiki/OpenFOAM(R)-git-version-&-Homebrew

oliveroxtoby commented 5 years ago

Thank you for your efforts! Does it seem to be working now? I will add this info to the Readme.

fpiergen commented 5 years ago

I have not tried to run the case yet. On thing I did notice is that it had no place to input where I want to write the files for openfoam. It used a temporary directory. /var/folders/k5/srn0g_vn43sfnk93p1pwv3140000gn/T/case

I was able to write the case to that area. When I have some more time I will do the run part and see if I can view the results.

Thanks, Fabio

On Apr 2, 2019, at 11:34 AM, Oliver Oxtoby notifications@github.com wrote:

Thank you for your efforts! Does it seem to be working now? I will add this info to the Readme.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jaheyns/CfdOF/issues/15#issuecomment-479054708, or mute the thread https://github.com/notifications/unsubscribe-auth/ADBrXIPifYxEpK-Yc94468UKeSb-529rks5vc3iZgaJpZM4bOxRE.

oliveroxtoby commented 5 years ago

You should be able to set this in the preferences dialog - Edit | Preferences | CFD, Default output directory.

fpiergen commented 5 years ago

This is is what I did in Freecad python console to get the matplotlib imported: import sys sys.path.append('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python’) import matplotlib

oliveroxtoby commented 5 years ago

So it turns out that the Plot workbench has been moved out of the FreeCAD core into an external module. Some packages include it (and its dependency, matplotlib), others don't. In future it will be installable from the AddOn manager, but for now a workaround like this is necessary. I have updated the Readme and dependency checker accordingly. For now it's a bit of a pain unfortunately.

fpiergen commented 5 years ago

Went through elbow tutorial in http://www.opensim.co.za/training.html

Everything seems to be working. A little buggy but it works. Thanks for help.