fvOptions::damping: Corrected handling of multiple damping regions
Resolves bug-report https://bugs.openfoam.org/view.php?id=3302
This commit is contained in:
@ -58,15 +58,15 @@ Foam::tmp<Foam::volScalarField::Internal> Foam::fv::damping::forceCoeff() const
|
|||||||
);
|
);
|
||||||
scalarField& forceCoeff = tforceCoeff.ref();
|
scalarField& forceCoeff = tforceCoeff.ref();
|
||||||
|
|
||||||
const scalar lambda = lambda_.value();
|
|
||||||
|
|
||||||
forAll(origins_, i)
|
forAll(origins_, i)
|
||||||
{
|
{
|
||||||
const vectorField& c = mesh_.cellCentres();
|
const vectorField& c = mesh_.cellCentres();
|
||||||
const scalarField x((c - origins_[i]) & directions_[i]);
|
const scalarField x((c - origins_[i]) & directions_[i]);
|
||||||
forceCoeff = lambda*max(forceCoeff, scale_->value(x));
|
forceCoeff = max(forceCoeff, scale_->value(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forceCoeff *= lambda_.value();
|
||||||
|
|
||||||
// Write out the force coefficient for debugging
|
// Write out the force coefficient for debugging
|
||||||
if (debug && mesh_.time().writeTime())
|
if (debug && mesh_.time().writeTime())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user