Pe: Create and write volScalarField in addition to the surfaceScalarField for ease of post-processing

This commit is contained in:
Henry 2015-04-25 16:31:54 +01:00
parent 3f249821ce
commit 6cc8fc128f

View file

@ -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;
}