mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso extrudeModel
|
||||
wclean
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -4,3 +4,5 @@ set -x
|
||||
|
||||
rm -rf PV3FoamReader/Make
|
||||
wclean libso vtkPV3Foam
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -261,11 +261,15 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
// Set the case as an environment variable - some BCs might use this
|
||||
if (fullCasePath.name().find("processor", 0) == 0)
|
||||
{
|
||||
setEnv("FOAM_CASE", fullCasePath.path(), true);
|
||||
const fileName globalCase = fullCasePath.path();
|
||||
|
||||
setEnv("FOAM_CASE", globalCase, true);
|
||||
setEnv("FOAM_CASENAME", globalCase.name(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
setEnv("FOAM_CASE", fullCasePath, true);
|
||||
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
|
||||
}
|
||||
|
||||
// look for 'case{region}.OpenFOAM'
|
||||
@ -299,6 +303,7 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
{
|
||||
Info<< "fullCasePath=" << fullCasePath << nl
|
||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||
<< "region=" << meshRegion_ << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -2,10 +2,17 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lincompressibleRASModels \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling
|
||||
|
||||
@ -26,25 +26,156 @@ Application
|
||||
yPlusRAS
|
||||
|
||||
Description
|
||||
Calculates and reports yPlus for all wall patches, for the specified times.
|
||||
Calculates and reports yPlus for all wall patches, for the specified times
|
||||
when using RAS turbulence models.
|
||||
|
||||
Default behaviour assumes operating in incompressible mode. To apply to
|
||||
compressible RAS cases, use the -compressible option.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
||||
#include "RASModel.H"
|
||||
#include "wallFvPatch.H"
|
||||
#include "incompressible/RAS/RASModel/RASModel.H"
|
||||
#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
|
||||
|
||||
#include "basicPsiThermo.H"
|
||||
#include "compressible/RAS/RASModel/RASModel.H"
|
||||
#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
|
||||
|
||||
#include "wallDist.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
void calcIncompressibleYPlus
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const Time& runTime,
|
||||
const volVectorField& U,
|
||||
volScalarField& yPlus
|
||||
)
|
||||
{
|
||||
typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
|
||||
wallFunctionPatchField;
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<incompressible::RASModel> RASModel
|
||||
(
|
||||
incompressible::RASModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
const volScalarField::GeometricBoundaryField nutPatches =
|
||||
RASModel->nut()().boundaryField();
|
||||
|
||||
forAll(nutPatches, patchi)
|
||||
{
|
||||
if (isA<wallFunctionPatchField>(nutPatches[patchi]))
|
||||
{
|
||||
const wallFunctionPatchField& nutPw =
|
||||
dynamic_cast<const wallFunctionPatchField&>
|
||||
(nutPatches[patchi]);
|
||||
|
||||
yPlus.boundaryField()[patchi] = nutPw.yPlus();
|
||||
const scalarField& Yp = yPlus.boundaryField()[patchi];
|
||||
|
||||
Info<< "Patch " << patchi
|
||||
<< " named " << nutPw.patch().name()
|
||||
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
|
||||
<< " average: " << average(Yp) << nl << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void calcCompressibleYPlus
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const Time& runTime,
|
||||
const volVectorField& U,
|
||||
volScalarField& yPlus
|
||||
)
|
||||
{
|
||||
typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
|
||||
wallFunctionPatchField;
|
||||
|
||||
IOobject rhoHeader
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (!rhoHeader.headerOk())
|
||||
{
|
||||
Info<< " no rho field" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
Info << "Reading field rho\n" << endl;
|
||||
volScalarField rho(rhoHeader, mesh);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
autoPtr<basicPsiThermo> pThermo
|
||||
(
|
||||
basicPsiThermo::New(mesh)
|
||||
);
|
||||
basicPsiThermo& thermo = pThermo();
|
||||
|
||||
autoPtr<compressible::RASModel> RASModel
|
||||
(
|
||||
compressible::RASModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
const volScalarField::GeometricBoundaryField mutPatches =
|
||||
RASModel->mut()().boundaryField();
|
||||
|
||||
forAll(mutPatches, patchi)
|
||||
{
|
||||
if (isA<wallFunctionPatchField>(mutPatches[patchi]))
|
||||
{
|
||||
const wallFunctionPatchField& mutPw =
|
||||
dynamic_cast<const wallFunctionPatchField&>
|
||||
(mutPatches[patchi]);
|
||||
|
||||
yPlus.boundaryField()[patchi] = mutPw.yPlus();
|
||||
const scalarField& Yp = yPlus.boundaryField()[patchi];
|
||||
|
||||
Info<< "Patch " << patchi
|
||||
<< " named " << mutPw.patch().name()
|
||||
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
|
||||
<< " average: " << average(Yp) << nl << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
|
||||
#include "addRegionOption.H"
|
||||
|
||||
argList::validOptions.insert("compressible","");
|
||||
|
||||
#include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
#include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
#include "createNamedMesh.H"
|
||||
|
||||
bool compressible = args.optionFound("compressible");
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
@ -76,49 +207,35 @@ int main(int argc, char *argv[])
|
||||
dimensionedScalar("yPlus", dimless, 0.0)
|
||||
);
|
||||
|
||||
Info << "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
IOobject UHeader
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<incompressible::RASModel> RASModel
|
||||
(
|
||||
incompressible::RASModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
const fvPatchList& patches = mesh.boundary();
|
||||
|
||||
forAll(patches, patchi)
|
||||
if (UHeader.headerOk())
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
Info << "Reading field U\n" << endl;
|
||||
volVectorField U(UHeader, mesh);
|
||||
|
||||
if (typeid(currPatch) == typeid(wallFvPatch))
|
||||
if (compressible)
|
||||
{
|
||||
yPlus.boundaryField()[patchi] = RASModel->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;
|
||||
calcCompressibleYPlus(mesh, runTime, U, yPlus);
|
||||
}
|
||||
else
|
||||
{
|
||||
calcIncompressibleYPlus(mesh, runTime, U, yPlus);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " no U field" << endl;
|
||||
}
|
||||
|
||||
Info<< "Writing yPlus to field "
|
||||
<< yPlus.name() << nl << endl;
|
||||
Info<< "Writing yPlus to field " << yPlus.name() << nl << endl;
|
||||
|
||||
yPlus.write();
|
||||
}
|
||||
@ -128,4 +245,5 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user