diff --git a/META-INFO/api-info b/META-INFO/api-info index c9fcef9ddc..0da2c4694b 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=2001 -patch=0 +patch=200129 diff --git a/src/OpenFOAM/expressions/exprResult/exprResultGlobals.C b/src/OpenFOAM/expressions/exprResult/exprResultGlobals.C index cd3d302fcb..04e270d641 100644 --- a/src/OpenFOAM/expressions/exprResult/exprResultGlobals.C +++ b/src/OpenFOAM/expressions/exprResult/exprResultGlobals.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2018 Bernhard Gschaider - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -203,7 +203,7 @@ Foam::expressions::exprResultGlobals::get { WarningInFunction << "No scope " << scopeName << " for " << name << nl - << "Known global scopes: " << variables_.sortToc() << nl; + << "Known global scopes: " << variables_.sortedToc() << nl; } #endif } diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H index 390713ff81..3a7aa26a72 100644 --- a/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.H @@ -97,13 +97,6 @@ public: vectorTensorTransform& operator=(const vectorTensorTransform&) = default; - //- Move construct - vectorTensorTransform(vectorTensorTransform&&) = default; - - //- Move assignment - vectorTensorTransform& - operator=(vectorTensorTransform&&) = default; - // Constructors diff --git a/src/OpenFOAM/primitives/quaternion/quaternion.H b/src/OpenFOAM/primitives/quaternion/quaternion.H index 161c4d0644..9935d4c8cb 100644 --- a/src/OpenFOAM/primitives/quaternion/quaternion.H +++ b/src/OpenFOAM/primitives/quaternion/quaternion.H @@ -138,12 +138,6 @@ public: //- Copy assignment quaternion& operator=(const quaternion&) = default; - //- Move construct - quaternion(quaternion&&) = default; - - //- Move assignment - quaternion& operator=(quaternion&&) = default; - // Constructors diff --git a/src/OpenFOAM/primitives/septernion/septernion.H b/src/OpenFOAM/primitives/septernion/septernion.H index a70c8a599c..bc97c1bfbd 100644 --- a/src/OpenFOAM/primitives/septernion/septernion.H +++ b/src/OpenFOAM/primitives/septernion/septernion.H @@ -96,12 +96,6 @@ public: //- Copy assignment septernion& operator=(const septernion&) = default; - //- Move construct - septernion(septernion&&) = default; - - //- Move assignment - septernion& operator=(septernion&&) = default; - // Constructors diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.C b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.C index 2d64a4f974..54add60652 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -120,9 +120,18 @@ kEpsilonPhitF::kEpsilonPhitF propertiesName ), + includeNu_ + ( + Switch::getOrAddToDict + ( + "includeNu", + this->coeffDict_, + true + ) + ), Cmu_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Cmu", this->coeffDict_, @@ -131,7 +140,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Ceps1a_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Ceps1a", this->coeffDict_, @@ -140,7 +149,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Ceps1b_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Ceps1b", this->coeffDict_, @@ -149,7 +158,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Ceps1c_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Ceps1c", this->coeffDict_, @@ -158,7 +167,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Ceps2_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Ceps2", this->coeffDict_, @@ -167,7 +176,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Cf1_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Cf1", this->coeffDict_, @@ -176,7 +185,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Cf2_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Cf2", this->coeffDict_, @@ -185,7 +194,7 @@ kEpsilonPhitF::kEpsilonPhitF ), CL_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "CL", this->coeffDict_, @@ -194,7 +203,7 @@ kEpsilonPhitF::kEpsilonPhitF ), Ceta_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "Ceta", this->coeffDict_, @@ -203,7 +212,7 @@ kEpsilonPhitF::kEpsilonPhitF ), CT_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "CT", this->coeffDict_, @@ -212,7 +221,7 @@ kEpsilonPhitF::kEpsilonPhitF ), sigmaK_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "sigmaK", this->coeffDict_, @@ -221,7 +230,7 @@ kEpsilonPhitF::kEpsilonPhitF ), sigmaEps_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "sigmaEps", this->coeffDict_, @@ -230,7 +239,7 @@ kEpsilonPhitF::kEpsilonPhitF ), sigmaPhit_ ( - dimensioned::getOrAddToDict + dimensionedScalar::getOrAddToDict ( "sigmaPhit", this->coeffDict_, @@ -340,6 +349,7 @@ bool kEpsilonPhitF::read() { if (eddyViscosity>::read()) { + includeNu_.readIfPresent("includeNu", this->coeffDict()); Cmu_.readIfPresent(this->coeffDict()); Ceps1a_.readIfPresent(this->coeffDict()); Ceps1b_.readIfPresent(this->coeffDict()); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.H b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.H index 05442df56e..cf45e2ea3d 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilonPhitF/kEpsilonPhitF.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,11 +34,15 @@ Description compressible flows. The model is a three-transport-equation linear-eddy-viscosity turbulence - closure model alongside an elliptic relaxation equation: - - Turbulent kinetic energy, \c k, - - Turbulent kinetic energy dissipation rate, \c epsilon, - - Normalised wall-normal fluctuating velocity scale, \c phit, - - Elliptic relaxation factor, \c f. + closure model alongside an elliptic relaxation equation. + + \heading Input fields + \plaintable + k | Turbulent kinetic energy [m2/s2] + epsilon | Turbulent kinetic energy dissipation rate [m2/s3] + phit | Normalised wall-normal fluctuating velocity scale [-] + f | Elliptic relaxation factor [1/s] + \endplaintable Reference: \verbatim @@ -53,19 +57,20 @@ Description \verbatim kEpsilonPhitFCoeffs { - Cmu 0.22, // Turbulent viscosity constant - Ceps1a 1.4, // Model constant for epsilon - Ceps1b 1.0, // Model constant for epsilon - Ceps1c 0.05, // Model constant for epsilon - Ceps2 1.9, // Model constant for epsilon - Cf1 1.4, // Model constant for f - Cf2 0.3, // Model constant for f - CL 0.25, // Model constant for L - Ceta 110.0, // Model constant for L - CT 6.0, // Model constant for T - sigmaK 1.0, // Turbulent Prandtl number for k - sigmaEps 1.3, // Turbulent Prandtl number for epsilon - sigmaPhit 1.0, // Turbulent Prandtl number for phit = sigmaK + includeNu true; // include nu in (LUU: Eq. 17), see Notes + Cmu 0.22; // Turbulent viscosity constant + Ceps1a 1.4; // Model constant for epsilon + Ceps1b 1.0; // Model constant for epsilon + Ceps1c 0.05; // Model constant for epsilon + Ceps2 1.9; // Model constant for epsilon + Cf1 1.4; // Model constant for f + Cf2 0.3; // Model constant for f + CL 0.25; // Model constant for L + Ceta 110.0; // Model constant for L + CT 6.0; // Model constant for T + sigmaK 1.0; // Turbulent Prandtl number for k + sigmaEps 1.3; // Turbulent Prandtl number for epsilon + sigmaPhit 1.0; // Turbulent Prandtl number for phit = sigmaK } \endverbatim @@ -74,6 +79,14 @@ Note However, the name 'phi' preexisted in OpenFOAM; therefore, this name was replaced by 'phit' herein. + Including \c nu in \c DphitEff even though it is not present in (LUU:Eq. 17) + provided higher level of resemblance to benchmarks for the tests considered, + particularly for the peak skin friction (yet, pressure-related predictions + were unaffected). Users can switch off \c nu in \c DphitEff by using + \c includeNu entry in \c kEpsilonPhitFCoeffs as shown above in order to + follow the reference paper thereat. \c includeNu is left \c true by default. + See GitLab issue #1560. + SourceFiles kEpsilonPhitF.C @@ -117,6 +130,8 @@ protected: // Protected Data + Switch includeNu_; + // Model coefficients dimensionedScalar Cmu_; @@ -208,7 +223,7 @@ public: //- Re-read model coefficients if they have changed virtual bool read(); - //- Return the effective diffusivity for k + //- Return the effective diffusivity for k (LUU:Eq. 3) tmp DkEff() const { return tmp @@ -221,7 +236,7 @@ public: ); } - //- Return the effective diffusivity for epsilon + //- Return the effective diffusivity for epsilon (LUU:Eq. 4) tmp DepsilonEff() const { return tmp @@ -234,17 +249,18 @@ public: ); } - //- Return the effective diffusivity for phit + //- Return the effective diffusivity for phit (LUU:Eq. 17) tmp DphitEff() const { - return tmp - ( - new volScalarField - ( - "DphitEff", - this->nut_/sigmaPhit_ + this->nu() - ) - ); + auto tfld = + tmp::New("DphitEff", this->nut_/sigmaPhit_); + + if (includeNu_) + { + tfld.ref() += this->nu(); + } + + return tfld; } //- Return the turbulent kinetic energy field diff --git a/src/fileFormats/ensight/file/ensightFile.C b/src/fileFormats/ensight/file/ensightFile.C index dd4bdeb4b6..4cdb931fff 100644 --- a/src/fileFormats/ensight/file/ensightFile.C +++ b/src/fileFormats/ensight/file/ensightFile.C @@ -166,19 +166,15 @@ Foam::Ostream& Foam::ensightFile::write Foam::Ostream& Foam::ensightFile::write(const char* value) { - // Parentheses around strncpy to silence the GCC -Wstringop-truncation - // warning, which is spurious here. - // The max-size and buffer-size *are* identical, which means the buffer - // may not have a nul terminator. However, this is properly handled in - // the subsequent binary write and the ASCII write explicitly adds - // a nul terminator. + // Output 80 chars, but allocate for trailing nul character + // to avoid -Wstringop-truncation warnings/errors. - char buf[80]; - (strncpy(buf, value, 80)); // max 80 chars or padded with nul if smaller + char buf[80+1]; + strncpy(buf, value, 80); // max 80 chars or padded with nul if smaller if (format() == IOstream::BINARY) { - write(buf, sizeof(buf)); + write(buf, 80); } else { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchVectorField.C index 9a4310711b..014dc2d527 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchVectorField.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -96,11 +96,11 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs() const vector nf(computePatchNormal()); // Find the second local coordinate direction - direction minCmpt = -1; - scalar minMag = VGREAT; - for (direction cmpt = 0; cmpt < pTraits::nComponents; ++cmpt) + direction minCmpt = 0; + scalar minMag = mag(nf[minCmpt]); + for (direction cmpt = 1; cmpt < pTraits::nComponents; ++cmpt) { - scalar s = mag(nf[cmpt]); + const scalar s = mag(nf[cmpt]); if (s < minMag) { minMag = s; @@ -110,7 +110,7 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs() // Create the second local coordinate direction vector e2(Zero); - e2[minCmpt] = 1.0; + e2[minCmpt] = 1; // Remove normal component e2 -= (nf&e2)*nf; @@ -147,17 +147,14 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs() // Compute virtual-actual patch index pairs List> indexPairs(this->size(), Pair