diff --git a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options index 89e52b6d52..1d01ecc4c3 100644 --- a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options +++ b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/Make/options @@ -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 diff --git a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C index dde4becd3f..166386c8e3 100644 --- a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C +++ b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C @@ -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,15 +221,125 @@ 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::typeName, + "0" + ); + replaceBoundaryType + ( + mesh, + "q", + compressible::RASModels::kqRWallFunctionFvPatchField::typeName, + "0" + ); + replaceBoundaryType + ( + mesh, + "R", + compressible::RASModels::kqRWallFunctionFvPatchField:: + 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:: + typeName, + "0" + ); + replaceBoundaryType + ( + mesh, + "q", + incompressible::RASModels::kqRWallFunctionFvPatchField:: + typeName, + "0" + ); + replaceBoundaryType + ( + mesh, + "R", + incompressible::RASModels::kqRWallFunctionFvPatchField:: + typeName, + "(0 0 0 0 0 0)" + ); +} + + int main(int argc, char *argv[]) { - -# include "addTimeOptions.H" + #include "addTimeOptions.H" argList::validOptions.insert("compressible", ""); -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" bool compressible = args.optionFound("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;