diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H index 7cc250a66a..062c5523c9 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H @@ -2,6 +2,7 @@ ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) + - fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U) + turbulence->divDevRhoReff(rho, U) ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 9e5461614b..b6e70fc295 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -58,7 +58,6 @@ { tphiAlphaCorr() -= tphiAlpha(); - volScalarField alpha100("alpha100", alpha10); alpha10 = alpha1; diff --git a/bin/foamCleanPath b/bin/foamCleanPath index 85b93f8f57..c6f1147bf4 100755 --- a/bin/foamCleanPath +++ b/bin/foamCleanPath @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -126,7 +126,7 @@ do if [ -e "$dir" ] then #- no duplicate dirs - duplicate=$(echo " $dirList " | sed -ne "s@ $dir @DUP@p") + duplicate=$(echo " $dirList " | sed -ne "s: $dir :DUP:p") if [ ! "$duplicate" ] then diff --git a/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C b/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C index da0db918a1..facf0ead5b 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C +++ b/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C @@ -47,7 +47,7 @@ Smagorinsky::Smagorinsky const word& type ) : - eddyViscosity > + LESeddyViscosity ( type, alpha, @@ -67,16 +67,6 @@ Smagorinsky::Smagorinsky this->coeffDict_, 0.094 ) - ), - - Ce_ - ( - dimensioned::lookupOrAddToDict - ( - "Ce", - this->coeffDict_, - 1.048 - ) ) { if (type == typeName) @@ -92,10 +82,9 @@ Smagorinsky::Smagorinsky template bool Smagorinsky::read() { - if (eddyViscosity >::read()) + if (LESeddyViscosity::read()) { Ck_.readIfPresent(this->coeffDict()); - Ce_.readIfPresent(this->coeffDict()); return true; } @@ -114,7 +103,7 @@ tmp Smagorinsky::k { volSymmTensorField D(symm(gradU)); - volScalarField a(Ce_/this->delta()); + volScalarField a(this->Ce_/this->delta()); volScalarField b((2.0/3.0)*tr(D)); volScalarField c(2*Ck_*this->delta()*(dev(D) && D)); @@ -137,7 +126,7 @@ tmp Smagorinsky::epsilon() const IOobject::NO_READ, IOobject::NO_WRITE ), - Ce_*k()*sqrt(k())/this->delta() + this->Ce_*k()*sqrt(k())/this->delta() ) ); } @@ -156,7 +145,7 @@ void Smagorinsky::correctNut() template void Smagorinsky::correct() { - eddyViscosity >::correct(); + LESeddyViscosity::correct(); correctNut(); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.H b/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.H index c74278dee9..c9e785a1b2 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.H +++ b/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.H @@ -62,7 +62,7 @@ SourceFiles #define Smagorinsky_H #include "LESModel.H" -#include "eddyViscosity.H" +#include "LESeddyViscosity.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -78,7 +78,7 @@ namespace LESModels template class Smagorinsky : - public eddyViscosity > + public LESeddyViscosity { // Private Member Functions @@ -92,7 +92,6 @@ protected: // Protected data dimensionedScalar Ck_; - dimensionedScalar Ce_; // Protected Member Functions diff --git a/src/TurbulenceModels/turbulenceModels/LES/eddyViscosity/LESeddyViscosity.C b/src/TurbulenceModels/turbulenceModels/LES/eddyViscosity/LESeddyViscosity.C new file mode 100644 index 0000000000..5c30bcbaea --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/eddyViscosity/LESeddyViscosity.C @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "LESeddyViscosity.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +LESeddyViscosity::LESeddyViscosity +( + const word& type, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + eddyViscosity > + ( + type, + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ), + + Ce_ + ( + dimensioned::lookupOrAddToDict + ( + "Ce", + this->coeffDict_, + 1.048 + ) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool LESeddyViscosity::read() +{ + if (eddyViscosity >::read()) + { + Ce_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +template +tmp LESeddyViscosity::epsilon() const +{ + return tmp + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("epsilon", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + Ce_*this->k()*sqrt(this->k())/this->delta() + ) + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/eddyViscosity/LESeddyViscosity.H b/src/TurbulenceModels/turbulenceModels/LES/eddyViscosity/LESeddyViscosity.H new file mode 100644 index 0000000000..780aaea85c --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/eddyViscosity/LESeddyViscosity.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::LESModels::LESeddyViscosity + +Group + grpLESTurbulence + +Description + Eddy viscosity LES SGS model base class + +SourceFiles + LESeddyViscosity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LESeddyViscosity_H +#define LESeddyViscosity_H + +#include "LESModel.H" +#include "eddyViscosity.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class LESeddyViscosity Declaration +\*---------------------------------------------------------------------------*/ + +template +class LESeddyViscosity +: + public eddyViscosity > +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + LESeddyViscosity(const LESeddyViscosity&); + LESeddyViscosity& operator=(const LESeddyViscosity&); + + +protected: + + // Protected data + + dimensionedScalar Ce_; + + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + // Constructors + + //- Construct from components + LESeddyViscosity + ( + const word& type, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~LESeddyViscosity() + {} + + + // Member Functions + + //- Read model coefficients if they have changed + virtual bool read(); + + //- Return sub-grid disipation rate + virtual tmp epsilon() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "LESeddyViscosity.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C b/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C index dd99d718f9..0e1f41d7fb 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C +++ b/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C @@ -47,7 +47,7 @@ kEqn::kEqn const word& type ) : - eddyViscosity > + LESeddyViscosity ( type, alpha, @@ -80,16 +80,6 @@ kEqn::kEqn this->coeffDict_, 0.094 ) - ), - - Ce_ - ( - dimensioned::lookupOrAddToDict - ( - "Ce", - this->coeffDict_, - 1.048 - ) ) { if (type == typeName) @@ -105,10 +95,9 @@ kEqn::kEqn template bool kEqn::read() { - if (eddyViscosity >::read()) + if (LESeddyViscosity::read()) { Ck_.readIfPresent(this->coeffDict()); - Ce_.readIfPresent(this->coeffDict()); return true; } @@ -134,7 +123,7 @@ tmp kEqn::epsilon() const IOobject::NO_READ, IOobject::NO_WRITE ), - Ce_*k()*sqrt(k())/this->delta() + this->Ce_*k()*sqrt(k())/this->delta() ) ); } @@ -179,7 +168,7 @@ void kEqn::correct() const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - eddyViscosity >::correct(); + LESeddyViscosity::correct(); volScalarField divU(fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U))); @@ -196,7 +185,7 @@ void kEqn::correct() == alpha*rho*G - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_) - - fvm::Sp(Ce_*alpha*rho*sqrt(k_)/this->delta(), k_) + - fvm::Sp(this->Ce_*alpha*rho*sqrt(k_)/this->delta(), k_) + kSource() ); diff --git a/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.H b/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.H index 838655d00a..47525e4601 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.H +++ b/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.H @@ -66,7 +66,7 @@ SourceFiles #define kEqn_H #include "LESModel.H" -#include "eddyViscosity.H" +#include "LESeddyViscosity.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -82,7 +82,7 @@ namespace LESModels template class kEqn : - public eddyViscosity > + public LESeddyViscosity { // Private Member Functions @@ -98,7 +98,6 @@ protected: volScalarField k_; dimensionedScalar Ck_; - dimensionedScalar Ce_; // Protected Member Functions