From 6cc8fc128f4e1ba9f0f3cee2ec4e5f2f19bfb091 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 25 Apr 2015 16:31:54 +0100 Subject: [PATCH] Pe: Create and write volScalarField in addition to the surfaceScalarField for ease of post-processing --- .../postProcessing/velocityField/Pe/Pe.C | 71 ++++++++++--------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/applications/utilities/postProcessing/velocityField/Pe/Pe.C b/applications/utilities/postProcessing/velocityField/Pe/Pe.C index 544a1169..2cb60326 100644 --- a/applications/utilities/postProcessing/velocityField/Pe/Pe.C +++ b/applications/utilities/postProcessing/velocityField/Pe/Pe.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,23 +25,21 @@ Application Pe Description - Calculates and writes the Pe number as a surfaceScalarField obtained from - field phi. + Calculates the Peclet number Pe from the flux phi and writes the maximum + value, the surfaceScalarField Pef and volScalarField Pe. - The -noWrite option just outputs the max/min values without writing - the field. + With the -noWrite option just outputs the max value without writing + the fields. \*---------------------------------------------------------------------------*/ #include "calc.H" -#include "fvc.H" +#include "surfaceInterpolate.H" +#include "fvcAverage.H" +#include "turbulentTransportModel.H" +#include "turbulentFluidThermoModel.H" #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" -#include "incompressible/RAS/RASModel/RASModel.H" -#include "incompressible/LES/LESModel/LESModel.H" -#include "fluidThermo.H" -#include "compressible/RAS/RASModel/RASModel.H" -#include "compressible/LES/LESModel/LESModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -120,10 +118,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ( IOobject ( - "Pe", + "Pef", runTime.timeName(), - mesh, - IOobject::NO_READ + mesh ), mag(phi) /( @@ -151,10 +148,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ( IOobject ( - "Pe", + "Pef", runTime.timeName(), - mesh, - IOobject::NO_READ + mesh ), mag(phi) /( @@ -187,10 +183,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ( IOobject ( - "Pe", + "Pef", runTime.timeName(), - mesh, - IOobject::NO_READ + mesh ), mag(phi) /( @@ -238,10 +233,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ( IOobject ( - "Pe", + "Pef", runTime.timeName(), - mesh, - IOobject::NO_READ + mesh ), mag(phi) /( @@ -280,10 +274,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ( IOobject ( - "Pe", + "Pef", runTime.timeName(), - mesh, - IOobject::NO_READ + mesh ), mag(phi) /( @@ -316,10 +309,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ( IOobject ( - "Pe", + "Pef", runTime.timeName(), - mesh, - IOobject::NO_READ + mesh ), mag(phi) /( @@ -338,19 +330,34 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) << abort(FatalError); } - Info<< "Pe max : " << max(PePtr()).value() << endl; + Info<< " Pe max : " << max(PePtr()).value() << endl; if (writeResults) { + Info<< " Writing surfaceScalarField : " + << PePtr().name() << endl; PePtr().write(); + + volScalarField Pe + ( + IOobject + ( + "Pe", + runTime.timeName(), + mesh + ), + fvc::average(PePtr()) + ); + + Info<< " Writing volScalarField : " + << Pe.name() << endl; + Pe.write(); } } else { Info<< " No phi" << endl; } - - Info<< "\nEnd\n" << endl; }