Wednesday, June 8, 2016

Code For Straight Pipe In BlockMesh

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0 0 0)
    (0.1 0 0)  
    (0.1 0.1 0) 
    (0 0.1 0) 
    (0 0 1)  
    (0.1 0 1) 
    (0.1 0.1 1) 
    (0 0.1 1)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (40 40 200) simpleGrading (1 1 2)

);

edges
(
);

boundary
(
    side
    {
        type wall;
        faces
        (
            (0 3 7 4)
            (5 6 2 1)
            (1 0 4 5)
            (3 2 6 7)
        );
    }
   
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 3)
        );
    }
    outlet
    {
        type patch;
        faces
    (  
            (7 6 5 4)
    );
    }
);

mergePatchPairs
(
);

// ************************************************************************* //

Friday, June 3, 2016

               Basic Of OpenFOAM 

  • After proper installation go to your OpenFOAM directory(folder).
  • In OpenFOAM directory you will see their a number of directories are there.
  • To understand the functionality of OpenFOAM we have to understand the functionality of each directory.
  • First go to the tutorials directory and there are also many directories present inside it like basic,heat transfer,incompressible.These are the cases we want to solve for like we want to solve for incompressible fluid so wwe chose incompressible directory. 
  • In incompressible directory there are many other directories are there which are thee cases for the incompressible fluid or these are the  solvers for different cases for incompressible fluids.
  • Lets chose icoFoam it is used to solve for laminar case of incompressible fluid 
  • Each directory contains three directory inside it these are  0 ,constant and  system
        • Function of individual directory (0,constant and system)
    • 0 directory function
      • 0 directory:- contains the initial and boundary conditions  of different parameters like pressure and  velocity
      • constant directory :- it contains the geometry of  the shape we are solving for and the transport properties of fluid that remains constant for the simulation time
      • System directory:- it mainly contain 4 files named as  blockmeshDict,controlDict,fvSchemes and fvSolutions
            • here bllockmesh is  used to mesh the geometry to solve by the  FVM method 
            • controlDict contains the informations about the timing of simulations
            • fvSchemes and fvSolutions are used as an solvers for the given conditions here in fvschemes and fvSolutions many name as Eular,Guass linear solving techniques are given read more about to know how solutions are find for  different cases.


  •  In main directory of OpenFOAM contains another directory named as src which contains all the source code for the different solvers  are being used in the solutions of different cases.
  • You can study the codes and know  more about how the solution is done by different methods.


So here we stopped today.Next we will start from the working and different cases in OpenFOAM.

Computational Fluid Dynamics For Beginners

      System requirement

  • Ubuntu 15.10 OS
  •  OpenFOAM 3.0.1                                                                                   






 Installation Of OpenFOAM in Ubuntu 15.01 OSInstallation of OpenFOAM in ubuntu OS is a little bit complex in itself.

  • Copy and Paste all instructions step by step in your OS terminal and install OpenFOAM software
  • Now run the test for installed software if it not working ok make log file and search all the errors on Google and take the necessary steps to correct installations.
  • After complete installation run any test simulation to ensure OpenFOAM working properly

How OpenFOAM works

  • Before work on OpenFOAM you need to know how actually OpenFOAM works for this you have to read a deeply about the Navier Stoke Equation
  • To solve higher order partial differential equations you have to apply different numerical methods as you studied in your theory courses.The three most basic are :-
    •  FDM (Finite Difference Method)
    •  FVM (Finite Volume Method)
    •  FEM (Finite Element Method)
         Finite difference method is easy to solve but less accurate.
         Finite volume method is a little bit typical but more accurate than FDM
         Finite  element method is more typical and most accurate among the three
Study Of finite difference Method and Finite Volume Method is sufficient for the beginners in CFD.
A brief study  of FDM and FVM is necessary to know the working of OpenFOAM.


After study all theory required for OpenFOAM lets on next chapter to start The CFD and a further study on OpenFOAM


Readers are also  advised to Please visit the link:   http://lorenabarba.com/blog/cfd-python-12-steps-to-navier-stokes/
one of the good tutorials for CFD
    For any problem in installtion or otherwise  feel free to mail me at    ajayboora14@gmail.com