From 76d719d1e6f955c85bbf2b37563c5c19b0c386d6 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Fri, 24 Jun 2022 14:06:39 +0100 Subject: [PATCH 1/9] RELEASE: Updated version to v2206 --- etc/bashrc | 2 +- etc/cshrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index c8e659d8fd..9d7b3effaa 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -55,7 +55,7 @@ # [WM_PROJECT_VERSION] - A human-readable version name # A development version is often named 'com' - as in www.openfoam.com -export WM_PROJECT_VERSION=com +export WM_PROJECT_VERSION=v2206 #------------------------------------------------------------------------------ # Configuration environment variables. diff --git a/etc/cshrc b/etc/cshrc index f117dad892..c944e9db45 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -55,7 +55,7 @@ # [WM_PROJECT_VERSION] - A human-readable version name # A development version is often named 'com' - as in www.openfoam.com -setenv WM_PROJECT_VERSION com +setenv WM_PROJECT_VERSION v2206 #------------------------------------------------------------------------------ # Configuration environment variables. From de21a6bc0e5bdae2a4c70ed7bbd4349269e1842e Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Mon, 4 Jul 2022 13:34:13 +0100 Subject: [PATCH 2/9] BUG: setTurbulenceFields: update processor boundaries (fixes #2527) --- .../setTurbulenceFields/setTurbulenceFields.C | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/applications/utilities/preProcessing/setTurbulenceFields/setTurbulenceFields.C b/applications/utilities/preProcessing/setTurbulenceFields/setTurbulenceFields.C index 6e69f83457..c5351daf5d 100644 --- a/applications/utilities/preProcessing/setTurbulenceFields/setTurbulenceFields.C +++ b/applications/utilities/preProcessing/setTurbulenceFields/setTurbulenceFields.C @@ -109,6 +109,7 @@ Note #include "singlePhaseTransportModel.H" #include "turbulentTransportModel.H" #include "turbulentFluidThermoModel.H" +#include "processorFvPatchField.H" #include "wallFvPatch.H" #include "fixedValueFvPatchFields.H" @@ -122,6 +123,40 @@ void InfoField(const word& fldName) } +template +void correctProcessorPatches +( + GeometricField& vf +) +{ + if (!Pstream::parRun()) + { + return; + } + + // Not possible to use correctBoundaryConditions on fields as they may + // use local info as opposed to the constraint values employed here, + // but still need to update processor patches + auto& bf = vf.boundaryFieldRef(); + + forAll(bf, patchi) + { + if (isA>(bf[patchi])) + { + bf[patchi].initEvaluate(); + } + } + + forAll(bf, patchi) + { + if (isA>(bf[patchi])) + { + bf[patchi].evaluate(); + } + } +} + + IOobject createIOobject ( const fvMesh& mesh, @@ -447,22 +482,26 @@ int main(int argc, char *argv[]) // (M:Eq. 9) const dimensionedScalar maxU(dimVelocity, SMALL); U *= min(scalar(1), fRei*uTau/max(mag(U), maxU)); + correctProcessorPatches(U); } if (tepsilon.valid()) { tepsilon.ref() = epsilon; + correctProcessorPatches(tepsilon.ref()); } if (tk.valid()) { tk.ref() = k; + correctProcessorPatches(tk.ref()); } if (tomega.valid()) { const dimensionedScalar k0(sqr(dimLength/dimTime), SMALL); tomega.ref() = Cmu*epsilon/(k + k0); + correctProcessorPatches(tomega.ref()); } if (tR.valid()) @@ -475,6 +514,7 @@ int main(int argc, char *argv[]) { R[celli] = Rdiag[celli]; } + correctProcessorPatches(R); } From 92f38b589a4cde47467b7bac60bd61c1c1d93c65 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Thu, 7 Jul 2022 17:07:18 +0100 Subject: [PATCH 3/9] BUG: solidBodyMotionFunction: avoid reading model name from subdictionary (fixes #2526) --- .../solidBodyMotionFunction.C | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C index a530af913b..04aeb65704 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,16 +41,18 @@ namespace Foam Foam::solidBodyMotionFunction::solidBodyMotionFunction ( - const dictionary& SBMFCoeffs, + const dictionary& dict, const Time& runTime ) : SBMFCoeffs_ ( - SBMFCoeffs.optionalSubDict + dict.found("solidBodyMotionFunction") + ? dict.optionalSubDict ( - SBMFCoeffs.get("solidBodyMotionFunction") + "Coeffs" + dict.get("solidBodyMotionFunction") + "Coeffs" ) + : dict ), time_(runTime) {} @@ -57,9 +60,9 @@ Foam::solidBodyMotionFunction::solidBodyMotionFunction // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::solidBodyMotionFunction::read(const dictionary& SBMFCoeffs) +bool Foam::solidBodyMotionFunction::read(const dictionary& dict) { - SBMFCoeffs_ = SBMFCoeffs.optionalSubDict(type() + "Coeffs"); + SBMFCoeffs_ = dict.optionalSubDict(type() + "Coeffs"); return true; } From 71a612085b670d80b7f1a97a06de2633c7e34e78 Mon Sep 17 00:00:00 2001 From: Robin Knowles Date: Mon, 23 May 2022 11:24:53 +0000 Subject: [PATCH 4/9] BUG: caseDicts: fix pressureDifferencePatch and pressureDifferenceSurface scripts (fixes #2482) --- .../postProcessing/pressure/pressureDifference.cfg | 2 ++ .../pressure/pressureDifferencePatch.cfg | 4 ++-- .../pressure/pressureDifferenceSurface.cfg | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg b/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg index ef3c1f8d7f..2548174692 100644 --- a/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg +++ b/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg @@ -22,12 +22,14 @@ functions #includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg" operation areaAverage; fields (p); + $region1; } region2 { #includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg" operation areaAverage; fields (p); + $region2; } } diff --git a/etc/caseDicts/postProcessing/pressure/pressureDifferencePatch.cfg b/etc/caseDicts/postProcessing/pressure/pressureDifferencePatch.cfg index 71134ca909..36c21c8729 100644 --- a/etc/caseDicts/postProcessing/pressure/pressureDifferencePatch.cfg +++ b/etc/caseDicts/postProcessing/pressure/pressureDifferencePatch.cfg @@ -6,8 +6,6 @@ \\/ M anipulation | \*---------------------------------------------------------------------------*/ -#includeEtc "caseDicts/postProcessing/pressure/pressureDifference.cfg" - region1 { regionType patch; @@ -19,4 +17,6 @@ region2 name $patch2; } +#includeEtc "caseDicts/postProcessing/pressure/pressureDifference.cfg" + // ************************************************************************* // diff --git a/etc/caseDicts/postProcessing/pressure/pressureDifferenceSurface.cfg b/etc/caseDicts/postProcessing/pressure/pressureDifferenceSurface.cfg index 873b616d1d..204715339d 100644 --- a/etc/caseDicts/postProcessing/pressure/pressureDifferenceSurface.cfg +++ b/etc/caseDicts/postProcessing/pressure/pressureDifferenceSurface.cfg @@ -6,16 +6,14 @@ \\/ M anipulation | \*---------------------------------------------------------------------------*/ -#includeEtc "caseDicts/postProcessing/pressure/pressureDifference.cfg" - region1 { - regionType sampledSurface; - + regionType sampledSurface; + name $triSurface1; sampledSurfaceDict { type meshedSurface; - regionType cells; + source cells; interpolate true; surface $triSurface1; } @@ -24,10 +22,13 @@ region1 region2 { $region1; + name $triSurface2; sampledSurfaceDict { surface $triSurface2; } } +#includeEtc "caseDicts/postProcessing/pressure/pressureDifference.cfg" + // ************************************************************************* // From a72d4a17087d34865cf9ac76a679acc867e5c622 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Wed, 27 Jul 2022 13:11:21 +0100 Subject: [PATCH 5/9] BUG: externalHeatFluxSource: memory leakage (fixes #2545) --- .../derived/externalHeatFluxSource/externalHeatFluxSource.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C b/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C index c36fb0ae51..e29fa73367 100644 --- a/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C +++ b/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -110,14 +110,14 @@ void Foam::fa::externalHeatFluxSource::addSup false ); - auto tQ = new areaScalarField + auto tQ = tmp::New ( io, regionMesh(), dimensionedScalar("q", dimPower/sqr(dimLength), 0), zeroGradientFaPatchScalarField::typeName ); - areaScalarField& Q = *tQ; + areaScalarField& Q = tQ.ref(); switch (mode_) { From 9f40db8977b0d2a892c15bbba52335a42168f83b Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Tue, 2 Aug 2022 11:32:08 +0100 Subject: [PATCH 6/9] BUG: forceCoeffs: correct the order of pressure and viscous components (fixes #2552) --- src/functionObjects/forces/forceCoeffs/forceCoeffs.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C index f793922e4c..7dc901d3d6 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -171,8 +171,8 @@ void Foam::functionObjects::forceCoeffs::calcForceCoeffs() Cf_.reset ( - forceScaling.value()*coordSys.localVector(sumPatchForcesV_), forceScaling.value()*coordSys.localVector(sumPatchForcesP_), + forceScaling.value()*coordSys.localVector(sumPatchForcesV_), forceScaling.value()*coordSys.localVector(sumInternalForces_) ); } From b0cd2ea991f1c1076ef1a9c82fe0569f08b2d552 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Tue, 2 Aug 2022 17:18:25 +0100 Subject: [PATCH 7/9] BUG: binModels: read and use writeFile settings (fixes #2553) --- .../field/binField/binModels/binModel/binModel.C | 5 +++++ .../singleDirectionUniformBinTemplates.C | 4 ++-- .../binField/binModels/uniformBin/uniformBinTemplates.C | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/functionObjects/field/binField/binModels/binModel/binModel.C b/src/functionObjects/field/binField/binModels/binModel/binModel.C index 5e351b0783..6670a4b2ee 100644 --- a/src/functionObjects/field/binField/binModels/binModel/binModel.C +++ b/src/functionObjects/field/binField/binModels/binModel/binModel.C @@ -148,6 +148,11 @@ Foam::binModel::binModel bool Foam::binModel::read(const dictionary& dict) { + if (!functionObjects::writeFile::read(dict)) + { + return false; + } + patchSet_ = mesh_.boundaryMesh().patchSet(dict.get("patches")); fieldNames_ = dict.get("fields").sortedToc(); diff --git a/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C b/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C index 5fedd25a11..04714fe74d 100644 --- a/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C +++ b/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C @@ -104,7 +104,7 @@ bool Foam::binModels::singleDirectionUniformBin::processField return false; } - if (Pstream::master() && !writtenHeader_) + if (writeToFile() && !writtenHeader_) { writeFileHeader(filePtrs_[fieldi]); } @@ -183,7 +183,7 @@ bool Foam::binModels::singleDirectionUniformBin::processField } } - if (Pstream::master()) + if (writeToFile()) { writeBinnedData(data, filePtrs_[fieldi]); } diff --git a/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C b/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C index 8f7c1c103e..12d7e9c1ce 100644 --- a/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C +++ b/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C @@ -98,7 +98,7 @@ bool Foam::binModels::uniformBin::processField(const label fieldi) return false; } - if (Pstream::master() && !writtenHeader_) + if (writeToFile() && !writtenHeader_) { writeFileHeader(filePtrs_[fieldi]); } @@ -166,7 +166,7 @@ bool Foam::binModels::uniformBin::processField(const label fieldi) } } - if (Pstream::master()) + if (writeToFile()) { writeBinnedData(data, filePtrs_[fieldi]); } From bc3bff8ef5428395031a2abffd47c98a688acaf3 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Thu, 4 Aug 2022 13:10:50 +0100 Subject: [PATCH 8/9] BUG: binModels: ensure main processor writes out binned data (fixes #2530) --- .../singleDirectionUniformBinTemplates.C | 5 +++++ .../binField/binModels/uniformBin/uniformBinTemplates.C | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C b/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C index 04714fe74d..ad5024263c 100644 --- a/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C +++ b/src/functionObjects/field/binField/binModels/singleDirectionUniformBin/singleDirectionUniformBinTemplates.C @@ -183,6 +183,11 @@ bool Foam::binModels::singleDirectionUniformBin::processField } } + for (auto& binList : data) + { + reduce(binList, sumOp>()); + } + if (writeToFile()) { writeBinnedData(data, filePtrs_[fieldi]); diff --git a/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C b/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C index 12d7e9c1ce..c9edd55a13 100644 --- a/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C +++ b/src/functionObjects/field/binField/binModels/uniformBin/uniformBinTemplates.C @@ -166,6 +166,11 @@ bool Foam::binModels::uniformBin::processField(const label fieldi) } } + for (auto& binList : data) + { + reduce(binList, sumOp>()); + } + if (writeToFile()) { writeBinnedData(data, filePtrs_[fieldi]); From b6a6e40c275efc2851332302c918e17dbc80faf2 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 18 Aug 2022 11:43:18 +0200 Subject: [PATCH 9/9] BUG: incorrect order for output scaling (transformPoints, ...) - the output write scaling should be applied *after* undoing the effects of the specified rotation centre. Fixes #2566 ENH: update option names for transformPoints and surfaceTransformPoints - prefer '-auto-centre' and '-centre', but also accept the previous options '-auto-origin' and '-origin' as aliases. Changing to '-centre' avoids possible confusion with coordinate system origin(). --- .../transformPoints/transformPoints.C | 43 ++++++++++--------- .../surfaceTransformPoints.C | 39 +++++++++-------- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C index 0022525ad4..e27e9b0015 100644 --- a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C +++ b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C @@ -62,8 +62,8 @@ Usage -rotate-z angle Rotate (degrees) about z-axis. - or -yawPitchRoll (yawdegrees pitchdegrees rolldegrees) - or -rollPitchYaw (rolldegrees pitchdegrees yawdegrees) + or -yawPitchRoll : (yaw pitch roll) degrees + or -rollPitchYaw : (roll pitch yaw) degrees -scale scalar|vector Scale the points by the given scalar or vector on output. @@ -268,15 +268,18 @@ int main(int argc, char *argv[]) ); argList::addBoolOption ( - "auto-origin", - "Use bounding box centre as origin for rotations" + "auto-centre", + "Use bounding box centre as centre for rotations" ); argList::addOption ( - "origin", + "centre", "point", - "Use specified as origin for rotations" + "Use specified as centre for rotations" ); + argList::addOptionCompat("auto-centre", {"auto-origin", 2206}); + argList::addOptionCompat("centre", {"origin", 2206}); + argList::addOption ( "rotate", @@ -437,18 +440,18 @@ int main(int argc, char *argv[]) points += v; } - vector origin; - bool useOrigin = args.readIfPresent("origin", origin); - if (args.found("auto-origin") && !useOrigin) + vector rotationCentre; + bool useRotationCentre = args.readIfPresent("centre", rotationCentre); + if (args.found("auto-centre") && !useRotationCentre) { - useOrigin = true; - origin = boundBox(points).centre(); + useRotationCentre = true; + rotationCentre = boundBox(points).centre(); } - if (useOrigin) + if (useRotationCentre) { - Info<< "Set origin for rotations to " << origin << endl; - points -= origin; + Info<< "Set centre of rotation to " << rotationCentre << endl; + points -= rotationCentre; } @@ -545,15 +548,15 @@ int main(int argc, char *argv[]) } } + if (useRotationCentre) + { + Info<< "Unset centre of rotation from " << rotationCentre << endl; + points += rotationCentre; + } + // Output scaling applyScaling(points, getScalingOpt("scale", args)); - if (useOrigin) - { - Info<< "Unset origin for rotations from " << origin << endl; - points += origin; - } - // Set the precision of the points data to 10 IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); diff --git a/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C b/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C index dcee32d3d4..4db518c5bf 100644 --- a/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C +++ b/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C @@ -188,15 +188,18 @@ int main(int argc, char *argv[]) ); argList::addBoolOption ( - "auto-origin", - "Use bounding box centre as origin for rotations" + "auto-centre", + "Use bounding box centre as centre for rotations" ); argList::addOption ( - "origin", + "centre", "point", - "Use specified as origin for rotations" + "Use specified as centre for rotations" ); + argList::addOptionCompat("auto-centre", {"auto-origin", 2206}); + argList::addOptionCompat("centre", {"origin", 2206}); + argList::addOption ( "rotate", @@ -352,18 +355,18 @@ int main(int argc, char *argv[]) points += v; } - vector origin; - bool useOrigin = args.readIfPresent("origin", origin); - if (args.found("auto-origin") && !useOrigin) + vector rotationCentre; + bool useRotationCentre = args.readIfPresent("centre", rotationCentre); + if (args.found("auto-centre") && !useRotationCentre) { - useOrigin = true; - origin = boundBox(points).centre(); + useRotationCentre = true; + rotationCentre = boundBox(points).centre(); } - if (useOrigin) + if (useRotationCentre) { - Info<< "Set origin for rotations to " << origin << endl; - points -= origin; + Info<< "Set centre of rotation to " << rotationCentre << endl; + points -= rotationCentre; } @@ -455,15 +458,15 @@ int main(int argc, char *argv[]) transform(points, rot, points); } + if (useRotationCentre) + { + Info<< "Unset centre of rotation from " << rotationCentre << endl; + points += rotationCentre; + } + // Output scaling applyScaling(points, getScalingOpt("write-scale", args)); - if (useOrigin) - { - Info<< "Unset origin for rotations from " << origin << endl; - points += origin; - } - surf1.movePoints(points); surf1.write(exportName, writeFileType);