mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Pe: Create and write volScalarField in addition to the surfaceScalarField for ease of post-processing
Update handling of turbulence models
This commit is contained in:
@ -1,9 +1,10 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||||
|
-I$(LIB_SRC)/transportModels \
|
||||||
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
@ -20,4 +21,5 @@ EXE_LIBS = \
|
|||||||
-lspecie \
|
-lspecie \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-lmeshTools
|
-lmeshTools \
|
||||||
|
-lsampling
|
||||||
|
|||||||
@ -25,20 +25,21 @@ Application
|
|||||||
Pe
|
Pe
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Calculates and writes the Pe number as a surfaceScalarField obtained from
|
Calculates the Peclet number Pe from the flux phi and writes the maximum
|
||||||
field phi.
|
value, the surfaceScalarField Pef and volScalarField Pe.
|
||||||
|
|
||||||
The -noWrite option just outputs the max/min values without writing
|
With the -noWrite option just outputs the max value without writing
|
||||||
the field.
|
the fields.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "calc.H"
|
#include "calc.H"
|
||||||
#include "fvc.H"
|
#include "surfaceInterpolate.H"
|
||||||
|
#include "fvcAverage.H"
|
||||||
|
|
||||||
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "turbulentTransportModel.H"
|
#include "turbulentTransportModel.H"
|
||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -73,18 +74,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject RASPropertiesHeader
|
IOobject turbulencePropertiesHeader
|
||||||
(
|
(
|
||||||
"RASProperties",
|
"turbulenceProperties",
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject LESPropertiesHeader
|
|
||||||
(
|
|
||||||
"LESProperties",
|
|
||||||
runTime.constant(),
|
runTime.constant(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
@ -95,15 +87,13 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
|
|
||||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||||
{
|
{
|
||||||
if (RASPropertiesHeader.headerOk())
|
if (turbulencePropertiesHeader.headerOk())
|
||||||
{
|
{
|
||||||
IOdictionary RASProperties(RASPropertiesHeader);
|
|
||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
autoPtr<incompressible::RASModel> RASModel
|
autoPtr<incompressible::turbulenceModel> turbulenceModel
|
||||||
(
|
(
|
||||||
incompressible::RASModel::New
|
incompressible::turbulenceModel::New
|
||||||
(
|
(
|
||||||
U,
|
U,
|
||||||
phi,
|
phi,
|
||||||
@ -117,47 +107,15 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Pe",
|
"Pef",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh,
|
mesh
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
),
|
||||||
mag(phi)
|
mag(phi)
|
||||||
/(
|
/(
|
||||||
mesh.magSf()
|
mesh.magSf()
|
||||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
* mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
* fvc::interpolate(RASModel->nuEff())
|
* fvc::interpolate(turbulenceModel->nuEff())
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (LESPropertiesHeader.headerOk())
|
|
||||||
{
|
|
||||||
IOdictionary LESProperties(LESPropertiesHeader);
|
|
||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
|
||||||
|
|
||||||
autoPtr<incompressible::LESModel> sgsModel
|
|
||||||
(
|
|
||||||
incompressible::LESModel::New(U, phi, laminarTransport)
|
|
||||||
);
|
|
||||||
|
|
||||||
PePtr.set
|
|
||||||
(
|
|
||||||
new surfaceScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Pe",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
|
||||||
mag(phi)
|
|
||||||
/(
|
|
||||||
mesh.magSf()
|
|
||||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
|
||||||
* fvc::interpolate(sgsModel->nuEff())
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -184,10 +142,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Pe",
|
"Pef",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh,
|
mesh
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
),
|
||||||
mag(phi)
|
mag(phi)
|
||||||
/(
|
/(
|
||||||
@ -201,10 +158,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||||
{
|
{
|
||||||
if (RASPropertiesHeader.headerOk())
|
if (turbulencePropertiesHeader.headerOk())
|
||||||
{
|
{
|
||||||
IOdictionary RASProperties(RASPropertiesHeader);
|
|
||||||
|
|
||||||
autoPtr<fluidThermo> thermo(fluidThermo::New(mesh));
|
autoPtr<fluidThermo> thermo(fluidThermo::New(mesh));
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
@ -218,9 +173,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
thermo->rho()
|
thermo->rho()
|
||||||
);
|
);
|
||||||
|
|
||||||
autoPtr<compressible::RASModel> RASModel
|
autoPtr<compressible::turbulenceModel> turbulenceModel
|
||||||
(
|
(
|
||||||
compressible::RASModel::New
|
compressible::turbulenceModel::New
|
||||||
(
|
(
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
@ -235,58 +190,15 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Pe",
|
"Pef",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh,
|
mesh
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
),
|
||||||
mag(phi)
|
mag(phi)
|
||||||
/(
|
/(
|
||||||
mesh.magSf()
|
mesh.magSf()
|
||||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
* mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
* fvc::interpolate(RASModel->muEff())
|
* fvc::interpolate(turbulenceModel->muEff())
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (LESPropertiesHeader.headerOk())
|
|
||||||
{
|
|
||||||
IOdictionary LESProperties(LESPropertiesHeader);
|
|
||||||
|
|
||||||
autoPtr<fluidThermo> thermo(fluidThermo::New(mesh));
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
thermo->rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
autoPtr<compressible::LESModel> sgsModel
|
|
||||||
(
|
|
||||||
compressible::LESModel::New(rho, U, phi, thermo())
|
|
||||||
);
|
|
||||||
|
|
||||||
PePtr.set
|
|
||||||
(
|
|
||||||
new surfaceScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Pe",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
|
||||||
mag(phi)
|
|
||||||
/(
|
|
||||||
mesh.magSf()
|
|
||||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
|
||||||
* fvc::interpolate(sgsModel->muEff())
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -313,10 +225,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Pe",
|
"Pef",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh,
|
mesh
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
),
|
||||||
mag(phi)
|
mag(phi)
|
||||||
/(
|
/(
|
||||||
@ -335,19 +246,34 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Pe max : " << max(PePtr()).value() << endl;
|
Info<< " Pe max : " << max(PePtr()).value() << endl;
|
||||||
|
|
||||||
if (writeResults)
|
if (writeResults)
|
||||||
{
|
{
|
||||||
|
Info<< " Writing surfaceScalarField : "
|
||||||
|
<< PePtr().name() << endl;
|
||||||
PePtr().write();
|
PePtr().write();
|
||||||
|
|
||||||
|
volScalarField Pe
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Pe",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
fvc::average(PePtr())
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Writing volScalarField : "
|
||||||
|
<< Pe.name() << endl;
|
||||||
|
Pe.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< " No phi" << endl;
|
Info<< " No phi" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\nEnd\n" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,7 +57,7 @@ namespace Foam
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Foam::timeSelector::addOptions();
|
Foam::timeSelector::addOptions();
|
||||||
# include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
Foam::argList::addBoolOption
|
Foam::argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noWrite",
|
"noWrite",
|
||||||
|
|||||||
Reference in New Issue
Block a user