Creation of OpenFOAM-dev repository 15/04/2008

This commit is contained in:
OpenFOAM-admin
2008-04-15 18:56:58 +01:00
commit 3170c7c0c9
9896 changed files with 4016171 additions and 0 deletions

View File

@ -0,0 +1,32 @@
XiModels/XiModel/XiModel.C
XiModels/XiModel/newXiModel.C
XiModels/fixed/fixed.C
XiModels/algebraic/algebraic.C
XiModels/transport/transport.C
XiModels/XiEqModels/XiEqModel/XiEqModel.C
XiModels/XiEqModels/XiEqModel/newXiEqModel.C
XiModels/XiEqModels/Gulder/Gulder.C
XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C
XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C
XiModels/XiGModels/XiGModel/XiGModel.C
XiModels/XiGModels/XiGModel/newXiGModel.C
XiModels/XiGModels/KTS/KTS.C
XiModels/XiGModels/instabilityG/instabilityG.C
PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
PDRModels/dragModels/PDRDragModel/PDRDragModel.C
PDRModels/dragModels/PDRDragModel/newPDRDragModel.C
PDRModels/dragModels/basic/basic.C
PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C
PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
PDRFoam.C
EXE = $(FOAM_USER_APPBIN)/PDRFoam

View File

@ -0,0 +1,29 @@
EXE_INC = \
-IXiModels/XiModel \
-IXiModels/XiEqModels/XiEqModel \
-IXiModels/XiGModels/XiGModel \
-IPDRModels/dragModels/PDRDragModel \
-IlaminarFlameSpeed/SCOPE \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude
EXE_LIBS = \
-lengine \
-lmeshTools \
-lcompressibleTurbulenceModels \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-ldynamicFvMesh

View File

@ -0,0 +1,137 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application
PDRFoam
Description
Compressible premixed/partially-premixed combustion solver with turbulence
modelling.
Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
equation or from an algebraic exression. Both approaches are
based on Gulder's flame speed correlation which has been shown
to be appropriate by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
model will be required.
For cases involving very lean Propane flames or other flames which are
very strain-sensitive, a transport equation for the laminar flame
speed is present. This equation is derived using heuristic arguments
involving the strain time scale and the strain-rate at extinction.
the transport velocity is the same as that for the Xi equation.
For large flames e.g. explosions additional modelling for the flame
wrinkling due to surface instabilities may be applied.
PDR (porosity/distributed resistance) modelling is included to handle
regions containing blockages which cannot be resolved by the mesh.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "hhuCombustionThermo.H"
#include "turbulenceModel.H"
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
#include "ignition.H"
#include "Switch.H"
#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readCombustionProperties.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setInitialDeltaT.H"
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;
# include "rhoEqn.H"
# include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "bEqn.H"
# include "ftEqn.H"
# include "huEqn.H"
# include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
# include "pEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "\nExecutionTime = "
<< runTime.elapsedCpuTime()
<< " s\n" << endl;
}
Info<< "\n end\n";
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,201 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application
PDRFoam
Description
Compressible premixed/partially-premixed combustion solver with turbulence
modelling.
Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
equation or from an algebraic exression. Both approaches are
based on Gulder's flame speed correlation which has been shown
to be appropriate by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
model will be required.
For cases involving very lean Propane flames or other flames which are
very strain-sensitive, a transport equation for the laminar flame
speed is present. This equation is derived using heuristic arguments
involving the strain time scale and the strain-rate at extinction.
the transport velocity is the same as that for the Xi equation.
For large flames e.g. explosions additional modelling for the flame
wrinkling due to surface instabilities may be applied.
PDR (porosity/distributed resistance) modelling is included to handle
regions containing blockages which cannot be resolved by the mesh.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "hhuCombustionThermo.H"
#include "turbulenceModel.H"
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
#include "ignition.H"
#include "Switch.H"
#include "bound.H"
#include "dynamicRefineFvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "readCombustionProperties.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "readTimeControls.H"
# include "setInitialDeltaT.H"
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;
// Indicators for refinement. Note: before runTime++
// only for postprocessing reasons.
tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
volScalarField normalisedGradP
(
"normalisedGradP",
tmagGradP()/max(tmagGradP())
);
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
tmagGradP.clear();
bool meshChanged = false;
{
// Make the fluxes absolute
fvc::makeAbsolute(phi, rho, U);
// Test : disable refinement for some cells
PackedList<1>& protectedCell =
refCast<dynamicRefineFvMesh>(mesh).protectedCell();
if (protectedCell.size() == 0)
{
protectedCell.setSize(mesh.nCells());
protectedCell = 0;
}
forAll(betav, cellI)
{
if (betav[cellI] < 0.99)
{
protectedCell[cellI] = 1;
}
}
//volScalarField pIndicator("pIndicator",
// p*(fvc::laplacian(p))
// / (
// magSqr(fvc::grad(p))
// + dimensionedScalar
// (
// "smallish",
// sqr(p.dimensions()/dimLength),
// 1E-6
// )
// ));
//pIndicator.writeOpt() = IOobject::AUTO_WRITE;
// Flux estimate for introduced faces.
volVectorField rhoU("rhoU", rho*U);
// Do any mesh changes
meshChanged = mesh.update();
// if (mesh.moving() || meshChanged)
// {
//# include "correctPhi.H"
// }
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, rho, U);
}
# include "rhoEqn.H"
# include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "bEqn.H"
# include "ftEqn.H"
# include "huEqn.H"
# include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
# include "pEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "\nExecutionTime = "
<< runTime.elapsedCpuTime()
<< " s\n" << endl;
}
Info<< "\n end\n";
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,154 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "basicXiSubXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::basicSubGrid::basicSubGrid
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
N_
(
IOobject
(
"N",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "N"),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
ns_
(
IOobject
(
"ns",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "ns"),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
B_
(
IOobject
(
"B",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "B"),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
Lobs_
(
IOobject
(
"Lobs",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "Lobs"),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiEqModels::basicSubGrid::~basicSubGrid()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
{
const objectRegistry& db = Su_.db();
const volVectorField& U = db.lookupObject<volVectorField>("U");
volScalarField magU = mag(U);
volVectorField Uhat =
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4));
volScalarField n = max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4));
volScalarField b = (Uhat & B_ & Uhat)/n;
volScalarField up = sqrt((2.0/3.0)*turbulence_.k());
volScalarField XiSubEq =
scalar(1)
+ max(2.2*sqrt(b), min(0.34*magU/up, scalar(1.6)))
*min(0.25*n, scalar(1));
return XiSubEq*XiEqModel_->XiEq();
}
bool Foam::XiEqModels::basicSubGrid::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
return XiEqModel_->read(XiEqModelCoeffs_);
}
// ************************************************************************* //

View File

@ -0,0 +1,126 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
basicSubGrid
Description
Basic sub-grid obstacle flame-wrinking enhancement factor model.
Details supplied by J Puttock 2/7/06.
SourceFiles
basicSubGrid.C
\*---------------------------------------------------------------------------*/
#ifndef basicSubGrid_H
#define basicSubGrid_H
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class basicSubGrid Declaration
\*---------------------------------------------------------------------------*/
class basicSubGrid
:
public XiEqModel
{
// Private data
//- Count
volScalarField N_;
//- Sub-count
volSymmTensorField ns_;
//- tblock
volSymmTensorField B_;
//- Typical obstacle diameters per cell
volScalarField Lobs_;
//- Equilibrium Xi model due to turbulence
autoPtr<XiEqModel> XiEqModel_;
// Private Member Functions
//- Disallow copy construct
basicSubGrid(const basicSubGrid&);
//- Disallow default bitwise assignment
void operator=(const basicSubGrid&);
public:
//- Runtime type information
TypeName("basicSubGrid");
// Constructors
//- Construct from components
basicSubGrid
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~basicSubGrid();
// Member Functions
//- Return the flame-wrinking XiEq
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiEqModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "basicXiSubG.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModels::basicSubGrid::basicSubGrid
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
k1(readScalar(XiGModelCoeffs_.lookup("k1"))),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiGModels::basicSubGrid::~basicSubGrid()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
{
const objectRegistry& db = Su_.db();
const volVectorField& U = db.lookupObject<volVectorField>("U");
const volScalarField& N = db.lookupObject<volScalarField>("N");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
tmp<volScalarField> tGtot = XiGModel_->G();
volScalarField& Gtot = tGtot();
forAll(N, celli)
{
if (N[celli] > 1e-3)
{
Gtot[celli] += k1*mag(U[celli])/Lobs[celli];
}
}
return tGtot;
}
Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::Db() const
{
const objectRegistry& db = Su_.db();
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
return XiGModel_->Db()
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*Lobs)*Lobs/(mgb*Lobs + 1.0);
}
bool Foam::XiGModels::basicSubGrid::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.lookup("k1") >> k1;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
basicSubGrid
Description
Basic sub-grid obstacle flame-wrinking generation rate coefficient model.
Details supplied by J Puttock 2/7/06.
SourceFiles
basicSubGrid.C
\*---------------------------------------------------------------------------*/
#ifndef basicSubGrid_H
#define basicSubGrid_H
#include "XiGModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
/*---------------------------------------------------------------------------*\
Class basicSubGrid Declaration
\*---------------------------------------------------------------------------*/
class basicSubGrid
:
public XiGModel
{
// Private data
//- Sub-grid generation rate coefficient
scalar k1;
//- Xi generation rate model due to turbulence
autoPtr<XiGModel> XiGModel_;
// Private Member Functions
//- Disallow copy construct
basicSubGrid(const basicSubGrid&);
//- Disallow default bitwise assignment
void operator=(const basicSubGrid&);
public:
//- Runtime type information
TypeName("basicSubGridG");
// Constructors
//- Construct from components
basicSubGrid
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~basicSubGrid();
// Member Functions
//- Return the flame-wrinking generation rate
virtual tmp<volScalarField> G() const;
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiGProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiGModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "PDRDragModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(PDRDragModel, 0);
defineRunTimeSelectionTable(PDRDragModel, dictionary);
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::PDRDragModel::PDRDragModel
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
)
:
regIOobject
(
IOobject
(
"PDRDragModel",
U.time().constant(),
U.db()
)
),
PDRDragModelCoeffs_
(
PDRProperties.subDict
(
word(PDRProperties.lookup("PDRDragModel")) + "Coeffs"
)
),
turbulence_(turbulence),
rho_(rho),
U_(U),
phi_(phi),
on_(PDRDragModelCoeffs_.lookup("drag"))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::PDRDragModel::~PDRDragModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
{
PDRDragModelCoeffs_ = PDRProperties.subDict(type() + "Coeffs");
PDRDragModelCoeffs_.lookup("PDRDragModel") >> on_;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,177 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
PDRDragModel
Description
Base-class for sub-grid obstacle drag models.
SourceFiles
PDRDragModel.C
\*---------------------------------------------------------------------------*/
#ifndef PDRDragModel_H
#define PDRDragModel_H
#include "IOdictionary.H"
#include "hhuCombustionThermo.H"
#include "turbulenceModel.H"
#include "multivariateSurfaceInterpolationScheme.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class PDRDragModel Declaration
\*---------------------------------------------------------------------------*/
class PDRDragModel
:
public regIOobject
{
protected:
// Protected data
dictionary PDRDragModelCoeffs_;
const compressible::turbulenceModel& turbulence_;
const volScalarField& rho_;
const volVectorField& U_;
const surfaceScalarField& phi_;
Switch on_;
private:
// Private Member Functions
//- Disallow copy construct
PDRDragModel(const PDRDragModel&);
//- Disallow default bitwise assignment
void operator=(const PDRDragModel&);
public:
//- Runtime type information
TypeName("PDRDragModel");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
PDRDragModel,
dictionary,
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
),
(
PDRProperties,
turbulence,
rho,
U,
phi
)
);
// Selectors
//- Return a reference to the selected Xi model
static autoPtr<PDRDragModel> New
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
);
// Constructors
//- Construct from components
PDRDragModel
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
);
// Destructor
virtual ~PDRDragModel();
// Member Functions
//- Return true if the drag model is switched on
bool on() const
{
return on_;
}
//- Return the momentum drag coefficient
virtual tmp<volSymmTensorField> Dcu() const = 0;
//- Return the momentum drag turbulence generation rate
virtual tmp<volScalarField> Gk() const = 0;
//- Update properties from given dictionary
virtual bool read(const dictionary& PDRProperties) = 0;
virtual bool writeData(Ostream&) const
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "PDRDragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
)
{
word PDRDragModelTypeName = PDRProperties.lookup("PDRDragModel");
Info<< "Selecting flame-wrinkling model " << PDRDragModelTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(PDRDragModelTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"PDRDragModel::New"
) << "Unknown PDRDragModel type "
<< PDRDragModelTypeName << endl << endl
<< "Valid PDRDragModels are : " << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<PDRDragModel>
(cstrIter()(PDRProperties, turbulence, rho, U, phi));
}
// ************************************************************************* //

View File

@ -0,0 +1,145 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "basic.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace PDRDragModels
{
defineTypeNameAndDebug(basic, 0);
addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::PDRDragModels::basic::basic
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
)
:
PDRDragModel(PDRProperties, turbulence, rho, U, phi),
Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")),
Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")),
Aw2_
(
"Aw2",
sqr
(
volScalarField
(
IOobject
(
"Aw",
U_.mesh().time().findInstance(polyMesh::meshSubDir, "Aw"),
polyMesh::meshSubDir,
U_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
U_.mesh()
)
)
),
CR_
(
IOobject
(
"CR",
U_.mesh().time().findInstance(polyMesh::meshSubDir, "CR"),
polyMesh::meshSubDir,
U_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
U_.mesh()
),
CT_
(
IOobject
(
"CT",
U_.mesh().time().findInstance(polyMesh::meshSubDir, "CT"),
polyMesh::meshSubDir,
U_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
U_.mesh()
)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::PDRDragModels::basic::~basic()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
{
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
return rho_*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_;
}
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
{
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
return
rho_*mag(U_)*(U_ & CT_ & U_)
+ Csk*betav*turbulence_.muEff()*Aw2_*magSqr(U_);
}
bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
{
PDRDragModel::read(PDRProperties);
PDRDragModelCoeffs_.lookup("Csu") >> Csu.value();
PDRDragModelCoeffs_.lookup("Csk") >> Csk.value();
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,123 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
basic
Description
Basic sub-grid obstacle drag model.
Details supplied by J Puttock 2/7/06.
SourceFiles
basic.C
\*---------------------------------------------------------------------------*/
#ifndef basic_H
#define basic_H
#include "PDRDragModel.H"
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace PDRDragModels
{
/*---------------------------------------------------------------------------*\
Class basic Declaration
\*---------------------------------------------------------------------------*/
class basic
:
public PDRDragModel
{
// Private data
dimensionedScalar Csu;
dimensionedScalar Csk;
volScalarField Aw2_;
volSymmTensorField CR_;
volSymmTensorField CT_;
// Private Member Functions
//- Disallow copy construct
basic(const basic&);
//- Disallow default bitwise assignment
void operator=(const basic&);
public:
//- Runtime type information
TypeName("basic");
// Constructors
//- Construct from components
basic
(
const dictionary& PDRProperties,
const compressible::turbulenceModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
);
// Destructor
virtual ~basic();
// Member Functions
//- Return the momentum drag coefficient
virtual tmp<volSymmTensorField> Dcu() const;
//- Return the momentum drag turbulence generation rate
virtual tmp<volScalarField> Gk() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& PDRProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace PDRDragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,266 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "PDRkEpsilon.H"
#include "wallFvPatch.H"
#include "PDRDragModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace turbulenceModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(PDRkEpsilon, 0);
addToRunTimeSelectionTable(turbulenceModel, PDRkEpsilon, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
PDRkEpsilon::PDRkEpsilon
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
)
:
turbulenceModel(typeName, rho, U, phi, thermophysicalModel),
Cmu(turbulenceModelCoeffs_.lookup("Cmu")),
C1(turbulenceModelCoeffs_.lookup("C1")),
C2(turbulenceModelCoeffs_.lookup("C2")),
alphak(turbulenceModelCoeffs_.lookup("alphak")),
alphaEps(turbulenceModelCoeffs_.lookup("alphaEps")),
alphah(turbulenceModelCoeffs_.lookup("alphah")),
k_
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
),
epsilon_
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
),
mut_
(
IOobject
(
"mut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
Cmu*rho_*sqr(k_)/(epsilon_ + epsilonSmall_)
)
{
# include "wallViscosityI.H"
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<volSymmTensorField> PDRkEpsilon::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))),
k_.boundaryField().types()
)
);
}
tmp<volSymmTensorField> PDRkEpsilon::devRhoReff() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"devRhoReff",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
-muEff()*dev(twoSymm(fvc::grad(U_)))
)
);
}
tmp<fvVectorMatrix> PDRkEpsilon::divDevRhoReff(volVectorField& U) const
{
return
(
- fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
);
}
bool PDRkEpsilon::read()
{
if (turbulenceModel::read())
{
turbulenceModelCoeffs_.lookup("Cmu") >> Cmu;
turbulenceModelCoeffs_.lookup("C1") >> C1;
turbulenceModelCoeffs_.lookup("C2") >> C2;
turbulenceModelCoeffs_.lookup("alphak") >> alphak;
turbulenceModelCoeffs_.lookup("alphaEps") >> alphaEps;
turbulenceModelCoeffs_.lookup("alphah") >> alphah;
return true;
}
else
{
return false;
}
}
void PDRkEpsilon::correct()
{
if (!turbulence_)
{
// Re-calculate viscosity
mut_ = rho_*Cmu*sqr(k_)/(epsilon_ + epsilonSmall_);
# include "wallViscosityI.H"
return;
}
turbulenceModel::correct();
volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_));
if (mesh_.moving())
{
divU += fvc::div(mesh_.phi());
}
tmp<volTensorField> tgradU = fvc::grad(U_);
volScalarField G = 2*mut_*(tgradU() && dev(symm(tgradU())));
tgradU.clear();
// Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
const PDRDragModel& drag =
U_.db().lookupObject<PDRDragModel>("PDRDragModel");
volScalarField GR = drag.Gk();
# include "wallFunctionsI.H"
// Dissipation equation
tmp<fvScalarMatrix> epsEqn
(
betav*fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1*(betav*G + GR)*epsilon_/k_
- fvm::SuSp(((2.0/3.0)*C1)*betav*rho_*divU, epsilon_)
- fvm::Sp(C2*betav*rho_*epsilon_/k_, epsilon_)
);
# include "wallDissipationI.H"
epsEqn().relax();
solve(epsEqn);
bound(epsilon_, epsilon0_);
// Turbulent kinetic energy equation
tmp<fvScalarMatrix> kEqn
(
betav*fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::laplacian(DkEff(), k_)
==
betav*G + GR
- fvm::SuSp((2.0/3.0)*betav*rho_*divU, k_)
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
);
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
// Re-calculate viscosity
mut_ = rho_*Cmu*sqr(k_)/epsilon_;
# include "wallViscosityI.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace turbulenceModels
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,169 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
PDRkEpsilon
Description
Standard k-epsilon turbulence model.
SourceFiles
PDRkEpsilon.C
PDRkEpsilonCorrect.C
\*---------------------------------------------------------------------------*/
#ifndef compressiblePDRkEpsilon_H
#define compressiblePDRkEpsilon_H
#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace turbulenceModels
{
/*---------------------------------------------------------------------------*\
Class PDRkEpsilon Declaration
\*---------------------------------------------------------------------------*/
class PDRkEpsilon
:
public turbulenceModel
{
// Private data
dimensionedScalar Cmu;
dimensionedScalar C1;
dimensionedScalar C2;
dimensionedScalar alphak;
dimensionedScalar alphaEps;
dimensionedScalar alphah;
volScalarField k_;
volScalarField epsilon_;
volScalarField mut_;
public:
//- Runtime type information
TypeName("PDRkEpsilon");
// Constructors
//- from components
PDRkEpsilon
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
);
// Destructor
~PDRkEpsilon()
{}
// Member Functions
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
return tmp<volScalarField>
(
new volScalarField("DkEff", alphak*mut_ + mu())
);
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> DepsilonEff() const
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", alphaEps*mut_ + mu())
);
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
new volScalarField("alphaEff", alphah*mut_ + alpha())
);
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
//- Read turbulenceProperties dictionary
bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace turbulenceModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Global
CourantNo
Description
Calculates and outputs the mean and maximum Courant Numbers.
\*---------------------------------------------------------------------------*/
{
scalar meanStCoNum = 0.0;
if (mesh.nInternalFaces())
{
surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()
*mag(phiSt/fvc::interpolate(rho));
StCoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
meanStCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
}
Info<< "St courant Number mean: " << meanStCoNum
<< " max: " << StCoNum << endl;
}
// ************************************************************************* //

View File

@ -0,0 +1,16 @@
fvVectorMatrix UEqn
(
betav*fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
betav*rho*g
);
volSymmTensorField invA = inv(I*UEqn.A() + drag->Dcu());
if (momentumPredictor)
{
U = invA & (UEqn.H() - betav*fvc::grad(p));
U.correctBoundaryConditions();
}

View File

@ -0,0 +1,91 @@
// Calculate Xi according to the selected flame wrinkling model
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Calculate coefficients for Gulder's flame speed correlation
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*k);
volScalarField epsilonPlus = pow(uPrimeCoef, 3)*epsilon;
volScalarField tauEta = sqrt(mag(thermo->muu()/(rhou*epsilonPlus)));
volScalarField Reta = up/
(
sqrt(epsilonPlus*tauEta)
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8)
);
else if (XiModel == "algebraic")
{
// Simple algebraic model for Xi based on Gulders correlation
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField GEta = GEtaCoef/tauEta;
volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta;
volScalarField R =
GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999);
volScalarField XiEqStar = R/(R - GEta - GIn);
//- Calculate the unweighted b
//volScalarField Rrho = thermo->rhou()/thermo->rhob();
//volScalarField bbar = b/(b + (Rrho*(1.0 - b)));
Xi == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0);
}
else if (XiModel == "transport")
{
// Calculate Xi transport coefficients based on Gulders correlation
// and DNS data for the rate of generation
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField GEta = GEtaCoef/tauEta;
volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta;
volScalarField R =
GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999);
volScalarField XiEqStar = R/(R - GEta - GIn);
volScalarField XiEq =
1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0);
volScalarField G = R*(XiEq - 1.0)/XiEq;
// Calculate Xi flux
// ~~~~~~~~~~~~~~~~~
surfaceScalarField phiXi =
phiSt
+ (
- fvc::interpolate(fvc::laplacian(Dbf, b)/mgb)*nf
+ fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf
);
// Solve for the flame wrinkling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solve
(
betav*fvm::ddt(rho, Xi)
+ mvConvection->fvmDiv(phi, Xi)
+ fvm::div(phiXi, Xi, "div(phiXi,Xi)")
- fvm::Sp(fvc::div(phiXi), Xi)
==
betav*rho*R
- fvm::Sp(betav*rho*(R - G), Xi)
);
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi.max(1.0);
Xi = min(Xi, 2.0*XiEq);
Info<< "max(Xi) = " << max(Xi).value() << endl;
Info<< "max(XiEq) = " << max(XiEq).value() << endl;
}
else
{
FatalError
<< args.executable() << " : Unknown Xi model " << XiModel
<< abort(FatalError);
}

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "Gulder.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(Gulder, 0);
addToRunTimeSelectionTable(XiEqModel, Gulder, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::Gulder::Gulder
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
SuMin(0.01*Su.average())
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiEqModels::Gulder::~Gulder()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
{
volScalarField up = sqrt((2.0/3.0)*turbulence_.k());
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)));
volScalarField Reta = up/
(
sqrt(epsilon*tauEta)
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8)
);
return 1.0 + XiEqCoef*sqrt(up/(Su_ + SuMin))*Reta;
}
bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
Gulder
Description
Simple Gulder model for XiEq based on Gulders correlation
with a linear correction function to give a plausible profile for XiEq.
SourceFiles
Gulder.C
\*---------------------------------------------------------------------------*/
#ifndef Gulder_H
#define Gulder_H
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class Gulder Declaration
\*---------------------------------------------------------------------------*/
class Gulder
:
public XiEqModel
{
// Private data
scalar XiEqCoef;
dimensionedScalar SuMin;
// Private Member Functions
//- Disallow copy construct
Gulder(const Gulder&);
//- Disallow default bitwise assignment
void operator=(const Gulder&);
public:
//- Runtime type information
TypeName("Gulder");
// Constructors
//- Construct from components
Gulder
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~Gulder();
// Member Functions
//- Return the flame-wrinking XiEq
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiEqModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "SCOPEBlendXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(SCOPEBlend, 0);
addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::SCOPEBlend::SCOPEBlend
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqModelL_
(
XiEqModel::New
(
XiEqModelCoeffs_.subDict("XiEqModelL"),
thermo,
turbulence,
Su
)
),
XiEqModelH_
(
XiEqModel::New
(
XiEqModelCoeffs_.subDict("XiEqModelH"),
thermo,
turbulence,
Su
)
)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiEqModels::SCOPEBlend::~SCOPEBlend()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEBlend::XiEq() const
{
return pow
(
pow4(1.0/XiEqModelL_->XiEq()) + pow4(1.0/XiEqModelH_->XiEq()),
-0.25
);
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
SCOPEBlend
Description
SourceFiles
SCOPEBlend.C
\*---------------------------------------------------------------------------*/
#ifndef SCOPEBlend_H
#define SCOPEBlend_H
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class SCOPEBlend Declaration
\*---------------------------------------------------------------------------*/
class SCOPEBlend
:
public XiEqModel
{
// Private data
//- Low turbulence intensity equilibrium Xi model
autoPtr<XiEqModel> XiEqModelL_;
//- High turbulence intensity equilibrium Xi model
autoPtr<XiEqModel> XiEqModelH_;
// Private Member Functions
//- Disallow copy construct
SCOPEBlend(const SCOPEBlend&);
//- Disallow default bitwise assignment
void operator=(const SCOPEBlend&);
public:
//- Runtime type information
TypeName("SCOPEBlend");
// Constructors
//- Construct from components
SCOPEBlend
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~SCOPEBlend();
// Member Functions
//- Return the flame-wrinking XiEq
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiEqModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "SCOPEXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(SCOPEXiEq, 0);
addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
XiEqExp(readScalar(XiEqModelCoeffs_.lookup("XiEqExp"))),
lCoef(readScalar(XiEqModelCoeffs_.lookup("lCoef"))),
SuMin(0.01*Su.average()),
MaModel
(
IOdictionary
(
IOobject
(
"combustionProperties",
Su.mesh().time().constant(),
Su.mesh(),
IOobject::MUST_READ
)
),
thermo
)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiEqModels::SCOPEXiEq::~SCOPEXiEq()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
{
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField up = sqrt((2.0/3.0)*k);
volScalarField l = (lCoef*sqrt(3.0/2.0))*up*k/epsilon;
volScalarField Rl = up*l*thermo_.rhou()/thermo_.muu();
volScalarField upBySu = up/(Su_ + SuMin);
volScalarField K = 0.157*upBySu/sqrt(Rl);
volScalarField Ma = MaModel.Ma();
tmp<volScalarField> tXiEq
(
new volScalarField
(
IOobject
(
"XiEq",
epsilon.time().timeName(),
epsilon.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
epsilon.mesh(),
dimensionedScalar("XiEq", dimless, 0.0)
)
);
volScalarField& xieq = tXiEq();
forAll(xieq, celli)
{
if (Ma[celli] > 0.01)
{
xieq[celli] =
XiEqCoef*pow(K[celli]*Ma[celli], -XiEqExp)*upBySu[celli];
}
}
forAll(xieq.boundaryField(), patchi)
{
scalarField& xieqp = xieq.boundaryField()[patchi];
const scalarField& Kp = K.boundaryField()[patchi];
const scalarField& Map = Ma.boundaryField()[patchi];
const scalarField& upBySup = upBySu.boundaryField()[patchi];
forAll(xieqp, facei)
{
if (Ma[facei] > 0.01)
{
xieqp[facei] =
XiEqCoef*pow(Kp[facei]*Map[facei], -XiEqExp)*upBySup[facei];
}
}
}
return tXiEq;
}
bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef;
XiEqModelCoeffs_.lookup("XiEqExp") >> XiEqExp;
XiEqModelCoeffs_.lookup("lCoef") >> lCoef;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
SCOPEXiEq
Description
Simple SCOPEXiEq model for XiEq based on SCOPEXiEqs correlation
with a linear correction function to give a plausible profile for XiEq.
SourceFiles
SCOPEXiEq.C
\*---------------------------------------------------------------------------*/
#ifndef SCOPEXiEq_H
#define SCOPEXiEq_H
#include "XiEqModel.H"
#include "SCOPELaminarFlameSpeed.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class SCOPEXiEq Declaration
\*---------------------------------------------------------------------------*/
class SCOPEXiEq
:
public XiEqModel
{
// Private data
scalar XiEqCoef;
scalar XiEqExp;
scalar lCoef;
dimensionedScalar SuMin;
//- The SCOPE laminar flame speed model used to obtain the
// Marstein number. Note: the laminar flame speed need not be
// obtained form the same model.
laminarFlameSpeedModels::SCOPE MaModel;
// Private Member Functions
//- Disallow copy construct
SCOPEXiEq(const SCOPEXiEq&);
//- Disallow default bitwise assignment
void operator=(const SCOPEXiEq&);
public:
//- Runtime type information
TypeName("SCOPEXiEq");
// Constructors
//- Construct from components
SCOPEXiEq
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~SCOPEXiEq();
// Member Functions
//- Return the flame-wrinking XiEq
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiEqModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "XiEqModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(XiEqModel, 0);
defineRunTimeSelectionTable(XiEqModel, dictionary);
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModel::XiEqModel
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiEqModelCoeffs_
(
XiEqProperties.subDict
(
word(XiEqProperties.lookup("XiEqModel")) + "Coeffs"
)
),
thermo_(thermo),
turbulence_(turbulence),
Su_(Su)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiEqModel::~XiEqModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
{
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,156 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
XiEqModel
Description
Base-class for all XiEq models used by the b-XiEq combustion model.
SourceFiles
XiEqModel.C
\*---------------------------------------------------------------------------*/
#ifndef XiEqModel_H
#define XiEqModel_H
#include "IOdictionary.H"
#include "hhuCombustionThermo.H"
#include "turbulenceModel.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class XiEqModel Declaration
\*---------------------------------------------------------------------------*/
class XiEqModel
{
protected:
// Protected data
dictionary XiEqModelCoeffs_;
const hhuCombustionThermo& thermo_;
const compressible::turbulenceModel& turbulence_;
const volScalarField& Su_;
private:
// Private Member Functions
//- Disallow copy construct
XiEqModel(const XiEqModel&);
//- Disallow default bitwise assignment
void operator=(const XiEqModel&);
public:
//- Runtime type information
TypeName("XiEqModel");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
XiEqModel,
dictionary,
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
),
(
XiEqProperties,
thermo,
turbulence,
Su
)
);
// Selectors
//- Return a reference to the selected XiEq model
static autoPtr<XiEqModel> New
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Constructors
//- Construct from components
XiEqModel
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~XiEqModel();
// Member Functions
//- Return the flame-wrinking XiEq
virtual tmp<volScalarField> XiEq() const
{
return turbulence_.muEff();
}
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
{
word XiEqModelTypeName = XiEqProperties.lookup("XiEqModel");
Info<< "Selecting flame-wrinkling model " << XiEqModelTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(XiEqModelTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"XiEqModel::New"
"("
" const hhuCombustionThermo& thermo,"
" const compressible::turbulenceModel& turbulence,"
" const volScalarField& Su"
")"
) << "Unknown XiEqModel type "
<< XiEqModelTypeName << endl << endl
<< "Valid XiEqModels are : " << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<XiEqModel>
(cstrIter()(XiEqProperties, thermo, turbulence, Su));
}
// ************************************************************************* //

View File

@ -0,0 +1,83 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "instabilityXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(instability, 0);
addToRunTimeSelectionTable(XiEqModel, instability, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::instability::instability
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqIn(readScalar(XiEqModelCoeffs_.lookup("XiEqIn"))),
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiEqModels::instability::~instability()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const
{
volScalarField turbXiEq = XiEqModel_->XiEq();
return XiEqIn/turbXiEq + turbXiEq;
}
bool Foam::XiEqModels::instability::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.lookup("XiEqIn") >> XiEqIn;
return XiEqModel_->read(XiEqModelCoeffs_);
}
// ************************************************************************* //

View File

@ -0,0 +1,115 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
instability
Description
SourceFiles
instability.C
\*---------------------------------------------------------------------------*/
#ifndef instability_H
#define instability_H
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class instability Declaration
\*---------------------------------------------------------------------------*/
class instability
:
public XiEqModel
{
// Private data
//- Equilibrium Xi due to instability only
scalar XiEqIn;
//- Equilibrium Xi model due to all other effects
autoPtr<XiEqModel> XiEqModel_;
// Private Member Functions
//- Disallow copy construct
instability(const instability&);
//- Disallow default bitwise assignment
void operator=(const instability&);
public:
//- Runtime type information
TypeName("instability");
// Constructors
//- Construct from components
instability
(
const dictionary& XiEqProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~instability();
// Member Functions
//- Return the flame-wrinking XiEq
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiEqModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "KTS.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
defineTypeNameAndDebug(KTS, 0);
addToRunTimeSelectionTable(XiGModel, KTS, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModels::KTS::KTS
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
GEtaCoef(readScalar(XiGModelCoeffs_.lookup("GEtaCoef")))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiGModels::KTS::~KTS()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
{
volScalarField up = sqrt((2.0/3.0)*turbulence_.k());
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)));
return GEtaCoef/tauEta;
}
bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.lookup("GEtaCoef") >> GEtaCoef;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
KTS
Description
Simple Kolmogorov time-scale model for the flame-wrinling generation rate.
SourceFiles
KTS.C
\*---------------------------------------------------------------------------*/
#ifndef KTS_H
#define KTS_H
#include "XiGModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
/*---------------------------------------------------------------------------*\
Class KTS Declaration
\*---------------------------------------------------------------------------*/
class KTS
:
public XiGModel
{
// Private data
scalar GEtaCoef;
// Private Member Functions
//- Disallow copy construct
KTS(const KTS&);
//- Disallow default bitwise assignment
void operator=(const KTS&);
public:
//- Runtime type information
TypeName("KTS");
// Constructors
//- Construct from components
KTS
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~KTS();
// Member Functions
//- Return the flame-wrinking generation rate
virtual tmp<volScalarField> G() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiGProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiGModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "XiGModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(XiGModel, 0);
defineRunTimeSelectionTable(XiGModel, dictionary);
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModel::XiGModel
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiGModelCoeffs_
(
XiGProperties.subDict
(
word(XiGProperties.lookup("XiGModel")) + "Coeffs"
)
),
thermo_(thermo),
turbulence_(turbulence),
Su_(Su)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiGModel::~XiGModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::XiGModel::read(const dictionary& XiGProperties)
{
XiGModelCoeffs_ = XiGProperties.subDict(type() + "Coeffs");
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,159 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
XiGModel
Description
Base-class for all Xi generation models used by the b-Xi combustion model.
SourceFiles
XiGModel.C
\*---------------------------------------------------------------------------*/
#ifndef XiGModel_H
#define XiGModel_H
#include "IOdictionary.H"
#include "hhuCombustionThermo.H"
#include "turbulenceModel.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class XiGModel Declaration
\*---------------------------------------------------------------------------*/
class XiGModel
{
protected:
// Protected data
dictionary XiGModelCoeffs_;
const hhuCombustionThermo& thermo_;
const compressible::turbulenceModel& turbulence_;
const volScalarField& Su_;
private:
// Private Member Functions
//- Disallow copy construct
XiGModel(const XiGModel&);
//- Disallow default bitwise assignment
void operator=(const XiGModel&);
public:
//- Runtime type information
TypeName("XiGModel");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
XiGModel,
dictionary,
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
),
(
XiGProperties,
thermo,
turbulence,
Su
)
);
// Selectors
//- Return a reference to the selected XiG model
static autoPtr<XiGModel> New
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Constructors
//- Construct from components
XiGModel
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~XiGModel();
// Member Functions
//- Return the flame-wrinking genration rate
virtual tmp<volScalarField> G() const = 0;
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const
{
return turbulence_.muEff();
}
//- Update properties from given dictionary
virtual bool read(const dictionary& XiGProperties) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "XiGModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
{
word XiGModelTypeName = XiGProperties.lookup("XiGModel");
Info<< "Selecting flame-wrinkling model " << XiGModelTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(XiGModelTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"XiGModel::New"
"("
" const hhuCombustionThermo& thermo,"
" const compressible::turbulenceModel& turbulence,"
" const volScalarField& Su"
")"
) << "Unknown XiGModel type "
<< XiGModelTypeName << endl << endl
<< "Valid XiGModels are : " << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<XiGModel>
(cstrIter()(XiGProperties, thermo, turbulence, Su));
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "instabilityG.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
defineTypeNameAndDebug(instabilityG, 0);
addToRunTimeSelectionTable(XiGModel, instabilityG, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModels::instabilityG::instabilityG
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
GIn(XiGModelCoeffs_.lookup("GIn")),
lambdaIn(XiGModelCoeffs_.lookup("lambdaIn")),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiGModels::instabilityG::~instabilityG()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::G() const
{
volScalarField turbXiG = XiGModel_->G();
return GIn*GIn/(GIn + turbXiG) + turbXiG;
}
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::Db() const
{
const objectRegistry& db = Su_.db();
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
return XiGModel_->Db()
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn)/(mgb + 1.0/lambdaIn);
}
bool Foam::XiGModels::instabilityG::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.lookup("GIn") >> GIn;
XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
instabilityG
Description
Flame-surface instabilityG flame-wrinking generation rate coefficient model.
SourceFiles
instabilityG.C
\*---------------------------------------------------------------------------*/
#ifndef instabilityG_H
#define instabilityG_H
#include "XiGModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
/*---------------------------------------------------------------------------*\
Class instabilityG Declaration
\*---------------------------------------------------------------------------*/
class instabilityG
:
public XiGModel
{
// Private data
//- Flame instabilityG wrinling generation rate coefficient
dimensionedScalar GIn;
//- InstabilityG length-scale
dimensionedScalar lambdaIn;
//- Xi generation rate model due to all other processes
autoPtr<XiGModel> XiGModel_;
// Private Member Functions
//- Disallow copy construct
instabilityG(const instabilityG&);
//- Disallow default bitwise assignment
void operator=(const instabilityG&);
public:
//- Runtime type information
TypeName("instabilityG");
// Constructors
//- Construct from components
instabilityG
(
const dictionary& XiGProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su
);
// Destructor
virtual ~instabilityG();
// Member Functions
//- Return the flame-wrinking generation rate
virtual tmp<volScalarField> G() const;
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiGProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiGModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "XiModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(XiModel, 0);
defineRunTimeSelectionTable(XiModel, dictionary);
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModel::XiModel
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModelCoeffs_
(
XiProperties.subDict
(
word(XiProperties.lookup("XiModel")) + "Coeffs"
)
),
thermo_(thermo),
turbulence_(turbulence),
Su_(Su),
rho_(rho),
b_(b),
phi_(phi),
Xi_
(
IOobject
(
"Xi",
b.time().timeName(),
b.db(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
b.mesh()
)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiModel::~XiModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::XiModel::read(const dictionary& XiProperties)
{
XiModelCoeffs_ = XiProperties.subDict(type() + "Coeffs");
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,198 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
XiModel
Description
Base-class for all Xi models used by the b-Xi combustion model.
SourceFiles
XiModel.C
\*---------------------------------------------------------------------------*/
#ifndef XiModel_H
#define XiModel_H
#include "IOdictionary.H"
#include "hhuCombustionThermo.H"
#include "turbulenceModel.H"
#include "multivariateSurfaceInterpolationScheme.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class XiModel Declaration
\*---------------------------------------------------------------------------*/
class XiModel
{
protected:
// Protected data
dictionary XiModelCoeffs_;
const hhuCombustionThermo& thermo_;
const compressible::turbulenceModel& turbulence_;
const volScalarField& Su_;
const volScalarField& rho_;
const volScalarField& b_;
const surfaceScalarField& phi_;
//- Flame wrinking field
volScalarField Xi_;
private:
// Private Member Functions
//- Disallow copy construct
XiModel(const XiModel&);
//- Disallow default bitwise assignment
void operator=(const XiModel&);
public:
//- Runtime type information
TypeName("XiModel");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
XiModel,
dictionary,
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
),
(
XiProperties,
thermo,
turbulence,
Su,
rho,
b,
phi
)
);
// Selectors
//- Return a reference to the selected Xi model
static autoPtr<XiModel> New
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
);
// Constructors
//- Construct from components
XiModel
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
);
// Destructor
virtual ~XiModel();
// Member Functions
//- Return the flame-wrinking Xi
virtual const volScalarField& Xi() const
{
return Xi_;
}
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const
{
return turbulence_.muEff();
}
//- Add Xi to the multivariateSurfaceInterpolationScheme table
// if required
virtual void addXi
(
multivariateSurfaceInterpolationScheme<scalar>::fieldTable&
)
{}
//- Correct the flame-wrinking Xi
virtual void correct() = 0;
//- Correct the flame-wrinking Xi using the given convection scheme
virtual void correct(const fv::convectionScheme<scalar>&)
{
correct();
}
//- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "XiModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
{
word XiModelTypeName = XiProperties.lookup("XiModel");
Info<< "Selecting flame-wrinkling model " << XiModelTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(XiModelTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"XiModel::New"
) << "Unknown XiModel type "
<< XiModelTypeName << endl << endl
<< "Valid XiModels are : " << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<XiModel>
(cstrIter()(XiProperties, thermo, turbulence, Su, rho, b, phi));
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "algebraic.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
defineTypeNameAndDebug(algebraic, 0);
addToRunTimeSelectionTable(XiModel, algebraic, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModels::algebraic::algebraic
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(readScalar(XiModelCoeffs_.lookup("XiShapeCoef"))),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiModels::algebraic::~algebraic()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiModels::algebraic::Db() const
{
return XiGModel_->Db();
}
void Foam::XiModels::algebraic::correct()
{
volScalarField XiEqEta = XiEqModel_->XiEq();
volScalarField GEta = XiGModel_->G();
volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999);
volScalarField XiEqStar = R/(R - GEta);
Xi_ == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0);
}
bool Foam::XiModels::algebraic::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
algebraic
Description
Simple algebraic model for Xi based on Gulders correlation
with a linear correction function to give a plausible profile for Xi.
SourceFiles
algebraic.C
\*---------------------------------------------------------------------------*/
#ifndef algebraic_H
#define algebraic_H
#include "XiModel.H"
#include "XiEqModel.H"
#include "XiGModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
/*---------------------------------------------------------------------------*\
Class algebraic Declaration
\*---------------------------------------------------------------------------*/
class algebraic
:
public XiModel
{
// Private data
scalar XiShapeCoef;
autoPtr<XiEqModel> XiEqModel_;
autoPtr<XiGModel> XiGModel_;
// Private Member Functions
//- Disallow copy construct
algebraic(const algebraic&);
//- Disallow default bitwise assignment
void operator=(const algebraic&);
public:
//- Runtime type information
TypeName("algebraic");
// Constructors
//- Construct from components
algebraic
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
);
// Destructor
virtual ~algebraic();
// Member Functions
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Correct the flame-wrinking Xi
virtual void correct();
//- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "fixed.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
defineTypeNameAndDebug(fixed, 0);
addToRunTimeSelectionTable(XiModel, fixed, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModels::fixed::fixed
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiModels::fixed::~fixed()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::XiModels::fixed::read(const dictionary& XiProperties)
{
return XiModel::read(XiProperties);
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
fixed
Description
Fixed value model for Xi.
SourceFiles
fixed.C
\*---------------------------------------------------------------------------*/
#ifndef fixed_H
#define fixed_H
#include "XiModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
/*---------------------------------------------------------------------------*\
Class fixed Declaration
\*---------------------------------------------------------------------------*/
class fixed
:
public XiModel
{
// Private Member Functions
//- Disallow copy construct
fixed(const fixed&);
//- Disallow default bitwise assignment
void operator=(const fixed&);
public:
//- Runtime type information
TypeName("fixed");
// Constructors
//- Construct from components
fixed
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
);
// Destructor
virtual ~fixed();
// Member Functions
//- Correct the flame-wrinking Xi
virtual void correct()
{}
//- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,139 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "transport.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
defineTypeNameAndDebug(transport, 0);
addToRunTimeSelectionTable(XiModel, transport, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModels::transport::transport
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(readScalar(XiModelCoeffs_.lookup("XiShapeCoef"))),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
Foam::XiModels::transport::~transport()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiModels::transport::Db() const
{
return XiGModel_->Db();
}
void Foam::XiModels::transport::correct
(
const fv::convectionScheme<scalar>& mvConvection
)
{
volScalarField XiEqEta = XiEqModel_->XiEq();
volScalarField GEta = XiGModel_->G();
volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999);
volScalarField XiEqStar = R/(R - GEta);
volScalarField XiEq =
1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0);
volScalarField G = R*(XiEq - 1.0)/XiEq;
const objectRegistry& db = b_.db();
const volScalarField& betav = db.lookupObject<volScalarField>("betav");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const surfaceScalarField& phiSt =
db.lookupObject<surfaceScalarField>("phiSt");
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
const surfaceScalarField& nf = db.lookupObject<surfaceScalarField>("nf");
surfaceScalarField phiXi
(
"phiXi",
phiSt
+ (
- fvc::interpolate(fvc::laplacian(Db, b_)/mgb)*nf
+ fvc::interpolate(rho_)*fvc::interpolate(Su_*(1.0/Xi_ - Xi_))*nf
)
);
solve
(
betav*fvm::ddt(rho_, Xi_)
+ mvConvection.fvmDiv(phi_, Xi_)
+ fvm::div(phiXi, Xi_)
- fvm::Sp(fvc::div(phiXi), Xi_)
==
betav*rho_*R
- fvm::Sp(betav*rho_*(R - G), Xi_)
);
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi_.max(1.0);
Xi_ = min(Xi_, 2.0*XiEq);
}
bool Foam::XiModels::transport::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,139 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
transport
Description
Simple transport model for Xi based on Gulders correlation
with a linear correction function to give a plausible profile for Xi.
SourceFiles
transport.C
\*---------------------------------------------------------------------------*/
#ifndef transport_H
#define transport_H
#include "XiModel.H"
#include "XiEqModel.H"
#include "XiGModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
/*---------------------------------------------------------------------------*\
Class transport Declaration
\*---------------------------------------------------------------------------*/
class transport
:
public XiModel
{
// Private data
scalar XiShapeCoef;
autoPtr<XiEqModel> XiEqModel_;
autoPtr<XiGModel> XiGModel_;
// Private Member Functions
//- Disallow copy construct
transport(const transport&);
//- Disallow default bitwise assignment
void operator=(const transport&);
public:
//- Runtime type information
TypeName("transport");
// Constructors
//- Construct from components
transport
(
const dictionary& XiProperties,
const hhuCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
);
// Destructor
virtual ~transport();
// Member Functions
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Add Xi to the multivariateSurfaceInterpolationScheme table
virtual void addXi
(
multivariateSurfaceInterpolationScheme<scalar>::fieldTable& fields
)
{
fields.add(Xi_);
}
//- Correct the flame-wrinking Xi
virtual void correct()
{
notImplemented("transport::correct()");
}
//- Correct the flame-wrinking Xi using the given convection scheme
virtual void correct(const fv::convectionScheme<scalar>& mvConvection);
//- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,108 @@
tmp<fv::convectionScheme<scalar> > mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,ft_b_h_hu)")
)
);
volScalarField Db("Db", turbulence->muEff());
if (ign.ignited())
{
// Calculate the unstrained laminar flame speed
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Su = unstrainedLaminarFlameSpeed()();
const volScalarField& Xi = flameWrinkling->Xi();
// progress variable
// ~~~~~~~~~~~~~~~~~
volScalarField c("c", 1.0 - b);
// Unburnt gas density
// ~~~~~~~~~~~~~~~~~~~
volScalarField rhou = thermo->rhou();
// Calculate flame normal etc.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//volVectorField n = fvc::grad(b);
volVectorField n = fvc::reconstruct(fvc::snGrad(b)*mesh.magSf());
volScalarField mgb("mgb", mag(n));
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
{
volScalarField bc = b*c;
dMgb += 1.0e-3*
(bc*mgb)().weightedAverage(mesh.V())
/(bc.weightedAverage(mesh.V()) + SMALL);
}
mgb += dMgb;
surfaceVectorField Sfhat = mesh.Sf()/mesh.magSf();
surfaceVectorField nfVec = fvc::interpolate(n);
nfVec += Sfhat*(fvc::snGrad(b) - (Sfhat & nfVec));
nfVec /= (mag(nfVec) + dMgb);
surfaceScalarField nf("nf", mesh.Sf() & nfVec);
n /= mgb;
# include "StCorr.H"
// Calculate turbulent flame speed flux
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
surfaceScalarField phiSt("phiSt", fvc::interpolate(rhou*StCorr*St)*nf);
# include "StCourantNo.H"
Db = flameWrinkling->Db();
// Create b equation
// ~~~~~~~~~~~~~~~~~
fvScalarMatrix bEqn
(
betav*fvm::ddt(rho, b)
+ mvConvection->fvmDiv(phi, b)
+ fvm::div(phiSt, b)
- fvm::Sp(fvc::div(phiSt), b)
- fvm::laplacian(Db, b)
);
// Add ignition cell contribution to b-equation
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# include "ignite.H"
// Solve for b
// ~~~~~~~~~~~
bEqn.solve();
Info<< "min(b) = " << min(b).value() << endl;
if (composition.contains("ft"))
{
volScalarField& ft = composition.Y("ft");
Info<< "Combustion progress = "
<< 100*(1.0 - b)().weightedAverage(mesh.V()*ft).value() << "%"
<< endl;
}
else
{
Info<< "Combustion progress = "
<< 100*(1.0 - b)().weightedAverage(mesh.V()).value() << "%"
<< endl;
}
// Correct the flame-wrinkling
flameWrinkling->correct(mvConvection);
St = Xi*Su;
}

View File

@ -0,0 +1,164 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<hhuCombustionThermo> thermo
(
hhuCombustionThermo::New(mesh)
);
combustionMixture& composition = thermo->composition();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
volScalarField& hu = thermo->hu();
volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
//const volScalarField& T = thermo->T();
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo()
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
"DpDt",
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
(
laminarFlameSpeed::New(thermo)
);
Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field betav\n" << endl;
volScalarField betav
(
IOobject
(
"betav",
runTime.findInstance(polyMesh::meshSubDir, "betav"),
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
IOdictionary PDRProperties
(
IOobject
(
"PDRProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
//- Create the drag model
autoPtr<PDRDragModel> drag = PDRDragModel::New
(
PDRProperties,
turbulence,
rho,
U,
phi
);
//- Create the flame-wrinkling model
autoPtr<XiModel> flameWrinkling = XiModel::New
(
PDRProperties,
thermo,
turbulence,
Su,
rho,
b,
phi
);
Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St
(
IOobject
(
"St",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
flameWrinkling->Xi()*Su
);
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft"))
{
fields.add(composition.Y("ft"));
}
fields.add(b);
fields.add(h);
fields.add(hu);
flameWrinkling->addXi(fields);

View File

@ -0,0 +1,11 @@
if (composition.contains("ft"))
{
volScalarField& ft = composition.Y("ft");
solve
(
betav*fvm::ddt(rho, ft)
+ mvConvection->fvmDiv(phi, ft)
- fvm::laplacian(Db, ft)
);
}

View File

@ -0,0 +1,12 @@
{
solve
(
betav*fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(Db, h)
==
betav*DpDt
);
thermo->correct();
}

View File

@ -0,0 +1,18 @@
if (ign.ignited())
{
solve
(
betav*fvm::ddt(rho, hu)
+ mvConvection->fvmDiv(phi, hu)
- fvm::laplacian(Db, hu)
// These terms cannot be used in partially-premixed combustion due to
// the resultant inconsistency between ft and hu transport.
// A possible solution would be to solve for ftu as well as ft.
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), hu)
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hu)
==
betav*DpDt*rho/thermo->rhou()
);
}

View File

@ -0,0 +1,54 @@
if(turbulence)
{
volScalarField divU = fvc::div(Uf & mesh.Sf());
tmp<volTensorField> tgradU = fvc::grad(Uf);
volScalarField G = 2*mut*(tgradU() && dev(symm(tgradU())));
tgradU.clear();
// Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations
volScalarField GR = rho*mag(U)*(U & CT & U);
# include "wallFunctions.H"
// Dissipation equation
fvScalarMatrix epsEqn
(
betav*fvm::ddt(rho, epsilon)
+ fvm::div(phi, epsilon)
- fvm::laplacian(fvc::interpolate(alphaEps*muEff), epsilon)
==
C1*(betav*G + GR)*epsilon/k
- fvm::SuSp((2.0/3.0*C1)*betav*rho*divU, epsilon)
- fvm::Sp(C2*betav*rho*epsilon/k, epsilon)
);
# include "wallDissipation.H"
epsEqn.solve();
bound(epsilon, dimensionedScalar("0", epsilon.dimensions(), 1.0e-15));
// Turbulent kinetic energy equation
solve
(
betav*fvm::ddt(rho, k)
+ fvm::div(phi, k)
- fvm::laplacian(fvc::interpolate(alphak*muEff), k)
==
betav*G + GR
- fvm::SuSp(2.0/3.0*betav*rho*divU, k)
- fvm::Sp(betav*rho*epsilon/k, k)
);
bound(k, dimensionedScalar("0", k.dimensions(), 0.0));
//- Re-calculate turbulence viscosity
mut = Cmu*rho*sqr(k)/epsilon;
# include "wallViscosity.H"
}
muEff = mut + thermo->mu();

View File

@ -0,0 +1,439 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "SCOPELaminarFlameSpeed.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarFlameSpeedModels
{
defineTypeNameAndDebug(SCOPE, 0);
addToRunTimeSelectionTable
(
laminarFlameSpeed,
SCOPE,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarFlameSpeedModels::SCOPE::polynomial::polynomial
(
const dictionary& polyDict
)
:
FixedList<scalar, 7>(polyDict.lookup("coefficients")),
ll(readScalar(polyDict.lookup("lowerLimit"))),
ul(readScalar(polyDict.lookup("upperLimit"))),
llv(polyPhi(ll, *this)),
ulv(polyPhi(ul, *this)),
lu(0)
{}
Foam::laminarFlameSpeedModels::SCOPE::SCOPE
(
const dictionary& dict,
const hhuCombustionThermo& ct
)
:
laminarFlameSpeed(dict, ct),
coeffsDict_(dict.subDict(typeName + "Coeffs").subDict(fuel_)),
LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))),
UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))),
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),
SuPolyU_(coeffsDict_.subDict("upperSuPolynomial")),
Texp_(readScalar(coeffsDict_.lookup("Texp"))),
pexp_(readScalar(coeffsDict_.lookup("pexp"))),
MaPolyL_(coeffsDict_.subDict("lowerMaPolynomial")),
MaPolyU_(coeffsDict_.subDict("upperMaPolynomial"))
{
SuPolyL_.ll = max(SuPolyL_.ll, LFL_) + SMALL;
SuPolyU_.ul = min(SuPolyU_.ul, UFL_) - SMALL;
SuPolyL_.lu = 0.5*(SuPolyL_.ul + SuPolyU_.ll);
SuPolyU_.lu = SuPolyL_.lu - SMALL;
MaPolyL_.lu = 0.5*(MaPolyL_.ul + MaPolyU_.ll);
MaPolyU_.lu = MaPolyL_.lu - SMALL;
if (debug)
{
Info<< "phi Su (T = Tref, p = pref)" << endl;
label n = 200;
for (int i=0; i<n; i++)
{
scalar phi = (2.0*i)/n;
Info<< phi << token::TAB << SuRef(phi) << endl;
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::laminarFlameSpeedModels::SCOPE::~SCOPE()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::polyPhi
(
scalar phi,
const polynomial& a
)
{
scalar x = phi - 1.0;
return
a[0]
*(
scalar(1)
+ x*(a[1] + x*(a[2] + x*(a[3] + x*(a[4] + x*(a[5] + x*a[6])))))
);
}
inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::SuRef
(
scalar phi
) const
{
if (phi < LFL_ || phi > UFL_)
{
// Return 0 beyond the flamibility limits
return scalar(0);
}
else if (phi < SuPolyL_.ll)
{
// Use linear interpolation between the low end of the
// lower polynomial and the lower flamibility limit
return SuPolyL_.llv*(phi - LFL_)/(SuPolyL_.ll - LFL_);
}
else if (phi > SuPolyU_.ul)
{
// Use linear interpolation between the upper end of the
// upper polynomial and the upper flamibility limit
return SuPolyU_.ulv*(UFL_ - phi)/(UFL_ - SuPolyU_.ul);
}
else if (phi < SuPolyL_.lu)
{
// Evaluate the lower polynomial
return polyPhi(phi, SuPolyL_);
}
else if (phi > SuPolyU_.lu)
{
// Evaluate the upper polynomial
return polyPhi(phi, SuPolyU_);
}
else
{
FatalErrorIn("laminarFlameSpeedModels::SCOPE::SuRef(scalar phi)")
<< "phi = " << phi
<< " cannot be handled by SCOPE function with the "
"given coefficients"
<< exit(FatalError);
return scalar(0);
}
}
inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Ma
(
scalar phi
) const
{
if (phi < MaPolyL_.ll)
{
// Beyond the lower limit assume Ma is constant
return MaPolyL_.llv;
}
else if (phi > MaPolyU_.ul)
{
// Beyond the upper limit assume Ma is constant
return MaPolyU_.ulv;
}
else if (phi < SuPolyL_.lu)
{
// Evaluate the lower polynomial
return polyPhi(phi, MaPolyL_);
}
else if (phi > SuPolyU_.lu)
{
// Evaluate the upper polynomial
return polyPhi(phi, MaPolyU_);
}
else
{
FatalErrorIn("laminarFlameSpeedModels::SCOPE::Ma(scalar phi)")
<< "phi = " << phi
<< " cannot be handled by SCOPE function with the "
"given coefficients"
<< exit(FatalError);
return scalar(0);
}
}
inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
(
scalar p,
scalar Tu,
scalar phi
) const
{
static const scalar Tref = 300.0;
static const scalar pRef = 1.013e5;
return SuRef(phi)*pow((Tu/Tref), Texp_)*pow((p/pRef), pexp_);
}
Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
(
const volScalarField& p,
const volScalarField& Tu,
scalar phi
) const
{
tmp<volScalarField> tSu0
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar("Su0", dimVelocity, 0.0)
)
);
volScalarField& Su0 = tSu0();
forAll(Su0, celli)
{
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi);
}
forAll(Su0.boundaryField(), patchi)
{
scalarField& Su0p = Su0.boundaryField()[patchi];
const scalarField& pp = p.boundaryField()[patchi];
const scalarField& Tup = Tu.boundaryField()[patchi];
forAll(Su0p, facei)
{
Su0p[facei] = Su0pTphi(pp[facei], Tup[facei], phi);
}
}
return tSu0;
}
Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
(
const volScalarField& p,
const volScalarField& Tu,
const volScalarField& phi
) const
{
tmp<volScalarField> tSu0
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar("Su0", dimVelocity, 0.0)
)
);
volScalarField& Su0 = tSu0();
forAll(Su0, celli)
{
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli]);
}
forAll(Su0.boundaryField(), patchi)
{
scalarField& Su0p = Su0.boundaryField()[patchi];
const scalarField& pp = p.boundaryField()[patchi];
const scalarField& Tup = Tu.boundaryField()[patchi];
const scalarField& phip = phi.boundaryField()[patchi];
forAll(Su0p, facei)
{
Su0p[facei] =
Su0pTphi
(
pp[facei],
Tup[facei],
phip[facei]
);
}
}
return tSu0;
}
Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
(
const volScalarField& phi
) const
{
tmp<volScalarField> tMa
(
new volScalarField
(
IOobject
(
"Ma",
phi.time().timeName(),
phi.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
phi.mesh(),
dimensionedScalar("Ma", dimless, 0.0)
)
);
volScalarField& ma = tMa();
forAll(ma, celli)
{
ma[celli] = Ma(phi[celli]);
}
forAll(ma.boundaryField(), patchi)
{
scalarField& map = ma.boundaryField()[patchi];
const scalarField& phip = phi.boundaryField()[patchi];
forAll(map, facei)
{
map[facei] = Ma(phip[facei]);
}
}
return tMa;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarFlameSpeedModels::SCOPE::Ma() const
{
if (hhuCombustionThermo_.composition().contains("ft"))
{
const volScalarField& ft = hhuCombustionThermo_.composition().Y("ft");
return Ma
(
dimensionedScalar
(
hhuCombustionThermo_.lookup("stoichiometricAirFuelMassRatio")
)*ft/(scalar(1) - ft)
);
}
else
{
const fvMesh& mesh = hhuCombustionThermo_.p().mesh();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"Ma",
mesh.time().timeName(),
mesh.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
)
);
}
}
Foam::tmp<Foam::volScalarField>
Foam::laminarFlameSpeedModels::SCOPE::operator()() const
{
if (hhuCombustionThermo_.composition().contains("ft"))
{
const volScalarField& ft = hhuCombustionThermo_.composition().Y("ft");
return Su0pTphi
(
hhuCombustionThermo_.p(),
hhuCombustionThermo_.Tu(),
dimensionedScalar
(
hhuCombustionThermo_.lookup("stoichiometricAirFuelMassRatio")
)*ft/(scalar(1) - ft)
);
}
else
{
return Su0pTphi
(
hhuCombustionThermo_.p(),
hhuCombustionThermo_.Tu(),
equivalenceRatio_
);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,195 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
SCOPE
Description
Laminar flame speed obtained from the SCOPE correlation.
SourceFiles
SCOPELaminarFlameSpeed.C
\*---------------------------------------------------------------------------*/
#ifndef SCOPE_H
#define SCOPE_H
#include "laminarFlameSpeed.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarFlameSpeedModels
{
/*---------------------------------------------------------------------------*\
Class SCOPE Declaration
\*---------------------------------------------------------------------------*/
class SCOPE
:
public laminarFlameSpeed
{
// Private Data
class polynomial
:
public FixedList<scalar, 7>
{
public:
//- Lower limit
scalar ll;
//- Upper polynomial limit
scalar ul;
//- Value at lower limit
scalar llv;
//- Value at upper limit
scalar ulv;
//- Changeover point from lower to upper polynomial
scalar lu;
//- Construct from dictionary
polynomial(const dictionary& polyDict);
};
dictionary coeffsDict_;
//- Lower flamability limit
scalar LFL_;
//- Upper flamability limit
scalar UFL_;
//- Lower Su polynomial
polynomial SuPolyL_;
//- Upper Su polynomial
polynomial SuPolyU_;
//- Temperature correction exponent
scalar Texp_;
//- Pressure correction exponent
scalar pexp_;
//- Lower Ma polynomial
polynomial MaPolyL_;
//- Upper Ma polynomial
polynomial MaPolyU_;
// Private member functions
//- Polynomial evaluated from the given equivalence ratio
// and polynomial coefficients
static inline scalar polyPhi(scalar phi, const polynomial& a);
//- Laminar flame speed evaluated from the given equivalence ratio
// at the reference temperature and pressure
inline scalar SuRef(scalar phi) const;
//- Markstein evaluated from the given equivalence ratio
inline scalar Ma(scalar phi) const;
//- Laminar flame speed evaluated from the given equivalence ratio
// corrected for temperature and pressure dependence
inline scalar Su0pTphi(scalar p, scalar Tu, scalar phi) const;
//- Laminar flame speed evaluated from the given uniform
// equivalence ratio corrected for temperature and pressure dependence
tmp<volScalarField> Su0pTphi
(
const volScalarField& p,
const volScalarField& Tu,
scalar phi
) const;
//- Laminar flame speed evaluated from the given equivalence ratio
// distribution corrected for temperature and pressure dependence
tmp<volScalarField> Su0pTphi
(
const volScalarField& p,
const volScalarField& Tu,
const volScalarField& phi
) const;
//- Return the Markstein number
// evaluated from the given equivalence ratio
tmp<volScalarField> Ma(const volScalarField& phi) const;
//- Construct as copy (not implemented)
SCOPE(const SCOPE&);
void operator=(const SCOPE&);
public:
//- Runtime type information
TypeName("SCOPE");
// Constructors
//- Construct from dictionary and hhuCombustionThermo
SCOPE
(
const dictionary&,
const hhuCombustionThermo&
);
// Destructor
~SCOPE();
// Member functions
//- Return the Markstein number
tmp<volScalarField> Ma() const;
//- Return the laminar flame speed [m/s]
tmp<volScalarField> operator()() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End laminarFlameSpeedModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
rho = thermo->rho();
volScalarField rUA = 1.0/UEqn.A();
U = invA & UEqn.H();
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(thermo->psi())
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
betav*fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi =
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
betav*fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "continuityErrs.H"
U -= invA & (betav*fvc::grad(p));
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -0,0 +1,15 @@
Info<< "Reading combustion properties\n" << endl;
IOdictionary combustionProperties
(
IOobject
(
"combustionProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
ignition ign(combustionProperties, runTime, mesh);

View File

@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
solve(betav*fvm::ddt(rho) + fvc::div(phi));
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Global
setDeltaT
Description
Reset the timestep to maintain a constant maximum courant Number.
Reduction of time-step is imediate but increase is damped to avoid
unstable oscillations.
\*---------------------------------------------------------------------------*/
if (adjustTimeStep)
{
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
(
deltaTFact*runTime.deltaT().value(),
maxDeltaT
)
);
Info<< "deltaT = " << runTime.deltaT().value() << endl;
}
// ************************************************************************* //

View File

@ -0,0 +1,107 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
description "Compressible premixed/partially-premixed turbulent combustion code";
dictionaries
{
include "$FOAMX_CONFIG/dictionaries/controlDict/controlDictAdjustTimeStep.cfg";
fvSchemes;
fvSolution;
include "$FOAMX_CONFIG/dictionaries/turbulenceProperties/turbulenceModelsCompressible.cfg";
include "$FOAMX_CONFIG/dictionaries/thermophysicalProperties/thermophysicalPropertiesCombustion.cfg";
include "$FOAMX_CONFIG/dictionaries/environmentalProperties/environmentalPropertiesg.cfg";
combustionProperties;
}
fields
{
include "$FOAMX_CONFIG/entries/geometricFields/pDynamic.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/U.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/k.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/epsilon.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/T.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Tu.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/ft.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/fu.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/b.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Xi.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Su.cfg";
}
patchPhysicalTypes
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/thermal/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/thermal/patches.cfg";
}
patchFieldsPhysicalTypes
{
U
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/U.cfg";
}
p
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/p.cfg";
}
k
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/k.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/k.cfg";
}
epsilon
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/epsilon.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/epsilon.cfg";
}
T
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/thermal/T.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/thermal/T.cfg";
}
Tu
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/thermal/T.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/thermal/T.cfg";
}
ft
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
fu
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
b
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
Xi
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
Su
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/combustionProperties/combustionProperties.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/combustionProperties/laminarFlameSpeedCorrelation.cfg";
include "$FOAMX_CONFIG/dictionaries/combustionProperties/fuel.cfg";
include "$FOAMX_CONFIG/entries/dimensionedScalar/Su.cfg";
include "$FOAMX_CONFIG/dictionaries/combustionProperties/SuModel.cfg";
include "$FOAMX_CONFIG/entries/dimensionedScalar/equivalenceRatio.cfg";
include "$FOAMX_CONFIG/entries/dimensionedScalar/sigmaExt.cfg";
include "$FOAMX_CONFIG/dictionaries/combustionProperties/XiModel.cfg";
include "$FOAMX_CONFIG/entries/dimensionedScalar/XiCoef.cfg";
include "$FOAMX_CONFIG/entries/dimensionedScalar/XiShapeCoef.cfg";
include "$FOAMX_CONFIG/entries/dimensionedScalar/uPrimeCoef.cfg";
include "$FOAMX_CONFIG/dictionaries/combustionProperties/GuldersCoeffs.cfg";
include "$FOAMX_CONFIG/entries/Switch/ignite.cfg";
include "$FOAMX_CONFIG/dictionaries/combustionProperties/ignitionSites.cfg";
include "$FOAMX_CONFIG/dictionaries/combustionProperties/StCorr.cfg";
}
default
{
include "defaults/constant/combustionProperties";
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object combustionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
laminarFlameSpeedCorrelation Gulders;
fuel Propane;
Su Su [0 1 -1 0 0 0 0] 0.434;
SuModel unstrained;
equivalenceRatio equivalenceRatio [0 0 0 0 0 0 0] 1;
sigmaExt sigmaExt [0 0 -1 0 0 0 0] 100000;
XiModel transport;
XiCoef XiCoef [0 0 0 0 0 0 0] 0.62;
XiShapeCoef XiShapeCoef [0 0 0 0 0 0 0] 1;
uPrimeCoef uPrimeCoef [0 0 0 0 0 0 0] 1;
GuldersCoeffs
{
Methane
{
W W [0 0 0 0 0 0 0] 0.422;
eta eta [0 0 0 0 0 0 0] 0.15;
xi xi [0 0 0 0 0 0 0] 5.18;
alpha alpha [0 0 0 0 0 0 0] 2;
beta beta [0 0 0 0 0 0 0] -0.5;
f f [0 0 0 0 0 0 0] 2.3;
}
Propane
{
W W [0 0 0 0 0 0 0] 0.446;
eta eta [0 0 0 0 0 0 0] 0.12;
xi xi [0 0 0 0 0 0 0] 4.95;
alpha alpha [0 0 0 0 0 0 0] 1.77;
beta beta [0 0 0 0 0 0 0] -0.2;
f f [0 0 0 0 0 0 0] 2.3;
}
IsoOctane
{
W W [0 0 0 0 0 0 0] 0.4658;
eta eta [0 0 0 0 0 0 0] -0.326;
xi xi [0 0 0 0 0 0 0] 4.48;
alpha alpha [0 0 0 0 0 0 0] 1.56;
beta beta [0 0 0 0 0 0 0] -0.22;
f f [0 0 0 0 0 0 0] 2.3;
}
}
ignite yes;
ignitionSites
(
{
location (0 0 0.0005);
diameter 0.003;
start 0;
duration 0.001;
strength 1;
}
);
ignitionSphereFraction 1;
ignitionThickness ignitionThickness [0 1 0 0 0 0 0] 0;
ignitionCircleFraction 1;
ignitionKernelArea ignitionKernelArea [0 2 0 0 0 0 0] 0;
// ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss <>;
div(phid,p) Gauss <>;
div(phiU,p) Gauss linear;
div(phi,k) Gauss <>;
div(phi,epsilon) Gauss <>;
div(phi,R) Gauss <>;
div(R) Gauss linear;
div(phiXi,Xi) Gauss <>;
div(phiXi,Su) Gauss <>;
div(phiSt,b) Gauss <>;
div(phi,ft_b_h_hu) Gauss multivariateSelection
{
fu <>;
ft <>;
b <>;
h <>;
hu <>;
};
div(U) Gauss linear;
div((Su*grad(b))) Gauss linear;
div((U+((Su*Xi)*grad(b)))) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(muEff,U) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
laplacian(muEff,b) Gauss linear corrected;
laplacian(muEff,ft) Gauss linear corrected;
laplacian(alphaEff,h) Gauss linear corrected;
laplacian(alphaEff,hu) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
rho ICCG 1e-05 0;
U BICCG 1e-05 0;
p ICCG 1e-06 0;
ft BICCG 1e-05 0;
fu BICCG 1e-05 0;
b BICCG 1e-05 0;
Xi BICCG 1e-05 0;
Su BICCG 1e-05 0;
h BICCG 1e-05 0;
hu BICCG 1e-05 0;
R BICCG 1e-05 0;
k BICCG 1e-05 0;
epsilon BICCG 1e-05 0;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
momentumPredictor yes;
}
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSchemes/fvSchemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/ddt/transient.cfg";
include "fvSchemes/gradSchemes.cfg";
include "fvSchemes/divSchemes.cfg";
include "fvSchemes/laplacianSchemes.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/interpolation/defaultOnly.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/snGrad/defaultOnly.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/flux/p.cfg";
}
default
{
include "defaults/system/fvSchemes";
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
divSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiU.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phidp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiUp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phik.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiEpsilon.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiR.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/R.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiXiXi.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiXiSu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiStb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phift_b_h_hu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/U.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/SuGradb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/USuXiGradb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/muEffGradUT.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
gradSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/grad/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/grad/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/grad/p.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
laplacianSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/muEffU.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DkEffk.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DepsilonEffEpsilon.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DREffR.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/rhoAUp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/muEffb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/muEffFt.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/alphaEffh.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/alphaEffhu.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSolution/fvSolution.cfg";
entries
{
solvers
{
type dictionary;
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/rho.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/U.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/pSymm.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/ft.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/fu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/b.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/Xi.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/Su.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/h.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/hu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/R.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/k.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/epsilon.cfg";
}
}
include "$FOAMX_CONFIG/dictionaries/fvSolution/PISO.cfg";
}
default
{
include "defaults/system/fvSolution";
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
XiFoam.C
EXE = $(FOAM_APPBIN)/XiFoam

View File

@ -0,0 +1,19 @@
EXE_INC = \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
EXE_LIBS = \
-lengine \
-lfiniteVolume \
-lmeshTools \
-lcompressibleTurbulenceModels \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels

View File

@ -0,0 +1,13 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
rho*g
);
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Application
XiFoam
Description
Compressible premixed/partially-premixed combustion solver with turbulence
modelling.
Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
equation or from an algebraic exression. Both approaches are
based on Gulder's flame speed correlation which has been shown
to be appropriate by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
model will be required.
For cases involving very lean Propane flames or other flames which are
very strain-sensitive, a transport equation for the laminar flame
speed is present. This equation is derived using heuristic arguments
involving the strain time scale and the strain-rate at extinction.
the transport velocity is the same as that for the Xi equation.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "hhuCombustionThermo.H"
#include "compressible/turbulenceModel/turbulenceModel.H"
#include "laminarFlameSpeed.H"
#include "ignition.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readCombustionProperties.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "readTimeControls.H"
# include "compressibleCourantNo.H"
# include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "rhoEqn.H"
# include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "ftEqn.H"
# include "bEqn.H"
# include "huEqn.H"
# include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
# include "pEqn.H"
}
turbulence->correct();
rho = thermo->rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,237 @@
if (ign.ignited())
{
// progress variable
// ~~~~~~~~~~~~~~~~~
volScalarField c = scalar(1) - b;
// Unburnt gas density
// ~~~~~~~~~~~~~~~~~~~
volScalarField rhou = thermo->rhou();
// Calculate flame normal etc.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
volVectorField n = fvc::grad(b);
volScalarField mgb = mag(n);
dimensionedScalar dMgb = 1.0e-3*
(b*c*mgb)().weightedAverage(mesh.V())
/((b*c)().weightedAverage(mesh.V()) + SMALL)
+ dimensionedScalar("ddMgb", mgb.dimensions(), SMALL);
mgb += dMgb;
surfaceVectorField SfHat = mesh.Sf()/mesh.magSf();
surfaceVectorField nfVec = fvc::interpolate(n);
nfVec += SfHat*(fvc::snGrad(b) - (SfHat & nfVec));
nfVec /= (mag(nfVec) + dMgb);
surfaceScalarField nf = (mesh.Sf() & nfVec);
n /= mgb;
# include "StCorr.H"
// Calculate turbulent flame speed flux
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
surfaceScalarField phiSt = fvc::interpolate(rhou*StCorr*Su*Xi)*nf;
scalar StCoNum = max
(
mesh.surfaceInterpolation::deltaCoeffs()
*mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
).value()*runTime.deltaT().value();
Info<< "Max St-Courant Number = " << StCoNum << endl;
// Create b equation
// ~~~~~~~~~~~~~~~~~
fvScalarMatrix bEqn
(
fvm::ddt(rho, b)
+ mvConvection->fvmDiv(phi, b)
+ fvm::div(phiSt, b, "div(phiSt,b)")
- fvm::Sp(fvc::div(phiSt), b)
- fvm::laplacian(turbulence->muEff(), b)
);
// Add ignition cell contribution to b-equation
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# include "ignite.H"
// Solve for b
// ~~~~~~~~~~~
bEqn.solve();
Info<< "min(b) = " << min(b).value() << endl;
// Calculate coefficients for Gulder's flame speed correlation
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*turbulence->k());
//volScalarField up = sqrt(mag(diag(n * n) & diag(turbulence->r())));
volScalarField epsilon = pow(uPrimeCoef, 3)*turbulence->epsilon();
volScalarField tauEta = sqrt(thermo->muu()/(rhou*epsilon));
volScalarField Reta = up/
(
sqrt(epsilon*tauEta) + dimensionedScalar("1e-8", up.dimensions(), 1e-8)
);
//volScalarField l = 0.337*k*sqrt(k)/epsilon;
//Reta *= max((l - dimensionedScalar("dl", dimLength, 1.5e-3))/l, 0.0);
// Calculate Xi flux
// ~~~~~~~~~~~~~~~~~
surfaceScalarField phiXi =
phiSt
- fvc::interpolate(fvc::laplacian(turbulence->muEff(), b)/mgb)*nf
+ fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf;
// Calculate mean and turbulent strain rates
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volVectorField Ut = U + Su*Xi*n;
volScalarField sigmat = (n & n)*fvc::div(Ut) - (n & fvc::grad(Ut) & n);
volScalarField sigmas =
((n & n)*fvc::div(U) - (n & fvc::grad(U) & n))/Xi
+ (
(n & n)*fvc::div(Su*n)
- (n & fvc::grad(Su*n) & n)
)*(Xi + scalar(1))/(2*Xi);
// Calculate the unstrained laminar flame speed
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField Su0 = unstrainedLaminarFlameSpeed()();
// Calculate the laminar flame speed in equilibrium with the applied strain
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField SuInf = Su0*max(scalar(1) - sigmas/sigmaExt, scalar(0.01));
if (SuModel == "unstrained")
{
Su == Su0;
}
else if (SuModel == "equilibrium")
{
Su == SuInf;
}
else if (SuModel == "transport")
{
// Solve for the strained laminar flame speed
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField Rc =
(sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt)
/(sqr(Su0 - SuInf) + sqr(SuMin));
solve
(
fvm::ddt(rho, Su)
+ fvm::div(phi + phiXi, Su, "div(phiXi,Su)")
- fvm::Sp(fvc::div(phiXi), Su)
==
- fvm::SuSp(-rho*Rc*Su0/Su, Su)
- fvm::SuSp(rho*(sigmas + Rc), Su)
);
// Limit the maximum Su
// ~~~~~~~~~~~~~~~~~~~~
Su.min(SuMax);
Su.max(SuMin);
}
else
{
FatalError
<< args.executable() << " : Unknown Su model " << SuModel
<< abort(FatalError);
}
// Calculate Xi according to the selected flame wrinkling model
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (XiModel == "fixed")
{
// Do nothing, Xi is fixed!
}
else if (XiModel == "algebraic")
{
// Simple algebraic model for Xi based on Gulders correlation
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xi == scalar(1) +
(scalar(1) + (2*XiShapeCoef)*(scalar(0.5) - b))
*XiCoef*sqrt(up/(Su + SuMin))*Reta;
}
else if (XiModel == "transport")
{
// Calculate Xi transport coefficients based on Gulders correlation
// and DNS data for the rate of generation
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField XiEqStar =
scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta;
volScalarField XiEq =
scalar(1.001)
+ (scalar(1) + (2*XiShapeCoef)*(scalar(0.5) - b))
*(XiEqStar - scalar(1.001));
volScalarField Gstar = 0.28/tauEta;
volScalarField R = Gstar*XiEqStar/(XiEqStar - scalar(1));
volScalarField G = R*(XiEq - scalar(1.001))/XiEq;
//R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar;
// Solve for the flame wrinkling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solve
(
fvm::ddt(rho, Xi)
+ fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)")
- fvm::Sp(fvc::div(phiXi), Xi)
==
rho*R
- fvm::Sp(rho*(R - G), Xi)
- fvm::Sp
(
rho*max
(
sigmat - sigmas,
dimensionedScalar("0", sigmat.dimensions(), 0)
),
Xi
)
);
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi.max(1.0);
Info<< "max(Xi) = " << max(Xi).value() << endl;
Info<< "max(XiEq) = " << max(XiEq).value() << endl;
}
else
{
FatalError
<< args.executable() << " : Unknown Xi model " << XiModel
<< abort(FatalError);
}
Info<< "Combustion progress = "
<< 100*(scalar(1) - b)().weightedAverage(mesh.V()).value() << "%"
<< endl;
St = Xi*Su;
}

View File

@ -0,0 +1,130 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<hhuCombustionThermo> thermo
(
hhuCombustionThermo::New(mesh)
);
combustionMixture& composition = thermo->composition();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
volScalarField& hu = thermo->hu();
volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
const volScalarField& T = thermo->T();
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo()
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info<< "Creating field Xi\n" << endl;
volScalarField Xi
(
IOobject
(
"Xi",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
(
laminarFlameSpeed::New(thermo)
);
Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
dimensionedScalar SuMin = 0.01*Su.average();
dimensionedScalar SuMax = 4*Su.average();
Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St
(
IOobject
(
"St",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Xi*Su
);
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft"))
{
fields.add(composition.Y("ft"));
}
fields.add(b);
fields.add(h);
fields.add(hu);

View File

@ -0,0 +1,22 @@
tmp<fv::convectionScheme<scalar> > mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,ft_b_h_hu)")
)
);
if (composition.contains("ft"))
{
volScalarField& ft = composition.Y("ft");
solve
(
fvm::ddt(rho, ft)
+ mvConvection->fvmDiv(phi, ft)
- fvm::laplacian(turbulence->muEff(), ft)
);
}

View File

@ -0,0 +1,12 @@
{
solve
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
);
thermo->correct();
}

View File

@ -0,0 +1,18 @@
if (ign.ignited())
{
solve
(
fvm::ddt(rho, hu)
+ mvConvection->fvmDiv(phi, hu)
- fvm::laplacian(turbulence->alphaEff(), hu)
// These terms cannot be used in partially-premixed combustion due to
// the resultant inconsistency between ft and hu transport.
// A possible solution would be to solve for ftu as well as ft.
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), hu)
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hu)
==
DpDt*rho/thermo->rhou()
);
}

View File

@ -0,0 +1,68 @@
rho = thermo->rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(thermo->psi())
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi =
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -0,0 +1,45 @@
Info<< "Reading combustion properties\n" << endl;
IOdictionary combustionProperties
(
IOobject
(
"combustionProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
word SuModel
(
combustionProperties.lookup("SuModel")
);
dimensionedScalar sigmaExt
(
combustionProperties.lookup("sigmaExt")
);
word XiModel
(
combustionProperties.lookup("XiModel")
);
dimensionedScalar XiCoef
(
combustionProperties.lookup("XiCoef")
);
dimensionedScalar XiShapeCoef
(
combustionProperties.lookup("XiShapeCoef")
);
dimensionedScalar uPrimeCoef
(
combustionProperties.lookup("uPrimeCoef")
);
ignition ign(combustionProperties, runTime, mesh);

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
description "Compressible premixed/partially-premixed LES turbulent combustion code";
dictionaries
{
include "$FOAMX_CONFIG/dictionaries/controlDict/controlDict.cfg";
fvSchemes;
fvSolution;
include "$FOAMX_CONFIG/dictionaries/turbulenceProperties/LESmodelsCompressible.cfg";
include "$FOAMX_CONFIG/dictionaries/thermophysicalProperties/thermophysicalPropertiesCombustion.cfg";
include "$FOAMX_CONFIG/dictionaries/environmentalProperties/environmentalPropertiesg.cfg";
combustionProperties;
}
fields
{
include "$FOAMX_CONFIG/entries/geometricFields/pDynamic.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/U.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/k.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/muSgs.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/T.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Tu.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/ft.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/b.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Xi.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Su.cfg";
}
patchPhysicalTypes
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/thermal/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/thermal/patches.cfg";
turbulentInlet
{
description "Turbulent inlet";
parentType inlet;
}
}
patchFieldsPhysicalTypes
{
U
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/U.cfg";
turbulentInlet turbulentInlet;
}
p
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/p.cfg";
}
k
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/k.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/k.cfg";
}
muSgs
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/muSgs.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/muSgs.cfg";
}
T
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/thermal/T.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/thermal/T.cfg";
}
Tu
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/thermal/T.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/thermal/T.cfg";
}
ft
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
fu
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
b
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
Xi
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
Su
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/Y.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "../../XiFoam/FoamX/combustionProperties.cfg";
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object combustionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
laminarFlameSpeedCorrelation const;
fuel Propane;
Su Su [0 1 -1 0 0 0 0] 0.135;
SuModel transport;
equivalenceRatio equivalenceRatio [0 0 0 0 0 0 0] 0.6;
sigmaExt sigmaExt [0 0 -1 0 0 0 0] 338;
XiModel transport;
XiCoef XiCoef [0 0 0 0 0 0 0] 0.62;
XiShapeCoef XiShapeCoef [0 0 0 0 0 0 0] 1;
uPrimeCoef uPrimeCoef [0 0 0 0 0 0 0] 1;
GuldersCoeffs
{
Methane
{
W W [0 0 0 0 0 0 0] 0.422;
eta eta [0 0 0 0 0 0 0] 0.15;
xi xi [0 0 0 0 0 0 0] 5.18;
alpha alpha [0 0 0 0 0 0 0] 2;
beta beta [0 0 0 0 0 0 0] -0.5;
f f [0 0 0 0 0 0 0] 2.3;
}
Propane
{
W W [0 0 0 0 0 0 0] 0.446;
eta eta [0 0 0 0 0 0 0] 0.12;
xi xi [0 0 0 0 0 0 0] 4.95;
alpha alpha [0 0 0 0 0 0 0] 1.77;
beta beta [0 0 0 0 0 0 0] -0.2;
f f [0 0 0 0 0 0 0] 2.3;
}
IsoOctane
{
W W [0 0 0 0 0 0 0] 0.4658;
eta eta [0 0 0 0 0 0 0] -0.326;
xi xi [0 0 0 0 0 0 0] 4.48;
alpha alpha [0 0 0 0 0 0 0] 1.56;
beta beta [0 0 0 0 0 0 0] -0.22;
f f [0 0 0 0 0 0 0] 2.3;
}
}
ignite no;
ignitionSites
(
);
ignitionSphereFraction 1;
ignitionThickness ignitionThickness [0 1 0 0 0 0 0] 0;
ignitionCircleFraction 1;
ignitionKernelArea ignitionKernelArea [0 2 0 0 0 0 0] 0;
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss <>;
div(phid,p) Gauss linear;
div(phiU,p) Gauss linear;
div(phi,k) Gauss <>;
div(phi,B) Gauss <>;
div(B) Gauss linear;
div(phiXi,Xi) Gauss <>;
div(phiXi,Su) Gauss <>;
div(phiSt,b) Gauss <>;
div(phi,ft_b_h_hu) Gauss multivariateSelection
{
fu <>;
ft <>;
b <>;
h <>;
hu <>;
};
div(U) Gauss linear;
div((Su*grad(b))) Gauss linear;
div((U+((Su*Xi)*grad(b)))) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(muEff,U) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DBEff,B) Gauss linear corrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
laplacian(muEff,b) Gauss linear corrected;
laplacian(muEff,ft) Gauss linear corrected;
laplacian(alphaEff,h) Gauss linear corrected;
laplacian(alphaEff,hu) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
rho ICCG 1e-05 0;
U BICCG 1e-05 0;
p ICCG 1e-06 0;
ft BICCG 1e-05 0;
fu BICCG 1e-05 0;
b BICCG 1e-05 0;
Xi BICCG 1e-05 0;
Su BICCG 1e-05 0;
h BICCG 1e-05 0;
hu BICCG 1e-05 0;
R BICCG 1e-05 0;
k BICCG 1e-05 0;
epsilon BICCG 1e-05 0;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSchemes/fvSchemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/ddt/transient.cfg";
include "../../XiFoam/FoamX/fvSchemes/gradSchemes.cfg";
include "fvSchemes/divSchemes.cfg";
include "fvSchemes/laplacianSchemes.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/interpolation/defaultOnly.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/snGrad/defaultOnly.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/flux/p.cfg";
}
default
{
include "defaults/system/fvSchemes";
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
divSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiU.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phidp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiUp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phik.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiBT.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/B.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiXiXi.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiXiSu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiStb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phift_b_h_hu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/U.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/SuGradb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/USuXiGradb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/muEffGradUT.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,26 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
laplacianSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/muEffU.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DkEffk.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DBEffB.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/rhoAUp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/muEffb.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/muEffFt.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/alphaEffh.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/alphaEffhu.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSolution/fvSolution.cfg";
entries
{
solvers
{
type dictionary;
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/rho.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/U.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/pSymm.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/ft.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/fu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/b.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/Xi.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/Su.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/h.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/hu.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/R.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/k.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/epsilon.cfg";
}
}
include "$FOAMX_CONFIG/dictionaries/fvSolution/PISO.cfg";
}
default
{
include "defaults/system/fvSolution";
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
Xoodles.C
EXE = $(FOAM_APPBIN)/Xoodles

View File

@ -0,0 +1,23 @@
EXE_INC = \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/LESmodels \
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I../XiFoam
EXE_LIBS = \
-lengine \
-lfiniteVolume \
-lmeshTools \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lspecie \
-lcompressibleLESmodels \
-llaminarFlameSpeedModels

View File

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Application
Xoodles
Description
Compressible premixed/partially-premixed combustion solver with large-eddy
simulation (LES) turbulence modelling.
Combusting LES code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
equation or from an algebraic exression. Both approaches are
based on Gulder's flame speed correlation which has been shown
to be appropriate for LES by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
model will be required.
For cases involving very lean Propane flames or other flames which are
very strain-sensitive, a transport equation for the laminar flame
speed is present. This equation is derived using heuristic arguments
involving the strain time scale and the strain-rate at extinction.
the transport velocity is the same as that for the Xi equation.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "hhuCombustionThermo.H"
#include "compressible/LESmodel/LESmodel.H"
#include "laminarFlameSpeed.H"
#include "ignition.H"
#include "IFstream.H"
#include "OFstream.H"
#define divDevRhoReff divDevRhoBeff
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMeshNoClear.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "readPISOControls.H"
# include "readCombustionProperties.H"
# include "createAverages.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "compressibleCourantNo.H"
# include "rhoEqn.H"
turbulence->correct();
# include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "ftEqn.H"
# include "bEqn.H"
# include "huEqn.H"
# include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
# include "pEqn.H"
}
# include "calculateAverages.H"
runTime.write();
# include "writeNaveragingSteps.H"
rho = thermo->rho();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,16 @@
nAveragingSteps++;
scalar nm1Coeff = scalar(nAveragingSteps - 1)/nAveragingSteps;
scalar nCoeff = 1.0/nAveragingSteps;
R += sqr(Umean);
Umean = nm1Coeff*Umean + nCoeff*U;
R = nm1Coeff*R + nCoeff*sqr(U) - sqr(Umean);
pPrime2Mean += sqr(pMean);
pMean = nm1Coeff*pMean + nCoeff*p;
pPrime2Mean = nm1Coeff*pPrime2Mean + nCoeff*sqr(p) - sqr(pMean);
Tmean = nm1Coeff*Tmean + nCoeff*T;
bmean = nm1Coeff*bmean + nCoeff*b;
Ximean = nm1Coeff*Ximean + nCoeff*Xi;

View File

@ -0,0 +1,229 @@
label nAveragingSteps = 1;
IFstream nAveragingStepsFile
(
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
);
volVectorField* UmeanPtr;
volSymmTensorField* RPtr;
volScalarField* pMeanPtr;
volScalarField* pPrime2MeanPtr;
volScalarField* TmeanPtr;
volScalarField* bmeanPtr;
volScalarField* XimeanPtr;
if (nAveragingStepsFile.good())
{
nAveragingStepsFile >> nAveragingSteps;
Info << "Reading field Umean\n" << endl;
UmeanPtr = new volVectorField
(
IOobject
(
"Umean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field R\n" << endl;
RPtr = new volSymmTensorField
(
IOobject
(
"R",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field pMean\n" << endl;
pMeanPtr = new volScalarField
(
IOobject
(
"pMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field pPrime2Mean\n" << endl;
pPrime2MeanPtr = new volScalarField
(
IOobject
(
"pPrime2Mean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info << "Reading field Tmean\n" << endl;
TmeanPtr = new volScalarField
(
IOobject
(
"Tmean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info << "Reading field bmean\n" << endl;
bmeanPtr = new volScalarField
(
IOobject
(
"bmean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info << "Reading field Ximean\n" << endl;
XimeanPtr = new volScalarField
(
IOobject
(
"Ximean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
}
else
{
Info << "Creating field Umean\n" << endl;
UmeanPtr = new volVectorField
(
IOobject
(
"Umean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U
);
Info<< "Creating field R\n" << endl;
RPtr = new volSymmTensorField
(
IOobject
(
"R",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqr(U) - sqr(*UmeanPtr)
);
Info<< "Creating field pMean\n" << endl;
pMeanPtr = new volScalarField
(
IOobject
(
"pMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
p
);
Info<< "Creating field pPrime2Mean\n" << endl;
pPrime2MeanPtr = new volScalarField
(
IOobject
(
"pPrime2Mean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqr(p) - sqr(*pMeanPtr)
);
Info << "Creating field Tmean\n" << endl;
TmeanPtr = new volScalarField
(
IOobject
(
"Tmean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
T
);
Info << "Creating field bmean\n" << endl;
bmeanPtr = new volScalarField
(
IOobject
(
"bmean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
b
);
Info << "Creating field Ximean\n" << endl;
XimeanPtr = new volScalarField
(
IOobject
(
"Ximean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Xi
);
}
volVectorField& Umean = *UmeanPtr;
volSymmTensorField& R = *RPtr;
volScalarField& pMean = *pMeanPtr;
volScalarField& pPrime2Mean = *pPrime2MeanPtr;
volScalarField& Tmean = *TmeanPtr;
volScalarField& bmean = *bmeanPtr;
volScalarField& Ximean = *XimeanPtr;

View File

@ -0,0 +1,124 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<hhuCombustionThermo> thermo
(
hhuCombustionThermo::New(mesh)
);
combustionMixture& composition = thermo->composition();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
volScalarField& hu = thermo->hu();
volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
const volScalarField& T = thermo->T();
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::LESmodel> turbulence
(
compressible::LESmodel::New(rho, U, phi, thermo())
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info<< "Creating field Xi\n" << endl;
volScalarField Xi
(
IOobject
(
"Xi",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
(
laminarFlameSpeed::New(thermo)
);
Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
dimensionedScalar SuMin = 0.01*Su.average();
dimensionedScalar SuMax = 4*Su.average();
Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St
(
IOobject
(
"St",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Xi*Su
);
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft"))
{
fields.add(composition.Y("ft"));
}
fields.add(b);
fields.add(h);
fields.add(hu);

View File

@ -0,0 +1,18 @@
if (runTime.outputTime())
{
OFstream nAveragingStepsFile
(
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
);
if (nAveragingStepsFile.good())
{
nAveragingStepsFile << nAveragingSteps << endl;
}
else
{
FatalErrorIn(args.executable())
<< "Cannot open file " << nAveragingStepsFile.name()
<< abort(FatalError);
}
}

View File

@ -0,0 +1,3 @@
coldEngineFoam.C
EXE = $(FOAM_APPBIN)/coldEngineFoam

View File

@ -0,0 +1,16 @@
EXE_INC = \
-I../engineFoam \
-I../XiFoam \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/lnInclude
EXE_LIBS = \
-lengine \
-lfiniteVolume \
-lcompressibleTurbulenceModels \
-lbasicThermophysicalModels \
-lspecie

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Application
engineFoam
Description
Solver for cold-flow in internal combustion engines.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "engineTime.H"
#include "engineMesh.H"
#include "basicThermo.H"
#include "turbulenceModel.H"
#include "OFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createEngineTime.H"
# include "createEngineMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setInitialDeltaT.H"
# include "startSummary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readPISOControls.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "Crank angle = " << runTime.theta() << " CA-deg"
<< endl;
mesh.move();
# include "rhoEqn.H"
# include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "hEqn.H"
# include "pEqn.H"
}
turbulence->correct();
runTime.write();
# include "logSummary.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicThermo> thermo
(
basicThermo::New(mesh)
);
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
const volScalarField& T = thermo->T();
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo()
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -0,0 +1,12 @@
{
solve
(
fvm::ddt(rho, h)
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
);
thermo->correct();
}

View File

@ -0,0 +1,10 @@
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl;
logSummaryFile
<< runTime.theta() << tab
<< p.weightedAverage(mesh.V()).value() << tab
<< T.weightedAverage(mesh.V()).value() << tab
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< endl;

Some files were not shown because too many files have changed in this diff Show More