How to get contour surface position by openfoam

15
How to get contour surface position by OpenFOAM Osaka Univ. Takuya Yamamoto

Transcript of How to get contour surface position by openfoam

Page 1: How to get contour surface position by openfoam

How  to  get  contour  surface  position  by  OpenFOAM

Osaka  Univ.Takuya  Yamamoto

Page 2: How to get contour surface position by openfoam

Target  geometryOpenFOAM  tutorial  of  dam  break  (interFoam)  in  3D

Ini$al  condi$on The  interface  is  assumed  to  be  contour  surface  of  alpha1  =  0.5.

Page 3: How to get contour surface position by openfoam

Numerical  results  of  interface  position

Page 4: How to get contour surface position by openfoam

Getting  the  position  of  contour  surface  

We  can  get  the  contour  surface  posiDons  aEer  carrying  out  the  mulDphase  flow  simulaDons  and  by  using  either  of  the  following  opDons  

•  OpenFOAM  sample  uDlity  

•  ParaView  opDons

Page 5: How to get contour surface position by openfoam

Paraview?

VisualizaDon  toolbox  made  by  Sandia  NaDonal  Laboratories  The  latest  Ver.  4.3.1  Used  for  OpenFOAM  visualizaDon

www.paraview.org

Page 6: How to get contour surface position by openfoam

sample  utility

One  of  the  uDliDes  implemented  in  OpenFOAM

•  Get  data  along  lines  (sets)  •  Get  data  along  surfaces  (surface)

To  get  contour  surface  posiDon

surface  type:  isoSurface

How  to  use  sample  uDliDes  is  in  OpenFOAMwiki、sampleDict  examples  OpenFOAM  wiki  (hUps://openfoamwiki.net/index.php/Sample)  sampleDict  examples(uDlity/postProcessing/sampling/sample/sampleDict)

Page 7: How to get contour surface position by openfoam

How  to  write  sampleDict  file

In  system/sampleDict

surfaces  (          isoSurface          {                  type                        isoSurface;                  isoField                alpha1;                  isoValue                0.5;                  interpolate          true;          }  )

Name  (Whatever  you  want)  

OpDon  for  obtaining  isosurface  data  Variables  used  for  contour  Iso-­‐surface  value  OpDon  for  interpolaDon  

Open  the  test  case  

Page 8: How to get contour surface position by openfoam

Executing  sample

Execute  sample  in  a  case  directory  (in  the  same  folder  as  0,  constant,  system)

AEer  execuDng  the  sample  command,  a  folder  named  ‘surface’  is  created.  In  the  folder,  there  are  sampled  values  (contour  posiDons)  

(To  execute,  simply  type  ‘sample’  without  the  quotes  in  the  case  directory)  

Page 9: How to get contour surface position by openfoam

By  using  paraview  

Choose  Contour

Page 10: How to get contour surface position by openfoam

Choose  File/Save  Data

By  using  paraview  

Page 11: How to get contour surface position by openfoam

A  new  window  opens  automaDcally.  Input  saving  file  name.  Choose  file  format  as  csv  

By  using  paraview  

Page 12: How to get contour surface position by openfoam

A  new  window  opens  automaDcally.

When  you  choose  Write  All  Time  Steps,    the  contour  data  is  automaDcally  outpuUed.  

Choose  OK

By  using  paraview  

Page 13: How to get contour surface position by openfoam

Output  files  are    Filename.*.csv  The  contour  surface  posiDon  is  in  the  file.

*:  Output  step  number

By  using  paraview  

Page 14: How to get contour surface position by openfoam

Summary

•  Two  methods  to  get  contour  posiDon  are  explained.  •  By  using  OpenFOAM,  sample  uDlity  can  be  used  for  gegng  contour  posiDons.  

•  In  addiDon  to  the  OpenFOAM  uDlity,  we  can  get  contour  posiDons  by  using  ParaView.

Please  let  me  know  if  there  are  other  methods.

Page 15: How to get contour surface position by openfoam

Reference

•  https://openfoamwiki.net/index.php/Sample•  www.paraview.org