From a5f7fb6ad265ae846b9c85cf01b39433ca5b1a0a Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Tue, 22 Mar 2022 13:44:04 +0000 Subject: [PATCH 01/10] BUG: blendingFactor: fix DEShybrid blending-factor inconsistency (fixes #2419) --- src/functionObjects/field/Make/options | 2 + .../field/blendingFactor/blendingFactor.H | 50 ++++++------------- .../blendingFactor/blendingFactorTemplates.C | 17 +++++-- 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/src/functionObjects/field/Make/options b/src/functionObjects/field/Make/options index a99cf3db84..cc5819e29c 100644 --- a/src/functionObjects/field/Make/options +++ b/src/functionObjects/field/Make/options @@ -14,6 +14,7 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/schemes/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ @@ -39,6 +40,7 @@ LIB_LIBS = \ -lcompressibleTransportModels \ -lincompressibleTurbulenceModels \ -lcompressibleTurbulenceModels \ + -lturbulenceModelSchemes \ -lchemistryModel \ -lreactionThermophysicalModels \ -lpairPatchAgglomeration diff --git a/src/functionObjects/field/blendingFactor/blendingFactor.H b/src/functionObjects/field/blendingFactor/blendingFactor.H index ba5e09aa36..c93cbc5fcd 100644 --- a/src/functionObjects/field/blendingFactor/blendingFactor.H +++ b/src/functionObjects/field/blendingFactor/blendingFactor.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,26 +31,14 @@ Group grpFieldFunctionObjects Description - Computes the blending coefficient employed by blended divergence schemes, - giving an indicator as to which of the schemes is active across the domain. + Computes blending factor as an indicator about which + of the schemes is active across the domain. - Blended schemes combine contributions from two schemes, i.e. \f$\phi_1\f$ - and \f$\phi_2\f$, using a weight field, i.e. \f$w\f$, such that the - effective scheme value, i.e. \f$\phi_{eff}\f$, is computed as follows: - - \f[ - \phi_{eff} = w \phi_1 + (1 - w) \phi_2 - \f] - - The weight field, i.e. \f$w\f$, is surface field and converted to a volume - field for easier post-processing by setting the cell value to one minus - the minimum of the face values. - - This conversion leads to blending indicator field whose values mean: + Blending factor values mean: \verbatim 0 = scheme 0 1 = scheme 1 - 0-1 = a blend between scheme 0 and scheme 1 + 0-1 = a blending factor between scheme 0 and scheme 1 \endverbatim Operands: @@ -66,30 +54,28 @@ Usage \verbatim blendingFactor1 { - // Mandatory entries (unmodifiable) + // Mandatory entries type blendingFactor; libs (fieldFunctionObjects); - - // Mandatory (inherited) entry (runtime modifiable) field ; - // Optional entries (runtime modifiable) + // Optional entries phi phi; tolerance 0.001; - // Optional (inherited) entries + // Inherited entries ... } \endverbatim where the entries mean: \table - Property | Description | Type | Req'd | Deflt - type | Type name: blendingFactor | word | yes | - - libs | Library name: fieldFunctionObjects | word | yes | - - field | Name of the operand field | word | yes | - - phi | Name of flux field | word | no | phi - tolerance | Tolerance for number of blended cells | scalar | no | 0.001 + Property | Description | Type | Reqd | Deflt + type | Type name: blendingFactor | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + phi | Name of flux field | word | no | phi + tolerance | Tolerance for number of blended cells | scalar | no | 0.001 \endtable The inherited entries are elaborated in: @@ -99,14 +85,6 @@ Usage Usage by the \c postProcess utility is not available. -See also - - Foam::functionObject - - Foam::functionObjects::fieldExpression - - Foam::functionObjects::fvMeshFunctionObject - - Foam::functionObjects::writeFile - - Foam::CoBlended - - ExtendedCodeGuide::functionObjects::field::blendingFactor - SourceFiles blendingFactor.C blendingFactorTemplates.C diff --git a/src/functionObjects/field/blendingFactor/blendingFactorTemplates.C b/src/functionObjects/field/blendingFactor/blendingFactorTemplates.C index 2eb39896c2..e238f4677e 100644 --- a/src/functionObjects/field/blendingFactor/blendingFactorTemplates.C +++ b/src/functionObjects/field/blendingFactor/blendingFactorTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,6 +30,7 @@ License #include "boundedConvectionScheme.H" #include "blendedSchemeBase.H" #include "fvcCellReduce.H" +#include "DEShybrid.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -72,12 +73,18 @@ void Foam::functionObjects::blendingFactor::calcBlendingFactor // Convert into vol field whose values represent the local face minima // Note: - // - factor applied to 1st scheme, and (1-factor) to 2nd scheme // - not using the store(...) mechanism due to need to correct BCs - volScalarField& indicator = - lookupObjectRef(resultName_); + auto& indicator = lookupObjectRef(resultName_); + + if (isA>(blendedScheme)) + { + indicator = fvc::cellReduce(factorf, minEqOp(), GREAT); + } + else + { + indicator = 1 - fvc::cellReduce(factorf, minEqOp(), GREAT); + } - indicator = 1 - fvc::cellReduce(factorf, minEqOp(), GREAT); indicator.correctBoundaryConditions(); } From e28bed59e2e086f6b08d4bfeb5e8af5a6e220ed4 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Fri, 25 Mar 2022 14:58:31 +0000 Subject: [PATCH 02/10] BUG: DEShybrid: store the factor field on the mesh (fixes #2425) The blendingFactor function object overwrites the DEShybrid:Factor field internally when blendedSchemeBase debug flag is active. However, users are allowed to write out the original DEShybrid:Factor field by executing the writeObjects function object before any blendingFactor function object execution. --- .../schemes/DEShybrid/DEShybrid.H | 64 +++++++++++++------ .../field/blendingFactor/blendingFactor.H | 7 ++ 2 files changed, 53 insertions(+), 18 deletions(-) diff --git a/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H b/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H index 015b6122d3..9a19dee379 100644 --- a/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H +++ b/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2015-2021 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -226,32 +226,60 @@ class DEShybrid ) ); - const volScalarField factor + + const word factorName(IOobject::scopedName(typeName, "Factor")); + const fvMesh& mesh = this->mesh(); + + const IOobject factorIO ( - IOobject - ( - typeName + ":Factor", - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_) + factorName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE ); if (blendedSchemeBaseName::debug) { - factor.write(); - } + auto* factorPtr = mesh.getObjectPtr(factorName); - return tmp - ( - new surfaceScalarField + if (!factorPtr) + { + factorPtr = + new volScalarField + ( + factorIO, + mesh, + dimensionedScalar(dimless, Zero) + ); + + const_cast(mesh).objectRegistry::store(factorPtr); + } + + auto& factor = *factorPtr; + + factor = max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_); + + return tmp::New ( vf.name() + "BlendingFactor", fvc::interpolate(factor) - ) - ); + ); + } + else + { + const volScalarField factor + ( + factorIO, + max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_) + ); + + return tmp::New + ( + vf.name() + "BlendingFactor", + fvc::interpolate(factor) + ); + } } diff --git a/src/functionObjects/field/blendingFactor/blendingFactor.H b/src/functionObjects/field/blendingFactor/blendingFactor.H index c93cbc5fcd..841994e144 100644 --- a/src/functionObjects/field/blendingFactor/blendingFactor.H +++ b/src/functionObjects/field/blendingFactor/blendingFactor.H @@ -85,6 +85,13 @@ Usage Usage by the \c postProcess utility is not available. +Note + - The \c blendingFactor function object overwrites the \c DEShybrid:Factor + field internally when \c blendedSchemeBase debug flag is active. + However, users are allowed to write out the original \c DEShybrid:Factor + field by executing the \c writeObjects function object before + any \c blendingFactor function object execution. + SourceFiles blendingFactor.C blendingFactorTemplates.C From f118d9a2a2d2cd5bace08dafcf885ea436dbb01c Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Wed, 30 Mar 2022 10:21:49 +0100 Subject: [PATCH 03/10] BUG: humidityTemperature: fix dropwise condensation expression (fixes #2422) --- ...TemperatureCoupledMixedFvPatchScalarField.C | 7 ++++--- ...TemperatureCoupledMixedFvPatchScalarField.H | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C index 1baf7faece..61a150ce10 100644 --- a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015-2021 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -77,9 +77,10 @@ Foam::humidityTemperatureCoupledMixedFvPatchScalarField::htcCondensation const scalar Re ) const { - if (Tsat > 295 && Tsat < 373) + // (BLID:Eq. 10.52-10.53) + if (Tsat > 295.15 && Tsat < 373.15) { - return 51104 + 2044*Tsat; + return 51104 + 2044*(Tsat - 273.15); } else { diff --git a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H index bc5d081cdb..64cfd0f070 100644 --- a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015-2021 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,13 +52,19 @@ Description It assumes a drop-wise type of condensation, whereby its heat transfer Nusselt number is calculated using: \f{eqnarray*}{ - 51104 + 2044 T & T > 295 & T < 373 \\ - 255510 & T > 373 & + 51104 + 2044 (T - 273.15) & T > 295 & T < 373 \\ + 255510 & T > 373 & \f} - Reference: - - T. Bergam, A.Lavine, F. Incropera and D. Dewitt. Heat and Mass Transfer. - 7th Edition. Chapter 10. + References: + \verbatim + Standard models (tag:BLID): + Bergman, T. L., Lavine, A. S., + Incropera, F. P., & Dewitt, D. P. (2011). + Fundamentals of heat and mass transfer. + John Wiley & Sons. 7th Edition. Chapter 10. + ISBN:9780470501979 + \endverbatim The mass transfer correlation used is: From c323cbd35bf7d12773443fe604c2338c11e3ae2c Mon Sep 17 00:00:00 2001 From: Ian Cowan <> Date: Wed, 30 Mar 2022 11:23:28 +0100 Subject: [PATCH 04/10] TUT: verticalChannel: add limitTemperature to avoid negative temperatures (fixes #2391) TUT: propeller: remove duplicate log entry (fixes #1967) TUT: verticalChannelLTS: update input to avoid runtime errors (fixes #2426) TUT: Keyword updates --- .../pimpleFoam/RAS/propeller/system/forces | 2 -- .../constant/limestoneCloud1Properties | 2 +- .../constant/reactingCloud1Properties | 2 +- .../constant/thermo.incompressiblePoly | 4 +-- .../verticalChannel/system/fvOptions | 26 +++++++++++++++++++ 5 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvOptions diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/forces b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/forces index 4f32e012ab..15cbfd0162 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/forces +++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/forces @@ -14,8 +14,6 @@ forces writeControl timeStep; timeInterval 1; - log yes; - patches ("propeller.*"); rho rhoInf; // Indicates incompressible log true; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index 541fa8fe6d..6108d91d09 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -87,7 +87,7 @@ subModels { minValue 5e-06; maxValue 0.000565; - d 4.8e-05; + lambda 4.8e-05; n 0.5; } } diff --git a/tutorials/lagrangian/reactingParcelFoam/liquidFilmStepWithSprinkles/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/liquidFilmStepWithSprinkles/constant/reactingCloud1Properties index df0dea3cb8..7f178048ee 100644 --- a/tutorials/lagrangian/reactingParcelFoam/liquidFilmStepWithSprinkles/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/liquidFilmStepWithSprinkles/constant/reactingCloud1Properties @@ -104,7 +104,7 @@ subModels { minValue 5e-04; maxValue 0.0012; - d 7.5e-05; + lambda 7.5e-05; n 0.5; } } diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/constant/thermo.incompressiblePoly b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/constant/thermo.incompressiblePoly index 9b364f90eb..ace33ab1cc 100644 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/constant/thermo.incompressiblePoly +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/constant/thermo.incompressiblePoly @@ -49,8 +49,8 @@ H2O } thermodynamics { - Hf -13423000; - Sf 10482; + Hf 0; + Sf 0; CpCoeffs<8> ( 1563.1 1.604 -0.0029334 3.2168e-06 -1.1571e-09 0 0 0 ); } transport diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvOptions b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvOptions new file mode 100644 index 0000000000..0145de64bb --- /dev/null +++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvOptions @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitT +{ + type limitTemperature; + min 101; + max 600; + selectionMode all; +} + + +//************************************************************************** // From 123fe09fda9f6a15d8111e4b6d03959b217614dc Mon Sep 17 00:00:00 2001 From: Tobias Holzmann Date: Thu, 10 Feb 2022 23:55:20 +0100 Subject: [PATCH 05/10] BUG: activePressureForceBaffleVelocity: fix calculated area (fixes #2360) This patch provides the correct behavior of the boundary condition and its opening values. --- ...ePressureForceBaffleVelocityFvPatchVectorField.C | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C index 2df16fccf5..e8148719a0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -260,11 +260,13 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs() const labelList& nbrFaceCells = nbrPatch.patch().faceCells(); scalar valueDiff = 0; + scalar area = 0; // Add this side (p*area) forAll(cyclicFaceCells, facei) { valueDiff +=p[cyclicFaceCells[facei]]*mag(initCyclicSf_[facei]); + area += mag(initCyclicSf_[facei]); } // Remove other side @@ -275,7 +277,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs() if (!fBased_) //pressure based then weighted by area { - valueDiff = valueDiff/gSum(patch().magSf()); + valueDiff = valueDiff/(area + VSMALL); } reduce(valueDiff, sumOp()); @@ -284,12 +286,13 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs() { if (fBased_) { - Info<< "Force difference = " << valueDiff << endl; + Info<< "Force difference (threshold) = " << valueDiff + << "(" << minThresholdValue_ << ")" << endl; } else { - Info<< "Area-averaged pressure difference = " - << valueDiff << endl; + Info<< "Area-averaged pressure difference (threshold) = " + << valueDiff << "(" << minThresholdValue_ << ")" << endl; } } From 583fc4fb0dc9fbbdf0aa58c115b6ee05361ee413 Mon Sep 17 00:00:00 2001 From: Nima Samkhaniani <> Date: Wed, 30 Mar 2022 11:37:49 +0100 Subject: [PATCH 06/10] ENH: atmPlantCanopyUSource: improve implicit behaviour (fixes #2343) --- .../atmPlantCanopyUSource/atmPlantCanopyUSource.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/atmosphericModels/fvOptions/atmPlantCanopyUSource/atmPlantCanopyUSource.C b/src/atmosphericModels/fvOptions/atmPlantCanopyUSource/atmPlantCanopyUSource.C index f1044030bd..15f448ff57 100644 --- a/src/atmosphericModels/fvOptions/atmPlantCanopyUSource/atmPlantCanopyUSource.C +++ b/src/atmosphericModels/fvOptions/atmPlantCanopyUSource/atmPlantCanopyUSource.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. @@ -28,6 +28,7 @@ License #include "atmPlantCanopyUSource.H" #include "addToRunTimeSelectionTable.H" +#include "fvmSup.H" // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // @@ -99,7 +100,7 @@ void Foam::fv::atmPlantCanopyUSource::addSup if (V_ > VSMALL) { // (SP:Eq. 42) - eqn -= (plantCd_*leafAreaDensity_*mag(U))*U; + eqn -= fvm::Sp(plantCd_*leafAreaDensity_*mag(U), U); } } @@ -115,7 +116,7 @@ void Foam::fv::atmPlantCanopyUSource::addSup if (V_ > VSMALL) { - eqn -= rho*(plantCd_*leafAreaDensity_*mag(U))*U; + eqn -= fvm::Sp(rho*plantCd_*leafAreaDensity_*mag(U), U); } } @@ -132,7 +133,7 @@ void Foam::fv::atmPlantCanopyUSource::addSup if (V_ > VSMALL) { - eqn -= alpha*rho*(plantCd_*leafAreaDensity_*mag(U))*U; + eqn -= fvm::Sp(alpha*rho*plantCd_*leafAreaDensity_*mag(U), U); } } From 85786c698991f8abae509508e46e1e1f509b02d6 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Wed, 30 Mar 2022 17:43:58 +0100 Subject: [PATCH 07/10] INT: TDACChemistryModel: avoid redundant MPI communications (#2337) --- .../chemistryModel/TDACChemistryModel/TDACChemistryModel.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C index b249e9ac54..8bfbca15fb 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2017 OpenFOAM Foundation + Copyright (C) 2016-2021 OpenFOAM Foundation Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -864,7 +864,7 @@ Foam::scalar Foam::TDACChemistryModel::solve << " " << nActiveSpecies/nAvg << endl; } - if (Pstream::parRun()) + if (reduced && Pstream::parRun()) { List active(composition.active()); Pstream::listCombineAllGather(active, orEqOp()); From 7552608e08febf4b4cdbb099026d6377c951d697 Mon Sep 17 00:00:00 2001 From: Robin Kamenicky <> Date: Wed, 30 Mar 2022 11:50:21 +0100 Subject: [PATCH 08/10] BUG: linearTsubDiameter: fix the definition of bubble diameter (fixes #2312) --- .../diameterModels/linearTsubDiameter/linearTsubDiameter.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/linearTsubDiameter/linearTsubDiameter.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/linearTsubDiameter/linearTsubDiameter.C index bfddaca6e3..fb91423137 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/linearTsubDiameter/linearTsubDiameter.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/linearTsubDiameter/linearTsubDiameter.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018-2019 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -126,7 +126,7 @@ void Foam::diameterModels::linearTsub::correct() const volScalarField Tsub ( - liquid.thermo().T() - satModel.Tsat(liquid.thermo().p()) + satModel.Tsat(liquid.thermo().p()) - liquid.thermo().T() ); d_ = max @@ -135,7 +135,7 @@ void Foam::diameterModels::linearTsub::correct() min ( d2_, - (d1_*(Tsub - Tsub2_) + d2_*(Tsub - Tsub1_))/(Tsub2_ - Tsub1_) + (d1_*(Tsub - Tsub2_) - d2_*(Tsub - Tsub1_))/(Tsub1_ - Tsub2_) ) ); } From 2296d9142327c8136edf766e6e6b86a24de0eedf Mon Sep 17 00:00:00 2001 From: Michael Alletto <> Date: Wed, 30 Mar 2022 11:54:58 +0100 Subject: [PATCH 09/10] BUG: nutUBlendedWallFunction: avoid pressure spikes (fixes #2299) --- .../nutUBlendedWallFunctionFvPatchScalarField.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C index 38899885b4..47bdfbbd55 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -103,7 +103,8 @@ Foam::nutUBlendedWallFunctionFvPatchScalarField::calcUTau { const scalar yPlus = y[facei]*ut/nuw[facei]; const scalar uTauVis = magUp[facei]/yPlus; - const scalar uTauLog = kappa_*magUp[facei]/log(E_*yPlus); + const scalar uTauLog = + kappa_*magUp[facei]/log(max(E_*yPlus, 1 + 1e-4)); const scalar utNew = pow(pow(uTauVis, n_) + pow(uTauLog, n_), 1.0/n_); From f5ef5dc3716cdd54a2b177fc2045c93b0421d4d6 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Thu, 31 Mar 2022 09:32:32 +0100 Subject: [PATCH 10/10] COMP: snappyLayerDriver: remove 64-bit label ambiguity --- .../snappyHexMeshDriver/snappyLayerDriver.C | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C index 628a00400b..abb6ce6493 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2015-2021 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -5154,7 +5154,7 @@ void Foam::snappyLayerDriver::addLayers meshRefinement::updateList ( map.cellMap(), - 0, + label(0), cellNLayers ); forAll(cellNLayers, i) @@ -5237,7 +5237,7 @@ void Foam::snappyLayerDriver::addLayers meshRefinement::updateList ( newToOldPatchPoints, - 0, + label(0), basePatchNLayers ); meshRefinement::updateList @@ -5267,13 +5267,13 @@ void Foam::snappyLayerDriver::addLayers meshRefinement::updateList ( newToOldPatchPoints, - 0, + label(0), deltaNLayers ); meshRefinement::updateList ( newToOldPatchPoints, - 0, + label(0), nAddedLayers ); }