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

Python for openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 4 Post By dkxls

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2014, 08:17
Default Python for openfoam
  #1
Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 71
Rep Power: 12
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, 10:05
Default
  #2
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19
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, ramakant, adambarfi and 1 others like this.

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

Reply

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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[General] Python Shell button is diabled JPW ParaView 4 November 8, 2015 15:51
[OpenFOAM] using the python shell in paraFoam colinB ParaView 14 September 14, 2015 10:04
[OpenFOAM] paraview v4 - building with python - OF2.3.0, PVv4, Python 2.7 aylalisa ParaView 4 June 13, 2014 09:52
How to get Python Shell into ParaView 3.8.1? blaise OpenFOAM Installation 3 July 24, 2012 05:58
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 10:36


All times are GMT -4. The time now is 23:28.