mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects/forces: limit the bins to handle moving meshes
This approach simply accumulates data outside the range of the bins into the first or last bin which may be OK for small motions. For larger motions it may be better if the bins are updated or operate in a coordinate system attached to the body for solid-body motion. Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1560
This commit is contained in:
@ -375,13 +375,14 @@ void Foam::forces::applyBins
|
||||
|
||||
forAll(dd, i)
|
||||
{
|
||||
label binI = floor(dd[i]/binDx_);
|
||||
force_[0][binI] += fN[i];
|
||||
force_[1][binI] += fT[i];
|
||||
force_[2][binI] += fP[i];
|
||||
moment_[0][binI] += Md[i]^fN[i];
|
||||
moment_[1][binI] += Md[i]^fT[i];
|
||||
moment_[2][binI] += Md[i]^fP[i];
|
||||
label bini = min(max(floor(dd[i]/binDx_), 0), force_[0].size());
|
||||
|
||||
force_[0][bini] += fN[i];
|
||||
force_[1][bini] += fT[i];
|
||||
force_[2][bini] += fP[i];
|
||||
moment_[0][bini] += Md[i]^fN[i];
|
||||
moment_[1][bini] += Md[i]^fT[i];
|
||||
moment_[2][bini] += Md[i]^fP[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user