diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C index 7a85c2c972..32c178bd95 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C @@ -45,29 +45,7 @@ Foam::wallDependentModel::~wallDependentModel() const Foam::volScalarField& Foam::wallDependentModel::yWall() const { - if (!mesh_.foundObject("yWall")) - { - volScalarField* yPtr - ( - new volScalarField - ( - IOobject - ( - "yWall", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - true - ), - wallDist(mesh_).y() - ) - ); - - yPtr->checkIn(); - } - - return mesh_.lookupObject("yWall"); + return wallDist::New(mesh_).y(); } @@ -77,28 +55,6 @@ const Foam::volVectorField& Foam::wallDependentModel::nWall() const { wallDistReflection w(mesh_); - if (!mesh_.foundObject("yWall")) - { - volScalarField* yPtr - ( - new volScalarField - ( - IOobject - ( - "yWall", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - true - ), - w.y() - ) - ); - - yPtr->checkIn(); - } - volVectorField* nPtr ( new volVectorField diff --git a/applications/test/nearWallDist-wave/Test-WallDist.C b/applications/test/nearWallDist-wave/Test-WallDist.C index b27d882ecc..3827b6bbd2 100644 --- a/applications/test/nearWallDist-wave/Test-WallDist.C +++ b/applications/test/nearWallDist-wave/Test-WallDist.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,46 +26,36 @@ Description \*---------------------------------------------------------------------------*/ -#include "fvCFD.H" +#include "argList.H" +#include "Time.H" +#include "fvMesh.H" #include "wallDist.H" +using namespace Foam; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: int main(int argc, char *argv[]) { -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" Info<< "Mesh read in = " << runTime.cpuTimeIncrement() << " s\n" << endl << endl; - Info<< "Time now = " << runTime.timeName() << endl; // Wall distance - - wallDist y(mesh, true); - - if (y.nUnset() != 0) - { - WarningIn(args.executable()) - << "There are " << y.nUnset() - << " remaining unset cells and/or boundary values" << endl; - } - - - + const volScalarField& y = wallDist::New(mesh).y(); y.write(); - runTime++; Info<< "Time now = " << runTime.timeName() << endl; - // Move points boundBox meshBb(mesh.points()); @@ -83,14 +73,11 @@ int main(int argc, char *argv[]) } mesh.movePoints(newPoints); - mesh.write(); y.correct(); - y.write(); - Info<< "End\n" << endl; return 0; diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 3e53aaa055..e8d5f431a0 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -34,7 +34,6 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "LESModel.H" #include "nearWallDist.H" -#include "wallDist.H" #include "wallFvPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,17 +52,6 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << endl; fvMesh::readUpdateState state = mesh.readUpdate(); - // Wall distance - if (timeI == 0 || state != fvMesh::UNCHANGED) - { - Info<< "Calculating wall distance\n" << endl; - wallDist y(mesh); - Info<< "Writing wall distance to field " - << y.name() << nl << endl; - y.write(); - } - - volScalarField yPlus ( IOobject diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index 762297eb7d..c66f883739 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C @@ -43,8 +43,6 @@ Description #include "compressible/RAS/RASModel/RASModel.H" #include "mutWallFunction/mutWallFunctionFvPatchScalarField.H" -#include "wallDist.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void calcIncompressibleYPlus @@ -204,15 +202,6 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << endl; fvMesh::readUpdateState state = mesh.readUpdate(); - // Wall distance - if (timeI == 0 || state != fvMesh::UNCHANGED) - { - Info<< "Calculating wall distance\n" << endl; - wallDist y(mesh); - Info<< "Writing wall distance to field " << y.name() << nl << endl; - y.write(); - } - volScalarField yPlus ( IOobject diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H index 22515ac832..eaa3a0111f 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H +++ b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H @@ -38,7 +38,7 @@ volVectorField U ); Info<< "Calculating wall distance field" << endl; -volScalarField y(wallDist(mesh).y()); +const volScalarField& y(wallDist::New(mesh).y()); // Set the mean boundary-layer thickness dimensionedScalar ybl("ybl", dimLength, 0); diff --git a/etc/controlDict b/etc/controlDict index c3b4265142..b14599c5e2 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -610,6 +610,7 @@ DebugSwitches meshCutAndRemove 0; meshCutter 0; meshModifier 0; + meshObject 0; meshRefinement 0; meshSearch 0; meshToMesh 0; diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C index 7c72253775..0d44306571 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C @@ -43,7 +43,7 @@ void Foam::PrandtlDelta::calcDelta() delta_ = min ( static_cast(geometricDelta_()), - (kappa_/Cdelta_)*wallDist(mesh_).y() + (kappa_/Cdelta_)*wallDist::New(mesh_).y() ); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C index e952c1f48d..112ca4046e 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C @@ -261,7 +261,7 @@ kOmegaSST::kOmegaSST ) ), - y_(this->mesh_), + y_(wallDist::New(this->mesh_).y()), k_ ( diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.H b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.H index 85dee85ffe..8477ed86fa 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.H @@ -148,12 +148,13 @@ protected: Switch F3_; - //- Wall distance - // Note: different to wall distance in parent RASModel - wallDist y_; - // Fields + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField k_; volScalarField omega_; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index b2b170640b..4c550aaab2 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -42,8 +42,8 @@ $(wallDist)/wallPointYPlus/wallPointYPlus.C $(wallDist)/nearWallDist/nearWallDistNoSearch.C $(wallDist)/nearWallDist/nearWallDist.C $(wallDist)/wallDist/wallDist.C -$(wallDist)/meshWaveWallDist/patchDist.C -$(wallDist)/meshWaveWallDist/meshWaveWallDist.C +$(wallDist)/patchDistMethods/patchDistMethod/patchDistMethod.C +$(wallDist)/patchDistMethods/meshWave/meshWavePatchDistMethod.C $(wallDist)/wallDistReflection/reflectionVectors.C $(wallDist)/wallDistReflection/wallDistReflection.C diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 156f38b979..1a48576fc2 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,8 +49,19 @@ namespace Foam void Foam::fvMesh::clearGeomNotOldVol() { - meshObject::clear(*this); - meshObject::clear(*this); + meshObject::clearUpto + < + fvMesh, + GeometricMeshObject, + MoveableMeshObject + >(*this); + + meshObject::clearUpto + < + lduMesh, + GeometricMeshObject, + MoveableMeshObject + >(*this); slicedVolScalarField::DimensionedInternalField* VPtr = static_cast(VPtr_); diff --git a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/patchDist.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMethod.C similarity index 74% rename from src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/patchDist.C rename to src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMethod.C index 96747e9dde..b44817921e 100644 --- a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/patchDist.C +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMethod.C @@ -23,22 +23,47 @@ License \*---------------------------------------------------------------------------*/ -#include "patchDist.H" -#include "patchWave.H" +#include "meshWavePatchDistMethod.H" #include "fvMesh.H" +#include "volFields.H" +#include "patchWave.H" #include "emptyFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace patchDistMethods +{ + defineTypeNameAndDebug(meshWave, 0); + addToRunTimeSelectionTable(patchDistMethod, meshWave, dictionary); +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::patchDist::patchDist +Foam::patchDistMethods::meshWave::meshWave +( + const dictionary& dict, + const fvMesh& mesh, + const labelHashSet& patchIDs +) +: + patchDistMethod(mesh, patchIDs), + correctWalls_(dict.lookupOrDefault("correctWalls", true)), + nUnset_(0) +{} + + +Foam::patchDistMethods::meshWave::meshWave ( const fvMesh& mesh, const labelHashSet& patchIDs, const bool correctWalls ) : - mesh_(mesh), - patchIDs_(patchIDs), + patchDistMethod(mesh, patchIDs), correctWalls_(correctWalls), nUnset_(0) {} @@ -46,28 +71,8 @@ Foam::patchDist::patchDist // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::patchDist::y() const +bool Foam::patchDistMethods::meshWave::correct(volScalarField& y) { - tmp ty - ( - new volScalarField - ( - IOobject - ( - "y", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("y", dimLength, GREAT) - ) - ); - - volScalarField& y = ty(); - // Calculate distance starting from patch faces patchWave wave(mesh_, patchIDs_, correctWalls_); @@ -88,7 +93,7 @@ Foam::tmp Foam::patchDist::y() const // Transfer number of unset values nUnset_ = wave.nUnset(); - return ty; + return nUnset_ > 0; } diff --git a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/patchDist.H b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMethod.H similarity index 80% rename from src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/patchDist.H rename to src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMethod.H index 403b9e6427..674af38042 100644 --- a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/patchDist.H +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMethod.H @@ -39,36 +39,32 @@ Description takes the pointFaces() of the wall point to look for the nearest point. SourceFiles - patchDist.C + meshWavePatchDistMethod.C \*---------------------------------------------------------------------------*/ -#ifndef patchDist_H -#define patchDist_H +#ifndef meshWavePatchDistMethod_H +#define meshWavePatchDistMethod_H -#include "volFields.H" +#include "patchDistMethod.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class fvMesh; +namespace patchDistMethods +{ /*---------------------------------------------------------------------------*\ - Class patchDist Declaration + Class meshWave Declaration \*---------------------------------------------------------------------------*/ -class patchDist +class meshWave +: + public patchDistMethod { // Private Member Data - //- Reference to the mesh - const fvMesh& mesh_; - - //- Set of patch IDs - const labelHashSet patchIDs_; - //- Do accurate distance calculation for near-wall cells. const bool correctWalls_; @@ -79,20 +75,33 @@ class patchDist // Private Member Functions //- Disallow default bitwise copy construct - patchDist(const patchDist&); + meshWave(const meshWave&); //- Disallow default bitwise assignment - void operator=(const patchDist&); + void operator=(const meshWave&); public: + //- Runtime type information + TypeName("meshWave"); + + // Constructors + //- Construct from mesh and flag whether or not to correct wall. + // Calculate for all cells. + meshWave + ( + const dictionary& dict, + const fvMesh& mesh, + const labelHashSet& patchIDs + ); + //- Construct from mesh and flag whether or not to correct wall. // Calculate for all cells. correctWalls : correct wall (face&point) // cells for correct distance, searching neighbours. - patchDist + meshWave ( const fvMesh& mesh, const labelHashSet& patchIDs, @@ -102,19 +111,19 @@ public: // Member Functions - //- Calculate and return the distance to nearest patch - // for all cells and boundary - tmp y() const; - label nUnset() const { return nUnset_; } + + //- Correct the given distance-to-patch field + virtual bool correct(volScalarField& y); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace patchDistMethods } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/meshWaveWallDist.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWaveWallDist.C similarity index 100% rename from src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/meshWaveWallDist.C rename to src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWaveWallDist.C diff --git a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/meshWaveWallDist.H b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWaveWallDist.H similarity index 100% rename from src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/meshWaveWallDist.H rename to src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWaveWallDist.H diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C new file mode 100644 index 0000000000..d84a03a5a1 --- /dev/null +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "patchDistMethod.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(patchDistMethod, 0); + defineRunTimeSelectionTable(patchDistMethod, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::patchDistMethod::patchDistMethod +( + const fvMesh& mesh, + const labelHashSet& patchIDs +) +: + mesh_(mesh), + patchIDs_(patchIDs) +{} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::patchDistMethod::New +( + const dictionary& dict, + const fvMesh& mesh, + const labelHashSet& patchIDs +) +{ + word patchDistMethodType(dict.lookup("method")); + + Info<< "Selecting patchDistMethod " << patchDistMethodType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(patchDistMethodType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("patchDistMethod::New") + << "Unknown patchDistMethodType type " + << patchDistMethodType << endl << endl + << "Valid patchDistMethod types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, mesh, patchIDs); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::patchDistMethod::~patchDistMethod() +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H new file mode 100644 index 0000000000..efacc2f888 --- /dev/null +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::patchDistMethod + +Description + Specialisation of patchDist for wall distance calculation + +SourceFiles + patchDistMethod.C + +\*---------------------------------------------------------------------------*/ + +#ifndef patchDistMethod_H +#define patchDistMethod_H + +#include "dictionary.H" +#include "HashSet.H" +#include "volFieldsFwd.H" +#include "mapPolyMesh.H" +#include "runTimeSelectionTables.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class patchDistMethod Declaration +\*---------------------------------------------------------------------------*/ + +class patchDistMethod +{ + +protected: + + // Protected Member Data + + //- Reference to the mesh + const fvMesh& mesh_; + + //- Set of patch IDs + const labelHashSet patchIDs_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + patchDistMethod(const patchDistMethod&); + + //- Disallow default bitwise assignment + void operator=(const patchDistMethod&); + + +public: + + //- Runtime type information + TypeName("patchDistMethod"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + patchDistMethod, + dictionary, + ( + const dictionary& dict, + const fvMesh& mesh, + const labelHashSet& patchIDs + ), + (dict, mesh, patchIDs) + ); + + + // Constructors + + //- Construct from mesh and patch ID set + patchDistMethod + ( + const fvMesh& mesh, + const labelHashSet& patchIDs + ); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const fvMesh& mesh, + const labelHashSet& patchIDs + ); + + + //- Destructor + virtual ~patchDistMethod(); + + + // Member Functions + + //- Update cached geometry when the mesh moves + virtual bool movePoints() + { + return true; + } + + //- Update cached topology and geometry when the mesh changes + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Correct the given distance-to-patch field + virtual bool correct(volScalarField& y) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C index f6da94160b..e48915272c 100644 --- a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C +++ b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,25 +24,43 @@ License \*---------------------------------------------------------------------------*/ #include "wallDist.H" -#include "meshWaveWallDist.H" +#include "wallPolyPatch.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(wallDist, 0); +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::wallDist::wallDist(const fvMesh& mesh) : - volScalarField + MeshObject(mesh), + pdm_ + ( + patchDistMethod::New + ( + static_cast(mesh).subDict("wallDist"), + mesh, + mesh.boundaryMesh().findPatchIDs() + ) + ), + y_ ( IOobject ( - "y", + "yWall", mesh.time().timeName(), mesh ), mesh, - dimensionedScalar("y", dimLength, GREAT) + dimensionedScalar("yWall", dimLength, GREAT) ) { - correct(); + movePoints(); } @@ -54,9 +72,23 @@ Foam::wallDist::~wallDist() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::wallDist::correct() +bool Foam::wallDist::movePoints() { - volScalarField::operator=(meshWaveWallDist(mesh()).y()); + if (pdm_->movePoints()) + { + return pdm_->correct(y_); + } + else + { + return false; + } +} + + +void Foam::wallDist::updateMesh(const mapPolyMesh& mpm) +{ + pdm_->updateMesh(mpm); + pdm_->correct(y_); } diff --git a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H index 793b557d89..50063bdad8 100644 --- a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H +++ b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,8 @@ Class Foam::wallDist Description - Specialisation of patchDist for wall distance calculation + Interface to run-time selectable methods to calculate the distance-to-wall + field. SourceFiles wallDist.C @@ -35,6 +36,9 @@ SourceFiles #ifndef wallDist_H #define wallDist_H +#include "MeshObject.H" +#include "patchDistMethod.H" +#include "fvMesh.H" #include "volFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,8 +52,17 @@ namespace Foam class wallDist : - public volScalarField + public MeshObject { + // Private data + + //- Run-time selected method to generate the distance-to-wall field + autoPtr pdm_; + + //- Distance-to-wall field + volScalarField y_; + + // Private Member Functions //- Disallow default bitwise copy construct @@ -61,6 +74,10 @@ class wallDist public: + // Declare name of the class and its debug switch + ClassName("wallDist"); + + // Constructors //- Construct from mesh @@ -75,11 +92,14 @@ public: const volScalarField& y() const { - return *this; + return y_; } - //- Correct for mesh changes - virtual void correct(); + //- Update the y-field when the mesh moves + virtual bool movePoints(); + + //- Update the y-field when the mesh changes + virtual void updateMesh(const mapPolyMesh&); }; diff --git a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/wallDistData.C b/src/finiteVolume/fvMesh/wallDist/wallDistReflection/wallDistData.C similarity index 100% rename from src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/wallDistData.C rename to src/finiteVolume/fvMesh/wallDist/wallDistReflection/wallDistData.C diff --git a/src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/wallDistData.H b/src/finiteVolume/fvMesh/wallDist/wallDistReflection/wallDistData.H similarity index 100% rename from src/finiteVolume/fvMesh/wallDist/meshWaveWallDist/wallDistData.H rename to src/finiteVolume/fvMesh/wallDist/wallDistReflection/wallDistData.H diff --git a/src/meshTools/twoDPointCorrector/twoDPointCorrector.C b/src/meshTools/twoDPointCorrector/twoDPointCorrector.C index 798d0f8899..73aea238d0 100644 --- a/src/meshTools/twoDPointCorrector/twoDPointCorrector.C +++ b/src/meshTools/twoDPointCorrector/twoDPointCorrector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,8 +32,14 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +namespace Foam +{ + defineTypeNameAndDebug(twoDPointCorrector, 0); +} + const Foam::scalar Foam::twoDPointCorrector::edgeOrthogonalityTol = 1.0 - 1e-4; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::twoDPointCorrector::calcAddressing() const diff --git a/src/meshTools/twoDPointCorrector/twoDPointCorrector.H b/src/meshTools/twoDPointCorrector/twoDPointCorrector.H index c30a0282a0..83d5483ee0 100644 --- a/src/meshTools/twoDPointCorrector/twoDPointCorrector.H +++ b/src/meshTools/twoDPointCorrector/twoDPointCorrector.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,6 +111,10 @@ class twoDPointCorrector public: + // Declare name of the class and its debug switch + ClassName("twoDPointCorrector"); + + // Constructors //- Construct from components diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C index 1b8e5319a8..756b1d8cc4 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C @@ -28,7 +28,7 @@ License #include "fvcGrad.H" #include "unitConversion.H" #include "fvPatchField.H" -#include "patchDist.H" +#include "meshWavePatchDistMethod.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -66,9 +66,25 @@ void contactAngleForce::initialise() Info<< " " << pbm[patchI].name() << endl; } - patchDist dist(owner_.regionMesh(), patchIDs); + // Temporary implementation until run-time selection covers this case + patchDistMethods::meshWave dist(owner_.regionMesh(), patchIDs); + volScalarField y + ( + IOobject + ( + "y", + owner_.regionMesh().time().timeName(), + owner_.regionMesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + owner_.regionMesh(), + dimensionedScalar("y", dimLength, GREAT) + ); + dist.correct(y); - mask_ = pos(dist.y() - dimensionedScalar("dLim", dimLength, dLim)); + mask_ = pos(y - dimensionedScalar("dLim", dimLength, dLim)); } } diff --git a/src/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C b/src/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C index 31428abf16..a66e32fe57 100644 --- a/src/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C +++ b/src/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ void PrandtlDelta::calcDelta() delta_ = min ( static_cast(geometricDelta_()), - (kappa_/Cdelta_)*wallDist(mesh_).y() + (kappa_/Cdelta_)*wallDist::New(mesh_).y() ); } diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C index 324d857a31..03ad6fb653 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -111,7 +111,11 @@ tmp SpalartAllmaras::fv3() const } -tmp SpalartAllmaras::fw(const volScalarField& Stilda) const +tmp SpalartAllmaras::fw +( + const volScalarField& Stilda, + const volScalarField& dTilda +) const { volScalarField r ( @@ -124,7 +128,7 @@ tmp SpalartAllmaras::fw(const volScalarField& Stilda) const Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) ) - *sqr(kappa_*dTilda_) + *sqr(kappa_*dTilda) ), scalar(10.0) ) @@ -137,6 +141,14 @@ tmp SpalartAllmaras::fw(const volScalarField& Stilda) const } +tmp SpalartAllmaras::dTilda() const +{ + tmp tdTilda(CDES_*delta()); + min(tdTilda().dimensionedInternalField(), tdTilda(), y_); + return tdTilda; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // SpalartAllmaras::SpalartAllmaras @@ -255,6 +267,8 @@ SpalartAllmaras::SpalartAllmaras ashfordCorrection_(coeffDict_.lookupOrDefault("ashfordCorrection", true)), + y_(wallDist::New(mesh_).y()), + nuTilda_ ( IOobject @@ -268,7 +282,6 @@ SpalartAllmaras::SpalartAllmaras mesh_ ), - dTilda_(min(CDES_*delta(), wallDist(mesh_).y())), muSgs_ ( IOobject @@ -340,14 +353,10 @@ void SpalartAllmaras::correct(const tmp& tgradU) const volTensorField& gradU = tgradU(); LESModel::correct(gradU); - if (mesh_.changing()) - { - dTilda_ = min(CDES_*delta(), wallDist(mesh_).y()); - } - + const volScalarField dTilda(this->dTilda()); volScalarField Stilda ( - fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda_) + fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda) ); tmp nuTildaEqn @@ -363,7 +372,7 @@ void SpalartAllmaras::correct(const tmp& tgradU) - rho()*Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) == rho()*Cb1_*Stilda*nuTilda_ - - fvm::Sp(rho()*Cw1_*fw(Stilda)*nuTilda_/sqr(dTilda_), nuTilda_) + - fvm::Sp(rho()*Cw1_*fw(Stilda, dTilda)*nuTilda_/sqr(dTilda), nuTilda_) ); nuTildaEqn().relax(); @@ -407,8 +416,6 @@ bool SpalartAllmaras::read() tmp SpalartAllmaras::LESRegion() const { - volScalarField wd(wallDist(mesh_).y()); - tmp tLESRegion ( new volScalarField @@ -421,9 +428,7 @@ tmp SpalartAllmaras::LESRegion() const IOobject::NO_READ, IOobject::NO_WRITE ), - neg(min(CDES_*delta(), wd) - wd) -// mesh_, -// dimensionedScalar("zero", dimless, 0.0) + neg(dTilda() - y_) ) ); diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H index 11d24d3388..133cd6d173 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -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 @@ -49,6 +49,7 @@ SourceFiles #include "DESModel.H" #include "volFields.H" +#include "wallDist.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -92,8 +93,12 @@ class SpalartAllmaras // Fields + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField nuTilda_; - volScalarField dTilda_; volScalarField muSgs_; volScalarField alphaSgs_; @@ -106,7 +111,15 @@ class SpalartAllmaras tmp fv1() const; tmp fv2() const; tmp fv3() const; - tmp fw(const volScalarField& Stilda) const; + + tmp fw + ( + const volScalarField& Stilda, + const volScalarField& dTilda + ) const; + + //- Length scale + tmp dTilda() const; // Disallow default bitwise copy construct and assignment SpalartAllmaras(const SpalartAllmaras&); @@ -148,7 +161,7 @@ public: //- Return SGS kinetic energy virtual tmp k() const { - return sqr(muSgs()/rho()/ck_/dTilda_); + return sqr(muSgs()/rho()/ck_/dTilda()); } //- Return sub-grid disipation rate diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 7c6bfb41d3..97f849efa4 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -184,7 +184,7 @@ LaunderGibsonRSTM::LaunderGibsonRSTM ) ), - y_(mesh_), + yr_(mesh_), R_ ( @@ -375,7 +375,7 @@ void LaunderGibsonRSTM::correct() if (mesh_.changing()) { - y_.correct(); + yr_.correct(); } volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); @@ -443,10 +443,10 @@ void LaunderGibsonRSTM::correct() // wall reflection terms + symm ( - I*((y_.n() & reflect) & y_.n()) - - 1.5*(y_.n()*(reflect & y_.n()) - + (y_.n() & reflect)*y_.n()) - )*pow(Cmu_, 0.75)*rho_*pow(k_, 1.5)/(kappa_*y_*epsilon_) + I*((yr_.n() & reflect) & yr_.n()) + - 1.5*(yr_.n()*(reflect & yr_.n()) + + (yr_.n() & reflect)*yr_.n()) + )*pow(Cmu_, 0.75)*rho_*pow(k_, 1.5)/(kappa_*yr_*epsilon_) ); REqn().relax(); diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H index d7f09205b0..7caad177f1 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -109,7 +109,7 @@ protected: // Fields - wallDistReflection y_; + wallDistReflection yr_; volSymmTensorField R_; volScalarField k_; diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 9e5cf2d11f..b521c2b523 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -126,7 +126,7 @@ tmp SpalartAllmaras::fw(const volScalarField& Stilda) const Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) ) - *sqr(kappa_*d_) + *sqr(kappa_*y_) ), scalar(10.0) ) @@ -276,7 +276,7 @@ SpalartAllmaras::SpalartAllmaras autoCreateAlphat("alphat", mesh_) ), - d_(mesh_) + y_(wallDist::New(mesh_).y()) { alphat_ = mut_/Prt_; alphat_.correctBoundaryConditions(); @@ -435,18 +435,13 @@ void SpalartAllmaras::correct() RASModel::correct(); - if (mesh_.changing()) - { - d_.correct(); - } - const volScalarField chi(this->chi()); const volScalarField fv1(this->fv1(chi)); const volScalarField Stilda ( fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) - + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*y_) ); tmp nuTildaEqn @@ -457,7 +452,7 @@ void SpalartAllmaras::correct() - Cb2_/sigmaNut_*rho_*magSqr(fvc::grad(nuTilda_)) == Cb1_*rho_*Stilda*nuTilda_ - - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_*rho_/sqr(d_), nuTilda_) + - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_*rho_/sqr(y_), nuTilda_) ); nuTildaEqn().relax(); diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H index a0f0a31215..f2d40e7138 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -122,9 +122,10 @@ protected: volScalarField mut_; volScalarField alphat_; - - //- Wall distance - wallDist d_; + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; // Protected Member Functions diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index 999676d4f1..bcd60ebb2c 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -251,7 +251,7 @@ kOmegaSST::kOmegaSST ) ), - y_(mesh_), + y_(wallDist::New(mesh_).y()), k_ ( @@ -424,11 +424,6 @@ void kOmegaSST::correct() volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); - if (mesh_.changing()) - { - y_.correct(); - } - if (mesh_.moving()) { divU += fvc::div(mesh_.phi()); diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index 51f6a3c87b..1b64b6c9a4 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -149,12 +149,13 @@ protected: Switch F3_; - //- Wall distance - // Note: different to wall distance in parent RASModel - wallDist y_; - // Fields + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField k_; volScalarField omega_; volScalarField mut_; diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C index 39afb02f30..39a4505e72 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -168,7 +168,9 @@ tmp SpalartAllmaras::fw tmp SpalartAllmaras::dTilda(const volScalarField&) const { - return min(CDES_*delta(), y_); + tmp tdTilda(CDES_*delta()); + min(tdTilda().dimensionedInternalField(), tdTilda(), y_); + return tdTilda; } @@ -279,7 +281,7 @@ SpalartAllmaras::SpalartAllmaras ashfordCorrection_(coeffDict_.lookupOrDefault("ashfordCorrection", true)), - y_(mesh_), + y_(wallDist::New(mesh_).y()), nuTilda_ ( @@ -322,12 +324,6 @@ void SpalartAllmaras::correct(const tmp& gradU) { LESModel::correct(gradU); - if (mesh_.changing()) - { - y_.correct(); - y_.boundaryField() = max(y_.boundaryField(), VSMALL); - } - const volScalarField S(this->S(gradU)); const volScalarField dTilda(this->dTilda(S)); const volScalarField STilda(this->STilda(S, dTilda)); @@ -451,8 +447,6 @@ tmp SpalartAllmaras::LESRegion() const IOobject::NO_WRITE ), neg(dTilda(S(fvc::grad(U_))) - y_) -// mesh_, -// dimensionedScalar("zero", dimless, 0.0) ) ); diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H index 3f3b39e12b..3b69a746b8 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -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 @@ -105,7 +105,11 @@ protected: // Fields - wallDist y_; + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField nuTilda_; volScalarField nuSgs_; diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C index 376ec44ad1..3b312d5ae4 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C @@ -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 @@ -116,7 +116,7 @@ void Foam::IDDESDelta::calcDelta() ( max ( - cw_*wallDist(mesh()).y(), + cw_*wallDist::New(mesh()).y(), cw_*hmax ), tfaceToFacenMax diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C index 141d723613..6dd71f6c64 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -264,7 +264,7 @@ kOmegaSSTSAS::kOmegaSSTSAS ), omegaMin_("omegaMin", dimless/dimTime, SMALL), - y_(mesh_), + Cmu_ ( dimensioned::lookupOrAddToDict @@ -284,6 +284,8 @@ kOmegaSSTSAS::kOmegaSSTSAS ) ), + y_(wallDist::New(mesh_).y()), + k_ ( IOobject @@ -340,11 +342,6 @@ void kOmegaSSTSAS::correct(const tmp& gradU) { LESModel::correct(gradU); - if (mesh_.changing()) - { - y_.correct(); - } - volScalarField S2(2.0*magSqr(symm(gradU()))); gradU.clear(); diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H index 6d5eb587a7..fddf430ec1 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H @@ -117,13 +117,17 @@ protected: dimensionedScalar omegaMin_; - wallDist y_; dimensionedScalar Cmu_; dimensionedScalar kappa_; // Fields + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField k_; volScalarField omega_; volScalarField nuSgs_; diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C index cf07d2b2c0..ae824d9e0b 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -118,7 +118,7 @@ LamBremhorstKE::LamBremhorstKE mesh_ ), - y_(mesh_), + y_(wallDist::New(mesh_).y()), Rt_(sqr(k_)/(nu()*bound(epsilon_, epsilonMin_))), @@ -247,11 +247,6 @@ void LamBremhorstKE::correct() return; } - if (mesh_.changing()) - { - y_.correct(); - } - volScalarField G(GName(), nut_*2*magSqr(symm(fvc::grad(U_)))); diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H index 2b5870cacd..6481e5020d 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H @@ -72,7 +72,11 @@ protected: volScalarField k_; volScalarField epsilon_; - wallDist y_; + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField Rt_; volScalarField fMu_; diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index b2517f1a40..7a13dad94d 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -218,7 +218,7 @@ LienCubicKELowRe::LienCubicKELowRe mesh_ ), - y_(mesh_), + y_(wallDist::New(mesh_).y()), eta_ ( @@ -420,11 +420,6 @@ void LienCubicKELowRe::correct() return; } - if (mesh_.changing()) - { - y_.correct(); - } - tmp tgradU = fvc::grad(U_); const volTensorField& gradU = tgradU(); diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H index df9d0fab82..b771389dba 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H @@ -104,7 +104,10 @@ protected: volScalarField k_; volScalarField epsilon_; - wallDist y_; + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; volScalarField eta_; volScalarField ksi_; diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index 8401f3eed7..8fee2c00d8 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -164,7 +164,7 @@ LienLeschzinerLowRe::LienLeschzinerLowRe mesh_ ), - y_(mesh_), + y_(wallDist::New(mesh_).y()), yStar_(sqrt(k_)*y_/nu() + SMALL), @@ -296,11 +296,6 @@ void LienLeschzinerLowRe::correct() return; } - if (mesh_.changing()) - { - y_.correct(); - } - scalar Cmu75 = pow(Cmu_.value(), 0.75); const volTensorField gradU(fvc::grad(U_)); diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H index 0d8da074b5..660e68e8b0 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H @@ -83,7 +83,10 @@ protected: volScalarField k_; volScalarField epsilon_; - wallDist y_; + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; volScalarField yStar_; diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 999978f3c9..4249bce17b 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -124,7 +124,7 @@ tmp SpalartAllmaras::fw(const volScalarField& Stilda) const Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) ) - *sqr(kappa_*d_) + *sqr(kappa_*y_) ), scalar(10.0) ) @@ -253,7 +253,7 @@ SpalartAllmaras::SpalartAllmaras mesh_ ), - d_(mesh_) + y_(wallDist::New(mesh_).y()) { printCoeffs(); @@ -429,18 +429,13 @@ void SpalartAllmaras::correct() return; } - if (mesh_.changing()) - { - d_.correct(); - } - const volScalarField chi(this->chi()); const volScalarField fv1(this->fv1(chi)); const volScalarField Stilda ( fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) - + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*y_) ); tmp nuTildaEqn @@ -451,7 +446,7 @@ void SpalartAllmaras::correct() - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) == Cb1_*Stilda*nuTilda_ - - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) + - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(y_), nuTilda_) ); nuTildaEqn().relax(); diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H index 597b0859c4..9fffb54edb 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -119,7 +119,10 @@ protected: volScalarField nuTilda_; volScalarField nut_; - wallDist d_; + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; // Protected Member Functions diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 2a32217266..a115160221 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -242,7 +242,7 @@ kOmegaSST::kOmegaSST ) ), - y_(mesh_), + y_(wallDist::New(mesh_).y()), k_ ( @@ -404,11 +404,6 @@ void kOmegaSST::correct() return; } - if (mesh_.changing()) - { - y_.correct(); - } - const volScalarField S2(2*magSqr(symm(fvc::grad(U_)))); volScalarField G(GName(), nut_*S2); diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H index 49fdefb45a..692fc2c1f5 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H @@ -143,12 +143,13 @@ protected: Switch F3_; - //- Wall distance field - // Note: different to wall distance in parent RASModel - wallDist y_; - // Fields + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; + volScalarField k_; volScalarField omega_; volScalarField nut_; diff --git a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C index 2aa10e84c6..c77ff47427 100644 --- a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C +++ b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C @@ -504,7 +504,7 @@ kkLOmega::kkLOmega ), autoCreateNut("nut", mesh_) ), - y_(mesh_) + y_(wallDist::New(mesh_).y()) { bound(kt_, kMin_); bound(kl_, kMin_); @@ -637,12 +637,6 @@ void kkLOmega::correct() return; } - if (mesh_.changing()) - { - y_.correct(); - y_.boundaryField() = max(y_.boundaryField(), VSMALL); - } - const volScalarField kT(kt_ + kl_); @@ -773,7 +767,9 @@ void kkLOmega::correct() , omega_ ) - fvm::Sp(Cw2_*omega_, omega_) - + Cw3_*fOmega(lambdaEff, lambdaT)*alphaTEff*sqr(fw)*sqrt(kt_)/pow3(y_) + + ( + Cw3_*fOmega(lambdaEff, lambdaT)*alphaTEff*sqr(fw)*sqrt(kt_) + )().dimensionedInternalField()/pow3(y_.dimensionedInternalField()) ); diff --git a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H index 6badc208c3..0cdc006bd0 100644 --- a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H +++ b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H @@ -181,7 +181,11 @@ protected: volScalarField omega_; volScalarField kl_; volScalarField nut_; - wallDist y_; + + //- Wall distance + // Note: different to wall distance in parent RASModel + // which is for near-wall cells only + const volScalarField& y_; public: diff --git a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes index d0a93e860b..7510de7b7a 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes @@ -63,5 +63,10 @@ fluxRequired p ; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes index ef0a3305cf..5e55527b80 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes @@ -58,5 +58,10 @@ fluxRequired p_rgh; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes index ef0a3305cf..5e55527b80 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes @@ -58,5 +58,10 @@ fluxRequired p_rgh; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes b/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes index bc9d3bc597..c6d44d3c2e 100644 --- a/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes +++ b/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes @@ -60,5 +60,10 @@ fluxRequired p ; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/fvSchemes b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/fvSchemes index 1d00381423..ce1e571bfb 100644 --- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/fvSchemes +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/fvSchemes @@ -57,5 +57,10 @@ snGradSchemes default corrected; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/fvSchemes index 953fe762d0..5f99102285 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/fvSchemes @@ -57,4 +57,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + + // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/fvSchemes index 14ac340c9b..370aa5a664 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/fvSchemes @@ -56,4 +56,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + + // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes index 898761e5e6..ea3c1491e1 100644 --- a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes @@ -62,5 +62,10 @@ fluxRequired p ; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/fvSchemes b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/fvSchemes index 03be7b49e0..3972a7e788 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/fvSchemes +++ b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/fvSchemes @@ -64,4 +64,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + + // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/fvSchemes b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/fvSchemes index b17cff7ff3..3bc772bfed 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/fvSchemes @@ -58,5 +58,10 @@ fluxRequired p ; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes b/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes index e0aad005a3..4158d2dead 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes @@ -54,5 +54,10 @@ fluxRequired p ; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes index c0f1506a7c..065507c3f4 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes @@ -55,4 +55,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + + // ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes index 5b1a94bbec..4bef25ebf9 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes @@ -61,5 +61,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSchemes b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSchemes index 7ed447f064..d3296d4338 100644 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSchemes @@ -60,5 +60,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvSchemes b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvSchemes index 45390e50dc..d80f5e4e2a 100644 --- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvSchemes +++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/fvSchemes @@ -61,5 +61,10 @@ fluxRequired p; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/multiphase/LTSInterFoam/DTCHull/system/fvSchemes b/tutorials/multiphase/LTSInterFoam/DTCHull/system/fvSchemes index 0806a381d5..5dac713814 100644 --- a/tutorials/multiphase/LTSInterFoam/DTCHull/system/fvSchemes +++ b/tutorials/multiphase/LTSInterFoam/DTCHull/system/fvSchemes @@ -59,5 +59,10 @@ fluxRequired alpha.water; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes index d253239d92..618d1b4a9c 100644 --- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes @@ -57,5 +57,10 @@ fluxRequired rho ; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/DTCHull/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/DTCHull/system/fvSchemes index 4bca38f8ba..84b6393114 100644 --- a/tutorials/multiphase/interDyMFoam/ras/DTCHull/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/DTCHull/system/fvSchemes @@ -59,5 +59,10 @@ fluxRequired alpha.water; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/k b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/k new file mode 100644 index 0000000000..375776f540 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/k @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.00015; + +boundaryField +{ + atmosphere + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/nut b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/nut new file mode 100644 index 0000000000..2cb94295f9 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/nut @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 5e-07; + +boundaryField +{ + atmosphere + { + type zeroGradient; + } + + walls + { + type nutkRoughWallFunction; + Ks uniform 100e-6; + Cs uniform 0.5; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/omega b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/omega new file mode 100644 index 0000000000..ea3112f3d0 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/omega @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 2; + +boundaryField +{ + atmosphere + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + walls + { + type omegaWallFunction; + value $internalField; + } +} + + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/RASProperties b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/RASProperties index 0725438931..af7ecd49d2 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/RASProperties +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/RASProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -RASModel laminar; +RASModel kOmegaSST; turbulence on; diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/turbulenceProperties b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/turbulenceProperties index c2c3b28a1b..09c25018c3 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/turbulenceProperties +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/turbulenceProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType laminar; +simulationType laminar; //RASModel; // ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes index 5055a179c6..020384e5e8 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes @@ -30,6 +30,8 @@ divSchemes div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; + div(phi,k) Gauss upwind; + div(phi,omega) Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; } @@ -55,5 +57,10 @@ fluxRequired pcorr; } +wallDist +{ + method meshWave; +} + // ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution index 22380fc4ae..5ca78b8588 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution @@ -60,7 +60,7 @@ solvers nSweeps 1; } - "(k|B|nuTilda)" + "(k|omega|B|nuTilda).*" { solver smoothSolver; smoother symGaussSeidel; diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes index 706b90b7b3..8774b16c15 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes @@ -60,5 +60,10 @@ fluxRequired alpha.water; } +wallDist +{ + method meshWave; +} + // ************************************************************************* //