Compare commits

..

No commits in common. "trunk" and "slfm" have entirely different histories.
trunk ... slfm

55 changed files with 10 additions and 3310 deletions

2
.gitignore vendored
View file

@ -7,8 +7,6 @@
*.bak
*.bak[0-9][0-9]
\#*\#
.*.swp
.*.swo
# File-browser settings - anywhere
.directory

View file

@ -1,40 +0,0 @@
{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
fvm::ddt(alphac,rho, he) + mvConvection->fvmDiv(alphacPhi, he)
+ fvc::ddt(alphac,rho, K) + fvc::div(alphacPhi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(alphac*turbulence->alphaEff(), he)
==
alphac*rho*(U&g)
+ parcels.Sh(he)
+ radiation->Sh(thermo)
+ combustion->Sh()
+ fvOptions(alphac,rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View file

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

View file

@ -1,56 +0,0 @@
EXE_INC = \
-I. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiationModels \
-lODE \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels \
-lfvOptions \
-lsampling

View file

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
ThermoMPPICFoam
Description
Transient solver for compressible, turbulent flow with a reacting,
multiphase particle cloud, and optional sources/constraints.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "basicThermoKinematicMPPICCloud.H"
#include "rhoCombustionModel.H"
#include "radiationModel.H"
#include "fvOptions.H"
#include "SLGThermo.H"
#include "pimpleControl.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createTimeControls.H"
#include "createRDeltaT.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
turbulence->validate();
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
parcels.evolve();
// Update continuous phase volume fraction field
alphac = max(1.0 - parcels.theta(), alphacMin);
alphac.correctBoundaryConditions();
alphacf = fvc::interpolate(alphac);
alphacPhi = alphacf*phi;
fvVectorMatrix cloudSU(parcels.SU(U));
volVectorField cloudVolSUSu
(
IOobject
(
"cloudVolSUSu",
runTime.timeName(),
mesh
),
mesh,
dimensionedVector
(
"0",
cloudSU.dimensions()/dimVolume,
vector::zero
),
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
cloudVolSUSu.correctBoundaryConditions();
cloudSU.source() = vector::zero;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
#include "YEqn.H"
#include "EEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
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

@ -1,43 +0,0 @@
fvVectorMatrix UEqn
(
fvm::ddt(alphac, rho, U)
+ fvm::div(alphacPhi, U)
- fvm::laplacian(alphac*turbulence->muEff(),U)
- fvc::div(alphac*turbulence->muEff()*dev2(fvc::grad(U)().T()))
- fvm::Sp(fvc::ddt(alphac,rho) + fvc::div(alphacPhi), U)
==
cloudSU
+ fvOptions(alphac,rho, U)
);
UEqn.relax();
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
surfaceScalarField phicForces
(
(fvc::interpolate(rAU*cloudVolSUSu) & mesh.Sf())
+ alphacf*rhorAUf*(g & mesh.Sf())
);
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
phicForces/rAUf
)
- fvc::grad(p)
);
fvOptions.correct(U);
K = 0.5*magSqr(U);
}

View file

@ -1,53 +0,0 @@
tmp<fv::convectionScheme<scalar>> mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
)
);
{
combustion->correct();
dQ = combustion->dQ();
label inertIndex = -1;
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
{
if (Y[i].name() != inertSpecie)
{
volScalarField& Yi = Y[i];
fvScalarMatrix YEqn
(
fvm::ddt(alphac,rho, Yi)
+ mvConvection->fvmDiv(alphacPhi, Yi)
- fvm::laplacian(alphac*turbulence->muEff(), Yi)
==
combustion->R(Yi)
+ fvOptions(alphac,rho, Yi)
);
YEqn.relax();
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
fvOptions.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}
else
{
inertIndex = i;
}
}
Y[inertIndex] = scalar(1) - Yt;
Y[inertIndex].max(0.0);
}

View file

@ -1,26 +0,0 @@
Info<< "\nConstructing reacting cloud" << endl;
basicThermoKinematicMPPICCloud parcels
(
"reactingCloud",
rho,
U,
slgThermo.thermo().mu(),
g
);
// Continuouse phase volume fraction lower limit
scalar alphacMin
(
1.0
- readScalar
(
parcels.particleProperties().subDict("constantProperties").lookup("alphaMax")
)
);
// Update alphac from the particle locations
alphac = max(1.0 - parcels.theta(), alphacMin);
alphac.correctBoundaryConditions();
alphacf = fvc::interpolate(alphac);
alphacPhi = alphacf*phi;

View file

@ -1,2 +0,0 @@
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();

View file

@ -1,158 +0,0 @@
#include "readGravitationalAcceleration.H"
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion
(
combustionModels::rhoCombustionModel::New(mesh)
);
rhoReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie))
{
FatalErrorInFunction
<< "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species()
<< exit(FatalError);
}
volScalarField& p = thermo.p();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault
(
"rhoMax",
pimple.dict(),
dimDensity,
GREAT
)
);
dimensionedScalar rhoMin
(
dimensionedScalar::lookupOrDefault
(
"rhoMin",
pimple.dict(),
dimDensity,
0
)
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
// Set the turbulence into the combustion model
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(thermo.he());
volScalarField dQ
(
IOobject
(
"dQ",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
volScalarField alphac
(
IOobject
(
"alphac",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("0", dimless, 1)
);
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
surfaceScalarField alphacPhi("alphacPhi", alphacf*phi);
volScalarField alphacrho("alphacrho", alphac*rho);
#include "createMRF.H"
#include "createRadiationModel.H"
#include "createClouds.H"

View file

@ -1,81 +0,0 @@
{
rho = thermo.rho();
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
rhorAUf= fvc::interpolate(rho*rAU);
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
+ phicForces*rhof
)
);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
fvScalarMatrix pDDtEqn
(
fvc::ddt(alphac,rho) + alphac*psi*correction(fvm::ddt(p))
+ fvc::div(alphacf*phiHbyA)
==
fvOptions(alphac*psi, p, rho.name())
);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
pDDtEqn
- fvm::laplacian(alphacf*rhorAUf, p)
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + pEqn.flux()/alphacf;
alphacPhi = alphacf*phi;
p.relax();
thermo.rho() += psi*p;
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U = HbyA + rAU*fvc::reconstruct(phicForces/rAUf) - rAU*fvc::grad(p);
}
}
U.correctBoundaryConditions();
fvOptions.correct(U);
K = 0.5*magSqr(U);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
}

View file

@ -1,52 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
fvScalarMatrix rhoEqn
(
fvm::ddt(alphac,rho)
+ fvc::div(alphacPhi)
==
fvOptions(alphac,rho)
);
rhoEqn.solve();
fvOptions.correct(rho);
Info<< "rho min/max = " << min(rho).value() << ", " << max(rho).value()
<< endl;
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
}
// ************************************************************************* //

View file

@ -1,134 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
{
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();
// Maximum flow Courant number
scalar maxCo(readScalar(pimpleDict.lookup("maxCo")));
// Maximum time scale
scalar maxDeltaT(pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT));
// Smoothing parameter (0-1) when smoothing iterations > 0
scalar rDeltaTSmoothingCoeff
(
pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
);
// Damping coefficient (1-0)
scalar rDeltaTDampingCoeff
(
pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 0.2)
);
// Maximum change in cell temperature per iteration
// (relative to previous value)
scalar alphaTemp(pimpleDict.lookupOrDefault("alphaTemp", 0.05));
Info<< "Time scales min/max:" << endl;
// Cache old reciprocal time scale field
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Flow time scale
{
rDeltaT.ref() =
(
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
rDeltaT.max(1/maxDeltaT);
Info<< " Flow = "
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
}
// Reaction source time scale
{
volScalarField::Internal rDeltaTT
(
mag
(
parcels.hsTrans()/(mesh.V()*runTime.deltaT())
+ combustion->Sh()()
)
/(
alphaTemp
*rho()
*thermo.Cp()()()
*T()
)
);
Info<< " Temperature = "
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.ref() = max
(
rDeltaT(),
rDeltaTT
);
}
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
// Spatially smooth the time scale field
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
// Limit rate of change of time scale
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT = max
(
rDeltaT,
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
);
}
Info<< " Overall = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
// ************************************************************************* //

View file

@ -1,32 +0,0 @@
{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
mvConvection->fvmDiv(phi, he)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
parcels.Sh(he)
+ radiation->Sh(thermo)
+ combustion->Sh()
+ fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View file

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

View file

@ -1,57 +0,0 @@
EXE_INC = \
-I. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-llagrangian \
-llagrangianIntermediate \
-lcoalCombustion \
-llagrangianTurbulence \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiationModels \
-lODE \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels \
-lfvOptions \
-lsampling

View file

@ -1,21 +0,0 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho()*g
+ parcels.SU(U)
+ fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax();
fvOptions.constrain(UEqn);
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);

View file

@ -1,53 +0,0 @@
tmp<fv::convectionScheme<scalar>> mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
)
);
{
combustion->correct();
dQ = combustion->dQ();
label inertIndex = -1;
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
{
if (Y[i].name() != inertSpecie)
{
volScalarField& Yi = Y[i];
fvScalarMatrix YEqn
(
mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
==
parcels.Srho(i)
+ combustion->R(Yi)
+ fvOptions(rho, Yi)
);
YEqn.relax();
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
fvOptions.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}
else
{
inertIndex = i;
}
}
Y[inertIndex] = scalar(1) - Yt;
Y[inertIndex].max(0.0);
}

View file

@ -1,8 +0,0 @@
Info<< "\nConstructing reacting cloud" << endl;
coalCloudList parcels
(
rho,
U,
g,
slgThermo
);

View file

@ -1,2 +0,0 @@
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();

View file

@ -1,123 +0,0 @@
#include "readGravitationalAcceleration.H"
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion
(
combustionModels::rhoCombustionModel::New(mesh)
);
rhoReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie))
{
FatalErrorInFunction
<< "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species()
<< exit(FatalError);
}
volScalarField& p = thermo.p();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault
(
"rhoMax",
simple.dict(),
dimDensity,
GREAT
)
);
dimensionedScalar rhoMin
(
dimensionedScalar::lookupOrDefault
(
"rhoMin",
simple.dict(),
dimDensity,
0
)
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
// Set the turbulence into the combustion model
combustion->setTurbulence(turbulence());
Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(thermo.he());
volScalarField dQ
(
IOobject
(
"dQ",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
#include "createMRF.H"
#include "createRadiationModel.H"
#include "createClouds.H"

View file

@ -1,57 +0,0 @@
{
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
tUEqn.clear();
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*fvc::flux(HbyA)
);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p)
==
parcels.Srho()
+ fvOptions(psi, p, rho.name())
);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi = phiHbyA + pEqn.flux();
}
}
p.relax();
// Second part of thermodynamic density update
thermo.rho() += psi*p;
#include "compressibleContinuityErrs.H"
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
}

View file

@ -1,93 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
simpleCoalcombustionFoam
Description
Steady state solver for compressible, turbulent flow with reacting,
multiphase particle clouds and optional sources/constraints.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "coalCloudList.H"
#include "rhoCombustionModel.H"
#include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvOptions.H"
#include "SLGThermo.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
parcels.evolve();
// --- Pressure-velocity SIMPLE corrector loop
{
#include "UEqn.H"
#include "YEqn.H"
#include "EEqn.H"
#include "pEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View file

@ -1,227 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "EDM.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::EDM<Type>::EDM
(
const word& modelType,
const fvMesh& mesh,
const word& phaseName
)
:
Type(modelType, mesh, phaseName),
finiteRate_ (this->coeffs().lookupOrDefault("finiteRate", false)),
A_ (this->coeffs().lookupOrDefault("A", 4.0)),
B_ (this->coeffs().lookupOrDefault("B", 0.5))
{
if (finiteRate_)
{
Info<< " using Finite-rate/Eddy Dissipation Model" << endl;
}
else
{
Info<< " using Eddy Dissipation Model" << endl;
}
Info<< " A = " << A_ << endl;
Info<< " B = " << B_ << endl;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::EDM<Type>::~EDM()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::EDM<Type>::tc() const
{
return this->chemistryPtr_->tc();
}
template<class Type>
void Foam::combustionModels::EDM<Type>::correct()
{
if (this->active())
{
tmp<volScalarField> tk(this->turbulence().k());
const volScalarField& k = tk();
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const volScalarField& epsilon = tepsilon();
this->chemistryPtr_->edm(epsilon/k, A_, B_);
if (finiteRate_)
{
// Copy edm rate stored in chemistryPtr_->RR(i)
PtrList<DimensionedField<scalar, volMesh>> edmRates
(
this->thermo().composition().Y().size()
);
forAll(edmRates, i)
{
edmRates.set
(
i,
new DimensionedField<scalar, volMesh>
(
this->chemistryPtr_->RR(i)
)
);
}
this->chemistryPtr_->calculate();
forAll(edmRates, i)
{
DimensionedField<scalar, volMesh> &finiteRatei
(
this->chemistryPtr_->RR(i)
);
forAll(finiteRatei, celli)
{
finiteRatei[celli] = min(finiteRatei[celli], edmRates[i][celli]);
finiteRatei[celli] =
finiteRatei[celli]*edmRates[i][celli]
/ (finiteRatei[celli] + edmRates[i][celli] + SMALL);
}
}
}
}
}
template<class Type>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::EDM<Type>::R(volScalarField& Y) const
{
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
fvScalarMatrix& Su = tSu.ref();
if (this->active())
{
const label specieI =
this->thermo().composition().species()[Y.member()];
Su += this->chemistryPtr_->RR(specieI);
}
return tSu;
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::EDM<Type>::dQ() const
{
tmp<volScalarField> tdQ
(
new volScalarField
(
IOobject
(
IOobject::groupName(typeName + ":dQ", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
)
);
if (this->active())
{
tdQ.ref() = this->chemistryPtr_->dQ();
}
return tdQ;
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::EDM<Type>::Sh() const
{
tmp<volScalarField> tSh
(
new volScalarField
(
IOobject
(
IOobject::groupName(typeName + ":Sh", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
)
);
if (this->active())
{
tSh.ref() = this->chemistryPtr_->Sh();
}
return tSh;
}
template<class Type>
bool Foam::combustionModels::EDM<Type>::read()
{
if (Type::read())
{
this->coeffs().lookup("finiteRate") >> finiteRate_;
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View file

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::combustionModels::EDM
Description
Eddy dissipation model with finite-rate chemistry.
28.Feb.2017
Combustion Lab. POSTECH
Karam Han
(Version upgraded by Jinwoo Park)
SourceFiles
EDM.C
\*---------------------------------------------------------------------------*/
#ifndef EDM_H
#define EDM_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
/*---------------------------------------------------------------------------*\
Class EDM Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class EDM
:
public Type
{
// Private data
//- finite-rate/EDM using Arrhenius formula
bool finiteRate_;
//- EDM Parameter A
scalar A_;
//- EDM Parameter B
scalar B_;
protected:
// Protected Member Functions
//- Return the chemical time scale
tmp<volScalarField> tc() const;
private:
// Private Member Functions
//- Disallow copy construct
EDM(const EDM&);
//- Disallow default bitwise assignment
void operator=(const EDM&);
public:
//- Runtime type information
TypeName("EDM");
// Constructors
//- Construct from components
EDM
(
const word& modelType,
const fvMesh& mesh,
const word& phaseName
);
//- Destructor
virtual ~EDM();
// Member Functions
// Evolution
//- Correct combustion rate
virtual void correct();
//- Fuel consumption rate matrix.
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
// IO
//- Update properties from given dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "EDM.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -1,38 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "makeCombustionTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "EDM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(EDM, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(EDM, rhoChemistryCombustion, rhoCombustionModel);
// ************************************************************************* //

View file

@ -13,8 +13,6 @@ rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
diffusion/diffusions.C
infinitelyFastChemistry/infinitelyFastChemistrys.C
EDM/EDMs.C
PaSR/PaSRs.C
laminar/laminars.C

View file

@ -34,7 +34,6 @@ License
#include "COxidationKineticDiffusionLimitedRate.H"
#include "COxidationHurtMitchell.H"
#include "COxidationMurphyShaddix.H"
#include "COxidationKD_CO.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +47,6 @@ License
); \
makeSurfaceReactionModelType(COxidationIntrinsicRate, CloudType); \
makeSurfaceReactionModelType(COxidationHurtMitchell, CloudType); \
makeSurfaceReactionModelType(COxidationKD_CO, CloudType); \
makeSurfaceReactionModelType(COxidationMurphyShaddix, CloudType);

View file

@ -1,178 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "COxidationKD_CO.H"
#include "mathematicalConstants.H"
#include "thermodynamicConstants.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationKD_CO<CloudType>::
COxidationKD_CO
(
const dictionary& dict,
CloudType& owner
)
:
SurfaceReactionModel<CloudType>(dict, owner, typeName),
Sb_(readScalar(this->coeffDict().lookup("Sb"))),
C1_(readScalar(this->coeffDict().lookup("C1"))),
C2_(readScalar(this->coeffDict().lookup("C2"))),
E_(readScalar(this->coeffDict().lookup("E"))),
CsLocalId_(-1),
O2GlobalId_(owner.composition().carrierId("O2")),
COGlobalId_(owner.composition().carrierId("CO")),
WC_(0.0),
WO2_(0.0),
HcCO_(0.0)
{
// Determine Cs ids
label idSolid = owner.composition().idSolid();
CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO = owner.thermo().carrier().W(COGlobalId_);
WC_ = WCO - 0.5*WO2_;
HcCO_ = owner.thermo().carrier().Hc(COGlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
Info<< " C(s): particle mass fraction = " << YCloc*YSolidTot << endl;
}
template<class CloudType>
Foam::COxidationKD_CO<CloudType>::
COxidationKD_CO
(
const COxidationKD_CO<CloudType>& srm
)
:
SurfaceReactionModel<CloudType>(srm),
Sb_(srm.Sb_),
C1_(srm.C1_),
C2_(srm.C2_),
E_(srm.E_),
CsLocalId_(srm.CsLocalId_),
O2GlobalId_(srm.O2GlobalId_),
COGlobalId_(srm.COGlobalId_),
WC_(srm.WC_),
WO2_(srm.WO2_),
HcCO_(srm.HcCO_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationKD_CO<CloudType>::
~COxidationKD_CO()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::scalar Foam::COxidationKD_CO<CloudType>::calculate
(
const scalar dt,
const label cellI,
const scalar d,
const scalar T,
const scalar Tc,
const scalar pc,
const scalar rhoc,
const scalar mass,
const scalarField& YGas,
const scalarField& YLiquid,
const scalarField& YSolid,
const scalarField& YMixture,
const scalar N,
scalarField& dMassGas,
scalarField& dMassLiquid,
scalarField& dMassSolid,
scalarField& dMassSRCarrier
) const
{
// Fraction of remaining combustible material
const label idSolid = CloudType::parcelType::SLD;
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
// Surface combustion active combustible fraction is consumed
if (fComb < SMALL)
{
return 0.0;
}
const SLGThermo& thermo = this->owner().thermo();
// Local mass fraction of O2 in the carrier phase
const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[cellI];
// Diffusion rate coefficient
const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);
// Kinetic rate
const scalar Rk = C2_*exp(-E_/(constant::thermodynamic::RR*T)); //
// Particle surface area
const scalar Ap = constant::mathematical::pi*sqr(d);
// Change in C mass [kg]
scalar dmC = Ap*rhoc*constant::thermodynamic::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk)*dt;
// Limit mass transfer by availability of C
dmC = min(mass*fComb, dmC);
// Molar consumption
const scalar dOmega = dmC/WC_;
// Change in O2 mass [kg]
const scalar dmO2 = dOmega*Sb_*WO2_;
// Mass of newly created CO [kg]
const scalar dmCO = dOmega*(WC_ + Sb_*WO2_);
// Update local particle C mass
dMassSolid[CsLocalId_] += dOmega*WC_;
// Update carrier O2 and CO mass
dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[COGlobalId_] += dmCO;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
// carrier sensible enthalpy exchange handled via change in mass
// Heat of reaction [J]
//Info<<"Heat of reaction(Char)"<<tab<<(dmC*HsC - dmCO*HcCO_)/dmC<<endl;
return dmC*HsC - dmCO*HcCO_;
}
// ************************************************************************* //

View file

@ -1,176 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
COxidationKD_CO
Description
Kinetic/diffusion limited rate surface reaction model for coal parcels.
Limited to:
C(s) + Sb*O2 -> CO
where Sb is the stoichiometry of the reaction
\*---------------------------------------------------------------------------*/
#ifndef COxidationKD_CO_H
#define COxidationKD_CO_H
#include "SurfaceReactionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward class declarations
template<class CloudType>
class COxidationKD_CO;
/*---------------------------------------------------------------------------*\
Class COxidationKD_CO Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class COxidationKD_CO
:
public SurfaceReactionModel<CloudType>
{
// Private data
// Model constants
//- Stoichiometry of reaction
const scalar Sb_;
//- Mass diffusion limited rate constant, C1
const scalar C1_;
//- Kinetics limited rate pre-exponential constant, C2
const scalar C2_;
//- Kinetics limited rate activation energy
const scalar E_;
// Addressing
//- Cs positions in global/local lists
label CsLocalId_;
//- O2 position in global list
label O2GlobalId_;
//- CO2 positions in global list
label COGlobalId_;
// Local copies of thermo properties
//- Molecular weight of C [kg/kmol]
scalar WC_;
//- Molecular weight of O2 [kg/kmol]
scalar WO2_;
//- Formation enthalpy for CO2 [J/kg]
scalar HcCO_;
public:
//- Runtime type information
TypeName("COxidationKD_CO");
// Constructors
//- Construct from dictionary
COxidationKD_CO
(
const dictionary& dict,
CloudType& owner
);
//- Construct copy
COxidationKD_CO
(
const COxidationKD_CO<CloudType>& srm
);
//- Construct and return a clone
virtual autoPtr<SurfaceReactionModel<CloudType> > clone() const
{
return autoPtr<SurfaceReactionModel<CloudType> >
(
new COxidationKD_CO<CloudType>(*this)
);
}
//- Destructor
virtual ~COxidationKD_CO();
// Member Functions
//- Update surface reactions
virtual scalar calculate
(
const scalar dt,
const label cellI,
const scalar d,
const scalar T,
const scalar Tc,
const scalar pc,
const scalar rhoc,
const scalar mass,
const scalarField& YGas,
const scalarField& YLiquid,
const scalarField& YSolid,
const scalarField& YMixture,
const scalar N,
scalarField& dMassGas,
scalarField& dMassLiquid,
scalarField& dMassSolid,
scalarField& dMassSRCarrier
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "COxidationKD_CO.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -50,12 +50,6 @@ $(KINEMATICMPPICPARCEL)/defineBasicKinematicMPPICParcel.C
$(KINEMATICMPPICPARCEL)/makeBasicKinematicMPPICParcelSubmodels.C
/* thermo kinematic MPPIC parcel sub-models */
THERMOMPPICPARCEL=$(DERIVEDPARCELS)/basicThermoKinematicMPPICParcel
$(THERMOMPPICPARCEL)/defineBasicThermoKinematicMPPICParcel.C
$(THERMOMPPICPARCEL)/makeBasicThermoKinematicMPPICParcelSubmodels.C
/* bolt-on models */
RADIATION=submodels/addOns/radiation
$(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C

View file

@ -213,88 +213,6 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
}
template<class CloudType>
Foam::ThermoCloud<CloudType>::ThermoCloud
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const volScalarField& mu,
const dimensionedVector& g,
bool readFields
)
:
CloudType
(
cloudName,
rho,
U,
mu,
g,
false
),
thermoCloud(),
cloudCopyPtr_(NULL),
constProps_(this->particleProperties()),
thermo_(this->mesh().template lookupObject<SLGThermo>("SLGThermo")),
T_(thermo_.thermo().T()),
p_(thermo_.thermo().p()),
heatTransferModel_(NULL),
TIntegrator_(NULL),
radiation_(false),
radAreaP_(NULL),
radT4_(NULL),
radAreaPT4_(NULL),
hsTrans_
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
this->name() + ":hsTrans",
this->db().time().timeName(),
this->db(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
this->mesh(),
dimensionedScalar("zero", dimEnergy, 0.0)
)
),
hsCoeff_
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
this->name() + ":hsCoeff",
this->db().time().timeName(),
this->db(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTemperature, 0.0)
)
)
{
if (this->solution().active())
{
setModels();
if (readFields)
{
parcelType::readFields(*this);
}
}
if (this->solution().resetSourcesOnStartup())
{
resetSourceTerms();
}
}
template<class CloudType>
Foam::ThermoCloud<CloudType>::ThermoCloud
(

View file

@ -180,17 +180,6 @@ public:
bool readFields = true
);
//- Construct given carrier gas fields
ThermoCloud
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const volScalarField& mu,
const dimensionedVector& g,
bool readFields = true
);
//- Copy constructor with new name
ThermoCloud(ThermoCloud<CloudType>& c, const word& name);

View file

@ -1,66 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::basicThermoKinematicMPPICCloud
Description
Cloud class to introduce Thermo kinematic MPPIC parcels
\*---------------------------------------------------------------------------*/
#ifndef basicThermoKinematicMPPICCloud_H
#define basicThermoKinematicMPPICCloud_H
#include "Cloud.H"
#include "KinematicCloud.H"
#include "MPPICCloud.H"
#include "basicThermoKinematicMPPICParcel.H"
#include "ThermoCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef MPPICCloud
<
ThermoCloud
<
KinematicCloud
<
Cloud
<
basicThermoKinematicMPPICParcel
>
>
>
>
basicThermoKinematicMPPICCloud;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -96,8 +96,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
pc_,
this->Tc_,
X,
dMassPC,
this->rhoc_
dMassPC
);
// Limit phase change mass by availability of each specie

View file

@ -1,63 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::basicThermoKinematicMPPICParcel
Description
Definition of basic Thermo kinematic MPPIC parcel
SourceFiles
basicThermoKinematicMPPICParcel.H
\*---------------------------------------------------------------------------*/
#ifndef basicThermoKinematicMPPICParcel_H
#define basicThermoKinematicMPPICParcel_H
#include "contiguous.H"
#include "particle.H"
#include "KinematicParcel.H"
#include "MPPICParcel.H"
#include "ThermoParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef MPPICParcel < ThermoParcel < KinematicParcel < particle > > > basicThermoKinematicMPPICParcel;
template<>
inline bool contiguous<basicThermoKinematicMPPICParcel>()
{
return true;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -1,38 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "basicThermoKinematicMPPICParcel.H"
#include "Cloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebug(basicThermoKinematicMPPICParcel, 0);
defineTemplateTypeNameAndDebug(Cloud<basicThermoKinematicMPPICParcel>, 0);
}
// ************************************************************************* //

View file

@ -1,67 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "basicThermoKinematicMPPICCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic sub-models
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeParcelSurfaceFilmModels.H"
// MPPIC sub-models
#include "makeMPPICParcelDampingModels.H"
#include "makeMPPICParcelIsotropyModels.H"
#include "makeMPPICParcelPackingModels.H"
// Thermo sub-models
#include "makeParcelHeatTransferModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeParcelCloudFunctionObjects(basicThermoKinematicMPPICCloud);
// Kinematic sub-models
makeParcelForces(basicThermoKinematicMPPICCloud);
makeParcelDispersionModels(basicThermoKinematicMPPICCloud);
makeParcelInjectionModels(basicThermoKinematicMPPICCloud);
makeParcelPatchInteractionModels(basicThermoKinematicMPPICCloud);
makeParcelStochasticCollisionModels(basicThermoKinematicMPPICCloud);
makeParcelSurfaceFilmModels(basicThermoKinematicMPPICCloud);
// MPPIC sub-models
makeMPPICParcelDampingModels(basicThermoKinematicMPPICCloud);
makeMPPICParcelIsotropyModels(basicThermoKinematicMPPICCloud);
makeMPPICParcelPackingModels(basicThermoKinematicMPPICCloud);
// Thermo sub-models
makeParcelHeatTransferModels(basicThermoKinematicMPPICCloud);
// ************************************************************************* //

View file

@ -30,7 +30,6 @@ License
#include "NoPhaseChange.H"
#include "LiquidEvaporation.H"
#include "LiquidEvaporationConvDiff.H"
#include "LiquidEvaporationBoil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -40,7 +39,6 @@ License
makePhaseChangeModel(CloudType); \
makePhaseChangeModelType(NoPhaseChange, CloudType); \
makePhaseChangeModelType(LiquidEvaporation, CloudType); \
makePhaseChangeModelType(LiquidEvaporationConvDiff, CloudType); \
makePhaseChangeModelType(LiquidEvaporationBoil, CloudType);

View file

@ -142,8 +142,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const
{
// immediately evaporate mass that has reached critical condition
@ -197,8 +196,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
// vapour concentration at surface [kmol/m3] at film temperature
const scalar Cs = pSat/(RR*Ts);
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
// vapour concentration in bulk gas [kmol/m3] at film temperature
const scalar Cinf = Xc[gid]*pc/(RR*Ts);
// molar flux of vapour [kmol/m2/s]
const scalar Ni = max(kc*(Cs - Cinf), 0.0);

View file

@ -119,8 +119,7 @@ public:
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const;
//- Return the enthalpy per unit mass

View file

@ -142,8 +142,7 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const
{
// immediately evaporate mass that has reached critical condition

View file

@ -129,8 +129,7 @@ public:
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const;
//- Return the enthalpy per unit mass

View file

@ -1,287 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "LiquidEvaporationConvDiff.H"
#include "specie.H"
#include "mathematicalConstants.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class CloudType>
Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationConvDiff<CloudType>::calcXc
(
const label celli
) const
{
scalarField Xc(this->owner().thermo().carrier().Y().size());
forAll(Xc, i)
{
Xc[i] =
this->owner().thermo().carrier().Y()[i][celli]
/this->owner().thermo().carrier().W(i);
}
return Xc/sum(Xc);
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Sh
(
const scalar Re,
const scalar Sc
) const
{
return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
(
const dictionary& dict,
CloudType& owner
)
:
PhaseChangeModel<CloudType>(dict, owner, typeName),
liquids_(owner.thermo().liquids()),
activeLiquids_(this->coeffDict().lookup("activeLiquids")),
liqToCarrierMap_(activeLiquids_.size(), -1),
liqToLiqMap_(activeLiquids_.size(), -1)
{
if (activeLiquids_.size() == 0)
{
WarningInFunction
<< "Evaporation model selected, but no active liquids defined"
<< nl << endl;
}
else
{
Info<< "Participating liquid species:" << endl;
// Determine mapping between liquid and carrier phase species
forAll(activeLiquids_, i)
{
Info<< " " << activeLiquids_[i] << endl;
liqToCarrierMap_[i] =
owner.composition().carrierId(activeLiquids_[i]);
}
// Determine mapping between model active liquids and global liquids
const label idLiquid = owner.composition().idLiquid();
forAll(activeLiquids_, i)
{
liqToLiqMap_[i] =
owner.composition().localId(idLiquid, activeLiquids_[i]);
}
}
}
template<class CloudType>
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
(
const LiquidEvaporationConvDiff<CloudType>& pcm
)
:
PhaseChangeModel<CloudType>(pcm),
liquids_(pcm.owner().thermo().liquids()),
activeLiquids_(pcm.activeLiquids_),
liqToCarrierMap_(pcm.liqToCarrierMap_),
liqToLiqMap_(pcm.liqToLiqMap_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::LiquidEvaporationConvDiff<CloudType>::~LiquidEvaporationConvDiff()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::LiquidEvaporationConvDiff<CloudType>::calculate
(
const scalar dt,
const label celli,
const scalar Re,
const scalar Pr,
const scalar d,
const scalar nu,
const scalar T,
const scalar Ts,
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc //POSECH
) const
{
// immediately evaporate mass that has reached critical condition
if ((liquids_.Tc(X) - T) < SMALL)
{
if (debug)
{
WarningInFunction
<< "Parcel reached critical conditions: "
<< "evaporating all avaliable mass" << endl;
}
forAll(activeLiquids_, i)
{
const label lid = liqToLiqMap_[i];
dMassPC[lid] = GREAT;
}
return;
}
// construct carrier phase species volume fractions for cell, celli
const scalarField Xc(calcXc(celli));
// calculate mass transfer of each specie in liquid
forAll(activeLiquids_, i)
{
const label gid = liqToCarrierMap_[i];
const label lid = liqToLiqMap_[i];
// vapour diffusivity [m2/s]
const scalar Dab = liquids_.properties()[lid].D(pc, Ts);
// saturation pressure for species i [pa]
// - carrier phase pressure assumed equal to the liquid vapour pressure
// close to the surface
// NOTE: if pSat > pc then particle is superheated
// calculated evaporation rate will be greater than that of a particle
// at boiling point, but this is not a boiling model
const scalar pSat = liquids_.properties()[lid].pv(pc, T);
// Schmidt number
const scalar Sc = nu/(Dab + ROOTVSMALL);
// Sherwood number
const scalar Sh = this->Sh(Re, Sc);
// mass transfer coefficient [m/s]
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
// vapour concentration at surface [kmol/m3] at film temperature
const scalar Cs = pSat/(RR*Ts);
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
// molar flux of vapour [kmol/m2/s]
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
// droplet surface pressure assumed to surface vapour pressure
const scalar ps = liquids_.pv(pc, Ts, X);
// vapour density at droplet surface [kg/m3]
const scalar rhos = ps*liquids_.W(X)/(RR*Ts);
// vapour mass fraction at surface
const scalar Ys = min((Cs*liquids_.W(X)/rhos),0.9);
// vapour mass fraction in bulk gas
const scalar Yinf = Cinf*liquids_.W(X)/rhos;
// Spalding mass number
const scalar Bm = max(((Ys - Yinf)/(1.0 - Ys)),0.0);
// mass transfer [kg]
dMassPC[lid] += kc*pi*sqr(d)*rhoc*log(1+Bm)*dt;
}
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::dh
(
const label idc,
const label idl,
const scalar p,
const scalar T
) const
{
scalar dh = 0;
typedef PhaseChangeModel<CloudType> parent;
switch (parent::enthalpyTransfer_)
{
case (parent::etLatentHeat):
{
dh = liquids_.properties()[idl].hl(p, T);
break;
}
case (parent::etEnthalpyDifference):
{
scalar hc = this->owner().composition().carrier().Ha(idc, p, T);
scalar hp = liquids_.properties()[idl].h(p, T);
dh = hc - hp;
break;
}
default:
{
FatalErrorInFunction
<< "Unknown enthalpyTransfer type" << abort(FatalError);
}
}
return dh;
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Tvap
(
const scalarField& X
) const
{
return liquids_.Tpt(X);
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::TMax
(
const scalar p,
const scalarField& X
) const
{
return liquids_.pvInvert(p, X);
}
// ************************************************************************* //

View file

@ -1,157 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::LiquidEvaporationConvDiff
Description
Liquid evaporation model
- uses ideal gas assumption
\*---------------------------------------------------------------------------*/
#ifndef LiquidEvaporationConvDiff_H
#define LiquidEvaporationConvDiff_H
#include "PhaseChangeModel.H"
#include "liquidMixtureProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class LiquidEvaporationConvDiff Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class LiquidEvaporationConvDiff
:
public PhaseChangeModel<CloudType>
{
protected:
// Protected data
//- Global liquid properties data
const liquidMixtureProperties& liquids_;
//- List of active liquid names
List<word> activeLiquids_;
//- Mapping between liquid and carrier species
List<label> liqToCarrierMap_;
//- Mapping between local and global liquid species
List<label> liqToLiqMap_;
// Protected Member Functions
//- Sherwood number as a function of Reynolds and Schmidt numbers
scalar Sh(const scalar Re, const scalar Sc) const;
//- Calculate the carrier phase component volume fractions at celli
tmp<scalarField> calcXc(const label celli) const;
public:
//- Runtime type information
TypeName("liquidEvaporationConvDiff");
// Constructors
//- Construct from dictionary
LiquidEvaporationConvDiff(const dictionary& dict, CloudType& cloud);
//- Construct copy
LiquidEvaporationConvDiff(const LiquidEvaporationConvDiff<CloudType>& pcm);
//- Construct and return a clone
virtual autoPtr<PhaseChangeModel<CloudType>> clone() const
{
return autoPtr<PhaseChangeModel<CloudType>>
(
new LiquidEvaporationConvDiff<CloudType>(*this)
);
}
//- Destructor
virtual ~LiquidEvaporationConvDiff();
// Member Functions
//- Update model
virtual void calculate
(
const scalar dt,
const label celli,
const scalar Re,
const scalar Pr,
const scalar d,
const scalar nu,
const scalar T,
const scalar Ts,
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
) const;
//- Return the enthalpy per unit mass
virtual scalar dh
(
const label idc,
const label idl,
const scalar p,
const scalar T
) const;
//- Return vapourisation temperature
virtual scalar Tvap(const scalarField& X) const;
//- Return maximum/limiting temperature
virtual scalar TMax(const scalar p, const scalarField& X) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "LiquidEvaporationConvDiff.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -78,8 +78,7 @@ void Foam::NoPhaseChange<CloudType>::calculate
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const
{
// Nothing to do...

View file

@ -94,8 +94,7 @@ public:
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const;
};

View file

@ -166,8 +166,7 @@ public:
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
scalarField& dMassPC
) const = 0;
//- Return the enthalpy per unit mass

View file

@ -86,17 +86,4 @@ Foam::basicChemistryModel::~basicChemistryModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::basicChemistryModel::edm
(
const scalarField& mixing,
const scalar A,
const scalar B
)
{
NotImplemented;
}
// ************************************************************************* //

View file

@ -159,14 +159,6 @@ public:
//- Calculates the reaction rates
virtual void calculate() = 0;
//- Calculates the eddy dissipation reaction rates
virtual void edm
(
const scalarField& mixing,
const scalar A,
const scalar B
);
//- Solve the reaction system for the given time step
// and return the characteristic time
virtual scalar solve(const scalar deltaT) = 0;

View file

@ -756,104 +756,6 @@ void Foam::chemistryModel<CompType, ThermoType>::calculate()
}
template<class CompType, class ThermoType>
void Foam::chemistryModel<CompType, ThermoType>::edm
(
const scalarField& mixing,
const scalar A,
const scalar B
)
{
if (!this->chemistry_)
{
return;
}
const volScalarField rho
(
IOobject
(
"rho",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->thermo().rho()
);
forAll(rho, celli)
{
const scalar rhoi = rho[celli];
const scalar mixingi = mixing[celli];
scalarField Yi(nSpecie_, 0.0);
for (label k=0; k<nSpecie_; k++)
{
Yi[k] = Y_[k][celli];
}
scalarField om(nSpecie_, 0.0);
scalar minYR = 1.0;
scalar YP = 0.0;
forAll(reactions_, m)
{
const Reaction<ThermoType>& R = reactions_[m];
scalar num = 0.0;
scalar den = 0.0;
forAll(R.lhs(), s)
{
const label k = R.lhs()[s].index;
const scalar vk = R.lhs()[s].stoichCoeff + SMALL;
const scalar Wk = specieThermo_[k].W();
minYR = min(minYR, Yi[k]/Wk/vk);
}
forAll(R.rhs(), s)
{
const label k = R.rhs()[s].index;
const scalar vk = R.rhs()[s].stoichCoeff;
const scalar Wk = specieThermo_[k].W();
num += Yi[k];
den += vk*Wk;
}
YP = num/den;
scalar omegam = min (A*rhoi*mixingi*minYR, A*B*rhoi*mixingi*YP);
forAll(R.lhs(), s)
{
const label k = R.lhs()[s].index;
const scalar vk = R.lhs()[s].stoichCoeff;
const scalar Wk = specieThermo_[k].W();
om[k] -= vk*Wk*omegam;
}
forAll(R.rhs(), s)
{
const label k = R.rhs()[s].index;
const scalar vk = R.rhs()[s].stoichCoeff;
const scalar Wk = specieThermo_[k].W();
om[k] += vk*Wk*omegam;
}
}
for (label k=0; k<nSpecie_; k++)
{
RR_[k][celli] = om[k];
}
}
}
template<class CompType, class ThermoType>
template<class DeltaTType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve

View file

@ -191,14 +191,6 @@ public:
//- Calculates the reaction rates
virtual void calculate();
//- Calculates the eddy dissipation reaction rates
virtual void edm
(
const scalarField& mixing,
const scalar A,
const scalar B
);
// Chemistry model functions (overriding abstract functions in
// basicChemistryModel.H)

View file

@ -25,7 +25,6 @@ submodels/absorptionEmissionModel/binaryAbsorptionEmission/binaryAbsorptionEmiss
submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C
submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C
submodels/absorptionEmissionModel/greyMeanSolidAbsorptionEmission/greyMeanSolidAbsorptionEmission.C
submodels/absorptionEmissionModel/wsggmAbsorptionEmission/wsggmAbsorptionEmission.C
/* Soot model */
submodels/sootModel/sootModel/sootModel.C

View file

@ -1,206 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "wsggmAbsorptionEmission.H"
#include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
#include "zeroGradientFvPatchFields.H"
#include "basicSpecieMixture.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace radiation
{
defineTypeNameAndDebug(wsggmAbsorptionEmission, 0);
addToRunTimeSelectionTable
(
absorptionEmissionModel,
wsggmAbsorptionEmission,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::radiation::wsggmAbsorptionEmission::wsggmAbsorptionEmission
(
const dictionary& dict,
const fvMesh& mesh
)
:
absorptionEmissionModel(dict, mesh),
coeffsDict_((dict.subDict(typeName + "Coeffs"))),
thermo_(mesh.lookupObject<fluidThermo>("thermophysicalProperties")),
emissivityCoeffs_(coeffsDict_.lookup("emissivityCoeffs")),
fittingFactors_(coeffsDict_.lookup("fittingFactors")),
pathLength_(coeffsDict_.lookup("pathLength"))
{
if (!isA<basicMultiComponentMixture>(thermo_))
{
FatalErrorIn
(
"radiation::wsggmAbsorptionEmission::wsggmAbsorptionEmission"
"("
"const dictionary&, "
"const fvMesh&"
")"
) << "Model requires a multi-component thermo package"
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::wsggmAbsorptionEmission::~wsggmAbsorptionEmission()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::radiation::wsggmAbsorptionEmission::aCont(const label bandI) const
{
const basicSpecieMixture& mixture =
dynamic_cast<const basicSpecieMixture&>(thermo_);
const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p();
tmp<volScalarField> ta
(
new volScalarField
(
IOobject
(
"aCont" + name(bandI),
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("a", dimless/dimLength, 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
scalarField& a = ta.ref().primitiveFieldRef();
label indexCO2, indexH2O;
scalar wCO2, wH2O;
forAll(mixture.Y(), specieI)
{
if(mixture.Y(specieI).name() == "CO2")
{
indexCO2 = specieI;
wCO2 = mixture.W(indexCO2);
}
else if(mixture.Y(specieI).name() == "H2O")
{
indexH2O = specieI;
wH2O = mixture.W(indexH2O);
}
}
forAll(a,celli)
{
scalar invWt = 0.0;
forAll(mixture.Y(), specieI)
{
invWt += mixture.Y(specieI)[celli]/mixture.W(specieI);
}
scalar meanWt = 1.0/invWt; //Mean molecular weight [kg/kmole]
// Sum of partial pressures of all absorbing gases [atm]
scalar Pcell_atm = paToAtm(meanWt*p[celli]*(mixture.Y(indexCO2)[celli]/wCO2 + mixture.Y(indexH2O)[celli]/wH2O));
// P*S at Eq.(1) of Ref. [atm*m]
scalar presPathLength = Pcell_atm*pathLength_.value();
// Limit cell temperature [K]
scalar Tcell = min(T[celli],2400.0);
scalar emissivity = 0.0;
forAll(emissivityCoeffs_, i) //k_i at Eq.(1) of Ref.
{
scalar weightingFactor = 0.0;
for(label j=0 ; j<4 ; j++)
{
//a_epsilon_i at Eq.(3) of Ref.
weightingFactor += fittingFactors_[i][j]*pow(Tcell, j);
}
//epsilon at Eq.(1) of Ref.
emissivity += weightingFactor * (1.0 - exp(-1.0*emissivityCoeffs_[i] * presPathLength));
}
emissivity = min(emissivity, 0.99999);
//Fluent theory guide(ver. 13) Eq.(5-106) [1/m]
a[celli] = max(1e-2, (-1.0)*log(1.0-emissivity)/pathLength_.value());
}
ta.ref().correctBoundaryConditions();
return ta;
}
Foam::tmp<Foam::volScalarField>
Foam::radiation::wsggmAbsorptionEmission::eCont(const label bandI) const
{
return aCont(bandI);
}
Foam::tmp<Foam::volScalarField>
Foam::radiation::wsggmAbsorptionEmission::ECont(const label bandI) const
{
tmp<volScalarField> E
(
new volScalarField
(
IOobject
(
"ECont" + name(bandI),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("E", dimMass/dimLength/pow3(dimTime), 0.0)
)
);
return E;
}
// ************************************************************************* //

View file

@ -1,163 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::radiation::wsggmAbsorptionEmission
Description
wsggmAbsorptionEmission radiation absorption and emission coefficients
for continuous phase
Ref. T.F Smith, Z.F. Shen and J.N. Friedman
Evaluation of Coefficients for the Weighted Sum of Gray Gases Model,
Transactions of the ASME, Vol. 104, pp. 602-608
Valid when Ptotal = 1atm, 0.001 < P*S < 10.0atm.m, 600 < T < 2400K
(where P*S = sum of partial pressures of absorbing gases
* mean beam length)
i.e. dictionary
\verbatim
wsggmAbsorptionEmissionCoeffs
{
pathLength pathLength [ 0 1 0 0 0 0 0] 0.251; //3.6V/S
// Pw/Pc = 2.0
emissivityCoeffs 3(0.4201 6.516 131.9);
fittingFactors
3
(
4(6.508e-1 -5.551e-4 3.029e-7 -5.353e-11)
4(-0.2504e-1 6.112e-4 -3.882e-7 6.528e-11)
4(2.718e-1 -3.118e-4 1.221e-7 -1.612e-11)
);
}
\endverbatim
SourceFiles
wsggmAbsorptionEmission.C
\*---------------------------------------------------------------------------*/
#ifndef wsggmAbsorptionEmission_H
#define wsggmAbsorptionEmission_H
#include "interpolationLookUpTable.H"
#include "absorptionEmissionModel.H"
#include "HashTable.H"
#include "absorptionCoeffs.H"
#include "fluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace radiation
{
/*---------------------------------------------------------------------------*\
Class wsggmAbsorptionEmission Declaration
\*---------------------------------------------------------------------------*/
class wsggmAbsorptionEmission
:
public absorptionEmissionModel
{
public:
private:
// Private data
//- Absorption model dictionary
dictionary coeffsDict_;
//- SLG thermo package
const fluidThermo& thermo_;
//- absorption coefficitent for individual grey gases
scalarList emissivityCoeffs_;
//- fitting Factors
scalarListList fittingFactors_;
//characteristic path length [m] from dict
dimensionedScalar pathLength_;
public:
//- Runtime type information
TypeName("wsggmAbsorptionEmission");
// Constructors
//- Construct from components
wsggmAbsorptionEmission(const dictionary& dict, const fvMesh& mesh);
//- Destructor
virtual ~wsggmAbsorptionEmission();
// Member Functions
// Access
// Absorption coefficient
//- Absorption coefficient for continuous phase
tmp<volScalarField> aCont(const label bandI = 0) const;
// Emission coefficient
//- Emission coefficient for continuous phase
tmp<volScalarField> eCont(const label bandI = 0) const;
// Emission contribution
//- Emission contribution for continuous phase
tmp<volScalarField> ECont(const label bandI = 0) const;
// Member Functions
inline bool isGrey() const
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace radiation
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //