COMP: eliminate some unused variables

This commit is contained in:
Mark Olesen
2021-11-02 11:08:14 +01:00
parent a6f2aff449
commit 3494d662c7
6 changed files with 14 additions and 26 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -320,7 +320,6 @@ bool Foam::processorLODs::box::doRefineBoxes
const label refineIter,
const label nSrcFaces,
const List<labelList>& refineFlags,
const labelList& nElems,
List<DynamicList<treeBoundBox>>& fixedBoxes
)
{
@ -332,7 +331,7 @@ bool Foam::processorLODs::box::doRefineBoxes
if (proci != Pstream::myProcNo())
{
UOPstream toProc(proci, pBufs);
toProc << nElems[proci] << refineFlags[proci];
toProc << refineFlags[proci];
}
}
@ -341,7 +340,6 @@ bool Foam::processorLODs::box::doRefineBoxes
// Receive refine refinement actions from remote procs and use to refine
// local src boxes
bool refineBoxes = false;
label nElem = 0;
List<DynamicList<label>> newToOld(Pstream::nProcs());
@ -353,7 +351,6 @@ bool Foam::processorLODs::box::doRefineBoxes
}
UIPstream fromProc(proci, pBufs);
nElem += readLabel(fromProc);
const labelList refineFlags(fromProc);
const List<treeBoundBox>& procBoxes = boxes_[proci];
@ -467,7 +464,6 @@ Foam::autoPtr<Foam::mapDistribute> Foam::processorLODs::box::createMap
refinementIter,
nSrcElems,
refineFlags,
nElems,
fixedBoxes
);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -156,7 +156,6 @@ protected:
const label refineIter,
const label nSrcFaces,
const List<labelList>& refineFlags,
const labelList& nElems,
List<DynamicList<treeBoundBox>>& fixedBoxes
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -2201,19 +2201,16 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
// Storage for surfaceMesh. Size estimate.
List<labelledTri> triangles;
// Calculate number of faces and triangles
label nFaces = 0;
// Calculate number of triangles
label nTris = 0;
for (const label patchi : includePatches)
{
const polyPatch& patch = bMesh[patchi];
const pointField& points = patch.points();
nFaces += patch.size();
for (const face& f : patch)
{
faceList triFaces(f.nTriangles(points));
nTris += triFaces.size();
nTris += f.nTriangles(points);
}
}
@ -2230,7 +2227,7 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
label nTriTotal = 0;
label faceI = 0;
for (const face& f : patch)
for (const face& f : patch)
{
faceList triFaces(f.nTriangles(points));

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -297,11 +297,9 @@ void Foam::StandardChemistryModel<ReactionThermo, ThermoType>::derivatives
// Constant pressure
// dT/dt = ...
scalar rho = 0.0;
scalar cSum = 0.0;
for (label i = 0; i < nSpecie_; i++)
{
const scalar W = specieThermo_[i].W();
cSum += c_[i];
rho += W*c_[i];
}
scalar cp = 0.0;

View File

@ -622,7 +622,7 @@ void Foam::radiation::viewFactor::calculate()
const labelList& coarsePatchFace =
coarseMesh_.patchFaceMap()[patchID];
scalar heatFlux = 0.0;
/// scalar heatFlux = 0.0;
forAll(coarseToFine, coarseI)
{
label globalCoarse =
@ -631,12 +631,11 @@ void Foam::radiation::viewFactor::calculate()
const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine[coarseFaceID];
forAll(fineFaces, k)
{
label faceI = fineFaces[k];
qrp[faceI] = q[globalCoarse];
heatFlux += qrp[faceI]*sf[faceI];
for (const label facei : fineFaces)
{
qrp[facei] = q[globalCoarse];
/// heatFlux += qrp[facei]*sf[facei];
}
globCoarseId ++;
}

View File

@ -270,7 +270,6 @@ Foam::scalar Foam::cutFaceAdvect::timeIntegratedFaceFlux
scalarField pTimes_tri(3);
fPts_tri[0] = mesh_.faceCentres()[faceI];
pTimes_tri[0] = ((fPts_tri[0] - x0) & n0)/Un0;
scalar area = 0;
for (label pi = 0; pi < nPoints; ++pi)
{
fPts_tri[1] = fPts[pi];
@ -284,7 +283,7 @@ Foam::scalar Foam::cutFaceAdvect::timeIntegratedFaceFlux
*(fPts_tri[2] - fPts_tri[0])
^(fPts_tri[1] - fPts_tri[0])
);
area += magSf_tri;
const scalar phi_tri = phi*magSf_tri/magSf;
dVf +=
phi_tri/magSf_tri