CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[PyFoam] for Windows?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2012, 02:45
Default for Windows?
  #1
New Member
 
Alex Roumanidakis
Join Date: Dec 2012
Posts: 1
Rep Power: 0
Vitterfolk is on a distinguished road
Hey guys, I'm new here so sorry if this has been asked before, but is it possible to install the PyFoam libraries on windows? I'm running the windows compatible version 1.5. I'm rather inexperienced with anything beyond the syntax and logic of programming (Haven't played much with command prompt or programming beyond matlab or lessons on code academy). I'm willing to do the research on installing libraries and stuff on my own, but I just wanted to know if linux was required prior to dumping a bunch of time on it. Thanks!
Vitterfolk is offline   Reply With Quote

Old   December 24, 2012, 11:24
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Alex and welcome to the forum!

PyFoam has been developed and tested to work on Linux and Mac OS X.

AFAIK, PyFoam on Windows is currently only available in blueCFD (http://www.bluecape.com.pt/blueCFD/ - I'm the guy responsible for blueCFD) and it is still very limited, in the sense that most of the functionalities will not work. We haven't made much more progress, due to the current workload we've had since its release nearly a year ago. Public release of the changes we've made so far is still pending internal review and approval at blueCAPE (which is where I work).

Anyway, the main problem is that there are several functions in Python that PyFoam uses that will only work out-of-the-box in POSIX systems, such as Linux and Mac.
For making it work on Windows, it's necessary to search for the Python libraries that can help replace the missing functions that the Python version for Windows doesn't have by default. And some of those missing functions might still have to be coded, in case the external libraries that have been found don't have them...

Best regards,
Bruno

PS: I've moved this thread to the sub-forum dedicated to Installation on Windows, Mac and other Unsupported Platforms
__________________
wyldckat is offline   Reply With Quote

Old   January 11, 2013, 14:23
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings!

FYI, we've finally released the patches here: http://sourceforge.net/p/openfoam-ex...etspyfoam/166/

Best regards,
Bruno
__________________

Last edited by wyldckat; July 14, 2014 at 09:06. Reason: updated link to the new bug tracker
wyldckat is offline   Reply With Quote

Old   July 15, 2014, 07:50
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

I have some interesting updates on this topic. We at blueCAPE Lda (where I work) have created a new PyFoam repository at Github, dedicated to continuing the porting development of PyFoam to fully work on Windows: https://github.com/blueCFD/PyFoam

We made our first attempts to porting PyFoam to Windows back in 2011; later provided our modifications to the official PyFoam version in January 2013, which were introduced into PyFoam 0.6.0: www.cfd-online.com/Forums/openfoam-news-announcements-other/87114-new-release-pyfoam.html#post414040 - post #3

Unfortunately, the porting process was very incomplete back then and we haven't managed to pull any more efforts into porting PyFoam to Windows.
Therefore, we've started the project at Github yesterday, in hopes that this work can be continued by either ourselves or others.

The objective of this new repository at Github is to create a development environment for continuing the work that has been done so far: The very first release "PyFoam-Windows-0.6.3.tar.gz" is already available on the Releases page. For installing PyFoam 0.6.3 for Windows in blueCFD-Core, simply follow the instructions provided in the file "README.Windows".


A bug was already fixed today, but 3 are still open. Everyone is welcome to contribute!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 13, 2015, 09:02
Default pyFoam on windows
  #5
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Hi all,

Hopefully this is the correct place to create this thread. The question is about running pyFoamPlotWatcher on windows.

I did install pyFoam on a windows pc after a few hours of work. This is the project: https://github.com/blueCFD/PyFoam

Some minor modifications needed for a proper installation but it works fine. However when I try to see residuals & continuity plots following issue is exactly the problem I have: https://github.com/blueCFD/PyFoam/issues/3

Nothing appears when I run pyFoamPlotWatcher and it becomes visible for a second when Ctrl+C is hit then disappears again. You can see the attached file.

I would like to know if there any recommendations to cope with it.

Fatih.
Attached Images
File Type: jpg pyFoamErr.jpg (66.9 KB, 80 views)
fertinaz is offline   Reply With Quote

Old   January 13, 2015, 11:51
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Fatih,

I've moved your post from the post-processing forum to this thread, because this is a question specific to this port of PyFoam for Windows.

I need a few more details, in order to be able to help you:
  1. Which exact download package did you use and/or did you use "git clone"?
  2. Can you be more specific on the details regarding this statement:
    Quote:
    Originally Posted by fertinaz View Post
    Some minor modifications needed for a proper installation but it works fine.
    The smallest detail is more than enough to not have a working installation.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 13, 2015, 14:48
Default
  #7
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Hello Bruno,

Thanks for your respond, this looks like a more appropriate location for this thread

The steps I followed in details:

1- Naturally I started with the installation of python. I decided to use version 2.7

2- Then downloaded the project zip file: https://github.com/blueCFD/PyFoam and extracted it in the OF folder I have on windows (this is the OF2.1 version ported by symscape)

3- Applied the commands written in README.windows which are
mkdir %WM_PROJECT_DIR%\etc\config.d\
xcopy contrib\Windows\PyFoam.* %WM_PROJECT_DIR%\etc\config.d\
call %WM_PROJECT_DIR%\etc\config.d\PyFoam.bat
.\winsetup.bat
These commands are run in the OpenFOAM command prompt

3- To successfully accomplish the installation I had to modify the winsetup.bat file in which the setup.py is called:
- python setup.py install --prefix="%PYFOAM_ARCH_PATH%"
+ C:\FullPathPython\python setup.py install --prefix="%PYFOAM_ARCH_PATH%"
Otherwise one should see the irritating msg: "python is not recognized as an internal or external command"

4- Had to install numpy. Downloaded numpy‑1.8.2‑cp27‑none‑win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and installed it using pip.

5- Had to install gnuplot. Downloaded gp510-20141006-win64-mingw.exe.zip from http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/

6- After completing the gnuplot installation the full path for the gnuplot executable had to be written in PyFoam/PyFoam/ThirdParty/Gnuplot/gp_win32.py
- gnuplot_command = r'gnuplot.exe'
+ gnuplot_command = r'"C:\FullPathGnuplot\bin\gnuplot.exe"'
Note the "" here.

7- Run pyFoamPlotWatcher.bat with a sample log/simpleFoam.log

As far as I remember this must be it. I cannot check right now because I am not in the office at the moment but I guess these are the steps I followed today.

Thanks for your time.
fertinaz is offline   Reply With Quote

Old   January 13, 2015, 16:56
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Fatih,

You didn't download the pre-release version "0.6.3-win" from here: https://github.com/blueCFD/PyFoam/releases - or did you?
Because if you downloaded that specific version, then that explains the problem.

Either way, please confirm if the changes indicated in this commit are present in your source code snapshot: https://github.com/blueCFD/PyFoam/co...5caf947bdf603c - because these changes are meant to be the ones that fix this problem you're having.

edit: I forgot to mention that I've only tested this with gnuplot 4.6 so far... using the binary package downloaded directly from the gnuplot's project at Sourceforge.net.

Best regards,
Bruno

Last edited by wyldckat; January 13, 2015 at 16:59. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   January 14, 2015, 03:54
Default
  #9
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Ok, so started from scratch.
1- Downloaded "0.6.3-win" from https://github.com/blueCFD/PyFoam/releases
2- Applied changes in the commit you mentioned above: winhacks.py, gp_win32.py and FoamThread.py
3- Downgraded to gnuplot 4.6.6
4- Removed existing ThirdParty folder and installed 0.6.3-win
5- Run pyFoamPlotWatcher.bat log.simpleFoam
6- Result: Please see attached file.

Would be it be that gnuplot cannot access to the log file because some other application invoked by pyfoam locks it at the same time? I am not sure though it is just a guess.
Attached Images
File Type: jpg pyFoamErr-new.jpg (99.2 KB, 40 views)
fertinaz is offline   Reply With Quote

Old   January 14, 2015, 18:28
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Fatih,

Actually the "0.6.3-win" version is the one for which this feature you're trying to use will not work properly.
If you originally downloaded the one from the big "Download ZIP" button on the main page: https://github.com/blueCFD/PyFoam - then that is the latest code snapshot for this port. But even the latest version is still very experimental. I haven't been able to check properly what happens when I install this in another installation of blueCFD-Core on another machine. I'll try to look into this better either tomorrow or in the weekend.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 15, 2015, 06:34
Default
  #11
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Ok that was what I initially did, using the package comes by clicking "Download ZIP" button. The only difference between this version and the commit you mentioned is in the PyFoam/Execution/FoamThread.p

The code comes with the package is:
Code:
 if self.isWindows:
replaced with:
Code:
if uname()[0]=="Windows":
I tried both with gnuplot 5 and 4.6 but unfortunately did not seem to resolve the problem.

Many thanks for your time though. It would be nice if you can post here when you have a chance to dig deeper.
fertinaz is offline   Reply With Quote

Old   January 18, 2015, 14:37
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Fatih,

OK, I've fixed a couple of additional issues. Please get the latest ZIP from https://github.com/blueCFD/PyFoam

Now it should no longer give the problem with "unlink" after Ctrl+C is pressed and it should be able to show the graphs without exiting immediately, nor locking up... although please do keep in mind that the "--persist" option does not work on Windows, due to a limitation in gnuplot/Windows, at least as far as I can figure out.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 20, 2015, 02:50
Default
  #13
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Hi Bruno, many thanks for your time and effort. It works fine now.

Have a nice day.

Last edited by fertinaz; January 20, 2015 at 02:50. Reason: - removed attached err pics
fertinaz is offline   Reply With Quote

Old   November 29, 2016, 04:43
Default
  #14
New Member
 
Jeroen
Join Date: Oct 2016
Posts: 21
Rep Power: 10
verboomj is on a distinguished road
I follow all instructions according to the windows.readme file, but after the last command I get the warning that Numpy is not installed.

However, if I go to my C:/Python34 map in the command window, Numpy is working properly and is up to date.

Furthermore my if I use the command PyFoam in my BlueCFD shell it doesn't recognize the command.

Any idea?

Jeroen
verboomj is offline   Reply With Quote

Old   November 29, 2016, 06:29
Default
  #15
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Jeroen,

I haven't been able to update PyFoam to the latest version, to make it work on Windows.
Nonetheless, the old version should still work as intended with PyFoam 2.7.*

Therefore, I need to know a few details about the steps you've taken:
Quote:
Originally Posted by verboomj View Post
I follow all instructions according to the windows.readme file, but after the last command I get the warning that Numpy is not installed.
Which exact package did you download? Was it "PyFoam-Windows-0.6.3.tar.gz" or did you download from our "blueCFD-Core" branch at https://github.com/blueCFD/PyFoam/ ?

Quote:
Originally Posted by verboomj View Post
However, if I go to my C:/Python34 map in the command window, Numpy is working properly and is up to date.
I haven't tested our port with Python 3.4, I only tested it with Python 2.7. Which leads me to the next questions:

Quote:
Originally Posted by verboomj View Post
Furthermore my if I use the command PyFoam in my BlueCFD shell it doesn't recognize the command.
Which version of blueCFD-Core did you install?

And what steps did you take to integrate Python 3.4 into the blueCFD-Core shell?

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
openfoam, pyfoam, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:36.