Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs 2013-08-05 16:39:01 +01:00
commit 9541f6da85
9 changed files with 262 additions and 41 deletions

View File

@ -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)
);

View File

@ -58,7 +58,6 @@
{
tphiAlphaCorr() -= tphiAlpha();
volScalarField alpha100("alpha100", alpha10);
alpha10 = alpha1;

View File

@ -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

View File

@ -47,7 +47,7 @@ Smagorinsky<BasicTurbulenceModel>::Smagorinsky
const word& type
)
:
eddyViscosity<LESModel<BasicTurbulenceModel> >
LESeddyViscosity<BasicTurbulenceModel>
(
type,
alpha,
@ -67,16 +67,6 @@ Smagorinsky<BasicTurbulenceModel>::Smagorinsky
this->coeffDict_,
0.094
)
),
Ce_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ce",
this->coeffDict_,
1.048
)
)
{
if (type == typeName)
@ -92,10 +82,9 @@ Smagorinsky<BasicTurbulenceModel>::Smagorinsky
template<class BasicTurbulenceModel>
bool Smagorinsky<BasicTurbulenceModel>::read()
{
if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read())
if (LESeddyViscosity<BasicTurbulenceModel>::read())
{
Ck_.readIfPresent(this->coeffDict());
Ce_.readIfPresent(this->coeffDict());
return true;
}
@ -114,7 +103,7 @@ tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::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<volScalarField> Smagorinsky<BasicTurbulenceModel>::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<BasicTurbulenceModel>::correctNut()
template<class BasicTurbulenceModel>
void Smagorinsky<BasicTurbulenceModel>::correct()
{
eddyViscosity<LESModel<BasicTurbulenceModel> >::correct();
LESeddyViscosity<BasicTurbulenceModel>::correct();
correctNut();
}

View File

@ -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 BasicTurbulenceModel>
class Smagorinsky
:
public eddyViscosity<LESModel<BasicTurbulenceModel> >
public LESeddyViscosity<BasicTurbulenceModel>
{
// Private Member Functions
@ -92,7 +92,6 @@ protected:
// Protected data
dimensionedScalar Ck_;
dimensionedScalar Ce_;
// Protected Member Functions

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "LESeddyViscosity.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace LESModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
LESeddyViscosity<BasicTurbulenceModel>::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<LESModel<BasicTurbulenceModel> >
(
type,
alpha,
rho,
U,
alphaPhi,
phi,
transport,
propertiesName
),
Ce_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ce",
this->coeffDict_,
1.048
)
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
bool LESeddyViscosity<BasicTurbulenceModel>::read()
{
if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read())
{
Ce_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
template<class BasicTurbulenceModel>
tmp<volScalarField> LESeddyViscosity<BasicTurbulenceModel>::epsilon() const
{
return tmp<volScalarField>
(
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
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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 BasicTurbulenceModel>
class LESeddyViscosity
:
public eddyViscosity<LESModel<BasicTurbulenceModel> >
{
// 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<volScalarField> epsilon() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "LESeddyViscosity.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -47,7 +47,7 @@ kEqn<BasicTurbulenceModel>::kEqn
const word& type
)
:
eddyViscosity<LESModel<BasicTurbulenceModel> >
LESeddyViscosity<BasicTurbulenceModel>
(
type,
alpha,
@ -80,16 +80,6 @@ kEqn<BasicTurbulenceModel>::kEqn
this->coeffDict_,
0.094
)
),
Ce_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ce",
this->coeffDict_,
1.048
)
)
{
if (type == typeName)
@ -105,10 +95,9 @@ kEqn<BasicTurbulenceModel>::kEqn
template<class BasicTurbulenceModel>
bool kEqn<BasicTurbulenceModel>::read()
{
if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read())
if (LESeddyViscosity<BasicTurbulenceModel>::read())
{
Ck_.readIfPresent(this->coeffDict());
Ce_.readIfPresent(this->coeffDict());
return true;
}
@ -134,7 +123,7 @@ tmp<volScalarField> kEqn<BasicTurbulenceModel>::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<BasicTurbulenceModel>::correct()
const volVectorField& U = this->U_;
volScalarField& nut = this->nut_;
eddyViscosity<LESModel<BasicTurbulenceModel> >::correct();
LESeddyViscosity<BasicTurbulenceModel>::correct();
volScalarField divU(fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U)));
@ -196,7 +185,7 @@ void kEqn<BasicTurbulenceModel>::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()
);

View File

@ -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 BasicTurbulenceModel>
class kEqn
:
public eddyViscosity<LESModel<BasicTurbulenceModel> >
public LESeddyViscosity<BasicTurbulenceModel>
{
// Private Member Functions
@ -98,7 +98,6 @@ protected:
volScalarField k_;
dimensionedScalar Ck_;
dimensionedScalar Ce_;
// Protected Member Functions