CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Python for openfoam

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

Like Tree3Likes
  • 3 Post By dkxls

Reply
 
LinkBack Thread Tools Display Modes
Old   August 22, 2014, 07:17
Default Python for openfoam
  #1
New Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 3
Rep Power: 2
Divyaprakash is on a distinguished road
Should I continue to learn Python or should I switch over to C++ if want to make use of openFoam and CUDA (GPU computing))

Can python be used for openfoam? I am just a beginner in the field of CFD. I have started leaning Python just recently and find it quite interesting. ALso I came to know about the benefits of openFoam if I want to work as a freelancer. But I have read that the knowledge of C++ required for it.
Also, can GPU computing be done through Python? I have found some articles related to it, but they are very few.
Divyaprakash is offline   Reply With Quote

Old   August 22, 2014, 09:05
Default
  #2
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 116
Rep Power: 9
dkxls will become famous soon enough
If you are serious with OpenFOAM you should learn C++. Also note that OpenFOAM has a vast amount of own classes that accomplish what is nowadays also part of newer C++ standards. So it's more of learning OpenFOAM/C++.

Otherwise python is a very good choice for all kind of scientific purposes, especially when it comes to post-processing of CFD data. Numpy and matplotlib are very good starting points here.
For visualization purposes ParaView is very well suited (especially for OpenFOAM) and ParaView uses python as it's primary scripting language too.
There are a lot of tutorials, Google helps.

Concerning the GPU stuff: What do you wanna do?
There are a lot of tutorials for python and GPU programming out there, just google "python CUDA".
See for example here:
https://developer.nvidia.com/how-to-cuda-python
http://mathema.tician.de/software/pycuda/
http://mathema.tician.de/software/pyopencl/

Cheers,
Armin
Haier, adambarfi and tarjeiba like this.

Last edited by dkxls; August 22, 2014 at 11:21.
dkxls is offline   Reply With Quote

Reply

Tags
c++, cuda, gpu, openfoam, python

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
paraview v4 - building with python - OF2.3.0, PVv4, Python 2.7 aylalisa OpenFOAM Paraview & paraFoam 4 June 13, 2014 08:52
using the python shell in paraFoam colinB OpenFOAM Paraview & paraFoam 13 October 5, 2013 01:40
How to get Python Shell into ParaView 3.8.1? blaise OpenFOAM Installation 3 July 24, 2012 04:58
Python Shell button is diabled JPW ParaView 2 July 23, 2012 08:44
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 09:36


All times are GMT -4. The time now is 10:27.