MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / applyBins

Function applyBins

src/functionObjects/forces/forces/forces.C:371–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369
370
371void Foam::functionObjects::forces::applyBins
372(
373 const vectorField& Md,
374 const vectorField& fN,
375 const vectorField& fT,
376 const vectorField& fP,
377 const vectorField& d
378)
379{
380 if (nBin_ == 1)
381 {
382 force_[0][0] += sum(fN);
383 force_[1][0] += sum(fT);
384 force_[2][0] += sum(fP);
385 moment_[0][0] += sum(Md^fN);
386 moment_[1][0] += sum(Md^fT);
387 moment_[2][0] += sum(Md^fP);
388 }
389 else
390 {
391 scalarField dd((d & binDir_) - binMin_);
392
393 forAll(dd, i)
394 {
395 label bini = min(max(floor(dd[i]/binDx_), 0), force_[0].size() - 1);
396
397 force_[0][bini] += fN[i];
398 force_[1][bini] += fT[i];
399 force_[2][bini] += fP[i];
400 moment_[0][bini] += Md[i]^fN[i];
401 moment_[1][bini] += Md[i]^fT[i];
402 moment_[2][bini] += Md[i]^fP[i];
403 }
404 }
405}
406
407
408void Foam::functionObjects::forces::writeForces()

Callers 1

calcForcesMomentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected