diff --git a/src/meshTools/processorLOD/box/box.C b/src/meshTools/processorLOD/box/box.C index 4bf8dffc5f..246fb31973 100644 --- a/src/meshTools/processorLOD/box/box.C +++ b/src/meshTools/processorLOD/box/box.C @@ -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& refineFlags, - const labelList& nElems, List>& 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> 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& procBoxes = boxes_[proci]; @@ -467,7 +464,6 @@ Foam::autoPtr Foam::processorLODs::box::createMap refinementIter, nSrcElems, refineFlags, - nElems, fixedBoxes ); diff --git a/src/meshTools/processorLOD/box/box.H b/src/meshTools/processorLOD/box/box.H index 32375dac93..55e8e3d18d 100644 --- a/src/meshTools/processorLOD/box/box.H +++ b/src/meshTools/processorLOD/box/box.H @@ -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& refineFlags, - const labelList& nElems, List>& fixedBoxes ); diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C index 67b7ce45fb..d0dbf81db9 100644 --- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C +++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C @@ -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 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)); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C index 7f8fcd5eb9..cad5e2b9fe 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C @@ -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::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; diff --git a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C index 2288d8457a..fbc9b9629d 100644 --- a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C +++ b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C @@ -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 ++; } diff --git a/src/transportModels/geometricVoF/cellCuts/cutFace/cutFaceAdvect.C b/src/transportModels/geometricVoF/cellCuts/cutFace/cutFaceAdvect.C index 0091977e79..7030adeef1 100644 --- a/src/transportModels/geometricVoF/cellCuts/cutFace/cutFaceAdvect.C +++ b/src/transportModels/geometricVoF/cellCuts/cutFace/cutFaceAdvect.C @@ -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