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

This commit is contained in:
mattijs
2011-07-25 09:38:17 +01:00
39 changed files with 1411 additions and 454 deletions

View File

@ -1,126 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 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 "error.H"
#include "block.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
label block::vtxLabel(label a, label b, label c)
{
return (a + b*(BlockDef.xDim() + 1)
+ c*(BlockDef.xDim() + 1)*(BlockDef.yDim() + 1));
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from description
block::block(const blockDescriptor& definition)
:
BlockDef(definition),
Vertices
(
((BlockDef.xDim() + 1)*(BlockDef.yDim() + 1)*(BlockDef.zDim() + 1))
),
Cells
(
(BlockDef.xDim()*BlockDef.yDim()*BlockDef.zDim())
),
BoundaryPatches(6)
{
// create points
blockPoints();
// generate internal cells
blockCells();
// generate boundary patches
blockBoundary();
}
// as copy
block::block(const block& original)
:
BlockDef(original.blockDef()),
Vertices(original.points()),
Cells(original.cells()),
BoundaryPatches(original.boundaryPatches())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
block::~block()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const blockDescriptor& block::blockDef() const
{
return BlockDef;
}
const pointField& block::points() const
{
return Vertices;
}
const labelListList& block::cells() const
{
return Cells;
}
const labelListListList& block::boundaryPatches() const
{
return BoundaryPatches;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Ostream& operator<<(Ostream& os, const block& b)
{
os << b.Vertices << nl
<< b.Cells << nl
<< b.BoundaryPatches << endl;
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,138 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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 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::block
Description
Creates a single block of cells from point coordinates,
numbers of cells in each direction and expansion ratio
SourceFiles
block.C
blockIO.C
\*---------------------------------------------------------------------------*/
#ifndef block_H
#define block_H
#include "pointField.H"
#include "labelList.H"
#include "blockDescriptor.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Istream;
class Ostream;
/*---------------------------------------------------------------------------*\
Class block Declaration
\*---------------------------------------------------------------------------*/
class block
{
// Private data
//- block definition
blockDescriptor BlockDef;
//- list of vertices
pointField Vertices;
//- list of cells
labelListList Cells;
//- boundary patches
labelListListList BoundaryPatches;
// Private Member Functions
label vtxLabel(label i, label j, label k);
void blockPoints();
void blockCells();
void blockBoundary();
public:
// Constructors
//- from the block definition
block(const blockDescriptor&);
//- as copy
block(const block&);
//- clone function
autoPtr<block> clone() const
{
notImplemented("block::clone()");
return autoPtr<block>(NULL);
}
//- Destructor
~block();
// Member Functions
// Access
const blockDescriptor& blockDef() const;
const pointField& points() const;
const labelListList& cells() const;
const labelListListList& boundaryPatches() const;
// IOstream Operators
friend Ostream& operator<<(Ostream&, const block&);
};
inline Istream& operator>>(Istream& is, block*)
{
notImplemented("Istream& operator>>(Istream& is, block*)");
return is;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -5,7 +5,7 @@ GenSGSStress/GenSGSStress.C
Smagorinsky/Smagorinsky.C Smagorinsky/Smagorinsky.C
oneEqEddy/oneEqEddy.C oneEqEddy/oneEqEddy.C
lowReOneEqEddy/lowReOneEqEddy.C lowReOneEqEddy/lowReOneEqEddy.C
dynOneEqEddy/dynOneEqEddy.C homogeneousDynOneEqEddy/homogeneousDynOneEqEddy.C
DeardorffDiffStress/DeardorffDiffStress.C DeardorffDiffStress/DeardorffDiffStress.C
SpalartAllmaras/SpalartAllmaras.C SpalartAllmaras/SpalartAllmaras.C

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "dynOneEqEddy.H" #include "homogeneousDynOneEqEddy.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -37,12 +37,15 @@ namespace LESModels
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(dynOneEqEddy, 0); defineTypeNameAndDebug(homogeneousDynOneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary); addToRunTimeSelectionTable(LESModel, homogeneousDynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D) void homogeneousDynOneEqEddy::updateSubGridScaleFields
(
const volSymmTensorField& D
)
{ {
muSgs_ = ck_(D)*rho()*sqrt(k_)*delta(); muSgs_ = ck_(D)*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions(); muSgs_.correctBoundaryConditions();
@ -52,7 +55,10 @@ void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D)
} }
dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const dimensionedScalar homogeneousDynOneEqEddy::ck_
(
const volSymmTensorField& D
) const
{ {
volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))); volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))));
@ -67,7 +73,10 @@ dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const
} }
dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const dimensionedScalar homogeneousDynOneEqEddy::ce_
(
const volSymmTensorField& D
) const
{ {
volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))); volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))));
@ -91,7 +100,7 @@ dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
dynOneEqEddy::dynOneEqEddy homogeneousDynOneEqEddy::homogeneousDynOneEqEddy
( (
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
@ -128,7 +137,7 @@ dynOneEqEddy::dynOneEqEddy
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) void homogeneousDynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
{ {
const volTensorField& gradU = tgradU(); const volTensorField& gradU = tgradU();
@ -158,7 +167,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
} }
bool dynOneEqEddy::read() bool homogeneousDynOneEqEddy::read()
{ {
if (GenEddyVisc::read()) if (GenEddyVisc::read())
{ {

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::compressible::LESModels::dynOneEqEddy Foam::compressible::LESModels::homogeneousDynOneEqEddy
Description Description
One Equation Eddy Viscosity Model for compressible flows. One Equation Eddy Viscosity Model for compressible flows.
@ -46,12 +46,12 @@ Description
\endverbatim \endverbatim
SourceFiles SourceFiles
dynOneEqEddy.C homogeneousDynOneEqEddy.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef compressibleDynOneEqEddy_H #ifndef compressibleHomogeneousDynOneEqEddy_H
#define compressibleDynOneEqEddy_H #define compressibleHomogeneousDynOneEqEddy_H
#include "GenEddyVisc.H" #include "GenEddyVisc.H"
#include "LESfilter.H" #include "LESfilter.H"
@ -66,10 +66,10 @@ namespace LESModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class dynOneEqEddy Declaration Class homogeneousDynOneEqEddy Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class dynOneEqEddy class homogeneousDynOneEqEddy
: :
public GenEddyVisc public GenEddyVisc
{ {
@ -91,20 +91,20 @@ class dynOneEqEddy
dimensionedScalar ce_(const volSymmTensorField& D) const; dimensionedScalar ce_(const volSymmTensorField& D) const;
// Disallow default bitwise copy construct and assignment // Disallow default bitwise copy construct and assignment
dynOneEqEddy(const dynOneEqEddy&); homogeneousDynOneEqEddy(const homogeneousDynOneEqEddy&);
dynOneEqEddy& operator=(const dynOneEqEddy&); homogeneousDynOneEqEddy& operator=(const homogeneousDynOneEqEddy&);
public: public:
//- Runtime type information //- Runtime type information
TypeName("dynOneEqEddy"); TypeName("homogeneousDynOneEqEddy");
// Constructors // Constructors
//- Constructor from components //- Constructor from components
dynOneEqEddy homogeneousDynOneEqEddy
( (
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
@ -116,7 +116,7 @@ public:
//- Destructor //- Destructor
virtual ~dynOneEqEddy() virtual ~homogeneousDynOneEqEddy()
{} {}

View File

@ -110,7 +110,7 @@ void Foam::porousBafflePressureFvPatchField<Foam::scalar>::updateCoeffs()
<< endl; << endl;
} }
jumpCyclicFvPatchField<scalar>::updateCoeffs(); fixedJumpFvPatchField<scalar>::updateCoeffs();
} }

View File

@ -12,8 +12,8 @@ SpalartAllmarasIDDES/SpalartAllmarasIDDES.C
SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C
oneEqEddy/oneEqEddy.C oneEqEddy/oneEqEddy.C
homogeneousDynOneEqEddy/homogeneousDynOneEqEddy.C
dynOneEqEddy/dynOneEqEddy.C dynOneEqEddy/dynOneEqEddy.C
locDynOneEqEddy/locDynOneEqEddy.C
Smagorinsky/Smagorinsky.C Smagorinsky/Smagorinsky.C
homogeneousDynSmagorinsky/homogeneousDynSmagorinsky.C homogeneousDynSmagorinsky/homogeneousDynSmagorinsky.C
LRRDiffStress/LRRDiffStress.C LRRDiffStress/LRRDiffStress.C

View File

@ -25,8 +25,8 @@ Class
Foam::incompressible::LESModels::dynLagrangian Foam::incompressible::LESModels::dynLagrangian
Description Description
Lagrangian Two Equations Eddy Viscosity Model for incompressible Dynamic eddy-viscosity model with Lagrangian averaging for incompressible
flows flow
\verbatim \verbatim
B = 2/3*k*I - 2*nuSgs*dev(D) B = 2/3*k*I - 2*nuSgs*dev(D)
@ -57,9 +57,13 @@ Description
\endverbatim \endverbatim
Reference: Reference:
1. Charles Meneveau, Thomas Lund and William Cabot \verbatim
"A Lagrangian dynamic subgrid-scale model of turbulence" "A Lagrangian dynamic subgrid-scale model of turbulence"
J. Fluid Mech (1996), vol 319, pp. 353-385 Charles Meneveau,
Thomas Lund,
William Cabot,
J. Fluid Mech (1996), vol 319, pp. 353-385
\endverbatim
SourceFiles SourceFiles
dynLagrangian.C dynLagrangian.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,68 +42,61 @@ addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D) void dynOneEqEddy::updateSubGridScaleFields
(
const volSymmTensorField& D,
const volScalarField& KK
)
{ {
nuSgs_ = ck(D)*sqrt(k_)*delta(); nuSgs_ = ck(D, KK)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions(); nuSgs_.correctBoundaryConditions();
} }
dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const volScalarField dynOneEqEddy::ck
(
const volSymmTensorField& D,
const volScalarField& KK
) const
{ {
tmp<volScalarField> KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); const volSymmTensorField LL
(
simpleFilter_(dev(filter_(sqr(U())) - (sqr(filter_(U())))))
);
const volSymmTensorField MM const volSymmTensorField MM
( (
delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)) simpleFilter_(-2.0*delta()*pow(KK, 0.5)*filter_(D))
); );
dimensionedScalar MMMM = average(magSqr(MM)); const volScalarField ck
(
simpleFilter_(0.5*(LL && MM))
/(
simpleFilter_(magSqr(MM))
+ dimensionedScalar("small", sqr(MM.dimensions()), VSMALL)
)
);
if (MMMM.value() > VSMALL) tmp<volScalarField> tfld = 0.5*(mag(ck) + ck);
{ return tfld();
tmp<volSymmTensorField> LL = dev(filter_(sqr(U())) - sqr(filter_(U())));
return average(LL && MM)/MMMM;
}
else
{
return 0.0;
}
} }
dimensionedScalar dynOneEqEddy::ce(const volSymmTensorField& D) const volScalarField dynOneEqEddy::ce
(
const volSymmTensorField& D,
const volScalarField& KK
) const
{ {
const volScalarField KK const volScalarField ce
( (
0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))) simpleFilter_(nuEff()*(filter_(magSqr(D)) - magSqr(filter_(D))))
/simpleFilter_(pow(KK, 1.5)/(2.0*delta()))
); );
const volScalarField mm tmp<volScalarField> tfld = 0.5*(mag(ce) + ce);
( return tfld();
pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta()
);
dimensionedScalar mmmm = average(magSqr(mm));
if (mmmm.value() > VSMALL)
{
tmp<volScalarField> ee =
(
2*delta()*ck(D)
* (
filter_(sqrt(k_)*magSqr(D))
- 2*sqrt(KK + filter_(k_))*magSqr(filter_(D))
)
);
return average(ee*mm)/mmmm;
}
else
{
return 0.0;
}
} }
@ -134,12 +127,14 @@ dynOneEqEddy::dynOneEqEddy
mesh_ mesh_
), ),
simpleFilter_(U.mesh()),
filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_()) filter_(filterPtr_())
{ {
bound(k_, kMin_); bound(k_, kMin_);
updateSubGridScaleFields(symm(fvc::grad(U))); const volScalarField KK(0.5*(filter_(magSqr(U)) - magSqr(filter_(U))));
updateSubGridScaleFields(symm(fvc::grad(U)), KK);
printCoeffs(); printCoeffs();
} }
@ -147,14 +142,15 @@ dynOneEqEddy::dynOneEqEddy
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) void dynOneEqEddy::correct(const tmp<volTensorField>& gradU)
{ {
const volTensorField& gradU = tgradU(); LESModel::correct(gradU);
GenEddyVisc::correct(gradU);
const volSymmTensorField D(symm(gradU)); const volSymmTensorField D(symm(gradU));
volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))));
KK.max(dimensionedScalar("small", KK.dimensions(), SMALL));
const volScalarField P(2.0*nuSgs_*magSqr(D)); const volScalarField P(2.0*nuSgs_*magSqr(D));
tmp<fvScalarMatrix> kEqn tmp<fvScalarMatrix> kEqn
@ -164,7 +160,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
- fvm::laplacian(DkEff(), k_) - fvm::laplacian(DkEff(), k_)
== ==
P P
- fvm::Sp(ce(D)*sqrt(k_)/delta(), k_) - fvm::Sp(ce(D, KK)*sqrt(k_)/delta(), k_)
); );
kEqn().relax(); kEqn().relax();
@ -172,7 +168,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, kMin_); bound(k_, kMin_);
updateSubGridScaleFields(D); updateSubGridScaleFields(D, KK);
} }

View File

@ -25,29 +25,36 @@ Class
Foam::incompressible::LESModels::dynOneEqEddy Foam::incompressible::LESModels::dynOneEqEddy
Description Description
One Equation Eddy Viscosity Model for incompressible flows. Localised Dynamic One Equation Eddy Viscosity Model for incompressible
flows
Eddy viscosity SGS model using a modeled balance equation to simulate Eddy viscosity SGS model using a modeled balance equation to simulate
the behaviour of k. the behaviour of k, hence
Thus
\verbatim \verbatim
d/dt(k) + div(U*k) - div(nuSgs*grad(k)) d/dt(k) + div(U*k) - div(nuSgs*grad(k))
= =
-B*L - ce*k^3/2/delta -B*L - ce*rho*k^3/2/delta
and and
B = 2/3*k*I - 2*nuSgs*dev(D) B = 2/3*k*I - 2*nuSgs*dev(D)
Beff = 2/3*k*I - 2*nuEff*dev(D) Beff = 2/3*k*I - 2*nuEff*dev(D)
where where
nuSgs = cD*delta^2*||D||
D = symm(grad(U));
nuSgs = ck*sqrt(k)*delta
nuEff = nuSgs + nu nuEff = nuSgs + nu
\endverbatim \endverbatim
A dynamic procedure is here applied to evaluate ck and ce
\verbatim
ck=<L.M>/<M.M>
and
ce=<e*m>/<m*m>
where
K = 0.5*(F(U.U) - F(U).F(U))
L = (F(U*U) - F(U)*F(U) - 0.33*K*I)
M = delta*(F(sqrt(k)*D) - 2*sqrt(K + filter(k))*F(D))
m = pow(K + F(k), 3.0/2.0)/(2*delta) - F(pow(k, 3.0/2.0))/delta
e = 2*delta*ck*(F(sqrt(k)*(D && D)) - 2*sqrt(K + F(k))*(F(D) && F(D)))/
\endverbatim
SourceFiles SourceFiles
dynOneEqEddy.C dynOneEqEddy.C
@ -57,6 +64,7 @@ SourceFiles
#define dynOneEqEddy_H #define dynOneEqEddy_H
#include "GenEddyVisc.H" #include "GenEddyVisc.H"
#include "simpleFilter.H"
#include "LESfilter.H" #include "LESfilter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -80,6 +88,7 @@ class dynOneEqEddy
volScalarField k_; volScalarField k_;
simpleFilter simpleFilter_;
autoPtr<LESfilter> filterPtr_; autoPtr<LESfilter> filterPtr_;
LESfilter& filter_; LESfilter& filter_;
@ -87,11 +96,24 @@ class dynOneEqEddy
// Private Member Functions // Private Member Functions
//- Update sub-grid scale fields //- Update sub-grid scale fields
void updateSubGridScaleFields(const volSymmTensorField& D); void updateSubGridScaleFields
(
const volSymmTensorField& D,
const volScalarField& KK
);
//- Calculate ck, ce by filtering the velocity field U. //- Calculate ck, ce by filtering the velocity field U.
dimensionedScalar ck(const volSymmTensorField& D) const; volScalarField ck
dimensionedScalar ce(const volSymmTensorField& D) const; (
const volSymmTensorField&,
const volScalarField&
) const;
volScalarField ce
(
const volSymmTensorField&,
const volScalarField&
) const;
// Disallow default bitwise copy construct and assignment // Disallow default bitwise copy construct and assignment
dynOneEqEddy(const dynOneEqEddy&); dynOneEqEddy(const dynOneEqEddy&);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "locDynOneEqEddy.H" #include "homogeneousDynOneEqEddy.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -37,72 +37,88 @@ namespace LESModels
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(locDynOneEqEddy, 0); defineTypeNameAndDebug(homogeneousDynOneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, locDynOneEqEddy, dictionary); addToRunTimeSelectionTable(LESModel, homogeneousDynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void locDynOneEqEddy::updateSubGridScaleFields void homogeneousDynOneEqEddy::updateSubGridScaleFields
( (
const volSymmTensorField& D, const volSymmTensorField& D
const volScalarField& KK
) )
{ {
nuSgs_ = ck(D, KK)*sqrt(k_)*delta(); nuSgs_ = ck(D)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions(); nuSgs_.correctBoundaryConditions();
} }
volScalarField locDynOneEqEddy::ck dimensionedScalar homogeneousDynOneEqEddy::ck
( (
const volSymmTensorField& D, const volSymmTensorField& D
const volScalarField& KK
) const ) const
{ {
const volSymmTensorField LL tmp<volScalarField> KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())));
(
simpleFilter_(dev(filter_(sqr(U())) - (sqr(filter_(U())))))
);
const volSymmTensorField MM const volSymmTensorField MM
( (
simpleFilter_(-2.0*delta()*pow(KK, 0.5)*filter_(D)) delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D))
); );
const volScalarField ck dimensionedScalar MMMM = average(magSqr(MM));
(
simpleFilter_(0.5*(LL && MM))
/(
simpleFilter_(magSqr(MM))
+ dimensionedScalar("small", sqr(MM.dimensions()), VSMALL)
)
);
tmp<volScalarField> tfld = 0.5*(mag(ck) + ck); if (MMMM.value() > VSMALL)
return tfld(); {
tmp<volSymmTensorField> LL = dev(filter_(sqr(U())) - sqr(filter_(U())));
return average(LL && MM)/MMMM;
}
else
{
return 0.0;
}
} }
volScalarField locDynOneEqEddy::ce dimensionedScalar homogeneousDynOneEqEddy::ce
( (
const volSymmTensorField& D, const volSymmTensorField& D
const volScalarField& KK
) const ) const
{ {
const volScalarField ce const volScalarField KK
( (
simpleFilter_(nuEff()*(filter_(magSqr(D)) - magSqr(filter_(D)))) 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))
/simpleFilter_(pow(KK, 1.5)/(2.0*delta()))
); );
tmp<volScalarField> tfld = 0.5*(mag(ce) + ce); const volScalarField mm
return tfld(); (
pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta()
);
dimensionedScalar mmmm = average(magSqr(mm));
if (mmmm.value() > VSMALL)
{
tmp<volScalarField> ee =
(
2*delta()*ck(D)
* (
filter_(sqrt(k_)*magSqr(D))
- 2*sqrt(KK + filter_(k_))*magSqr(filter_(D))
)
);
return average(ee*mm)/mmmm;
}
else
{
return 0.0;
}
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
locDynOneEqEddy::locDynOneEqEddy homogeneousDynOneEqEddy::homogeneousDynOneEqEddy
( (
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& phi, const surfaceScalarField& phi,
@ -127,14 +143,12 @@ locDynOneEqEddy::locDynOneEqEddy
mesh_ mesh_
), ),
simpleFilter_(U.mesh()),
filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_()) filter_(filterPtr_())
{ {
bound(k_, kMin_); bound(k_, kMin_);
const volScalarField KK(0.5*(filter_(magSqr(U)) - magSqr(filter_(U)))); updateSubGridScaleFields(symm(fvc::grad(U)));
updateSubGridScaleFields(symm(fvc::grad(U)), KK);
printCoeffs(); printCoeffs();
} }
@ -142,15 +156,14 @@ locDynOneEqEddy::locDynOneEqEddy
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU) void homogeneousDynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
{ {
LESModel::correct(gradU); const volTensorField& gradU = tgradU();
GenEddyVisc::correct(gradU);
const volSymmTensorField D(symm(gradU)); const volSymmTensorField D(symm(gradU));
volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))));
KK.max(dimensionedScalar("small", KK.dimensions(), SMALL));
const volScalarField P(2.0*nuSgs_*magSqr(D)); const volScalarField P(2.0*nuSgs_*magSqr(D));
tmp<fvScalarMatrix> kEqn tmp<fvScalarMatrix> kEqn
@ -160,7 +173,7 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU)
- fvm::laplacian(DkEff(), k_) - fvm::laplacian(DkEff(), k_)
== ==
P P
- fvm::Sp(ce(D, KK)*sqrt(k_)/delta(), k_) - fvm::Sp(ce(D)*sqrt(k_)/delta(), k_)
); );
kEqn().relax(); kEqn().relax();
@ -168,11 +181,11 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, kMin_); bound(k_, kMin_);
updateSubGridScaleFields(D, KK); updateSubGridScaleFields(D);
} }
bool locDynOneEqEddy::read() bool homogeneousDynOneEqEddy::read()
{ {
if (GenEddyVisc::read()) if (GenEddyVisc::read())
{ {

View File

@ -22,49 +22,41 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::incompressible::LESModels::locDynOneEqEddy Foam::incompressible::LESModels::homogeneousDynOneEqEddy
Description Description
Localised Dynamic One Equation Eddy Viscosity Model for incompressible One Equation Eddy Viscosity Model for incompressible flows.
flows
Eddy viscosity SGS model using a modeled balance equation to simulate Eddy viscosity SGS model using a modeled balance equation to simulate
the behaviour of k, hence the behaviour of k.
Thus
\verbatim \verbatim
d/dt(k) + div(U*k) - div(nuSgs*grad(k)) d/dt(k) + div(U*k) - div(nuSgs*grad(k))
= =
-B*L - ce*rho*k^3/2/delta -B*L - ce*k^3/2/delta
and and
B = 2/3*k*I - 2*nuSgs*dev(D) B = 2/3*k*I - 2*nuSgs*dev(D)
Beff = 2/3*k*I - 2*nuEff*dev(D) Beff = 2/3*k*I - 2*nuEff*dev(D)
where where
nuSgs = cD*delta^2*||D||
D = symm(grad(U));
nuSgs = ck*sqrt(k)*delta
nuEff = nuSgs + nu nuEff = nuSgs + nu
\endverbatim \endverbatim
A dynamic procedure is here applied to evaluate ck and ce
\verbatim
ck=<L.M>/<M.M>
and
ce=<e*m>/<m*m>
where
K = 0.5*(F(U.U) - F(U).F(U))
L = (F(U*U) - F(U)*F(U) - 0.33*K*I)
M = delta*(F(sqrt(k)*D) - 2*sqrt(K + filter(k))*F(D))
m = pow(K + F(k), 3.0/2.0)/(2*delta) - F(pow(k, 3.0/2.0))/delta
e = 2*delta*ck*(F(sqrt(k)*(D && D)) - 2*sqrt(K + F(k))*(F(D) && F(D)))/
\endverbatim
SourceFiles SourceFiles
locDynOneEqEddy.C homogeneousDynOneEqEddy.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef locDynOneEqEddy_H #ifndef homogeneousDynOneEqEddy_H
#define locDynOneEqEddy_H #define homogeneousDynOneEqEddy_H
#include "GenEddyVisc.H" #include "GenEddyVisc.H"
#include "simpleFilter.H"
#include "LESfilter.H" #include "LESfilter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -77,10 +69,10 @@ namespace LESModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class locDynOneEqEddy Declaration Class homogeneousDynOneEqEddy Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class locDynOneEqEddy class homogeneousDynOneEqEddy
: :
public GenEddyVisc public GenEddyVisc
{ {
@ -88,7 +80,6 @@ class locDynOneEqEddy
volScalarField k_; volScalarField k_;
simpleFilter simpleFilter_;
autoPtr<LESfilter> filterPtr_; autoPtr<LESfilter> filterPtr_;
LESfilter& filter_; LESfilter& filter_;
@ -96,39 +87,26 @@ class locDynOneEqEddy
// Private Member Functions // Private Member Functions
//- Update sub-grid scale fields //- Update sub-grid scale fields
void updateSubGridScaleFields void updateSubGridScaleFields(const volSymmTensorField& D);
(
const volSymmTensorField& D,
const volScalarField& KK
);
//- Calculate ck, ce by filtering the velocity field U. //- Calculate ck, ce by filtering the velocity field U.
volScalarField ck dimensionedScalar ck(const volSymmTensorField& D) const;
( dimensionedScalar ce(const volSymmTensorField& D) const;
const volSymmTensorField&,
const volScalarField&
) const;
volScalarField ce
(
const volSymmTensorField&,
const volScalarField&
) const;
// Disallow default bitwise copy construct and assignment // Disallow default bitwise copy construct and assignment
locDynOneEqEddy(const locDynOneEqEddy&); homogeneousDynOneEqEddy(const homogeneousDynOneEqEddy&);
locDynOneEqEddy& operator=(const locDynOneEqEddy&); homogeneousDynOneEqEddy& operator=(const homogeneousDynOneEqEddy&);
public: public:
//- Runtime type information //- Runtime type information
TypeName("locDynOneEqEddy"); TypeName("homogeneousDynOneEqEddy");
// Constructors // Constructors
//- Construct from components //- Construct from components
locDynOneEqEddy homogeneousDynOneEqEddy
( (
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& phi, const surfaceScalarField& phi,
@ -139,7 +117,7 @@ public:
//- Destructor //- Destructor
virtual ~locDynOneEqEddy() virtual ~homogeneousDynOneEqEddy()
{} {}

View File

@ -69,7 +69,7 @@ dimensionedScalar homogeneousDynSmagorinsky::cD
tmp<volSymmTensorField> LL = tmp<volSymmTensorField> LL =
dev(filter_(sqr(U())) - (sqr(filter_(U())))); dev(filter_(sqr(U())) - (sqr(filter_(U()))));
return average(LL && MM)/MMMM; return 0.5*average(LL && MM)/MMMM;
} }
else else
{ {

View File

@ -48,7 +48,7 @@ Description
and and
cD=<L.M>/<M.M>, cD=1/2*<L.M>/<M.M>,
where where

View File

@ -25,7 +25,7 @@ Class
Foam::incompressible::LESModels::kOmegaSSTSAS Foam::incompressible::LESModels::kOmegaSSTSAS
Description Description
kOmegaSSTSAS LES turbulence model for incompressible flows kOmegaSSTSAS LES turbulence model for incompressible flows
based on: based on:
"Evaluation of the SST-SAS model: channel flow, asymmetric diffuser "Evaluation of the SST-SAS model: channel flow, asymmetric diffuser
@ -44,6 +44,7 @@ Description
Heidelberg 2009. Heidelberg 2009.
F. R. Menter and Y. Egorov. F. R. Menter and Y. Egorov.
SourceFiles SourceFiles
kOmegaSSTSAS.C kOmegaSSTSAS.C

View File

@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
keepCases="damBreak" keepCases="damBreak damBreakPorousBaffle"
loseCases="damBreakFine" loseCases="damBreakFine"
for case in $keepCases for case in $keepCases
@ -15,6 +15,12 @@ do
then then
cp $case/0/alpha1.org $case/0/alpha1 cp $case/0/alpha1.org $case/0/alpha1
fi fi
if [ "$case" = "damBreakPorousBaffle" ]
then
cp $case/0/alpha1.org $case/0/alpha1
fi
done done
for case in $loseCases for case in $loseCases

View File

@ -23,6 +23,9 @@ setDamBreakFine ()
mv temp.$$ $controlDict mv temp.$$ $controlDict
} }
# Do damBreakPorousBaffle
(cd damBreakPorousBaffle && foamRunTutorials)
# Do damBreak # Do damBreak
(cd damBreak && foamRunTutorials) (cd damBreak && foamRunTutorials)
@ -43,4 +46,7 @@ cloneCase damBreak damBreakFine
runApplication reconstructPar runApplication reconstructPar
) )
# Do damBreakPorousBaffle
(cd damBreakPorousBaffle && foamRunTutorials)
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
leftWall
{
type fixedValue;
value uniform (0 0 0);
}
rightWall
{
type fixedValue;
value uniform (0 0 0);
}
lowerWall
{
type fixedValue;
value uniform (0 0 0);
}
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha1.org;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha1.org;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
leftWall
{
type epsilonWallFunction;
value uniform 0.1;
}
rightWall
{
type epsilonWallFunction;
value uniform 0.1;
}
lowerWall
{
type epsilonWallFunction;
value uniform 0.1;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ 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.1;
boundaryField
{
leftWall
{
type kqRWallFunction;
value uniform 0.1;
}
rightWall
{
type kqRWallFunction;
value uniform 0.1;
}
lowerWall
{
type kqRWallFunction;
value uniform 0.1;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type nutkWallFunction;
value uniform 0;
}
rightWall
{
type nutkWallFunction;
value uniform 0;
}
lowerWall
{
type nutkWallFunction;
value uniform 0;
}
atmosphere
{
type calculated;
value uniform 0;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 1 -1 -2 0 0 0 0 ];
internalField uniform 0;
boundaryField
{
leftWall
{
type buoyantPressure;
gradient uniform 0;
value uniform 0;
}
rightWall
{
type buoyantPressure;
gradient uniform 0;
value uniform 0;
}
lowerWall
{
type buoyantPressure;
gradient uniform 0;
value uniform 0;
}
atmosphere
{
type totalPressure;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
porous_half0
{
type porousBafflePressure;
patchType cyclic;
jump uniform 0;
D 700;
I 500;
length 1.05;
value uniform 0;
}
porous_half1
{
type porousBafflePressure;
patchType cyclic;
jump uniform 0;
D 700;
I 500;
length 1.05;
value uniform 0;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=`getApplication`
runApplication blockMesh
runApplication setFields
unset FOAM_SIGFPE
unset FOAM_SETNAN
# Create faceZones for porous baffles
runApplication topoSet
createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite > log.createBaffles 2>&1
runApplication changeDictionary
runApplication $application
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 -9.81 0 );
// ************************************************************************* //

View File

@ -0,0 +1,122 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.146;
vertices
(
(0 0 0)
(2 0 0)
(2.16438 0 0)
(4 0 0)
(0 0.32876 0)
(2 0.32876 0)
(2.16438 0.32876 0)
(4 0.32876 0)
(0 4 0)
(2 4 0)
(2.16438 4 0)
(4 4 0)
(0 0 0.1)
(2 0 0.1)
(2.16438 0 0.1)
(4 0 0.1)
(0 0.32876 0.1)
(2 0.32876 0.1)
(2.16438 0.32876 0.1)
(4 0.32876 0.1)
(0 4 0.1)
(2 4 0.1)
(2.16438 4 0.1)
(4 4 0.1)
);
blocks
(
hex (0 1 5 4 12 13 17 16) (23 8 1) simpleGrading (1 1 1)
hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1)
hex (4 5 9 8 16 17 21 20) (23 42 1) simpleGrading (1 1 1)
hex (5 6 10 9 17 18 22 21) (4 42 1) simpleGrading (1 1 1)
hex (6 7 11 10 18 19 23 22) (19 42 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
leftWall
{
type wall;
faces
(
(0 12 16 4)
(4 16 20 8)
);
}
rightWall
{
type wall;
faces
(
(7 19 15 3)
(11 23 19 7)
);
}
lowerWall
{
type wall;
faces
(
(0 1 13 12)
(1 5 17 13)
(5 6 18 17)
(2 14 18 6)
(2 3 15 14)
);
}
atmosphere
{
type patch;
faces
(
(8 20 21 9)
(9 21 22 10)
(10 22 23 11)
);
}
porous_half0
{
type cyclic;
faces ();
neighbourPatch porous_half1;
}
porous_half1
{
type cyclic;
faces ();
neighbourPatch porous_half0;
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
7
(
leftWall
{
type wall;
nFaces 50;
startFace 4419;
}
rightWall
{
type wall;
nFaces 50;
startFace 4469;
}
lowerWall
{
type wall;
nFaces 62;
startFace 4519;
}
atmosphere
{
type patch;
nFaces 46;
startFace 4581;
}
porous_half0
{
type cyclic;
nFaces 13;
startFace 4627;
matchTolerance 0.0001;
neighbourPatch porous_half1;
}
porous_half1
{
type cyclic;
nFaces 13;
startFace 4640;
matchTolerance 0.0001;
neighbourPatch porous_half0;
}
defaultFaces
{
type empty;
nFaces 4536;
startFace 4653;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
twoPhase
{
transportModel twoPhase;
phase1 phase1;
phase2 phase2;
}
phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 0;
}
BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 99.6;
n n [ 0 0 0 0 0 0 0 ] 0.1003;
}
}
phase2
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 0;
}
BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 99.6;
n n [ 0 0 0 0 0 0 0 ] 0.1003;
}
}
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RASModel;
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
faceSet cyclicFaces new boxToFace (0.3015 0.0493 -1) (0.3069 0.2077 1);
cellSet cyclicFacesSlaveCells new boxToCell (-1 0 -1) (0.305 0.31 1)
faceZoneSet cyclicZoneFaces new setsToFaceZone cyclicFaces cyclicFacesSlaveCells

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
p_rgh
{
boundaryField
{
porous_half0
{
type porousBafflePressure;
patchType cyclic;
D 700;
I 500;
length 1.05;
jump uniform 0
value uniform 0;
}
porous_half1
{
type porousBafflePressure;
patchType cyclic;
D 700;
I 500;
length 1.05;
jump uniform 0;
value uniform 0;
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 1;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.1;
maxAlphaCo 0.1;
maxDeltaT 1;
libs
(
"libturbulenceDerivedFvPatchFields.so"
);
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rho*phi,U) Gauss linear;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha;
}
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
pcorr
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
}
p_rghFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0;
}
"(U|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
"(U|k|epsilon)Final"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-07;
relTol 0;
}
}
PIMPLE
{
momentumPredictor yes;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 4;
cAlpha 2;
}
relaxation
{
U 1;
k 1;
epsilon 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha1 0
);
regions
(
boxToCell
{
box (0 0 -1) (0.1461 0.292 1);
fieldValues
(
volScalarFieldValue alpha1 1
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name cyclicFaces;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (0.3015 0.0493 -1) (0.3069 0.2077 1);
}
}
{
name cyclicFacesSlaveCells;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
box (-1 0 -1) (0.305 0.31 1);
}
}
{
name cyclicZoneFaces;
type faceZoneSet;
action new;
source setsToFaceZone;
sourceInfo
{
faceSet cyclicFaces;
cellSet cyclicFacesSlaveCells;
}
}
);
// ************************************************************************* //