BUG: forces FO: adds forces and moments beyond binMax to the last bin
Summary
In forces
FO, when binData == true
with a user-defined binMax
, forces and moment estimations for the patch region outside the bin are added into the last bin if binMax
is less than the extent of a given patch in the binning direction.
For example, in the following sketch, the forces and moments outside the linear bin are added into the bin-3.
The error arises from the applyBins
func:
...
const scalarField dd((d & binDir_) - binMin_);
forAll(dd, i)
{
label bini = min(max(floor(dd[i]/binDx_), 0), force_[0].size() - 1); // PROBLEM
force_[0][bini] += fN[i];
...
Environment information
- OpenFOAM version : 73057447