20
Computer exercise 1 MVK150: Applied CFD Aurélia Vallier Holger Grosshans

Computer exercise 1The cavity case • Create a folder CFD_labOF in your local directory • Copy the cavity case C:\win32app\cfd\OpenFOAM-1.5\tutorials\icoFoam\cavity in this folder

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • Computer exercise 1

    MVK150: Applied CFD

    Aurélia VallierHolger Grosshans

  • How to get OpenFOAM

    Unix/Linux

    www.opencfd.co.uk

    MS Windows (used in this lab)

    http://sourceforge.net/projects/openfoam-mswin/

    DOCUMENTATION (linux version)http://foam.sourceforge.net/doc/Guides-a4/UserGuide.pdf

    http://www.opencfd.co.uk/http://sourceforge.net/projects/openfoam-mswin/http://sourceforge.net/projects/openfoam-mswin/http://sourceforge.net/projects/openfoam-mswin/

  • Tree structure

  • Tree structure

    • OpenFOAM is a C++ library of applications

  • Tree structure

  • Tree structure

    Input files for solving equationse.g. discretization schemes, used solver, timestep, …

    Input files for the physical properties-> blockMeshDict = Input file for creating the meshFiles which define the mesh. Created by blockMeshDict

    Initial conditions input files in 0. Results created in other folders

  • The cavity case

    • Create a folder CFD_labOF in your local directory

    • Copy the cavity case

    C:\win32app\cfd\OpenFOAM-1.5\tutorials\icoFoam\cavity

    in this folder.

    • Open OpenFOAM Designer and do File -> OpenCase to open your cavity case

  • OpenFOAM Designer

    Input files for the caseEditor for the input files

    OpenFOAM applications

  • Create the Mesh

    • Look into the constant/polyMesh folder

    • Do MeshUtilities -> Generation -> blockMesh -> start

    • Look into the constant/polyMesh folder to see that the mesh was created

  • Look at the mesh in Paraview

    • Create an empty file cavity/cavity.OpenFOAM in OpenFOAM Designer (File-> New)

    • Open paraview

    • Add the pluggins as instructed

    • File -> Open and open the file cavity.OpenFOAM

  • Look at the mesh in Paraview

  • blockMeshDict

    Coordinates of the vertices 0 to 7

    Connect the verticesinto one block

    The cells are hexagonal

    Number of cells in directionx, y and z

    The mesh is equidistantin each direction

    Name of the boundaries(user defined)

    Type of the boundaries- empty type for 2D case- wall type for a wall- patch type for the others.

    Connect the verticesinto one patch

    • Edit ’constant/polyMesh/blockMeshDict’ in OpenFOAM Designer

    Scale

  • New case : bend pipe

    • Copy case ’cavity’ to new case ’pipe’

    • Open case ’pipe’ in OpenFOAM Designer

    • Edit ’constant/polyMesh/blockMeshDict’

  • block0

    block2

    block1

    v0

    Plan z=0

    Plan z=0.1

    v1

    v2

    v7

    v5

    v3

    v4

    v6

    v13

    v15v14

    v12

    v11

    v8

    v10

    v9

    3 m(40 cells)

    3 m (40 cells)

    1 m

    New case : bend pipe

    inletvelocity Ux = 1m/s Pressure : zeroGradient

    Outlet velocity: zeroGradientPressure: fixedValue

    innerWallvelocity : 0pressure : zeroGradient

    outerWallvelocity : 0pressure : zeroGradient

  • blockMeshDict: curved edges

  • New case : bend pipe

    • Create the mesh with BlockMesh

    • Create an empty file pipe/pipe.OpenFOAM in OpenFOAM Designer (File-> New)

    • Check the mesh in ParaView

    • Do not close paraview and go back to the OpenFOAM Designer window

    • Define the initial and boundary conditions by editing 0/U and 0/p

    • Run icoFoam : solver -> incompressible -> icoFoam

    • Check the results in paraView : load the new time steps by clicking the box ’updateGUI’ and ’Apply’.

  • Check the results in paraview

    Load the internal meshand the boundaries

    Load velocity and pressure

    Show the last time step computed

    Show the velocity field

    Show the scale

  • Check the results in paraviewCreate a slice view (Znormal, uncheck ’Show Plane’ and Apply)

  • Check the results in paraviewSample the results over a line : - Highlight the file ’pipe.OpenFOAM’-Filters -> Alphabetical -> Plot over Line-Define the sampling line-Apply

  • Check the results in paraview

    Try with another sampling line