Difference between revisions of "OpenFOAM/C3/Using-PyFoam-Utilities/English"
Nancyvarkey (Talk | contribs) |
Nancyvarkey (Talk | contribs) |
||
(8 intermediate revisions by one other user not shown) | |||
Line 23: | Line 23: | ||
* About '''PyFoam Utilities''' | * About '''PyFoam Utilities''' | ||
− | * How to use '''PyFoam Utilites''' | + | * How to use '''PyFoam Utilites''' |
* How to run and plot data for the '''shockTube''' case using '''PyFoam Utilites''' | * How to run and plot data for the '''shockTube''' case using '''PyFoam Utilites''' | ||
Line 32: | Line 32: | ||
| 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: | ||
− | * '''Ubuntu Linux '''14.04 | + | * '''Ubuntu Linux Operating System '''14.04 |
* '''OpenFOAM v2.3.0''' | * '''OpenFOAM v2.3.0''' | ||
* '''PyFoam 0.6.5''' | * '''PyFoam 0.6.5''' | ||
Line 40: | Line 40: | ||
Pre-requisite | Pre-requisite | ||
− | | 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;"| As a prerequisite 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;"| As a prerequisite user should have : |
− | * | + | |
+ | * basic knowledge of running commands on the '''Linux terminal''' | ||
* And some experience of running and analyzing '''OpenFOAM''' cases | * And some experience of running and analyzing '''OpenFOAM''' cases | ||
Line 47: | Line 48: | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show slide : Introduction to PyFoam Utilities | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show slide : Introduction to PyFoam Utilities | ||
| 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;"| Let me introduce you to '''PyFoam utilities.''' | | 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;"| Let me introduce you to '''PyFoam utilities.''' | ||
+ | |||
* '''Utilities '''are''' Python programs '''which come inbuilt with '''PyFoam.''' | * '''Utilities '''are''' Python programs '''which come inbuilt with '''PyFoam.''' | ||
Line 57: | Line 59: | ||
|- | |- | ||
− | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open terminal | + | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open terminal. Type '''pyFoam''' and press '''Tab''' twice |
− | + | ||
− | + | ||
− | Type '''pyFoam''' and press '''Tab''' twice | + | |
− | + | ||
| 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;"| Open the '''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;"| Open the '''terminal'''. | ||
Line 73: | Line 71: | ||
| 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;"| Let me switch back to the slides. | | 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;"| Let me switch back to the slides. | ||
− | Each '''utility''' can be executed with the '''–help''' option. | + | Each '''utility''' can be executed with the '''–help''' option. |
Line 83: | 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;"| We are going to use the | + | | 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 are going to use the following '''PyFoam Utilities''' to run the '''Shock Tube''' case. |
Line 91: | Line 89: | ||
* '''PyFoamSamplePlot.py''' | * '''PyFoamSamplePlot.py''' | ||
− | And then plot the necessary data using '''PyFoam''' | + | And then plot the necessary data using '''PyFoam''' |
|- | |- | ||
Line 117: | Line 115: | ||
− | Both the pressures zones are | + | Both the pressures zones are separated by a thin diaphragm. |
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''run/tutorials/compressible/rhoCentralFoam''' | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''run/tutorials/compressible/rhoCentralFoam''' | ||
− | | 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;"| Open the '''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;"| Open the '''Terminal''' and type the path for '''rhoCentralFoam''' inside '''compressible solver.''' |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''ls''' | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''ls''' | ||
− | | 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;"| You can see the '''shockTube''' case | + | | 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;"| Type '''ls'''. |
+ | |||
+ | You can see the '''shockTube''' case. | ||
|- | |- | ||
Line 148: | Line 142: | ||
− | So type '''cp -r 0.org 0''' | + | So type '''cp -r 0.org 0''' |
|- | |- | ||
Line 160: | Line 154: | ||
'''gedit sampleDict''' | '''gedit sampleDict''' | ||
− | | 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;"| Open the '''sampleDict''' file using '''gedit | + | | 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;"| Open the '''sampleDict''' file using '''gedit'''. |
|- | |- | ||
Line 167: | Line 161: | ||
− | | 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;"| Go to the bottom of the file and | + | | 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;"| Go to the bottom of the file and '''Remove U.Component(0).''' |
Line 195: | Line 189: | ||
'''pyFoamRunner.py rhoCentralFoam''' | '''pyFoamRunner.py rhoCentralFoam''' | ||
− | | 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 use the '''pyFoam utility | + | | 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 use the '''pyFoam utility of pyFoamRunner.py''' |
− | Type '''pyFoamRunner.py <'''followed by name of the '''solver > i.e. RhoCentralFoam''' | + | Type '''pyFoamRunner.py <'''followed by name of the '''solver > i.e. RhoCentralFoam'''. |
Line 205: | Line 199: | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Switch to the '''terminal '''and type '''ls''' | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Switch to the '''terminal '''and type '''ls''' | ||
− | |||
− | |||
| 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;"| Go back to the '''terminal''' and type '''ls.''' | | 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;"| Go back to the '''terminal''' and type '''ls.''' | ||
− | We can see the | + | We can see the log files which are generated. |
|- | |- | ||
Line 222: | Line 214: | ||
'''pyFoamSamplePlot.py ./ --dir=postProcessing/sets –info''' | '''pyFoamSamplePlot.py ./ --dir=postProcessing/sets –info''' | ||
| 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;"| After this we can plot for various '''time steps''' 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;"| After this we can plot for various '''time steps''' using- | ||
− | |||
'''pyFoamSamplePlot.py ./ --dir=postProcessing/sets –info''' | '''pyFoamSamplePlot.py ./ --dir=postProcessing/sets –info''' | ||
Line 249: | Line 240: | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show slide : Summary | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show slide : Summary | ||
− | | 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 learnt about '''PyFoam Utilities.''' | + | | 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 learnt about '''PyFoam Utilities.''' |
Latest revision as of 10:52, 2 March 2017
Tutorial : 22
Name : Using PyFoam Utilities
Script : Anmol Sahoo and Rahul Joshi
Narration : Rahul Joshi
Keywords : OpenFOAM, PyFoam, CFD, Linux, PyFoam utilities,shockTube
|
|
Show Slide : Title | Welcome to the spoken tutorial on Using PyFoam Utilities |
Show Slide : Learning Objectives | In this tutorial we will learn :
|
Show Slide :
System Requirement |
To record this tutorial I am using:
|
Show Slide :
Pre-requisite |
As a prerequisite user should have :
|
Show slide : Introduction to PyFoam Utilities | Let me introduce you to PyFoam utilities.
|
Show slide : List of Utilities | List of utilites that can be viewed using tab completion |
Open terminal. Type pyFoam and press Tab twice | Open the terminal.
|
Show slide : List of utilities | Let me switch back to the slides.
Each utility can be executed with the –help option.
|
Show Slide : using utilties
|
We are going to use the following PyFoam Utilities to run the Shock Tube case.
And then plot the necessary data using PyFoam |
Show slide : PyFoamRunner.py | PyFoamRunner.py can be used to run cases.
|
Show slide : PyFoamSamplePlot.py | This utility is used to plot the various data obtained from the previously set up sampleDict. |
Show slide : Problem definition
|
Shock Tube is an instrument -
In this case, the rectangular tube has low pressure on the right side and high pressure on the left side.
|
Type run/tutorials/compressible/rhoCentralFoam | Open the Terminal and type the path for rhoCentralFoam inside compressible solver. |
Type ls | Type ls.
You can see the shockTube case. |
Type cd shockTube | Type cd shockTube |
Point to the 3 files | You can see three folders 0.org , constant and system. |
On Terminal type
cp -r 0.org 0 |
We need to copy the 0 file from 0.org
|
Type cd system | Now, go to the system folder by typing
cd system |
Type
gedit sampleDict |
Open the sampleDict file using gedit. |
In sampleDict file, do as narrated
|
Go to the bottom of the file and Remove U.Component(0).
|
Save the file and exit | Save and exit the file. |
Type cd .. | Go one level back by typing cd .. |
Type blockMesh | Run the command blockMesh to mesh the geometry. |
Type setFields | After this type setFields to set the pressure boundary condition. |
Type
pyFoamRunner.py rhoCentralFoam |
Now we will use the pyFoam utility of pyFoamRunner.py
|
Switch to the terminal and type ls | Go back to the terminal and type ls.
|
Type sample | Now type sample to run the sample utility. |
Type
pyFoamSamplePlot.py ./ --dir=postProcessing/sets –info |
After this we can plot for various time steps using-
pyFoamSamplePlot.py ./ --dir=postProcessing/sets –info
|
Type pyFoamSamplePlot.py ./ --dir=postProcessing/sets --field=T --mode=timesInOne | gnuplot | Then type pyFoamSamplePlot.py ./ --dir=postProcessing/sets --field=T --mode=timesInOne | gnuplot |
The output generated will be a png file. | |
Type ls
|
Type ls.
|
Show slide : Summary | In this tutorial, we learnt about PyFoam Utilities.
|
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 | This is Rahul Joshi from IIT Bombay signing off. Thanks for watching |