OpenFOAM: inletOutlet boundary and why defining both inletValue and value
OpenFOAM: inletOutlet boundary and why defining both inletValue and value
The inletOutlet is a generic boundary condition that provides an outflow condition, with specified inflow for the case of return flow[1].
The mode of operation is determined by the sign of the flux across the patch faces[1].
- Positive flux (out of domain): apply zero-gradient condition.
- Negative flux (into domain): apply the inletValue fixed-value.
Example:
1 | outlet |
Question:
In the above code block, we have defined the “inletValue” for backflow conditions. Then why do we further define a “value”?
Answer:(from chatGPT, for reference only)
This is a required field in OpenFOAM for any field with a fvPatchField, even if it is not always used directly by the boundary condition logic.
During mesh initialization and when reading field files like U, p, etc., OpenFOAM needs a placeholder value for each boundary. The value field provides this.
In some contexts (like post-processing, writing, or during initial time steps), OpenFOAM may fall back to value if the dynamic logic of the boundary condition is not yet triggered.