![Page 1: How to get contour surface position by openfoam](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/1.jpg)
How to get contour surface position by OpenFOAM
Osaka Univ.Takuya Yamamoto
![Page 2: How to get contour surface position by openfoam](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/2.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/3.jpg)
Numerical results of interface position
![Page 4: How to get contour surface position by openfoam](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/4.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/5.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/6.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/7.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/8.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/9.jpg)
By using paraview
Choose Contour
![Page 10: How to get contour surface position by openfoam](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/10.jpg)
Choose File/Save Data
By using paraview
![Page 11: How to get contour surface position by openfoam](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/11.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/12.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/13.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/14.jpg)
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](https://reader034.vdocuments.pub/reader034/viewer/2022042602/55ce319abb61eb3a1c8b47aa/html5/thumbnails/15.jpg)
Reference
• https://openfoamwiki.net/index.php/Sample• www.paraview.org