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