Skip to content
Snippets Groups Projects
Commit 83ef7aa5 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: velocityDampingConstraint - updated to operate on a cell section. See #2301

parent 7825d24d
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2015-2021 OpenCFD Ltd.
Copyright (C) 2015-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -64,14 +64,14 @@ void Foam::fv::velocityDampingConstraint::addDamping(fvMatrix<vector>& eqn)
label nDamped = 0;
forAll(U, cellI)
for (label celli : cells_)
{
const scalar magU = mag(U[cellI]);
const scalar magU = mag(U[celli]);
if (magU > UMax_)
{
const scalar scale = sqr(Foam::cbrt(vol[cellI]));
const scalar scale = sqr(Foam::cbrt(vol[celli]));
diag[cellI] += scale*(magU-UMax_);
diag[celli] += scale*(magU-UMax_);
++nDamped;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment