From 4a084af2695e45a48502f5e8a5ec47618955fcc6 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 29 Jul 2019 10:06:26 +0200 Subject: [PATCH 1/5] CONFIG: add postProcessing/fields/lambVector template (fixes #1386) --- .../postProcessing/fields/lambVector | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 etc/caseDicts/postProcessing/fields/lambVector diff --git a/etc/caseDicts/postProcessing/fields/lambVector b/etc/caseDicts/postProcessing/fields/lambVector new file mode 100644 index 0000000000..f8692fd715 --- /dev/null +++ b/etc/caseDicts/postProcessing/fields/lambVector @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Version: v1906 + \\ / A nd | Web: www.OpenFOAM.com + \\/ M anipulation | +------------------------------------------------------------------------------- +Description + Calculates and writes the second largest eigenvalue of the sum of the + square of the symmetrical and anti-symmetrical parts of the velocity + gradient tensor. + +\*---------------------------------------------------------------------------*/ + +type lambVector; +libs ("libfieldFunctionObjects.so"); + +field U; + +executeControl writeTime; +writeControl writeTime; + +// ************************************************************************* // From 45a5674831c21a448f84de49f8af6e8cad77e426 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 30 Jul 2019 08:49:15 -0700 Subject: [PATCH 2/5] ENH: Small editing to fvSchemes and alphatWallBoilingWallFunction --- ...allBoilingWallFunctionFvPatchScalarField.C | 38 ++++++++++------ .../solidQuenching2D/system/water/fvSchemes | 45 +++---------------- 2 files changed, 31 insertions(+), 52 deletions(-) diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index bd4722a01b..bb8858fb01 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -1045,7 +1045,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() mDotL_[i] = dmdt_[i]*L[i]; // No quenching flux - //qq_[i] = 0.0; + qq_[i] = 0.0; this->operator[](i) = ( @@ -1104,6 +1104,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() A1[i] = 1.0; qq_[i] = 0.0; mDotL_[i] = 0.0; + dmdt_[i] = 0.0; // Turbulente thermal diffusivity for single phase. this->operator[](i) = @@ -1141,12 +1142,12 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() Info<< " dmdt: " << gMin((dmdt_)) << " - " << gMax((dmdt_)) << endl; - Info<< " alphatlEff: " << gMin(liquidw*(*this + alphaw)) + Info<< " alphatlEff: " << gMin(liquidw*(*this + alphaw)) << " - " << gMax(liquidw*(*this + alphaw)) << endl; scalar Qeff = gSum(qEff*patch().magSf()); - Info<< " Effective heat transfer rate to liquid:" << Qeff - << endl; + Info<< " Effective heat transfer rate to liquid: " << Qeff + << endl << nl; if (debug & 2) { @@ -1186,11 +1187,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() } } - Info<< "Sub Cool faces : " << nSubCool << endl; - Info<< "Transient faces : " << nTransient << endl; - Info<< "Film faces : " << nFilm << endl; - Info<< "Non Boiling faces : " << nNonBoiling << endl; - Info<< "Total faces : " << this->size() << endl; + Info<< "Faces regime : " << nl << endl; + + Info<< " sub Cool faces : " << nSubCool << endl; + Info<< " transient faces : " << nTransient << endl; + Info<< " film faces : " << nFilm << endl; + Info<< " non-Boiling faces : " << nNonBoiling << endl; + Info<< " total faces : " << this->size() << endl << nl; const scalarField qc ( @@ -1199,7 +1202,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ); scalar Qc = gSum(qc*patch().magSf()); - Info<< " Convective heat transfer:" << Qc << endl; + Info<< " Convective heat transfer: " << Qc << endl; const scalarField qFilm ( @@ -1219,14 +1222,21 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() Info<< " Transient boiling heat transfer:" << Qtbtot << endl; - Info<< " tDNB: " << gMin(tDNB) << " - " << gMax(tDNB) + Info<< " TDNB: " << gMin(tDNB) << " - " << gMax(tDNB) << endl; - scalar QsubCool = gSum + const scalarField qSubCool ( - fLiquid*nSubCools*(qq_ + qe())*patch().magSf() + fLiquid*nSubCools* + ( + A1*alphatConv_*hew.snGrad() + + qe() + qq() + ) ); - Info<< " Sub Cool boiling heat transfer:" << QsubCool + + scalar QsubCool = gSum(qSubCool*patch().magSf()); + + Info<< " Sub Cool boiling heat transfer: " << QsubCool << endl; Info<< " N: " << gMin(nSubCools*N) << " - " diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes index 18e8717320..908a2f4570 100644 --- a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes @@ -22,58 +22,27 @@ ddtSchemes gradSchemes { default Gauss linear; - /* - grad((1-alpha.gas)) leastSquares;//Gauss linear; - grad(alpha.gas) leastSquares;//Gauss linear; - grad(U.gas) leastSquares;//Gauss linear; - grad(U.liquid) leastSquares;// Gauss linear; - - grad(h.gas) leastSquares; - grad(h.liquid) leastSquares; - - grad(alpha.liquid) leastSquares; - grad(alpha.gas) leastSquares; - - grad(rho) leastSquares; - - grad(p_rgh) leastSquares; - - grad(epsilon.liquid) leastSquares; - grad(k.liquid) leastSquares; - */ - } divSchemes { - default none;//Gauss upwind; + default none; "div\(phi,alpha.*\)" Gauss vanLeer; "div\(phir,alpha.*\)" Gauss vanLeer; - "div\(alphaRhoPhi.*,U.*\)" Gauss upwind;//limitedLinearV 1; - "div\(phi.*,U.*\)" Gauss upwind;//limitedLinearV 1; + "div\(alphaRhoPhi.*,U.*\)" Gauss upwind; + "div\(phi.*,U.*\)" Gauss upwind; - "div\(alphaRhoPhi.*,Yi\)" Gauss upwind;//limitedLinear 1; - "div\(alphaRhoPhi.*,(h|e|f).*\)" Gauss upwind;//limitedLinear 1; - "div\(alphaRhoPhi.*,K.*\)" Gauss upwind;//limitedLinear 1; - "div\(alphaPhi.*,p\)" Gauss upwind;//limitedLinear 1; + "div\(alphaRhoPhi.*,Yi\)" Gauss upwind; + "div\(alphaRhoPhi.*,(h|e|f).*\)" Gauss upwind; + "div\(alphaRhoPhi.*,K.*\)" Gauss upwind; + "div\(alphaPhi.*,p\)" Gauss upwind; "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss upwind; "div\(phim,(k|epsilon)m\)" Gauss upwind; "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; - -/* - div(phi,U) Gauss upwind; - div(phi,K) Gauss linear; - div(phi,h) Gauss upwind; - div(phi,k) Gauss upwind; - div(phi,epsilon) Gauss upwind; - div(phi,R) Gauss upwind; - div(R) Gauss linear; - div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; -*/ } laplacianSchemes From 139ed3a1d5dd013cfbf51f077b3ca61844951a7d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 31 Jul 2019 12:02:13 +0200 Subject: [PATCH 3/5] STYLE: clarify comments in etc/colourTables --- etc/colourTables | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/colourTables b/etc/colourTables index f39d34d5e6..0cd938e203 100644 --- a/etc/colourTables +++ b/etc/colourTables @@ -7,9 +7,9 @@ \*---------------------------------------------------------------------------*/ // An OpenFOAM dictionary of colourTables. -// The names should match those in the colourTables class. +// The predefined enumerations in the colourTables class *must* also appear +// here, but the file can also contain additional custom colour tables too. -6 ( coolToWarm @@ -91,6 +91,8 @@ xray ); } +// Additional tables (without code enumeration) + ) // ************************************************************************* // From babbfffc3dc560210caeb7e2134d77e4ec730db4 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 6 Aug 2019 10:30:07 +0200 Subject: [PATCH 4/5] BUG: incorrect binary read of injectedParticle (fixes #1393) - the read offset missed the tag_ member entirely and thus the entire particle information would be corrupt (incorrectly interpreted) as well as potential violation of adjacent (trailing) memory locations. --- src/lagrangian/basic/injectedParticle/injectedParticleIO.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/basic/injectedParticle/injectedParticleIO.C b/src/lagrangian/basic/injectedParticle/injectedParticleIO.C index 4fa325b9e4..eb3185ab39 100644 --- a/src/lagrangian/basic/injectedParticle/injectedParticleIO.C +++ b/src/lagrangian/basic/injectedParticle/injectedParticleIO.C @@ -76,7 +76,7 @@ Foam::injectedParticle::injectedParticle } else { - is.read(reinterpret_cast(&soi_), sizeofFields); + is.read(reinterpret_cast(&tag_), sizeofFields); } } From da4bfbae00cae685a47c7fae1f90066f93a70392 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 6 Aug 2019 16:02:38 +0200 Subject: [PATCH 5/5] CONFIG: bump patch level --- META-INFO/api-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META-INFO/api-info b/META-INFO/api-info index dedb008f68..f5ea670a39 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=1906 -patch=190724 +patch=190806