Openfoam Training Part 2v5

  • Upload
    cypiii

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

  • 8/9/2019 Openfoam Training Part 2v5

    1/23

    Introduction to fluid mechanics simulation using

    the OpenFOAM® technology

    « Simulation in porous media from pore to large scale »

    Part II: Mesh complex geometries, application to the evaluation of permeability,

    transport of passive scalars at the porescale

    !tanford

    November 10, 2014"ersion #$%

    &ontact: cyprien$soulaine'stanford$edu

    http://web.stanford.edu/~csoulain/ 

    mailto:[email protected]://web.stanford.edu/~csoulain/http://web.stanford.edu/~csoulain/mailto:[email protected]

  • 8/9/2019 Openfoam Training Part 2v5

    2/23

    [email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    Previously in OpenFOAM training$$$

     A case is always organized in the same way: time directory, constant directory and systemdirectory.

    To setup a case, it is recommanded to adapt an eisting tutorial.

    The initial and boundary conditions are defined in the 0  directory.

    !or simple meshes, we can use blockMesh, otherwise we should use an eternal gridder orsnappyHexMesh.

    Two different algorithms to sol"e #a"ier$%to&es e'uations : %()*+ -simpleFoam... and *(%-icoFoam, pisoFoam...

  • 8/9/2019 Openfoam Training Part 2v5

    3/23

    [email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    (eneral introduction to the OpenFOAM® technologyWhat is OpenFOAM ?

    First simulations )ith OpenFOAM® 

    #1 – Heat i!!"sion

    ene$al st$"ct"$e o! an OpenFOAM® case

    #% – &a'ity 

    Whe$e one can !in help an oc"mentation ?

    #( – )oise"ille !lo* 

    #+ – $aina-e expe$iment in a capilla$y t"be

    *o) to mesh complex geometries )ith OpenFOAM® +

    # – Mesh a po$e/space *ith snappyHexMesh

    snappyHexMesh o'e$'ie* 

    # – cala$ t$anspo$t in po$o"s meia at the po$e/scale

    Programming euations )ith OpenFOAM® 

    2asics o! OpenFOAM p$o-$ammin- 

    ene$al st$"ct"$e o! an application

    *eat transfer in porous media )ith OpenFOAM® 

    #3 – 4empe$at"$e in po$o"s meia

    #5 – &$eate a 6 a$cy 7 sol'e$ 

    #8 – 4*o/e9"ations moel !o$ heat t$ans!e$ in po$o"s meia

    *o) to solve -avier!to.es euation )ith OpenFOAM® +

  • 8/9/2019 Openfoam Training Part 2v5

    4/23

    [email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    snappyHexes! overvie) /0123

      o  p  e  n   !  o  a  m .  c  o  m

    snappyHexMesh is an automatic and robust mesher able to grid any complegeometry

    )esh a region inside or/and around an obect described by a surface mesh

    (t is compatible with a lot of input formats resulting from 3A4 softwares ortomography imaging :;.stl , ;.ob

  • 8/9/2019 Openfoam Training Part 2v5

    5/23

    [email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    snappyHexes! overvie) /2123

    open!oam.com

  • 8/9/2019 Openfoam Training Part 2v5

    6/23

    [email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    4# 5 Mesh a porespace /0163

    becti"e:• )esh the "oid space of a porous medium with snappyHexMesh

      o  "   t   l  e   t

       i  n   l  e   t

    =oi space that nees to be-$ie 

    *all 

    *all 

    1

    "

    oli -$ains e!ine by

    a s"$!ace mesh !ile

    8enerate the surface mesh -here the solid grain.

    3reate a suitable bac&ground mesh with blockMesh. (t needs to be fine enough toha"e at least 9 cells in the pore$throat thic&ness.

    4etect the "oid space, remo"e the cells occupied by the solid and snap them to fitas close as possible the initial surface obect with snappyHexMesh.

  • 8/9/2019 Openfoam Training Part 2v5

    7/23;[email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    4# 5 Mesh a porespace /2163

  • 8/9/2019 Openfoam Training Part 2v5

    8/[email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    4# 5 Mesh a porespace /7163

    The net step consists in creating a bac&ground mesh with blockMesh. The size of this bac&grounddomain depends on the bounding bo of the surface obect. (t can be obtained using the s"$!ace&heck  tool,

  • 8/9/2019 Openfoam Training Part 2v5

    9/[email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    4# 5 Mesh a porespace /8163

  • 8/9/2019 Openfoam Training Part 2v5

    10/[email protected]

       O  p  e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    4# 5 Mesh a porespace /#163

  • 8/9/2019 Openfoam Training Part 2v5

    11/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    4# 5 Mesh a porespace /6163

  • 8/9/2019 Openfoam Training Part 2v5

    12/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /0193

    becti"es:• %ol"e the flow in the "oid space gridded in the pre"ious eercise• stimate the permeability of the porous medium• %ol"e a passi"e scalar transport in the "oid space

    The flow and the scalar transport are uncoupled. They can therefore be sol"ed oneafter the other.

    The flow is obtained sol"ing a %to&es problem with simpleFoam. The case can be setupbased on o0 -or T?(A+%/incompressible/simple!oam/pitz4aily

       i  n   l  e   t

      o  "   t   l  e   t

  • 8/9/2019 Openfoam Training Part 2v5

    13/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /2a193

  • 8/9/2019 Openfoam Training Part 2v5

    14/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /2b193

    %witch off the turbulence model

  • 8/9/2019 Openfoam Training Part 2v5

    15/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /2c193

  • 8/9/2019 Openfoam Training Part 2v5

    16/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /7193

    (t might be useful to plot the residuals on$the$fly to chec& the simulation con"ergence. This can beachie"ed by redirecting the simulation log into a file and etracting the residual "alues with thefollowing gnuplot script :

  • 8/9/2019 Openfoam Training Part 2v5

    17/239;[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /8a193

  • 8/9/2019 Openfoam Training Part 2v5

    18/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /8b193

    o7ais : ?un the simulation with a multi$grid sol"er for the pressure matri and compare theresiduals con"ergence.

  • 8/9/2019 Openfoam Training Part 2v5

    19/[email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /#193

  • 8/9/2019 Openfoam Training Part 2v5

    20/23

    [email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /6193

  • 8/9/2019 Openfoam Training Part 2v5

    21/23

    [email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /193

    t0.0s

    t0.10s

    t0.1s

    t0.%0s

  • 8/9/2019 Openfoam Training Part 2v5

    22/23

    [email protected]

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    46 5 !calar transport in the pore space /9193

    0 1 2 3 4 5 6

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    D5e-6

    D1e-6

    D5e-7

    time (s)

           T

  • 8/9/2019 Openfoam Training Part 2v5

    23/23

    20i l i @ f d d

       O  p

      e  n   F   O   A   M   ®   i  n   i   t   i  a   t   i  o  n

    In the next parts$$$

    Part III: First programs, development of a heat tranfer solver in porous media

    Part I": *o) to solve -avier!to.es euations )ith OpenFOAM+

    http://web.stanford.edu/~csoulain/ 

    http://web.stanford.edu/~csoulain/http://web.stanford.edu/~csoulain/