OpenFOAM/C3/Installing-and-running-Gmsh/English

From Script | Spoken-Tutorial
Revision as of 12:50, 6 August 2014 by Gautam (Talk | contribs)

Jump to: navigation, search

Tutorial: Installing and runing Gmsh


Script and Narration: Gautam Sharma


Keywords: Gmsh.


Visual Cue
Narration
Slide 1 Hello and welcome to the spoken tutorial on Installing and running Gmsh.
Slide 2 : Learning Objectives


In this tutorial we will learn to
  • Install and run Gmsh
  • and create a basic geometry in Gmsh


Slide 2: Pre-requisite As a pre-requisite the user should have basic knowledge about mesh.
Slide 3:

System Requirement

To record this tutorial, I am using
  • Ubuntu Linux Operating system version 13.10. and
  • Gmsh version 2.8.4


Slide 4: About Gmsh


Let me introduce you to Gmsh.


Gmsh is an automatic 3-D finite element mesh generator, with built-in pre and post-processing facilities.


Its an Open-source software.

Slide 5 : Advantageous in creating complex geometry using blockMesh It is advantageous in creating complex geometries in gmsh than blockmesh utility of OpenFOAM.


like blades, aerofoil.


OpenFOAM supports importing mesh from third party meshing software like Gmsh.

Installing Gmsh


Synaptic Package Manager


Gmsh installed

Gmsh can be installed using Synaptic Package Manager.


Let me open Synaptic Package Manager for you.

It will ask for your password. Type in your password.


In search box type gmsh. Click on the checkbox in front of Gmsh. Click apply.


This might take some time. Your Gmsh is now installed.



Open browser


Alternately, you can also download Gmsh from the Gmsh website.


Let me open the browser.

Type: http://geuz.org/gmsh/ In the address bar, type: http://geuz.org/gmsh/
Scroll down to stable Linux release


Linux 64-bit

Scroll down and download the stable Linux release, according to your OS type.


I will download Linux 64-bit. Click on save file and ok.

Go to Home>> Downloads

Locate the file gmsh-2.8.4-Linux64.tgz

After finishing your download, go to the Downloads folder.
Extract the files Here you can see the tar file. Extract the file.


A new folder will be created.

Open Gmsh folder Open the folder. Go to bin and click on gmsh icon.
Gmsh start screen You can see the Gmsh start screen.


Let me go back to the slides.

Cube Now we will create a cube using Gmsh.
Diagram Here you can see the cube with side equal to one unit.
Gmsh window On the left hand, you can see the module tree with Geometry, Mesh and Solver as the branches.
Click Add Go to Geometry > Elementary entitites > Add.
Enter the coordinates of the cube Click on Point. A new window will appear.
Enter the coordinates Enter the X,Y and Z coordinates starting with (0 0 0) and press Enter.
(1 0 0)


(1 1 0)


(0 1 0)


z-direction coordinates


IEnter the second coordinates as (1 0 0) and press Enter.


The 3rd coordinate as (1 1 0) press Enter.


The 4th coordinate as (0 1 0) press Enter.


Similarly, enter the coordinates for the positive z-direction starting with (0 0 1)


Enter the remaining three coordinates and close the window.

Coordinates I have entered all the eight coordinates
Move the points Use the left mouse click to move the points.
8 points visible You can see all the 8 coordinates as points.
Join the points by Straight lines Now, click on the Straight line.
Select start point It wiil ask for start point select the first point.
Select end point It wiil ask for end point select the second point.
Straight line A line will be drawn between the two points.


Similarly join all the points

Join all the points Similarly join all the points.


I have joined all the points.

Press q to abort Press q to abort.
Define the faces Now we will define the faces of the cube.
Click on Plane Surface Click on Plane surface.


It will ask for the surface boundary.

Select the edges


Selected boundary

appear in red


Press e to end selection

Select the edges of the bottom face first.


You will note the edge we select turns in red color.


It will ask for any hole boundaries, if any.


Since we don't have holes in the geometry, press e to end the selection.

Face appears with centre lines You will notice the the face appears with dashed centre lines.
Define the top face Now define the top face.


Press e to end the selection.

Select the remaining faces


Similarly, define the remaining faces.


I have defined all the faces. Press q to abort.

Define the Volume Now, we will define the volume of the cube.


It will ask for the volume boundary.

Select the volume boundary Select any of the surface boundary and press e to end selection.
Green dot appears at centre A yellow dot appears in the centre of the cube, which represents the volume.


Press q to abort.

Define physical groups Now, we will define the physical groups.


Which will be used in exporting the geometry to OpenFOAM.

Define surface first Go to Physical Group>Add and click on Surface.
Select the surface boundary Select the front surface first press e to end the selection.


Select the back surface press e to end the selection.

Select the remaining face Similarly, select the remaining surfaces.


I have selected all the surfaces press q to abort.

Define the volume


Click on volume


Click the yellow dot


Dot appears in red

Now, we'll define the physical volume.


Click on Volume.


Click on the yellow dot at the centre of the cube.


The yellow dot will turn red in color. Press e to end selection.

Save you work Our cube is complete let us save our work.
Click on save as


Cube.geo

Go to File menu and click on Save as.


We will name our file as cube.geo.


Note that here geo stands for the geometry.


Click ok

Slide : Assignment This brings us to the end of the tutorial.


As an assignment try creating other basic shapes like cylinder and sphere.

Slide : Summary


In this tutorial we learnt :


  • 2 ways to install Gmsh using Synaptic Package Manager and website.
  • Created a cube using Gmsh.


Slide :

About Spoken tutorials

Watch the video available at this URL:

http://spoken-tutorial.org/What_is_a_Spoken_Tutorial

It summarizes the Spoken Tutorial project.

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

contact@spoken-tutorial.org

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.

This project is coordinated by http://spoken-tutorial

More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro

About the contributor This is Gautam Sharma from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

Gautam, Nancyvarkey, Rahuljoshi