|
[Sponsors] |
How to initialize flat interface with setExprFields (and "complex" mesh) ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 15, 2023, 06:47 |
How to initialize flat interface with setExprFields (and "complex" mesh) ?
|
#1 |
New Member
ALN
Join Date: Nov 2023
Posts: 3
Rep Power: 3 |
Hi, I would like to initialize a flat interface in a case with real bathymetry and cartesian mesh (generated with cfMesh). Some of the cells are wobbly, so interface is not flat. My idea is to put an alpha (phase volume fraction) proportional to the height of my interface in the cells (for example if the z_interface crosses the middle of the cell, alpha=0.5).
To do that, I would like to use setExprField (https://www.openfoam.com/documentation/guides/latest/doc/openfoam-guide-expression-syntax.html) . The trouble is : I can not find a way to access to the coordinates of nodes. I try to put something with pts().z() in expression but this error appears : --> FOAM FATAL ERROR: (openfoam-2206) Mismatch between field-mask geometric type (cells) and expression geometric type (points) which makes sense. How to get pts().z()[0] for example ? Many thanks for your attention ! |
|
November 16, 2023, 07:03 |
|
#2 |
New Member
ALN
Join Date: Nov 2023
Posts: 3
Rep Power: 3 |
Finally, I find a way to do what I want with setAlphaFieldDict. The file looks like this :
Code:
field "alpha.water"; type composedFunction; mode add; composedFunction { plane { type plane; origin (723480 7594560 0.); normal (0 0 -1); } } and it is activated with setAlphaField |
|
Tags |
initialisation, interface, openfoam, pre-processing, setexprfields |
|
|