CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Python for openfoam (https://www.cfd-online.com/Forums/openfoam-programming-development/140760-python-openfoam.html)

Divyaprakash August 22, 2014 07:17

Python for openfoam
 
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.

dkxls August 22, 2014 09:05

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


All times are GMT -4. The time now is 20:26.