AlphaInitializerFoam
Initialize the alpha (VOF) field with an input shape surface mesh in .stl format. The previous fluid shape will be retained.
Install / Use
/learn @daidezhi/AlphaInitializerFoamREADME
alphaInitializerFoam
:warning: IMPORTANT :warning: The alphaInitializerFoam has been renamed as setVofField and is available at geometricVofExt.
Introduction
alphaInitializerFoam is a pre-processing utility designed to initialize the alpha (VOF) field with an input shape surface mesh in .stl format. It works on polyhedral unstructured meshes. The previous fluid shape will be retained.
Another copy of alphaInitializerFoam and demo cases can be found in:
Dai, Dezhi (2019), “alphaInitializerFoam”, Mendeley Data, v2
http://dx.doi.org/10.17632/wg4sx7sc57.2
Compatibility
The source code of alphaInitializerFoam is developed and maintained for the latest OpenFOAM-plus release (currently OpenFOAM-v1812). A script for generating code for other releases and old versions will be provided in the near future.
Please notify me via the email address below if you found any errors or bugs, and I will fix them as soon as possible.
Methodology
The basic idea of alphaInitializerFoam follows:
- first compute the intersection of the surface mesh (blue), which represents the liquid or gas shape, and each cell (red) in the mesh,
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4a/Boolean_union.PNG" width="200"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0b/Boolean_intersect.PNG" width="200">Figures are from Wikipedia.
- then initialize the fraction value by normalizing the intersection volume with the cell one.
The .stl surface mesh loading and intersection operation in alphaInitializerFoam are from libigl and Cork libs, respectively.
It should be noted that the copies of Eigen, libigl and Cork that provided together with alphaInitializerFoam are ONLY used for simplifying the installation.
Installation
Before compiling alphaInitializerFoam, make sure that the OpenFOAM environment has been set properly.
-
Download
alphaInitializerFoamfrom this page or http://dx.doi.org/10.17632/wg4sx7sc57.2 -
Build
libcork.a
cd cork
make
- Build
alphaInitializerFoam
cd ..
wmake
All of the compiling commands above have been integrated into Allwmake script.
Usage
The usage of alphaInitializerFoam is simple:
Usage: alphaInitializerFoam [OPTIONS] <stl-file>
Arguments:
<stl-file> The input surface mesh in .stl format
Options:
-case <dir> Specify case directory to use (instead of the cwd)
-gas Initialize the shape for gas phase
-doc Display documentation in browser
-doc-source Display source code in browser
-help Display short help and exit
-help-compat Display compatibility options and exit
-help-full Display full help and exit
Initialize the alpha (VOF) field with an input shape surface mesh in .stl
format. The previous fluid shape will be retained.
Using: OpenFOAM-v1812 (1812) (see www.OpenFOAM.com)
Build: v1812
Arch: LSB;label=32;scalar=64
It should be noted that the parallel option has been disabled.
Demos
Three demo cases are available in http://dx.doi.org/10.17632/wg4sx7sc57.2 (alphaInitializerFoamTut.tar.gz).
The commands are integrated into the Allrun script for each case.
damBreak
<img src="https://i.imgur.com/xQNh65O.png">
<img src="https://i.imgur.com/B8hqsuZ.png">
<img src="https://i.imgur.com/qhpNmFU.png">
dualPiBubble
<img src="https://i.imgur.com/utTNzC1.png">
dualPiDroplet
<img src="https://i.imgur.com/Dmr2J6h.png">
Attribution
If you use alphaInitializerFoam in your academic projects, please cite this utility in general, you could use this BibTex entry:
@misc{alphaInitializerFoam,
doi = {10.17632/wg4sx7sc57.2},
url = {http://dx.doi.org/10.17632/wg4sx7sc57.2},
author = {Dai, Dezhi},
title = {alphaInitializerFoam},
publisher = {Mendeley Data, v2},
year = {2019}
}
Change Log
06/20/2019
06/11/2019
- Initial release.
Contributors
- Dezhi Dai, UT Arlington, dezhi.dai@mavs.uta.edu (Developer)
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
