updated - using classes to supply type names

- nasty utility - think about replacing/deleting altogether
This commit is contained in:
andy
2009-07-24 13:52:01 +01:00
parent af0d324075
commit 13b92a6c99
2 changed files with 136 additions and 44 deletions

View File

@ -1,6 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume

View File

@ -26,14 +26,13 @@ Application
applyWallFunctionBounaryConditions
Description
Updates OpenFOAM RAS cases to use the new wall function framework
Updates OpenFOAM RAS cases to use the new (v1.6) wall function framework
Attempts to determine whether case is compressible or incompressible, or
can be supplied with -compressible command line argument
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "fvMesh.H"
#include "Time.H"
@ -42,6 +41,16 @@ Description
#include "wallPolyPatch.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -105,25 +114,6 @@ bool caseIsCompressible(const fvMesh& mesh)
}
}
// Attempt hydrostatic pressure field
IOobject pdHeader
(
"pd",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (pdHeader.headerOk())
{
volScalarField pd(pdHeader, mesh);
if (pd.dimensions() == dimMass/sqr(dimTime)/dimLength)
{
return true;
}
}
// If none of the above are true, assume that the case is incompressible
return false;
}
@ -231,9 +221,119 @@ void replaceBoundaryType
}
void updateCompressibleCase(const fvMesh& mesh)
{
Info<< "Case treated as compressible" << nl << endl;
createVolScalarField
(
mesh,
"mut",
dimArea/dimTime*dimDensity
);
replaceBoundaryType
(
mesh,
"mut",
compressible::RASModels::mutWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
compressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
compressible::RASModels::omegaWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
compressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
}
void updateIncompressibleCase(const fvMesh& mesh)
{
Info<< "Case treated as incompressible" << nl << endl;
createVolScalarField(mesh, "nut", dimArea/dimTime);
replaceBoundaryType
(
mesh,
"nut",
incompressible::RASModels::nutWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
incompressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
incompressible::RASModels::omegaWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
incompressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
}
int main(int argc, char *argv[])
{
#include "addTimeOptions.H"
argList::validOptions.insert("compressible", "");
@ -249,28 +349,13 @@ int main(int argc, char *argv[])
if (compressible || caseIsCompressible(mesh))
{
Info<< "Case treated as compressible" << nl << endl;
createVolScalarField
(
mesh,
"mut",
dimArea/dimTime*dimDensity
);
replaceBoundaryType(mesh, "mut", "mutWallFunction", "0");
updateCompressibleCase(mesh);
}
else
{
Info<< "Case treated as incompressible" << nl << endl;
createVolScalarField(mesh, "nut", dimArea/dimTime);
replaceBoundaryType(mesh, "nut", "nutWallFunction", "0");
updateIncompressibleCase(mesh);
}
replaceBoundaryType(mesh, "epsilon", "epsilonWallFunction", "0");
replaceBoundaryType(mesh, "omega", "omegaWallFunction", "0");
replaceBoundaryType(mesh, "k", "kqRWallFunction", "0");
replaceBoundaryType(mesh, "q", "kqRWallFunction", "0");
replaceBoundaryType(mesh, "R", "kqRWallFunction", "(0 0 0 0 0 0)");
Info<< "End\n" << endl;
return 0;