Difference between revisions of "OpenFOAM/C3/Installing-and-Running-PyFoam/English"
Rahuljoshi (Talk | contribs) (Created page with "= Tutorial 20 C2 = '''Title of script''': '''Installing and Running PyFoam''' '''Script : Anmol Sahoo, Rahul Joshi''' '''Narration : Rahul Joshi''' '''Keywords: OpenFOAM,...") |
Rahuljoshi (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
'''Title of script''': '''Installing and Running PyFoam''' | '''Title of script''': '''Installing and Running PyFoam''' | ||
+ | |||
'''Script : Anmol Sahoo, Rahul Joshi''' | '''Script : Anmol Sahoo, Rahul Joshi''' | ||
+ | |||
'''Narration : Rahul Joshi''' | '''Narration : Rahul Joshi''' | ||
+ | |||
'''Keywords: OpenFOAM, PyFoam, CFD, Spoken Tutorial, Python''' | '''Keywords: OpenFOAM, PyFoam, CFD, Spoken Tutorial, Python''' | ||
Line 20: | Line 22: | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide : Learning Objectives | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide : Learning Objectives | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In this tutorial, we will learn how to | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In this tutorial, we will learn how to Install and check '''PyFoam''' and the required steps for the same. |
− | + | - What is '''PyFoam''' | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | - Checking installation of '''OpenFOAM''' | ||
+ | |||
+ | |||
+ | - Installing '''Python, Numpy and Gnuplot ''' | ||
+ | |||
+ | |||
+ | - Install '''PyFoam''' using '''pip''' | ||
+ | |||
+ | |||
+ | - Install '''PyFoam''' using sources | ||
+ | |||
+ | |||
+ | - Check if '''PyFoam''' is working | ||
|- | |- | ||
Line 38: | Line 48: | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| To record this tutorial I am using | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| To record this tutorial I am using | ||
− | |||
− | |||
− | Note that '''PyFoam''' will also work with '''OpenFoam v1.6+ ''' | + | - '''Ubuntu''' Linux Operating system '''14.04''' |
+ | |||
+ | |||
+ | - '''OpenFOAM''' version 2.3.0 | ||
+ | |||
+ | |||
+ | - Note that '''PyFoam''' will also work with '''OpenFoam v1.6+ and above ''' | ||
|- | |- | ||
Line 49: | Line 63: | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| To practice this tutorial, the user should have | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| To practice this tutorial, the user should have | ||
− | |||
− | |||
− | + | - Basic knowledge '''of Linux terminal commands''' | |
+ | |||
+ | |||
+ | - Experience with running and analyzing '''OpenFOAM''' cases | ||
+ | |||
+ | |||
+ | - If not please watch the Linux tutorial on this website | ||
+ | |||
+ | |||
+ | |||
|- | |- | ||
Line 60: | Line 81: | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| What is '''PyFoam? ''' | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| What is '''PyFoam? ''' | ||
− | + | ||
− | + | -'''PyFoam''' is a collection of Python libraries and utilities | |
− | + | ||
+ | |||
+ | -It can be used to manipulate '''OpenFOAM simulations''' and | ||
+ | |||
+ | |||
+ | -It is Designed to make working with '''OpenFOAM''' easier | ||
+ | |||
Line 76: | Line 103: | ||
− | + | - '''iteratively''' running '''simulations''' | |
− | + | ||
− | + | ||
+ | - automate data collection | ||
− | + | ||
− | + | - parametrically modify case files and | |
− | + | ||
+ | |||
+ | - many other such useful activities. | ||
+ | |||
+ | |||
+ | Note that : | ||
+ | |||
+ | |||
+ | - '''PyFoam '''works over '''OpenFOAM''' | ||
− | + | - Thus we need to always have an installation of '''OpenFOAM''' in our computer | |
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide: Checking OpenFOAM | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide: Checking OpenFOAM | ||
− | |||
+ | Open terminal | ||
− | |||
− | |||
− | |||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| First we check if our installation of OpenFOAM has been done properly | ||
− | You should get the details of''' icoFoam''' and '''OpenFOAM''' version and help text | + | |
+ | Open a '''terminal''', and type '''icoFoam -help''' | ||
+ | |||
+ | |||
+ | You should get the details of''' icoFoam''' and '''OpenFOAM''' version and help text | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide : Installing Pre-Requisites | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide : Installing Pre-Requisites | ||
− | |||
− | |||
+ | Open Terminal | ||
− | |||
− | + | type in terminal | |
− | + | ||
− | + | ||
− | |||
− | + | type in terminal | |
− | + | ||
− | |||
− | |||
− | + | type in terminal | |
− | |||
− | |||
− | + | type in terminal | |
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Then, type | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Now we will install the necessary prerequisites for PyFoam such as |
+ | |||
+ | -Python, Pip, Numpy and Gnuplot | ||
+ | |||
+ | |||
+ | using the terminal. | ||
+ | |||
+ | |||
+ | First we type | ||
+ | |||
+ | |||
+ | '''sudo apt-get install python-dev '''and press enter | ||
+ | |||
+ | |||
+ | Then, type | ||
+ | |||
+ | '''sudo apt-get install python-pip '''and press enter | ||
+ | |||
+ | |||
+ | Then, type | ||
'''pip install Numpy''' | '''pip install Numpy''' | ||
− | |||
− | |||
− | + | Then, type | |
− | + | ||
− | '''sudo apt-get install gnuplot gnuplot-x11 ''' | + | '''sudo apt-get install gnuplot gnuplot-x11 '''and press enter |
− | + | ||
− | + | With this we are done with installing the pre-requisites | |
− | + | ||
|- | |- | ||
Line 150: | Line 191: | ||
Install PyFoam | Install PyFoam | ||
− | |||
− | |||
− | |||
− | |||
− | '''pip install PyFoam''' | + | Open terminal |
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Now we will installing '''PyFoam''' using pip | ||
+ | |||
+ | |||
+ | Open the terminal and Type: '''pip install PyFoam ''' | ||
|- | |- | ||
Line 162: | Line 203: | ||
Installing PyFoam | Installing PyFoam | ||
− | |||
− | |||
− | |||
− | |||
− | + | Open browser | |
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
− | + | Download PyFoam | |
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
− | + | Open terminal : go to Downloads folder | |
− | + | ||
− | + | ||
− | + | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right: | + | Untar the files |
− | + | ||
+ | |||
+ | install PyFoam | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| We can also installing '''PyFoam''' from '''source''' | ||
+ | |||
+ | |||
+ | To do so, Open the browser and in the URL window type | ||
+ | |||
+ | [http://www.pypi.com/ www.pypi.com] | ||
+ | |||
+ | |||
+ | Search for '''PyFoam ''' | ||
+ | |||
+ | Download '''PyFoam-0.6.5.tar.xz''' | ||
+ | |||
+ | |||
+ | In the terminal go to downloads folder | ||
+ | |||
+ | |||
+ | Type '''tar -xvf PyFoam-0.6.5.tar.xz ''' | ||
+ | |||
+ | |||
+ | Type cd name of the folder '''PyFoam-0.6.5''' | ||
+ | |||
+ | |||
+ | aftet this type '''sudo''' '''python setup.py''' '''install''' | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slides: Checking PyFoam | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show Slides: Checking PyFoam | ||
− | |||
− | |||
− | |||
− | |||
− | + | Open Terminal : To Check PyFoam working | |
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
+ | type in terminal | ||
+ | type in terminal | ||
− | |||
− | |||
+ | type in terminal | ||
− | |||
− | |||
+ | check the message | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Now we have Check if PyFoam is detecting | ||
− | + | OpenFoam and working correctly. | |
− | + | Switch to terminal again | |
+ | |||
+ | |||
+ | Type '''python''' | ||
+ | |||
+ | |||
+ | '''import PyFoam''' | ||
− | |||
− | |||
− | |||
+ | '''from PyFoam.FoamInformation ''' | ||
− | |||
+ | '''print from PyFoam.FoamInformation.foamTutorials()''' | ||
− | |||
− | + | This Should print directory of OpenFOAM Tutorials. | |
− | + | ||
− | + | ||
− | + | ||
+ | Now let us summarise | ||
|- | |- | ||
Line 246: | Line 289: | ||
Forum to answer questions | Forum to answer questions | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Please post your timed queries in this forum | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Please post your timed queries in this forum |
Line 256: | Line 299: | ||
Forum to answer questions | Forum to answer questions | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Please post your general queries on | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Please post your general queries on OpenFOAM in this forum |
|- | |- | ||
Line 263: | Line 306: | ||
Textbook Companion | Textbook Companion | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The '''FOSSEE '''team coordinates the TBC project | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The '''FOSSEE '''team coordinates the TBC project |
|- | |- | ||
Line 271: | Line 314: | ||
− | + | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The Spoken Tutorial | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India |
Revision as of 09:45, 9 May 2016
Title of script: Installing and Running PyFoam
Script : Anmol Sahoo, Rahul Joshi
Narration : Rahul Joshi
Keywords: OpenFOAM, PyFoam, CFD, Spoken Tutorial, Python
|
|
Show Slide : Title | Hello and welcome to the spoken tutorial on installing and running PyFoam |
Show Slide : Learning Objectives | In this tutorial, we will learn how to Install and check PyFoam and the required steps for the same.
|
Show Slide :
System Requirement |
To record this tutorial I am using
|
Show Slide :
Pre-requisite |
To practice this tutorial, the user should have
|
Show Slide :
Introduction to PyFoam |
What is PyFoam?
|
Show Slide :
Introduction to PyFoam
|
PyFoam can be also be used for
|
Show Slide: Checking OpenFOAM
|
First we check if our installation of OpenFOAM has been done properly
|
Show Slide : Installing Pre-Requisites
|
Now we will install the necessary prerequisites for PyFoam such as
-Python, Pip, Numpy and Gnuplot
sudo apt-get install python-pip and press enter
pip install Numpy
sudo apt-get install gnuplot gnuplot-x11 and press enter
|
Show Slide :
Install PyFoam
|
Now we will installing PyFoam using pip
|
Show Slide :
Installing PyFoam
|
We can also installing PyFoam from source
Download PyFoam-0.6.5.tar.xz
|
Show Slides: Checking PyFoam
|
Now we have Check if PyFoam is detecting
OpenFoam and working correctly.
|
Show Slide
|
Please post your timed queries in this forum
|
Show Slide
|
Please post your general queries on OpenFOAM in this forum |
Show Slide
|
The FOSSEE team coordinates the TBC project |
Show Slide
Acknowledgement
|
The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India
|
Thank You | The script is prepared by Anmol Sahoo and this is Rahul Joshi from IIT Bombay signing off. Thanks for watching |