forced interpolation from coupled boundaries introduces problems
Summary
On e.g. cyclic
boundaries the value always has to be the interpolate of the two neighbouring cell values (except for geometry). For some field operations this can give unexpected results, e.g. sign
of a volScalarField. It is quite easy to have +1 in one cell and -1 in its coupled cell, resulting in a nonsensical 0 interpolated value on the coupled boundary. In ObukhovLength
functionObject it divides by this resulting in a sigfpe.
The general issue is that non-scalar indicator fields should not have boundary conditions.
Steps to reproduce
Run below tutorial in https://develop.openfoam.com/Development/openfoam/-/tree/feature-evaluation-check
Example case
tutorials/verificationAndValidation/atmosphericModels/atmForestStability/results/veryStable
What is the current bug behaviour?
sigfpe since sign(B) interpolates +1 and -1 resulting in 0 which is used to divide by in ObukhovLength functionObject.
What is the expected correct behavior?
Relevant logs and/or images
Environment information
- OpenFOAM version :
feature-evaluation-check
branch
Possible fixes
Relax the requirement that coupled cyclic faces have the same value on either side. Or have a different field type to disallow sign (an indicator field) to be interpolated.