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

BUG: kEpsilonLopesdaCosta model - loop was using the incorrect index

parent 8d582d02
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -50,14 +50,12 @@ void kEpsilonLopesdaCosta<BasicTurbulenceModel>::setPorosityCoefficient
const scalar Cpm = readScalar(pm.dict().lookup(C.name()));
forAll(cellZoneIDs, zonei)
for (const label zonei : cellZoneIDs)
{
const labelList& cells =
this->mesh_.cellZones()[cellZoneIDs[zonei]];
const labelList& cells = this->mesh_.cellZones()[zonei];
forAll(cells, i)
for (const label celli : cells)
{
const label celli = cells[i];
C[celli] = Cpm;
}
}
......@@ -79,15 +77,14 @@ void kEpsilonLopesdaCosta<BasicTurbulenceModel>::setCdSigma
const scalar Cpm = readScalar(pm.dict().lookup(C.name()));
forAll(cellZoneIDs, zonei)
for (const label zonei : cellZoneIDs)
{
const labelList& cells =
this->mesh_.cellZones()[cellZoneIDs[zonei]];
const labelList& cells = this->mesh_.cellZones()[zonei];
forAll(cells, i)
{
const label celli = cells[i];
C[celli] = Cpm*Sigma[celli];
C[celli] = Cpm*Sigma[i];
}
}
}
......@@ -115,10 +112,13 @@ void kEpsilonLopesdaCosta<BasicTurbulenceModel>::setPorosityCoefficients()
);
setPorosityCoefficient(Cmu_, pm);
Cmu_.correctBoundaryConditions();
setPorosityCoefficient(C1_, pm);
setPorosityCoefficient(C2_, pm);
setPorosityCoefficient(sigmak_, pm);
setPorosityCoefficient(sigmaEps_, pm);
sigmak_.correctBoundaryConditions();
sigmaEps_.correctBoundaryConditions();
setCdSigma(CdSigma_, pm);
setPorosityCoefficient(betap_, pm);
......
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::powerLawLopesdaCosta
Foam::porosityModels::powerLawLopesdaCosta
Description
Variant of the power law porosity model with spatially varying
......@@ -105,7 +105,7 @@ public:
/*---------------------------------------------------------------------------*\
Class powerLawLopesdaCosta Declaration
Class powerLawLopesdaCosta Declaration
\*---------------------------------------------------------------------------*/
class powerLawLopesdaCosta
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment