From 3fc33fcf5e6a63c84b08d5cf855c885e4dff12d7 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 17 Jul 2009 11:21:23 +0100 Subject: [PATCH] Added compressible form of vanDriest wall damping. --- .../compressible/LES/Make/files | 2 + .../LES/vanDriestDelta/vanDriestDelta.C | 160 ++++++++++++++++++ .../LES/vanDriestDelta/vanDriestDelta.H | 114 +++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.C create mode 100644 src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.H diff --git a/src/turbulenceModels/compressible/LES/Make/files b/src/turbulenceModels/compressible/LES/Make/files index 59073028cf..331f60eb87 100644 --- a/src/turbulenceModels/compressible/LES/Make/files +++ b/src/turbulenceModels/compressible/LES/Make/files @@ -9,6 +9,8 @@ dynOneEqEddy/dynOneEqEddy.C DeardorffDiffStress/DeardorffDiffStress.C SpalartAllmaras/SpalartAllmaras.C +vanDriestDelta/vanDriestDelta.C + /* Wall functions */ wallFunctions=derivedFvPatchFields/wallFunctions diff --git a/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.C b/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.C new file mode 100644 index 0000000000..a6c47deb08 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.C @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "vanDriestDelta.H" +#include "LESModel.H" +#include "wallFvPatch.H" +#include "wallDistData.H" +#include "wallPointYPlus.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(vanDriestDelta, 0); +addToRunTimeSelectionTable(LESdelta, vanDriestDelta, dictionary); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void vanDriestDelta::calcDelta() +{ + const LESModel& lesModel = mesh_.lookupObject("LESProperties"); + + const volVectorField& U = lesModel.U(); + const volScalarField& rho = lesModel.rho(); + const volScalarField& mu = lesModel.mu(); + tmp muSgs = lesModel.muSgs(); + + volScalarField ystar + ( + IOobject + ( + "ystar", + mesh_.time().constant(), + mesh_ + ), + mesh_, + dimensionedScalar("ystar", dimLength, GREAT) + ); + + const fvPatchList& patches = mesh_.boundary(); + forAll(patches, patchi) + { + if (isType(patches[patchi])) + { + const fvPatchVectorField& Uw = U.boundaryField()[patchi]; + const scalarField& rhow = rho.boundaryField()[patchi]; + const scalarField& muw = mu.boundaryField()[patchi]; + const scalarField& muSgsw = muSgs().boundaryField()[patchi]; + + ystar.boundaryField()[patchi] = + muw/(rhow*sqrt((muw + muSgsw)*mag(Uw.snGrad())/rhow + VSMALL)); + } + } + + wallPointYPlus::yPlusCutOff = 500; + wallDistData y(mesh_, ystar); + + delta_ = min + ( + static_cast(geometricDelta_()), + (kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +vanDriestDelta::vanDriestDelta +( + const word& name, + const fvMesh& mesh, + const dictionary& dd +) +: + LESdelta(name, mesh), + geometricDelta_ + ( + LESdelta::New("geometricDelta", mesh, dd.subDict(type() + "Coeffs")) + ), + kappa_(dd.lookupOrDefault("kappa", 0.4187)), + Aplus_ + ( + dd.subDict(type() + "Coeffs").lookupOrDefault("Aplus", 26.0) + ), + Cdelta_ + ( + dd.subDict(type() + "Coeffs").lookupOrDefault("Cdelta", 0.158) + ), + calcInterval_ + ( + dd.subDict(type() + "Coeffs").lookupOrDefault