diff --git a/META-INFO/api-info b/META-INFO/api-info index 87aba82fd9..e29cea3e5c 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=2112 -patch=0 +patch=220310 diff --git a/etc/config.csh/adios2 b/etc/config.csh/adios2 index 668eb3bf6d..a2459b02c1 100644 --- a/etc/config.csh/adios2 +++ b/etc/config.csh/adios2 @@ -5,7 +5,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2017-2020 OpenCFD Ltd. +# Copyright (C) 2017-2022 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -20,7 +20,7 @@ #------------------------------------------------------------------------------ # USER EDITABLE PART: Changes made here may be lost with the next upgrade -set adios2_version=ADIOS2-2.6.0 +set adios2_version=ADIOS2-2.7.1 setenv ADIOS2_ARCH_PATH "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios2_version" # END OF (NORMAL) USER EDITABLE PART diff --git a/etc/config.sh/adios2 b/etc/config.sh/adios2 index 4d2fd7e32c..7be5374b0c 100644 --- a/etc/config.sh/adios2 +++ b/etc/config.sh/adios2 @@ -5,7 +5,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2017-2020 OpenCFD Ltd. +# Copyright (C) 2017-2022 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -21,7 +21,7 @@ #------------------------------------------------------------------------------ # USER EDITABLE PART: Changes made here may be lost with the next upgrade -adios2_version=ADIOS2-2.6.0 +adios2_version=ADIOS2-2.7.1 export ADIOS2_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$adios2_version" # END OF (NORMAL) USER EDITABLE PART diff --git a/etc/config.sh/functions b/etc/config.sh/functions index d3765d29ac..2707f3a54c 100644 --- a/etc/config.sh/functions +++ b/etc/config.sh/functions @@ -149,7 +149,7 @@ then then case "$foamVar_end" in (/*) # Absolute path - _foamAddLib "foamVar_end" + _foamAddLib "$foamVar_end" ;; (*) # Relative to prefix _foamAddLib "$foamVar_prefix/$foamVar_end" diff --git a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H index d5fd13438d..bf734f4673 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,8 +37,8 @@ Description #include "token.H" -#ifndef runTimeSelectionTables_H -#define runTimeSelectionTables_H +#ifndef Foam_runTimeSelectionTables_H +#define Foam_runTimeSelectionTables_H #include // For std::unique_ptr #include // For std::pair @@ -89,6 +89,7 @@ Description // Not used directly: storage and helper methods for runtime tables +// - uses automatic cleanup for compat table (issue #2314) #define defineRunTimeSelectionTableBase(baseType,prefix,Tspecialize) \ \ /* Define table singleton (storage) */ \ @@ -124,8 +125,6 @@ Description { \ delete prefix##TablePtr_; \ prefix##TablePtr_ = nullptr; \ - prefix##CompatTablePtr_.reset(nullptr); \ - constructed = false; \ } \ } \ \ diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 4485ce389b..3fdedbb473 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -1273,6 +1273,7 @@ void Foam::argList::parse { source = "-roots"; runControl_.distributed(true); + if (roots.empty()) { FatalErrorInFunction @@ -1487,12 +1488,12 @@ void Foam::argList::parse options_.set("case", roots[subproci-1]/globalCase_); OPstream toProc(Pstream::commsTypes::scheduled, subproci); + toProc << args_ << options_ << runControl_.distributed() << label(runControl_.dryRun()) << label(runControl_.verbose()); - } options_.erase("case"); @@ -1540,6 +1541,7 @@ void Foam::argList::parse for (const int subproci : Pstream::subProcs()) { OPstream toProc(Pstream::commsTypes::scheduled, subproci); + toProc << args_ << options_ << runControl_.distributed() @@ -1559,6 +1561,7 @@ void Foam::argList::parse Pstream::commsTypes::scheduled, Pstream::masterNo() ); + fromMaster >> args_ >> options_ >> isDistributed diff --git a/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C index 6d0649285d..19424001cc 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2020 ENERCON GmbH - Copyright (C) 2020-2021 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -131,7 +131,7 @@ atmTurbulentHeatFluxTemperatureFvPatchScalarField fixedGradientFvPatchScalarField(atmpsf), heatSource_(atmpsf.heatSource_), alphaEffName_(atmpsf.alphaEffName_), - Cp0_(atmpsf.Cp0_), + Cp0_(atmpsf.Cp0_.clone()), q_(atmpsf.q_.clone(this->patch().patch())) {} @@ -146,7 +146,7 @@ atmTurbulentHeatFluxTemperatureFvPatchScalarField fixedGradientFvPatchScalarField(atmpsf, iF), heatSource_(atmpsf.heatSource_), alphaEffName_(atmpsf.alphaEffName_), - Cp0_(atmpsf.Cp0_), + Cp0_(atmpsf.Cp0_.clone()), q_(atmpsf.q_.clone(this->patch().patch())) {} diff --git a/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C b/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C index e776c32805..b2941a218f 100644 --- a/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C +++ b/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,15 +67,20 @@ void Foam::functionObjects::timeActivatedFileUpdate::updateFile() if (i > lastIndex_) { - Log << nl << type() << ": copying file" << nl << timeVsFile_[i].second() - << nl << "to:" << nl << fileToUpdate_ << nl << endl; + const fileName& srcFile = timeVsFile_[i].second(); + + // Report case-relative path for information + Log << nl << type() << ": copying file" << nl + << "from: " << time_.relativePath(srcFile, true) << nl + << "to : " << time_.relativePath(fileToUpdate_, true) << nl + << endl; if (Pstream::master() || time_.distributed()) { // Slaves do not copy if running non-distributed - fileName destFile(fileToUpdate_ + Foam::name(pid())); - cp(timeVsFile_[i].second(), destFile); - mv(destFile, fileToUpdate_); + fileName tmpFile(fileToUpdate_ + Foam::name(pid())); + Foam::cp(srcFile, tmpFile); + Foam::mv(tmpFile, fileToUpdate_); } lastIndex_ = i; modified_ = true; @@ -122,16 +127,23 @@ bool Foam::functionObjects::timeActivatedFileUpdate::read forAll(timeVsFile_, i) { - timeVsFile_[i].second() = timeVsFile_[i].second().expand(); - if (!isFile(timeVsFile_[i].second())) - { - FatalErrorInFunction - << "File: " << timeVsFile_[i].second() << " not found" - << nl << exit(FatalError); - } + timeVsFile_[i].second().expand(); + const fileName& srcFile = timeVsFile_[i].second(); + // Report case-relative path for information Info<< " " << timeVsFile_[i].first() << tab - << timeVsFile_[i].second() << endl; + << time_.relativePath(srcFile, true) << endl; + + if (Pstream::master() || time_.distributed()) + { + if (!Foam::isFile(srcFile)) + { + // Report full path on error + FatalErrorInFunction + << "File not found: " << srcFile << endl + << exit(FatalError); + } + } } // Copy starting files diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H index 45310e16d2..e11442604b 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H @@ -62,7 +62,8 @@ License makeCloudFunctionObjectType(PatchPostProcessing, CloudType); \ makeCloudFunctionObjectType(PatchParticleHistogram, CloudType); \ makeCloudFunctionObjectType(RemoveParcels, CloudType); \ - makeCloudFunctionObjectType(VoidFraction, CloudType); + makeCloudFunctionObjectType(VoidFraction, CloudType); \ + makeCloudFunctionObjectType(KinematicReynoldsNumber, CloudType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H index 9db624cd42..0694f77f78 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H @@ -51,7 +51,7 @@ Description Operand | Type | Location input | - | - output file | - | - - output field | scalarField | \/lagrangian/\/kinematicRe + output field | scalarField | \/lagrangian/\/Re \endtable Usage @@ -62,15 +62,15 @@ Usage KinematicReynoldsNumber1 { // Mandatory entries - type KinematicReynoldsNumber; + type ReynoldsNumber; } } \endverbatim where the entries mean: \table - Property | Description | Type | Reqd | Deflt - type | Type name: KinematicReynoldsNumber | word | yes | - + Property | Description | Type | Reqd | Deflt + type | Type name: ReynoldsNumber | word | yes | - \endtable See also diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H index b7a922104b..72ca5fbd6e 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H @@ -51,7 +51,7 @@ Description Operand | Type | Location input | - | - output file | - | - - output field | scalarField | \/lagrangian/\/thermoRe + output field | scalarField | \/lagrangian/\/Re \endtable Usage @@ -62,22 +62,22 @@ Usage ThermoReynoldsNumber1 { // Mandatory entries - type ThermoReynoldsNumber; + type ReynoldsNumber; } } \endverbatim where the entries mean: \table - Property | Description | Type | Reqd | Deflt - type | Type name: ThermoReynoldsNumber | word | yes | - + Property | Description | Type | Reqd | Deflt + type | Type name: ReynoldsNumber | word | yes | - \endtable Note - Normalisation factors \c rhoc and \c muc are based on temperature - dependent values calculated inside the film surrounding the particle - rather than freestream values; therefore, \c ThermoReynoldsNumber should not - be expected to operate with kinematic (non-thermo) applications. + dependent values calculated inside the film surrounding the particle + rather than freestream values; therefore, the thermo \c ReynoldsNumber + should not be expected to operate with kinematic (non-thermo) applications. See also - Foam::KinematicReynoldsNumber diff --git a/src/surfMesh/polySurface/polySurfaceTemplates.C b/src/surfMesh/polySurface/polySurfaceTemplates.C index 78f281f234..ba57c6660f 100644 --- a/src/surfMesh/polySurface/polySurfaceTemplates.C +++ b/src/surfMesh/polySurface/polySurfaceTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -106,7 +106,7 @@ void Foam::polySurface::storeField if (dimfield) { - dimfield->dimensions() = dims; + dimfield->dimensions().reset(dims); // Dimensions may have changed dimfield->field() = values; } else @@ -147,7 +147,7 @@ void Foam::polySurface::storeField if (dimfield) { - dimfield->dimensions() = dims; + dimfield->dimensions().reset(dims); // Dimensions may have changed dimfield->field() = std::move(values); } else diff --git a/src/surfMesh/surfMesh/surfMeshTemplates.C b/src/surfMesh/surfMesh/surfMeshTemplates.C index cf14e9d744..e777844f6d 100644 --- a/src/surfMesh/surfMesh/surfMeshTemplates.C +++ b/src/surfMesh/surfMesh/surfMeshTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,7 +45,7 @@ void Foam::surfMesh::storeField if (dimfield) { - dimfield->dimensions() = dims; + dimfield->dimensions().reset(dims); // Dimensions may have changed dimfield->field() = values; } else @@ -85,7 +85,7 @@ void Foam::surfMesh::storeField if (dimfield) { - dimfield->dimensions() = dims; + dimfield->dimensions().reset(dims); // Dimensions may have changed dimfield->field() = std::move(values); } else diff --git a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/system/relVelocity b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/system/relVelocity index 5d0eb1e1e6..32fcce76f4 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/system/relVelocity +++ b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/system/relVelocity @@ -14,6 +14,8 @@ relVelocity name relVelocity; libs ( utilityFunctionObjects ); + writeControl writeTime; + coeffs { // User input (duplicate of constant/dynamicMeshDict) @@ -72,7 +74,7 @@ relVelocity } #}; - codeExecute // codeWrite + codeWrite #{ const dictionary& context = this->codeContext(); diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/constant/kinematicCloudProperties b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/constant/kinematicCloudProperties index 66016fb9bb..41a26a317b 100644 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/constant/kinematicCloudProperties +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/constant/kinematicCloudProperties @@ -121,7 +121,12 @@ subModels cloudFunctions -{} +{ + ReynoldsNumber1 + { + type ReynoldsNumber; + } +} // ************************************************************************* //