Difference between revisions of "OpenFOAM/C2/Creating-simple-geometry-in-OpenFOAM/English"
Line 408: | Line 408: | ||
|- | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Clockwise curl of fingers | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Clockwise curl of fingers | ||
− | | 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;"| And '''fingers''' make a ''' | + | | 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;"| And '''fingers''' make a '''curl''' as shown in the figure. The '''curl''' can be '''clockwise''' or '''anticlockwise'''. |
|- | |- |
Revision as of 16:29, 29 May 2019
Title of script: Creating simple geometry in OpenFOAM
Author: Rahul Ashok Joshi
Keywords: Video Tutorial,Computational Fluid Dynamics (CFD),OpenFOAM geometry
|
|
Slide 1 | Hello and welcome to the spoken tutorial on creating a simple geometry in OpenFOAM |
Slide 2: Learning Objective | In this tutorial I will show you
|
Slide 3: System Requirement | To record this tutorial I am using
|
Slide 4: System Requirement
The tutorials were recorded using the versions specified in previous slide. Subsequently the tutorials were edited to latest versions. To install latest system requirements go to Installation Sheet. |
|
Only narration
|
In CFD the Pre-processing part consists of creating geometry and meshing it.
Let us take the Lid driven cavity case as an example. I have already opened the command terminal and entered the path for lid driven cavity. |
Slide 5: For OpenFOAM v 5.0
To source the OpenFOAM version 5, type: $of5 To go to the run folder, type: $cd $FOAM_RUN To open the cavity case directory, type: $cd tutorials/incompressible/icoFoam/cavity/cavity To list the contents of case directory, type: $ls |
|
In the command terminal
|
There are three folders 0,constant,and system
Geometry is inside the polymesh folder of constant. |
Terminal window: type cd constant | In the command terminal type cd constant and press Enter. |
Type ls | Now type ls and press Enter.
|
Type cd polyMesh | Type cd polymesh and press Enter. |
Type ls | Now type ls and press Enter. |
Slide 6: For OpenFOAM v 5.0
To list the contents of the cavity directory, type: $ls 0 constant system To open the system directory, type: $cd system To list the contents of the system directory, type: $ls blockMeshDict controlDict fvSchemes fvSolution |
|
Open the blockMeshDict file.
|
This contains the geometry file called as blockMeshDict.
Open the blockMeshDict file with any editor of your choice. In the terminal type gedit blockMeshDict. Note that M and D here are capital and press Enter. Let me drag this to the capture area. Now minimise this. |
Slides | Let me switch back to the slides. |
Hover over the diagram | In OpenFoam the entire geometry is broken into blocks. |
Block vertex starts from 0 | The blocks are numbered starting from 0 as shown in the figure. |
For 2D geometry enter a unit thickness cell in z axis | Note that in OpenFOAM for creating a 2D geometry, you need to give cell thickness value in the z-axis. |
Dimension of Cavity | Lid driven cavity is of length 1 and height 1.
|
Create empty file
right click >create document>empty file |
On your desktop create an empty file by
(Note that M and D here are capital) |
Copy data from old blockMeshDict file
|
Open this.
Now copy the data from the original lid driven cavity blockMeshDict file to the new blockMeshDict file from line 0.
Copy this and paste it here. Scroll down. Now leave some space after convertTometers. Enter 1 as the geometry is in meters. Insert a semi-colon and press Enter. Again press Enter. |
In the blockMeshDict file
|
In the file type vertices and press Enter. |
Insert ( | Insert the open bracket and press Enter.
Press the Tab key. |
Start with point 0
|
Start with point 0.
Insert open close brackets. Enter (0 space 0 space 0) and press Enter. Again press Tab key. Open close bracket.
|
Point 2 in the x-y plane | Again press the Tab key. Open close bracket.
Move towards point 2 in the positive x-y plane and enter (1 space 1 space 0) Press Enter. |
Point 3 in y direction | Again press the Tab key. Open close bracket.
Enter the 3rd point in positive y axis (0 space 1 space 0 ) Press Enter. |
Point 4 in the front face
enter (1 0 1) |
Again press the Tab key.
Enter the 4th point on the front face. Open close bracket. (0 space 0 space 0.1) And press Enter. |
Points 5,6,7 with unit cell thickness in z axis | Similarly enter the other points with one unit value in the positive z -axis. |
Inert ) and ; | Close the bracket and insert a semicolon after it.
Press Enter. Again press Enter. |
Type blocks and insert (
|
Below vertices are the blocks.
Type blocks and press Enter. Insert an open bracket and press Enter. Let me switch back to the slides. Note that Lid driven cavity is taken as a single block |
Enter the vertices of block
|
Let me switch back to blockMeshDict.
We are using here hexahedral blocks for meshing. Now type hex H E X, leave some space, in brackets enter (0 space 1 space 2 space 3 space 4 space 5 space 6 space 7). Again leave some space.
Note that for multiple blocks the points will be more. |
Enter grid points in x, y and z axis | After this enter the grid points in the x,y,and z directions |
Enter the mesh/grid size
enter ( 30 30 1) |
In brackets enter (30 space 30 space 1), leave some space. You can modify the grid as when needed. |
Grid point in z axis is kept as 1 | Grid point in z-axis can be taken as one |
Enter simpleGrading value ( 1 1 1 )
|
Now leave some space and type simple grading leave some space and enter (1 space 1 space 1).
This is the grid spacing in the x,y and z direction. Press enter, insert a close bracket and insert the semicolon and press enter. Again press enter.
|
Type edges | Now type edges and press enter,as this is a simple geometry edges can be kept empty. |
Insert ( ); | Insert open bracket press enter, close a bracket insert a semicolon and press enter. |
Boundary conditions | Below edges are the boundary conditions. |
Here you need to enter the boundary name for the faces | |
Type boundary
|
Type boundary and press enter
|
Slide : Geometry | In the geometry the upper wall is moving and other three walls are fixed. |
Front and back faces are named as empty | The front and back faces are termed as empty as this is a 2D problem |
Open the current blockMeshDict file | Open the New blockMeshDict file again |
Boundary patch as moving wall | In boundary put the name of the patch as moving wall press enter. |
Insert { | Insert a open curly bracket and press enter. |
Type of moving wall : wall
|
Enter type for the moving wall. Enter type space wall
|
Now faces, now press enter, insert open bracket, press enter, press a tab key, open close bracket and in this bracket type faces
Enter open and close brackets In brackets enter the points for faces | |
Let me switch back to the slides | |
Slide : Geometry | Note that order the points in such a way that the thumb should be normal to that face |
Clockwise curl of fingers | And fingers make a curl as shown in the figure. The curl can be clockwise or anticlockwise. |
Points should be entered matching the points inserted in vertices | Also note that the points should match with the points inserted in vertices. Now let me switch back to new blockMeshDict file. |
Enter (3 7 6 2)
|
Enter the face points as (3 space 7 space 6 space 2). Let me switch back to the slide. These are the points for the moving wall (3 7 6 2). Minimize this. Note that you can start from any point on that face.
Now press enter. Close the bracket. You need to enter the semicolon. After you insert the points for the faces again press enter. Close the curly bracket. Another note now after the curly brackets press enter again press enter.
|
Boundary patches for fixedWalls | Similarly enter boundary condition and faces for the fixed wall |
For front and back face enter type as empty | Being a 2D problem the type of boundary
|
Insert | Type mergePatchPairs and press enter. Since there are no patches to be merged, it can be kept empty. Insert the Open-closed brackets and insert a semicolon. Again press enter. |
BlockMeshDict file is completed
|
We are done with creating the blockMeshDict file.
The complete blockMeshDict file is as shown here. |
Close the original blockMeshDict file
|
Close the original blockMeshDict file
|
Type cd .. twice | type cd (dot) (dot) twice to return to the cavity folder Mesh the geometry |
Meshing, type blockMesh | in terminal type: blockMesh and press enter |
Viewing the geometry type paraFoam | View the geometry by typing in the command terminal paraFoam and press enter
|
In the object inspector menu click Apply | On the left hand side click Apply on object inspector menu |
Slide | In this tutorial we learnt:
Creating a simple geometry in OpenFOAM Viewed the geometry in Paraview This brings us to the end of the tutorial |
Slide : Assignment | Assignment
Change the geometry parameters : Enter the grid points as (40 40 1) and (50 50 1). View the geometry in paraview
|
Slide : About spoken tutorials | Watch the video available at this URL: http://spoken-tutorial.org/What_is_a_Spoken_Tutorial
If you do not have good bandwidth, you can download and watch it. |
Slide : about spoken tutorials | The Spoken Tutorial Project Team
-Conducts workshops using spoken tutorials -Gives certificates to those who pass an online test -For more details, please write to us at contact@spoken-tutorial.org |
Slide : Forum to answer questions | Do you have questions on THIS Spoken Tutorial?
Choose the minute and second where you have the question Explain your question briefly Someone from the FOSSEE team will answer them. Please visit http://forums.spoken-tutorial.org/ |
Slide : Forum to answer questions | Questions not related to the Spoken Tutorial?
Do you have general/technical questions on the Software? Please visit the FOSSEE forum http://forums.fossee.in/ Choose the Software and post your question |
Slide : Lab Migration project | We coordinate migration from commercial CFD software like ANSYS to OpenFOAM
We conduct free Workshops and provide solutions to CFD Problem Statements in OpenFOAM For more details visit this site: http://cfd.fossee.in/ |
Slide : Case Study project | We invite students to solve a feasible CFD problem statement of reasonable complexity using OpenFOAM
We give honorarium and certificate to those who do this For more details visit this site: http://cfd.fossee.in/ |
Slide: Acknowledgement | Spoken Tutorials are part of Talk to a Teacher project,
It is supported by the National Mission on Education through ICT, MHRD, Government of India. More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro |
About the contributor | This is Rahul Joshi from IIT BOMBAY signing off.
Thanks for joining.
|