From a6c18c36e831deef07640b1cdbb90216a5a73a47 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 13 May 2008 16:09:54 +0100 Subject: [PATCH 1/2] Made yPlusLES and checkYPlus more consistent --- .../wall/checkYPlus/checkYPlus.C | 64 ++++++++----------- .../postProcessing/wall/yPlusLES/yPlusLES.C | 51 +++++++++++---- 2 files changed, 65 insertions(+), 50 deletions(-) diff --git a/applications/utilities/postProcessing/wall/checkYPlus/checkYPlus.C b/applications/utilities/postProcessing/wall/checkYPlus/checkYPlus.C index d9752bfe92..0aa95fe7da 100644 --- a/applications/utilities/postProcessing/wall/checkYPlus/checkYPlus.C +++ b/applications/utilities/postProcessing/wall/checkYPlus/checkYPlus.C @@ -23,11 +23,10 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - checkYPlus + yPlusRAS Description - Calculates and reports yPlus for all wall patches, for each time in a - database. + Calculates and reports yPlus for all wall patches, for each time. \*---------------------------------------------------------------------------*/ @@ -40,21 +39,20 @@ Description int main(int argc, char *argv[]) { + #include "addTimeOptions.H" + #include "setRootCase.H" -# include "addTimeOptions.H" -# include "setRootCase.H" - -# include "createTime.H" + #include "createTime.H" // Get times list instantList Times = runTime.times(); // set startTime and endTime depending on -time and -latestTime options -# include "checkTimeOptions.H" + #include "checkTimeOptions.H" runTime.setTime(Times[startTime], startTime); -# include "createMesh.H" + #include "createMesh.H" for (label i=startTime; iyPlus(patchI); - const scalarField& Yp = yPlus.boundaryField()[patchI]; + const fvPatchList& patches = mesh.boundary(); - Info<< "Patch " << patchI - << " named " << mesh.boundary()[patchI].name() + forAll(patches, patchi) + { + const fvPatch& currPatch = patches[patchi]; + + if (typeid(currPatch) == typeid(wallFvPatch)) + { + yPlus.boundaryField()[patchi] = turbulence->yPlus(patchi); + const scalarField& Yp = yPlus.boundaryField()[patchi]; + + Info<< "Patch " << patchi + << " named " << currPatch.name() << " y+ : min: " << min(Yp) << " max: " << max(Yp) << " average: " << average(Yp) << nl << endl; } diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 1b724fffcb..a39b505488 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -26,7 +26,7 @@ Application yPlusLES Description - Calculates the yPlus of the near-wall cells for an LES. + Calculates and reports yPlus for all wall patches, for each time. \*---------------------------------------------------------------------------*/ @@ -39,21 +39,20 @@ Description int main(int argc, char *argv[]) { + #include "addTimeOptions.H" + #include "setRootCase.H" -# include "addTimeOptions.H" -# include "setRootCase.H" - -# include "createTime.H" + #include "createTime.H" // Get times list instantList Times = runTime.times(); // set startTime and endTime depending on -time and -latestTime options -# include "checkTimeOptions.H" + #include "checkTimeOptions.H" runTime.setTime(Times[startTime], startTime); -# include "createMesh.H" + #include "createMesh.H" for (label i=startTime; inuEff(); - volScalarField yPlus ( IOobject @@ -80,8 +76,34 @@ int main(int argc, char *argv[]) dimensionedScalar("yPlus", dimless, 0.0) ); - const fvPatchList& patches = mesh.boundary(); - + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ), + mesh + ); + + #include "createPhi.H" + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr sgsModel + ( + LESmodel::New(U, phi, laminarTransport) + ); + + volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y(); + volScalarField nuEff = sgsModel->nuEff(); + + const fvPatchList& patches = mesh.boundary(); + forAll(patches, patchi) { const fvPatch& currPatch = patches[patchi]; @@ -96,6 +118,11 @@ int main(int argc, char *argv[]) *mag(U.boundaryField()[patchi].snGrad()) ) /sgsModel->nu().boundaryField()[patchi]; + + Info<< "Patch " << patchi + << " named " << currPatch.name() + << " y+ : min: " << min(Yp) << " max: " << max(Yp) + << " average: " << average(Yp) << nl << endl; } } From bffb453c4540ebac16685f4d6adf449c2573b1e3 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 13 May 2008 16:16:32 +0100 Subject: [PATCH 2/2] Rename checkYPlus to yPlusRAS for consistency with yPlusLES --- .../FoamX/checkYPlus.cfg => yPlusRAS/FoamX/yPlusRAS.cfg} | 4 ++-- .../postProcessing/wall/{checkYPlus => yPlusRAS}/Make/files | 0 .../postProcessing/wall/{checkYPlus => yPlusRAS}/Make/options | 0 .../wall/{checkYPlus/checkYPlus.C => yPlusRAS/yPlusRAS.C} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename applications/utilities/postProcessing/wall/{checkYPlus/FoamX/checkYPlus.cfg => yPlusRAS/FoamX/yPlusRAS.cfg} (91%) rename applications/utilities/postProcessing/wall/{checkYPlus => yPlusRAS}/Make/files (100%) rename applications/utilities/postProcessing/wall/{checkYPlus => yPlusRAS}/Make/options (100%) rename applications/utilities/postProcessing/wall/{checkYPlus/checkYPlus.C => yPlusRAS/yPlusRAS.C} (100%) diff --git a/applications/utilities/postProcessing/wall/checkYPlus/FoamX/checkYPlus.cfg b/applications/utilities/postProcessing/wall/yPlusRAS/FoamX/yPlusRAS.cfg similarity index 91% rename from applications/utilities/postProcessing/wall/checkYPlus/FoamX/checkYPlus.cfg rename to applications/utilities/postProcessing/wall/yPlusRAS/FoamX/yPlusRAS.cfg index 8a3e9ba758..8e0b98c0fa 100644 --- a/applications/utilities/postProcessing/wall/checkYPlus/FoamX/checkYPlus.cfg +++ b/applications/utilities/postProcessing/wall/yPlusRAS/FoamX/yPlusRAS.cfg @@ -5,14 +5,14 @@ | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ -// checkYPlus tool definition +// yPlusRAS tool definition description "Create the y+ field"; checkYPlusDict { type dictionary; - description "checkYPlus control dictionary"; + description "yPlusRAS control dictionary"; dictionaryPath "system"; entries diff --git a/applications/utilities/postProcessing/wall/checkYPlus/Make/files b/applications/utilities/postProcessing/wall/yPlusRAS/Make/files similarity index 100% rename from applications/utilities/postProcessing/wall/checkYPlus/Make/files rename to applications/utilities/postProcessing/wall/yPlusRAS/Make/files diff --git a/applications/utilities/postProcessing/wall/checkYPlus/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options similarity index 100% rename from applications/utilities/postProcessing/wall/checkYPlus/Make/options rename to applications/utilities/postProcessing/wall/yPlusRAS/Make/options diff --git a/applications/utilities/postProcessing/wall/checkYPlus/checkYPlus.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C similarity index 100% rename from applications/utilities/postProcessing/wall/checkYPlus/checkYPlus.C rename to applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C