mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,6 +7,7 @@
|
||||
*.orig
|
||||
*.bak
|
||||
\#*\#
|
||||
.directory
|
||||
|
||||
# CVS recovered versions - anywhere
|
||||
.#*
|
||||
@ -47,7 +48,9 @@ doc/[Dd]oxygen/man
|
||||
# source packages - anywhere
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
*.tar
|
||||
*.tgz
|
||||
*.gtgz
|
||||
|
||||
# ignore the persistent .build tag in the main directory
|
||||
/.build
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
Info << "\nConstructing gas properties" << endl;
|
||||
/*
|
||||
PtrList<specieConstProperties> gasProperties(Y.size());
|
||||
forAll(gasProperties, i)
|
||||
{
|
||||
gasProperties.set
|
||||
(
|
||||
i,
|
||||
new specieConstProperties
|
||||
(
|
||||
dynamic_cast<const multiComponentMixture<constTransport<
|
||||
specieThermo<hConstThermo<perfectGas> > > >&>
|
||||
(thermo()).speciesData()[i]
|
||||
)
|
||||
);
|
||||
}
|
||||
*/
|
||||
PtrList<specieReactingProperties> gasProperties(Y.size());
|
||||
forAll(gasProperties, i)
|
||||
{
|
||||
gasProperties.set
|
||||
(
|
||||
i,
|
||||
new specieReactingProperties
|
||||
(
|
||||
dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Info<< "\nConstructing reacting cloud" << endl;
|
||||
basicReactingCloud parcels
|
||||
(
|
||||
"reactingCloud1",
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
thermo(),
|
||||
gasProperties
|
||||
);
|
||||
@ -19,7 +19,6 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/ODE/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(FOAM_USER_LIBBIN) \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lcompressibleRASModels \
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,11 +35,11 @@ Description
|
||||
#include "hCombustionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "basicThermoCloud.H"
|
||||
#include "coalCloud.H"
|
||||
#include "CoalCloud.H"
|
||||
#include "chemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "ReactingCloudThermoTypes.H"
|
||||
#include "timeActivatedExplicitSource.H"
|
||||
#include "reactingThermoTypes.H"
|
||||
#include "timeActivatedExplicitCellSource.H"
|
||||
#include "radiationModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -113,8 +113,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
enthalpySource.update();
|
||||
|
||||
rho = thermo->rho();
|
||||
|
||||
if (runTime.write())
|
||||
|
||||
@ -1,44 +1,11 @@
|
||||
Info<< "\nConstructing interpolation" << endl;
|
||||
|
||||
Info << "\nConstructing gas properties" << endl;
|
||||
/*
|
||||
PtrList<specieConstProperties> gasProperties(Y.size());
|
||||
forAll(gasProperties, i)
|
||||
{
|
||||
gasProperties.set
|
||||
(
|
||||
i,
|
||||
new specieConstProperties
|
||||
(
|
||||
dynamic_cast<const multiComponentMixture<constTransport<
|
||||
specieThermo<hConstThermo<perfectGas> > > >&>
|
||||
(thermo()).speciesData()[i]
|
||||
)
|
||||
);
|
||||
}
|
||||
*/
|
||||
PtrList<specieReactingProperties> gasProperties(Y.size());
|
||||
forAll(gasProperties, i)
|
||||
{
|
||||
gasProperties.set
|
||||
(
|
||||
i,
|
||||
new specieReactingProperties
|
||||
(
|
||||
dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Info<< "\nConstructing coal cloud" << endl;
|
||||
coalCloud coalParcels
|
||||
CoalCloud<specieReactingProperties> coalParcels
|
||||
(
|
||||
"coalCloud1",
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
thermo(),
|
||||
gasProperties
|
||||
thermo()
|
||||
);
|
||||
|
||||
Info<< "\nConstructing limestone cloud" << endl;
|
||||
|
||||
@ -105,8 +105,8 @@
|
||||
volScalarField DpDt =
|
||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
Info<< "\nConstructing explicit enthalpy source" << endl;
|
||||
timeActivatedExplicitSource enthalpySource
|
||||
Info<< "\nConstructing explicit enthalpy cell source" << endl;
|
||||
timeActivatedExplicitCellSource enthalpySource
|
||||
(
|
||||
"enthalpySource",
|
||||
mesh,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
reactingParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/reactingParcelFoam
|
||||
@ -0,0 +1,9 @@
|
||||
Info<< "\nConstructing reacting cloud" << endl;
|
||||
BasicReactingCloud<specieReactingProperties> parcels
|
||||
(
|
||||
"reactingCloud1",
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
thermo()
|
||||
);
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,10 +34,10 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "hCombustionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "basicReactingCloud.H"
|
||||
#include "BasicReactingCloud.H"
|
||||
#include "chemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "ReactingCloudThermoTypes.H"
|
||||
#include "reactingThermoTypes.H"
|
||||
#include "radiationModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -0,0 +1,3 @@
|
||||
trackedReactingParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/trackedReactingParcelFoam
|
||||
@ -0,0 +1,38 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-lspecie \
|
||||
-lbasicThermophysicalModels \
|
||||
-lliquids \
|
||||
-lliquidMixture \
|
||||
-lsolids \
|
||||
-lsolidMixture \
|
||||
-lthermophysicalFunctions \
|
||||
-lcombustionThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lradiation \
|
||||
-lODE
|
||||
@ -0,0 +1,47 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phi, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
==
|
||||
rho.dimensionedInternalField()*g
|
||||
+ reactingParcels.SU()
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
tmp<volScalarField> trAU;
|
||||
tmp<volTensorField> trTU;
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
tmp<volTensorField> tTU = tensor(I)*UEqn.A();
|
||||
pZones.addResistance(UEqn, tTU());
|
||||
trTU = inv(tTU());
|
||||
trTU().rename("rAU");
|
||||
|
||||
volVectorField gradp = fvc::grad(p);
|
||||
|
||||
for (int UCorr=0; UCorr<nUCorr; UCorr++)
|
||||
{
|
||||
U = trTU() & (UEqn.H() - gradp);
|
||||
}
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
else
|
||||
{
|
||||
pZones.addResistance(UEqn);
|
||||
|
||||
solve
|
||||
(
|
||||
UEqn == -fvc::grad(p)
|
||||
);
|
||||
|
||||
trAU = 1.0/UEqn.A();
|
||||
trAU().rename("rAU");
|
||||
}
|
||||
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
|
||||
tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
{
|
||||
label inertIndex = -1;
|
||||
volScalarField Yt = 0.0*Y[0];
|
||||
|
||||
for (label i=0; i<Y.size(); i++)
|
||||
{
|
||||
if (Y[i].name() != inertSpecie)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, Yi)
|
||||
+ mvConvection->fvmDiv(phi, Yi)
|
||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||
==
|
||||
reactingParcels.Srho(i)
|
||||
+ kappa*chemistry.RR(i)().dimensionedInternalField()
|
||||
+ pointMassSources.Su(i)
|
||||
);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
else
|
||||
{
|
||||
inertIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
{
|
||||
tmp<volScalarField> tdQ
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dQ",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar
|
||||
(
|
||||
"zero",
|
||||
dimensionSet(1, -3, -1, 0, 0, 0, 0),
|
||||
0.0
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
scalarField& dQ = tdQ();
|
||||
|
||||
scalarField cp(dQ.size(), 0.0);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
volScalarField RRi = chemistry.RR(i);
|
||||
|
||||
forAll(h, celli)
|
||||
{
|
||||
scalar Ti = T[celli];
|
||||
cp[celli] += Y[i][celli]*chemistry.specieThermo()[i].Cp(Ti);
|
||||
scalar hi = chemistry.specieThermo()[i].h(Ti);
|
||||
scalar RR = RRi[celli];
|
||||
dQ[celli] -= hi*RR;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(dQ, celli)
|
||||
{
|
||||
dQ[celli] /= cp[celli];
|
||||
}
|
||||
|
||||
tdQ().write();
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
{
|
||||
Info << "Solving chemistry" << endl;
|
||||
|
||||
chemistry.solve
|
||||
(
|
||||
runTime.value() - runTime.deltaT().value(),
|
||||
runTime.deltaT().value()
|
||||
);
|
||||
|
||||
// turbulent time scale
|
||||
if (turbulentReaction)
|
||||
{
|
||||
DimensionedField<scalar, volMesh> tk =
|
||||
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
|
||||
DimensionedField<scalar, volMesh> tc =
|
||||
chemistry.tc()().dimensionedInternalField();
|
||||
|
||||
// Chalmers PaSR model
|
||||
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
|
||||
}
|
||||
else
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
Info<< "\nConstructing reacting cloud" << endl;
|
||||
BasicTrackedReactingCloud<specieReactingProperties> reactingParcels
|
||||
(
|
||||
"reactingCloud1",
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
thermo()
|
||||
);
|
||||
@ -0,0 +1,111 @@
|
||||
Info<< "Reading thermophysical properties" << nl << endl;
|
||||
|
||||
autoPtr<hCombustionThermo> thermo
|
||||
(
|
||||
hCombustionThermo::New(mesh)
|
||||
);
|
||||
|
||||
combustionMixture& composition = thermo->composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
word inertSpecie(thermo->lookup("inertSpecie"));
|
||||
|
||||
volScalarField& p = thermo->p();
|
||||
volScalarField& h = thermo->h();
|
||||
const volScalarField& T = thermo->T();
|
||||
const volScalarField& psi = thermo->psi();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo->rho()
|
||||
);
|
||||
|
||||
Info<< "Reading field U" << nl << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
# include "compressibleCreatePhi.H"
|
||||
|
||||
DimensionedField<scalar, volMesh> kappa
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"kappa",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless, 0.0)
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model" << nl << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field DpDt" << nl << endl;
|
||||
volScalarField DpDt =
|
||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
Info << "Constructing chemical mechanism" << nl << endl;
|
||||
chemistryModel chemistry
|
||||
(
|
||||
thermo(),
|
||||
rho
|
||||
);
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
forAll (Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
|
||||
Info<< "Creating porous zones" << nl << endl;
|
||||
porousZones pZones(mesh);
|
||||
Switch pressureImplicitPorosity(false);
|
||||
|
||||
label nUCorr = 0;
|
||||
if (pZones.size())
|
||||
{
|
||||
// nUCorrectors for pressureImplicitPorosity
|
||||
if (mesh.solutionDict().subDict("PISO").found("nUCorrectors"))
|
||||
{
|
||||
mesh.solutionDict().subDict("PISO").lookup("nUCorrectors")
|
||||
>> nUCorr;
|
||||
}
|
||||
|
||||
if (nUCorr > 0)
|
||||
{
|
||||
pressureImplicitPorosity = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
Info<< "\nConstructing multi-component mass flow rate point sources" << endl;
|
||||
timeActivatedExplicitMulticomponentPointSource pointMassSources
|
||||
(
|
||||
"pointMassSources",
|
||||
mesh,
|
||||
Y,
|
||||
dimMass/dimVolume/dimTime
|
||||
);
|
||||
@ -0,0 +1,20 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ fvm::div(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
DpDt
|
||||
+ reactingParcels.Sh()
|
||||
+ radiation->Sh(thermo())
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
hEqn.solve();
|
||||
|
||||
thermo->correct();
|
||||
|
||||
radiation->correct();
|
||||
}
|
||||
110
applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H
Normal file
110
applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H
Normal file
@ -0,0 +1,110 @@
|
||||
rho = thermo->rho();
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
U = trTU()&UEqn.H();
|
||||
}
|
||||
else
|
||||
{
|
||||
U = trAU()*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++)
|
||||
{
|
||||
tmp<fvScalarMatrix> lapTerm;
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trTU(), p);
|
||||
}
|
||||
else
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trAU(), p);
|
||||
}
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvm::div(phid, p)
|
||||
- lapTerm()
|
||||
==
|
||||
reactingParcels.Srho()
|
||||
+ pointMassSources.Su()
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
phi =
|
||||
fvc::interpolate(rho)
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(trAU(), rho, U, phi)
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
tmp<fvScalarMatrix> lapTerm;
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trTU(), p);
|
||||
}
|
||||
else
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trAU(), p);
|
||||
}
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phi)
|
||||
- lapTerm()
|
||||
==
|
||||
reactingParcels.Srho()
|
||||
+ pointMassSources.Su()
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
U -= trTU()&fvc::grad(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
U -= trAU()*fvc::grad(p);
|
||||
}
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
Info<< "Reading chemistry properties\n" << endl;
|
||||
|
||||
IOdictionary chemistryProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistryProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction"));
|
||||
|
||||
dimensionedScalar Cmix("Cmix", dimless, 1.0);
|
||||
|
||||
if (turbulentReaction)
|
||||
{
|
||||
chemistryProperties.lookup("Cmix") >> Cmix;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
(
|
||||
fvm::ddt(rho)
|
||||
+ fvc::div(phi)
|
||||
==
|
||||
reactingParcels.Srho()
|
||||
+ pointMassSources.Su()
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,121 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 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
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "hCombustionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "BasicTrackedReactingCloud.H"
|
||||
#include "chemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "reactingThermoTypes.H"
|
||||
#include "radiationModel.H"
|
||||
#include "porousZones.H"
|
||||
#include "timeActivatedExplicitMulticomponentPointSource.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "readChemistryProperties.H"
|
||||
#include "readEnvironmentalProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "createRadiationModel.H"
|
||||
#include "createClouds.H"
|
||||
#include "createMulticomponentPointSources.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;
|
||||
|
||||
reactingParcels.evolve();
|
||||
|
||||
reactingParcels.info();
|
||||
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- PIMPLE loop
|
||||
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
{
|
||||
#include "hEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
rho = thermo->rho();
|
||||
|
||||
if (runTime.write())
|
||||
{
|
||||
#include "additionalOutput.H"
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,6 +90,9 @@ Usage
|
||||
The quoting is required to avoid shell expansions and to pass the
|
||||
information as a single argument.
|
||||
|
||||
@param -useTimeName \n
|
||||
use the time index in the VTK file name instead of the time index
|
||||
|
||||
Note
|
||||
mesh subset is handled by vtkMesh. Slight inconsistency in
|
||||
interpolation: on the internal field it interpolates the whole volfield
|
||||
@ -242,6 +245,7 @@ int main(int argc, char *argv[])
|
||||
argList::validOptions.insert("excludePatches","patches to exclude");
|
||||
argList::validOptions.insert("noFaceZones","");
|
||||
argList::validOptions.insert("noLinks","");
|
||||
argList::validOptions.insert("useTimeName","");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -250,6 +254,7 @@ int main(int argc, char *argv[])
|
||||
bool doFaceZones = !args.optionFound("noFaceZones");
|
||||
bool doLinks = !args.optionFound("noLinks");
|
||||
bool binary = !args.optionFound("ascii");
|
||||
bool useTimeName = args.optionFound("useTimeName");
|
||||
|
||||
if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4))
|
||||
{
|
||||
@ -359,6 +364,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Time: " << runTime.timeName() << endl;
|
||||
|
||||
word timeDesc = "";
|
||||
if (useTimeName)
|
||||
{
|
||||
timeDesc = runTime.timeName();
|
||||
}
|
||||
else
|
||||
{
|
||||
timeDesc = name(runTime.timeIndex());
|
||||
}
|
||||
|
||||
// Check for new polyMesh/ and update mesh, fvMeshSubset and cell
|
||||
// decomposition.
|
||||
polyMesh::readUpdateState meshState = vMesh.readUpdate();
|
||||
@ -388,7 +403,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
fvPath/set.name()/set.name()
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk"
|
||||
);
|
||||
|
||||
@ -411,7 +426,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
fvPath/set.name()/set.name()
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk"
|
||||
);
|
||||
|
||||
@ -548,7 +563,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
fvPath/vtkName
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk"
|
||||
);
|
||||
|
||||
@ -655,7 +670,7 @@ int main(int argc, char *argv[])
|
||||
/"surfaceFields"
|
||||
/"surfaceFields"
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk"
|
||||
);
|
||||
|
||||
@ -689,7 +704,7 @@ int main(int argc, char *argv[])
|
||||
patchFileName =
|
||||
fvPath/"allPatches"/cellSetName
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk";
|
||||
}
|
||||
else
|
||||
@ -697,7 +712,7 @@ int main(int argc, char *argv[])
|
||||
patchFileName =
|
||||
fvPath/"allPatches"/"allPatches"
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk";
|
||||
}
|
||||
|
||||
@ -767,7 +782,7 @@ int main(int argc, char *argv[])
|
||||
patchFileName =
|
||||
fvPath/pp.name()/cellSetName
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk";
|
||||
}
|
||||
else
|
||||
@ -775,7 +790,7 @@ int main(int argc, char *argv[])
|
||||
patchFileName =
|
||||
fvPath/pp.name()/pp.name()
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk";
|
||||
}
|
||||
|
||||
@ -867,7 +882,7 @@ int main(int argc, char *argv[])
|
||||
patchFileName =
|
||||
fvPath/pp.name()/cellSetName
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk";
|
||||
}
|
||||
else
|
||||
@ -875,7 +890,7 @@ int main(int argc, char *argv[])
|
||||
patchFileName =
|
||||
fvPath/pp.name()/pp.name()
|
||||
+ "_"
|
||||
+ name(timeI)
|
||||
+ timeDesc
|
||||
+ ".vtk";
|
||||
}
|
||||
|
||||
@ -931,7 +946,7 @@ int main(int argc, char *argv[])
|
||||
fileName lagrFileName
|
||||
(
|
||||
fvPath/cloud::prefix/cloudDirs[i]/cloudDirs[i]
|
||||
+ "_" + name(timeI) + ".vtk"
|
||||
+ "_" + timeDesc + ".vtk"
|
||||
);
|
||||
|
||||
Info<< " Lagrangian: " << lagrFileName << endl;
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
particleTracks.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/particleTracks
|
||||
@ -0,0 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-llagrangian
|
||||
@ -0,0 +1,22 @@
|
||||
IOdictionary propsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"particleTrackProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
|
||||
word cloudName(propsDict.lookup("cloudName"));
|
||||
|
||||
label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency")));
|
||||
|
||||
// outputMode: compositeFile, filePerTrack
|
||||
//word outputmode(propsDict.lookup("outputMode"))
|
||||
|
||||
label maxPositions(readLabel(propsDict.lookup("maxPositions")));
|
||||
|
||||
// outputFormat: raw, vtk
|
||||
//word outputFormat(propsDict.lookup("outputFormat"));
|
||||
@ -0,0 +1,270 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 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
|
||||
particleTracks
|
||||
|
||||
Description
|
||||
Generates a VTK file of particle tracks for cases that were computed using
|
||||
a tracked-parcel-type cloud
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "Cloud.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "timeSelector.H"
|
||||
#include "OFstream.H"
|
||||
#include "passiveParticle.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
# include "createFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "Scanning times to determine track data" << nl << endl;
|
||||
|
||||
labelList maxIds(Pstream::nProcs(), -1);
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject origProcHeader
|
||||
(
|
||||
"origProc",
|
||||
runTime.timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
IOobject idHeader
|
||||
(
|
||||
"id",
|
||||
runTime.timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
if (idHeader.headerOk() && origProcHeader.headerOk())
|
||||
{
|
||||
IOField<label> origProc(origProcHeader);
|
||||
IOField<label> id(idHeader);
|
||||
forAll(id, i)
|
||||
{
|
||||
maxIds[origProc[i]] = max(maxIds[origProc[i]], id[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Pstream::listCombineGather(maxIds, maxOp<label>());
|
||||
Pstream::listCombineScatter(maxIds);
|
||||
labelList numIds = maxIds + 1;
|
||||
|
||||
// calc starting ids for particles on each processor
|
||||
List<label> startIds(numIds.size(), 0);
|
||||
for (label i = 0; i < numIds.size()-1; i++)
|
||||
{
|
||||
startIds[i+1] += startIds[i] + numIds[i];
|
||||
}
|
||||
label nParticle = startIds[startIds.size()-1] + numIds[startIds.size()-1];
|
||||
|
||||
// number of tracks to generate
|
||||
label nTracks = nParticle/sampleFrequency;
|
||||
|
||||
// storage for all particle tracks
|
||||
List<DynamicList<vector> > allTracks(nTracks);
|
||||
|
||||
Info<< "\nGenerating " << nTracks << " particle tracks" << nl << endl;
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject positionsHeader
|
||||
(
|
||||
"positions",
|
||||
runTime.timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
IOobject origProcHeader
|
||||
(
|
||||
"origProc",
|
||||
runTime.timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
IOobject idHeader
|
||||
(
|
||||
"id",
|
||||
runTime.timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
positionsHeader.headerOk()
|
||||
&& origProcHeader.headerOk()
|
||||
&& idHeader.headerOk()
|
||||
)
|
||||
{
|
||||
Info<< " Reading particle positions" << endl;
|
||||
Cloud<passiveParticle> myCloud(mesh, cloudName, false);
|
||||
|
||||
Info<< " Reading particle id" << endl;
|
||||
IOField<label> id(idHeader);
|
||||
|
||||
Info<< " Reading particle origProc" << endl;
|
||||
IOField<label> origProc(origProcHeader);
|
||||
|
||||
// collect the track data on the master processor
|
||||
label i = 0;
|
||||
List<pointField> allPositions(Pstream::nProcs());
|
||||
allPositions[Pstream::myProcNo()].setSize(myCloud.size());
|
||||
forAllConstIter(Cloud<passiveParticle>, myCloud, iter)
|
||||
{
|
||||
allPositions[Pstream::myProcNo()][i++] = iter().position();
|
||||
}
|
||||
Pstream::gatherList(allPositions);
|
||||
|
||||
List<labelList> allIds(Pstream::nProcs());
|
||||
allIds[Pstream::myProcNo()] = id;
|
||||
Pstream::gatherList(allIds);
|
||||
|
||||
List<labelList> allOrigProcs(Pstream::nProcs());
|
||||
allOrigProcs[Pstream::myProcNo()] = origProc;
|
||||
Pstream::gatherList(allOrigProcs);
|
||||
|
||||
Info<< " Constructing tracks" << nl << endl;
|
||||
if (Pstream::master())
|
||||
{
|
||||
forAll(allPositions, procI)
|
||||
{
|
||||
forAll(allPositions[procI], i)
|
||||
{
|
||||
label globalId =
|
||||
startIds[allOrigProcs[procI][i]]
|
||||
+ allIds[procI][i];
|
||||
|
||||
if (globalId % sampleFrequency == 0)
|
||||
{
|
||||
label trackId = globalId/sampleFrequency;
|
||||
if (allTracks[trackId].size() < maxPositions)
|
||||
{
|
||||
allTracks[trackId].append
|
||||
(
|
||||
allPositions[procI][i]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No particles read" << nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
Info<< "\nWriting particle tracks" << nl << endl;
|
||||
|
||||
OFstream vtkTracks("particleTracks.vtk");
|
||||
|
||||
// Total number of points in tracks + 1 per track
|
||||
label nPoints = 0;
|
||||
forAll(allTracks, trackI)
|
||||
{
|
||||
nPoints += allTracks[trackI].size();
|
||||
}
|
||||
|
||||
vtkTracks
|
||||
<< "# vtk DataFile Version 2.0" << nl
|
||||
<< "particleTracks" << nl
|
||||
<< "ASCII" << nl
|
||||
<< "DATASET POLYDATA" << nl
|
||||
<< "POINTS " << nPoints << " float" << nl;
|
||||
|
||||
// Write track points to file
|
||||
forAll(allTracks, trackI)
|
||||
{
|
||||
forAll(allTracks[trackI], i)
|
||||
{
|
||||
const vector& pt = allTracks[trackI][i];
|
||||
vtkTracks << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
}
|
||||
}
|
||||
|
||||
// write track (line) connectivity to file
|
||||
vtkTracks << "LINES " << nTracks << ' ' << nPoints+nTracks << nl;
|
||||
|
||||
// Write ids of track points to file
|
||||
label globalPtI = 0;
|
||||
forAll(allTracks, trackI)
|
||||
{
|
||||
vtkTracks << allTracks[trackI].size();
|
||||
|
||||
forAll(allTracks[trackI], i)
|
||||
{
|
||||
vtkTracks << ' ' << globalPtI;
|
||||
globalPtI++;
|
||||
}
|
||||
|
||||
vtkTracks << nl;
|
||||
}
|
||||
|
||||
Info<< "end" << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -72,6 +72,7 @@ primitiveLists = primitives/Lists
|
||||
$(primitiveLists)/boolList.C
|
||||
$(primitiveLists)/labelIOList.C
|
||||
$(primitiveLists)/scalarList.C
|
||||
$(primitiveLists)/scalarIOList.C
|
||||
$(primitiveLists)/vectorList.C
|
||||
$(primitiveLists)/sphericalTensorList.C
|
||||
$(primitiveLists)/symmTensorList.C
|
||||
|
||||
@ -63,6 +63,21 @@ Foam::IOPtrList<T>::IOPtrList(const IOobject& io)
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const label s)
|
||||
:
|
||||
regIOobject(io),
|
||||
PtrList<T>(s)
|
||||
{
|
||||
if (io.readOpt() != IOobject::NO_READ)
|
||||
{
|
||||
FatalErrorIn("IOPtrList<T>::IOPtrList(const IOobject&, const label)")
|
||||
<< "NO_READ must be set if specifying size" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const PtrList<T>& list)
|
||||
:
|
||||
|
||||
@ -70,6 +70,9 @@ public:
|
||||
//- Construct from IOobject
|
||||
IOPtrList(const IOobject&);
|
||||
|
||||
//- Construct from IOobject with given size
|
||||
IOPtrList(const IOobject&, const label);
|
||||
|
||||
//- Construct from IOobject and a PtrList
|
||||
IOPtrList(const IOobject&, const PtrList<T>&);
|
||||
|
||||
|
||||
@ -22,27 +22,25 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
Declaration of scalar IOList containers
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicReactingParcel.H"
|
||||
#include "ReactingCloud.H"
|
||||
|
||||
#include "SinglePhaseMixture.H"
|
||||
#include "scalarIOList.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeCompositionModel(ReactingCloud<basicReactingParcel>);
|
||||
|
||||
// Add instances of composition model to the table
|
||||
makeCompositionModelType
|
||||
defineTemplateTypeNameAndDebugWithName(scalarIOList, "scalarList", 0);
|
||||
defineTemplateTypeNameAndDebugWithName
|
||||
(
|
||||
SinglePhaseMixture,
|
||||
ReactingCloud,
|
||||
basicReactingParcel
|
||||
scalarListIOList,
|
||||
"scalarListList",
|
||||
0
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -22,24 +22,30 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Typedef
|
||||
Foam::scalarIOList
|
||||
|
||||
Description
|
||||
Scalar container classes
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicKinematicParcel.H"
|
||||
#include "KinematicCloud.H"
|
||||
#ifndef scalarIOList_H
|
||||
#define scalarIOList_H
|
||||
|
||||
#include "NoDrag.H"
|
||||
#include "SphereDrag.H"
|
||||
#include "scalarList.H"
|
||||
#include "IOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeDragModel(KinematicCloud<basicKinematicParcel>);
|
||||
typedef IOList<scalar> scalarIOList;
|
||||
typedef IOList<scalarList> scalarListIOList;
|
||||
}
|
||||
|
||||
// Add instances of drag model to the table
|
||||
makeDragModelType(NoDrag, KinematicCloud, basicKinematicParcel);
|
||||
makeDragModelType(SphereDrag, KinematicCloud, basicKinematicParcel);
|
||||
};
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -115,6 +115,28 @@ bool Foam::trackedParticle::move(trackedParticle::trackData& td)
|
||||
}
|
||||
|
||||
|
||||
bool Foam::trackedParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
trackedParticle::trackData& td,
|
||||
const label patchI
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::trackedParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
int&,
|
||||
const label
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::trackedParticle::hitWedgePatch
|
||||
(
|
||||
const wedgePolyPatch&,
|
||||
|
||||
@ -169,6 +169,21 @@ public:
|
||||
bool move(trackData&);
|
||||
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
trackedParticle::trackData& td,
|
||||
const label patchI
|
||||
);
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
int&,
|
||||
const label patchI
|
||||
);
|
||||
|
||||
//- Overridable function to handle the particle hitting a wedge
|
||||
void hitWedgePatch
|
||||
(
|
||||
|
||||
@ -311,18 +311,32 @@ $(laplacianSchemes)/gaussLaplacianScheme/gaussLaplacianSchemes.C
|
||||
|
||||
finiteVolume/fvc/fvcMeshPhi.C
|
||||
|
||||
cfdTools/general/findRefCell/findRefCell.C
|
||||
cfdTools/general/adjustPhi/adjustPhi.C
|
||||
cfdTools/general/bound/bound.C
|
||||
cfdTools/general/porousMedia/porousZone.C
|
||||
cfdTools/general/porousMedia/porousZones.C
|
||||
cfdTools/general/MRF/MRFZone.C
|
||||
cfdTools/general/MRF/MRFZones.C
|
||||
cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C
|
||||
cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C
|
||||
cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C
|
||||
cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C
|
||||
cfdTools/general/SRF/SRFModel/rpm/rpm.C
|
||||
cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
|
||||
general = cfdTools/general
|
||||
$(general)/findRefCell/findRefCell.C
|
||||
$(general)/adjustPhi/adjustPhi.C
|
||||
$(general)/bound/bound.C
|
||||
|
||||
porousMedia = $(general)/porousMedia
|
||||
$(porousMedia)/porousZone.C
|
||||
$(porousMedia)/porousZones.C
|
||||
|
||||
MRF = $(general)/MRF
|
||||
$(MRF)/MRFZone.C
|
||||
$(MRF)/MRFZones.C
|
||||
|
||||
SRF = $(general)/SRF
|
||||
$(SRF)/SRFModel/SRFModel/SRFModel.C
|
||||
$(SRF)/SRFModel/SRFModel/newSRFModel.C
|
||||
$(SRF)/SRFModel/rpm/rpm.C
|
||||
$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
|
||||
|
||||
fieldSources = $(general)/fieldSources
|
||||
$(fieldSources)/pressureGradientExplicitSource/pressureGradientExplicitSource.C
|
||||
$(fieldSources)/timeActivatedExplicitSource/timeActivatedExplicitSource.C
|
||||
$(fieldSources)/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.C
|
||||
|
||||
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C
|
||||
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C
|
||||
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libfiniteVolume
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "timeActivatedExplicitCellSource.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::timeActivatedExplicitCellSource::updateCellSet()
|
||||
{
|
||||
cellSelector_->applyToSet(topoSetSource::NEW, selectedCellSet_);
|
||||
|
||||
Info<< " " << name_ << ": selected "
|
||||
<< returnReduce(selectedCellSet_.size(), sumOp<label>())
|
||||
<< " cells" << nl << endl;
|
||||
|
||||
V_ = scalarField(selectedCellSet_.size(), 1.0);
|
||||
if (volumeType_ == vtAbsolute)
|
||||
{
|
||||
label i = 0;
|
||||
forAllConstIter(cellSet, selectedCellSet_, iter)
|
||||
{
|
||||
V_[i++] = mesh_.V()[iter.key()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::timeActivatedExplicitCellSource::timeActivatedExplicitCellSource
|
||||
(
|
||||
const word& name,
|
||||
const fvMesh& mesh,
|
||||
const dimensionSet& dims
|
||||
)
|
||||
:
|
||||
timeActivatedExplicitSource(name, mesh, dims),
|
||||
onValue_(readScalar(lookup("onValue"))),
|
||||
offValue_(readScalar(lookup("offValue"))),
|
||||
V_(0),
|
||||
cellSource_(lookup("cellSource")),
|
||||
cellSelector_
|
||||
(
|
||||
topoSetSource::New
|
||||
(
|
||||
cellSource_,
|
||||
mesh,
|
||||
subDict(cellSource_ + "Coeffs")
|
||||
)
|
||||
),
|
||||
selectedCellSet_
|
||||
(
|
||||
mesh,
|
||||
name + "SourceCellSet",
|
||||
mesh.nCells()/10 + 1 // Reasonable size estimate.
|
||||
)
|
||||
{
|
||||
// Create the cell set
|
||||
updateCellSet();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::timeActivatedExplicitCellSource::onValue() const
|
||||
{
|
||||
return onValue_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::timeActivatedExplicitCellSource::offValue() const
|
||||
{
|
||||
return offValue_;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||
Foam::timeActivatedExplicitCellSource::Su()
|
||||
{
|
||||
tmp<DimensionedField<scalar, volMesh> > tSource
|
||||
(
|
||||
new DimensionedField<scalar, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name_ + "Su",
|
||||
runTime_.timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimensions_, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
scalar value = offValue_;
|
||||
if
|
||||
(
|
||||
active_
|
||||
&& (runTime_.time().value() >= timeStart_)
|
||||
&& (runTime_.time().value() <= timeStart_ + duration_)
|
||||
)
|
||||
{
|
||||
// Update the cell set if the mesh is changing
|
||||
if (mesh_.changing())
|
||||
{
|
||||
updateCellSet();
|
||||
}
|
||||
|
||||
value = onValue_;
|
||||
}
|
||||
|
||||
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(cellSet, selectedCellSet_, iter)
|
||||
{
|
||||
sourceField[iter.key()] = value/V_[i++];
|
||||
}
|
||||
|
||||
return tSource;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::timeActivatedExplicitCellSource::read()
|
||||
{
|
||||
if (timeActivatedExplicitSource::read())
|
||||
{
|
||||
lookup("onValue") >> onValue_;
|
||||
lookup("offValue") >> offValue_;
|
||||
lookup("cellSource") >> cellSource_;
|
||||
cellSelector_ =
|
||||
topoSetSource::New
|
||||
(
|
||||
cellSource_,
|
||||
mesh_,
|
||||
subDict(cellSource_ + "Coeffs")
|
||||
);
|
||||
updateCellSet();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,143 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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
|
||||
Foam::timeActivatedExplicitSourceNew
|
||||
|
||||
Description
|
||||
Creates a cell set source that is activated at a given time, and remains
|
||||
active for a specified duration. The source value is either in specific
|
||||
(XX/m3) or absolute (XX) units.
|
||||
|
||||
SourceFiles
|
||||
timeActivatedExplicitCellSource.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeActivatedExplicitCellSource_H
|
||||
#define timeActivatedExplicitCellSource_H
|
||||
|
||||
#include "timeActivatedExplicitSource.H"
|
||||
#include "topoSetSource.H"
|
||||
#include "cellSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class timeActivatedExplicitCellSource Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class timeActivatedExplicitCellSource
|
||||
:
|
||||
public timeActivatedExplicitSource
|
||||
{
|
||||
private:
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Update the cell set that the source is acting on
|
||||
void updateCellSet();
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
timeActivatedExplicitCellSource(const timeActivatedExplicitCellSource&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const timeActivatedExplicitCellSource&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
// Source properties
|
||||
|
||||
//- Value when "on"
|
||||
scalar onValue_;
|
||||
|
||||
//- Value when "off"
|
||||
scalar offValue_;
|
||||
|
||||
|
||||
// Cell set
|
||||
|
||||
//- Cell volumes
|
||||
scalarList V_;
|
||||
|
||||
//- Name of cell source (XXXToCell)
|
||||
word cellSource_;
|
||||
|
||||
//- Method by which the cells will be selected
|
||||
autoPtr<topoSetSource> cellSelector_;
|
||||
|
||||
//- Set of selected cells
|
||||
cellSet selectedCellSet_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from explicit source name and mesh
|
||||
timeActivatedExplicitCellSource
|
||||
(
|
||||
const word&,
|
||||
const fvMesh&,
|
||||
const dimensionSet&
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the "on" value
|
||||
virtual scalar onValue() const;
|
||||
|
||||
//- Return the "off" value
|
||||
virtual scalar offValue() const;
|
||||
|
||||
//- Return a tmp field of the source
|
||||
virtual tmp<DimensionedField<scalar, volMesh> > Su();
|
||||
|
||||
|
||||
//- Read properties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,87 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "pointSourceProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointSourceProperties::pointSourceProperties()
|
||||
:
|
||||
name_("unknownPointSourceName"),
|
||||
timeStart_(0.0),
|
||||
duration_(0.0),
|
||||
location_(point::zero),
|
||||
fieldData_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::pointSourceProperties::pointSourceProperties(const dictionary& dict)
|
||||
:
|
||||
name_(dict.name().name()),
|
||||
timeStart_(readScalar(dict.lookup("timeStart"))),
|
||||
duration_(readScalar(dict.lookup("duration"))),
|
||||
location_(dict.lookup("location")),
|
||||
fieldData_(dict.lookup("fieldData"))
|
||||
{}
|
||||
|
||||
|
||||
Foam::pointSourceProperties::pointSourceProperties
|
||||
(
|
||||
const pointSourceProperties& psp
|
||||
)
|
||||
:
|
||||
name_(psp.name_),
|
||||
timeStart_(psp.timeStart_),
|
||||
duration_(psp.duration_),
|
||||
location_(psp.location_),
|
||||
fieldData_(psp.fieldData_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::pointSourceProperties::operator=(const pointSourceProperties& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"pointSourceProperties::operator=(const pointSourceProperties&)"
|
||||
) << "Attempted assignment to self" << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Set updated values
|
||||
name_ = rhs.name_;
|
||||
timeStart_ = rhs.timeStart_;
|
||||
duration_ = rhs.duration_;
|
||||
location_ = rhs.location_;
|
||||
fieldData_ = rhs.fieldData_;}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,158 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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
|
||||
Foam::pointSourceProperties
|
||||
|
||||
Description
|
||||
Helper class to describe point source properties
|
||||
|
||||
SourceFiles
|
||||
pointSourceProperties.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef pointSourceProperties_H
|
||||
#define pointSourceProperties_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "Tuple2.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointSourceProperties Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class pointSourceProperties
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
typedef Tuple2<word, scalar> fieldNameValuePair;
|
||||
|
||||
//- Source name
|
||||
word name_;
|
||||
|
||||
//- Time start
|
||||
scalar timeStart_;
|
||||
|
||||
//- Duration
|
||||
scalar duration_;
|
||||
|
||||
//- Point location
|
||||
point location_;
|
||||
|
||||
//- List of source field name vs value pairs
|
||||
List<fieldNameValuePair> fieldData_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
pointSourceProperties();
|
||||
|
||||
//- Construct from dictionary
|
||||
pointSourceProperties(const dictionary& dict);
|
||||
|
||||
//- Construct from Istream
|
||||
pointSourceProperties(Istream& is);
|
||||
|
||||
//- Copy constructor
|
||||
pointSourceProperties(const pointSourceProperties&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the source name
|
||||
inline const word& name() const;
|
||||
|
||||
//- Return const access to the time start
|
||||
inline scalar timeStart() const;
|
||||
|
||||
//- Return const access to the time end
|
||||
inline scalar timeEnd() const;
|
||||
|
||||
//- Return const access to the duration
|
||||
inline scalar duration() const;
|
||||
|
||||
//- Return const access to the point location
|
||||
inline const point& location() const;
|
||||
|
||||
//- Return const access to the source field name vs value pairs
|
||||
inline const List<fieldNameValuePair>& fieldData() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Return access to the source name
|
||||
inline word& name();
|
||||
|
||||
//- Return access to the time start
|
||||
inline scalar& timeStart();
|
||||
|
||||
//- Return access to the duration
|
||||
inline scalar& duration();
|
||||
|
||||
//- Return access to the point location
|
||||
inline point& location();
|
||||
|
||||
//- Return access to the source field name vs value pairs
|
||||
inline List<fieldNameValuePair>& fieldData();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const pointSourceProperties&);
|
||||
|
||||
// IOstream operators
|
||||
|
||||
friend Istream& operator>>(Istream&, pointSourceProperties&);
|
||||
friend Ostream& operator<<(Ostream&, const pointSourceProperties&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "pointSourcePropertiesI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "pointSourceProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::word& Foam::pointSourceProperties::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::pointSourceProperties::timeStart() const
|
||||
{
|
||||
return timeStart_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::pointSourceProperties::timeEnd() const
|
||||
{
|
||||
return timeStart_ + duration_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::pointSourceProperties::duration() const
|
||||
{
|
||||
return duration_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::point& Foam::pointSourceProperties::location() const
|
||||
{
|
||||
return location_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::pointSourceProperties::fieldNameValuePair>&
|
||||
Foam::pointSourceProperties::fieldData() const
|
||||
{
|
||||
return fieldData_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::word& Foam::pointSourceProperties::name()
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::pointSourceProperties::timeStart()
|
||||
{
|
||||
return timeStart_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::pointSourceProperties::duration()
|
||||
{
|
||||
return duration_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::point& Foam::pointSourceProperties::location()
|
||||
{
|
||||
return location_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::List<Foam::pointSourceProperties::fieldNameValuePair>&
|
||||
Foam::pointSourceProperties::fieldData()
|
||||
{
|
||||
return fieldData_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,88 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "pointSourceProperties.H"
|
||||
#include "dictionaryEntry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointSourceProperties::pointSourceProperties(Istream& is)
|
||||
:
|
||||
name_("unknownPointSourceName"),
|
||||
timeStart_(0.0),
|
||||
duration_(0.0),
|
||||
location_(point::zero),
|
||||
fieldData_()
|
||||
{
|
||||
is.check("pointSourceProperties(Istream&)");
|
||||
|
||||
const dictionaryEntry entry(dictionary::null, is);
|
||||
|
||||
name_ = entry.keyword();
|
||||
entry.lookup("timeStart") >> timeStart_;
|
||||
entry.lookup("duration") >> duration_;
|
||||
entry.lookup("location") >> location_;
|
||||
entry.lookup("fieldData") >> fieldData_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, pointSourceProperties& psp)
|
||||
{
|
||||
is.check("Istream& operator>>(Istream&, pointSourceProperties&)");
|
||||
|
||||
const dictionaryEntry entry(dictionary::null, is);
|
||||
|
||||
psp.name_ = entry.keyword();
|
||||
entry.lookup("timeStart") >> psp.timeStart_;
|
||||
entry.lookup("duration") >> psp.duration_;
|
||||
entry.lookup("location") >> psp.location_;
|
||||
entry.lookup("fieldData") >> psp.fieldData_;
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const pointSourceProperties& psp)
|
||||
{
|
||||
os.check("Ostream& operator<<(Ostream&, const pointSourceProperties&)");
|
||||
|
||||
os << psp.name_ << nl << token::BEGIN_BLOCK << nl;
|
||||
os.writeKeyword("timeStart") << psp.timeStart_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("duration") << psp.duration_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("location") << psp.location_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("fieldData") << psp.fieldData_ << token::END_STATEMENT << nl;
|
||||
os << token::END_BLOCK << nl;
|
||||
|
||||
os.check("Ostream& operator<<(Ostream&, const pointSourceProperties&)");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,268 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "timeActivatedExplicitMulticomponentPointSource.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::label
|
||||
Foam::timeActivatedExplicitMulticomponentPointSource::carrierFieldId
|
||||
(
|
||||
const word& fieldName
|
||||
)
|
||||
{
|
||||
forAll(carrierFields_, fieldI)
|
||||
{
|
||||
if (carrierFields_[fieldI].name() == fieldName)
|
||||
{
|
||||
return fieldI;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void Foam::timeActivatedExplicitMulticomponentPointSource::updateAddressing()
|
||||
{
|
||||
forAll(pointSources_, sourceI)
|
||||
{
|
||||
const pointSourceProperties& psp = pointSources_[sourceI];
|
||||
label cid = mesh_.findCell(psp.location());
|
||||
if (cid < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeActivatedExplicitMulticomponentPointSource::"
|
||||
"updateAddressing()"
|
||||
) << "Unable to find location " << psp.location() << " in mesh "
|
||||
<< "for source " << psp.name() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellOwners_[sourceI] = cid;
|
||||
}
|
||||
|
||||
fieldIds_[sourceI].setSize(psp.fieldData().size());
|
||||
forAll(psp.fieldData(), fieldI)
|
||||
{
|
||||
const word& fieldName = psp.fieldData()[fieldI].first();
|
||||
label cfid = carrierFieldId(fieldName);
|
||||
if (cfid < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeActivatedExplicitMulticomponentPointSource::"
|
||||
"updateAddressing()"
|
||||
) << "Unable to find field " << fieldName << " in carrier "
|
||||
<< "fields for source " << psp.name() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldIds_[sourceI][fieldI] = cfid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::timeActivatedExplicitMulticomponentPointSource::
|
||||
timeActivatedExplicitMulticomponentPointSource
|
||||
(
|
||||
const word& name,
|
||||
const fvMesh& mesh,
|
||||
const PtrList<volScalarField>& carrierFields,
|
||||
const dimensionSet& dims
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name + "Properties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
name_(name),
|
||||
mesh_(mesh),
|
||||
runTime_(mesh.time()),
|
||||
dimensions_(dims),
|
||||
carrierFields_(carrierFields),
|
||||
active_(lookup("active")),
|
||||
pointSources_(lookup("pointSources")),
|
||||
cellOwners_(pointSources_.size()),
|
||||
fieldIds_(pointSources_.size())
|
||||
{
|
||||
// Initialise the field addressing
|
||||
updateAddressing();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||
Foam::timeActivatedExplicitMulticomponentPointSource::Su
|
||||
(
|
||||
const label fieldI
|
||||
)
|
||||
{
|
||||
if (mesh_.changing())
|
||||
{
|
||||
updateAddressing();
|
||||
}
|
||||
|
||||
tmp<DimensionedField<scalar, volMesh> > tSource
|
||||
(
|
||||
new DimensionedField<scalar, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name_ + carrierFields_[fieldI].name() + "Su",
|
||||
runTime_.timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimensions_, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
if (active_)
|
||||
{
|
||||
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
||||
|
||||
const scalarField& V = mesh_.V();
|
||||
const scalar dt = runTime_.deltaT().value();
|
||||
|
||||
forAll(pointSources_, sourceI)
|
||||
{
|
||||
const pointSourceProperties& psp = pointSources_[sourceI];
|
||||
|
||||
forAll(fieldIds_[sourceI], i)
|
||||
{
|
||||
if
|
||||
(
|
||||
fieldIds_[sourceI][i] == fieldI
|
||||
&& (runTime_.time().value() >= psp.timeStart())
|
||||
&& (runTime_.time().value() <= psp.timeEnd())
|
||||
)
|
||||
{
|
||||
const label cid = cellOwners_[sourceI];
|
||||
sourceField[cid] += dt*psp.fieldData()[i].second()/V[cid];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tSource;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||
Foam::timeActivatedExplicitMulticomponentPointSource::Su()
|
||||
{
|
||||
if (mesh_.changing())
|
||||
{
|
||||
updateAddressing();
|
||||
}
|
||||
|
||||
tmp<DimensionedField<scalar, volMesh> > tSource
|
||||
(
|
||||
new DimensionedField<scalar, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name_ + "TotalSu",
|
||||
runTime_.timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimensions_, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
if (active_)
|
||||
{
|
||||
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
||||
|
||||
const scalarField& V = mesh_.V();
|
||||
const scalar dt = runTime_.deltaT().value();
|
||||
|
||||
forAll(pointSources_, sourceI)
|
||||
{
|
||||
const pointSourceProperties& psp = pointSources_[sourceI];
|
||||
|
||||
forAll(fieldIds_[sourceI], i)
|
||||
{
|
||||
if
|
||||
(
|
||||
(runTime_.time().value() >= psp.timeStart())
|
||||
&& (runTime_.time().value() <= psp.timeEnd())
|
||||
)
|
||||
{
|
||||
const label cid = cellOwners_[sourceI];
|
||||
sourceField[cid] += dt*psp.fieldData()[i].second()/V[cid];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tSource;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::timeActivatedExplicitMulticomponentPointSource::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
lookup("active") >> active_;
|
||||
lookup("pointSources") >> pointSources_;
|
||||
|
||||
cellOwners_.setSize(pointSources_.size());
|
||||
|
||||
updateAddressing();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,185 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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
|
||||
Foam::timeActivatedExplicitMulticomponentPointSourceNew
|
||||
|
||||
Description
|
||||
Provides a mechanism to introduce point sources to a set of carrier fields.
|
||||
Carrier fields are supplied on consruction, and interrogated to provide the
|
||||
field indices of the sources.
|
||||
|
||||
Source values are assumed to be in <quantity>/s, and divided through by the
|
||||
cell volumes before being returned, e.g. for a kg/s source
|
||||
|
||||
Properties are described in a <name>Properties dictionary
|
||||
|
||||
active true; // are sources active (true/false)
|
||||
|
||||
pointSources
|
||||
(
|
||||
source1 // source name
|
||||
{
|
||||
timeStart 0.0;
|
||||
duration 1.0;
|
||||
location (0 0 0);
|
||||
fieldData
|
||||
(
|
||||
(H2O 0.1) // kg/s
|
||||
(O2 0.05) // kg/s
|
||||
);
|
||||
}
|
||||
source2 // source name
|
||||
{
|
||||
timeStart 0.5;
|
||||
duration 2.0;
|
||||
location (1 1 1);
|
||||
fieldData
|
||||
(
|
||||
(NO 0.1) // kg/s
|
||||
(CO2 0.05) // kg/s
|
||||
(H2 0.001) // kg/s
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
SourceFiles
|
||||
timeActivatedExplicitMulticomponentPointSourceNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeActivatedExplicitMulticomponentPointSource_H
|
||||
#define timeActivatedExplicitMulticomponentPointSource_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "pointSourceProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class timeActivatedExplicitMulitcomponentPointSource Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class timeActivatedExplicitMulticomponentPointSource
|
||||
:
|
||||
public IOdictionary
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Name of the source
|
||||
word name_;
|
||||
|
||||
//- Reference to the mesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
//- Reference to time database
|
||||
const Time& runTime_;
|
||||
|
||||
//- Source dimensions
|
||||
const dimensionSet& dimensions_;
|
||||
|
||||
//- Reference to the multicomponent carrier fields
|
||||
const PtrList<volScalarField>& carrierFields_;
|
||||
|
||||
//- Active flag
|
||||
bool active_;
|
||||
|
||||
//- List of point source properties
|
||||
List<pointSourceProperties> pointSources_;
|
||||
|
||||
//- List of cell owners for point source locations
|
||||
List<label> cellOwners_;
|
||||
|
||||
//- List of field ids for each source
|
||||
List<labelList> fieldIds_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Return the id of field given its name
|
||||
label carrierFieldId(const word& fieldName);
|
||||
|
||||
//- Update the addressing between source and carrier fields
|
||||
void updateAddressing();
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
timeActivatedExplicitMulticomponentPointSource
|
||||
(
|
||||
const timeActivatedExplicitMulticomponentPointSource&
|
||||
);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const timeActivatedExplicitMulticomponentPointSource&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
timeActivatedExplicitMulticomponentPointSource
|
||||
(
|
||||
const word&,
|
||||
const fvMesh&,
|
||||
const PtrList<volScalarField>&,
|
||||
const dimensionSet&
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return a tmp field of the source for field fieldI
|
||||
virtual tmp<DimensionedField<scalar, volMesh> > Su
|
||||
(
|
||||
const label fieldI
|
||||
);
|
||||
|
||||
//- Return a tmp field of the total source
|
||||
virtual tmp<DimensionedField<scalar, volMesh> > Su();
|
||||
|
||||
|
||||
//- Read properties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -44,33 +44,11 @@ const Foam::NamedEnum<Foam::timeActivatedExplicitSource::volumeType, 2>
|
||||
Foam::timeActivatedExplicitSource::volumeTypeNames_;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::timeActivatedExplicitSource::updateCellSet()
|
||||
{
|
||||
cellSelector_->applyToSet(topoSetSource::NEW, selectedCellSet_);
|
||||
|
||||
Info<< " " << sourceName_ << ": selected "
|
||||
<< returnReduce(selectedCellSet_.size(), sumOp<label>())
|
||||
<< " cells" << nl << endl;
|
||||
|
||||
V_ = scalarField(selectedCellSet_.size(), 1.0);
|
||||
if (volumeType_ == vtAbsolute)
|
||||
{
|
||||
label i = 0;
|
||||
forAllConstIter(cellSet, selectedCellSet_, iter)
|
||||
{
|
||||
V_[i++] = mesh_.V()[iter.key()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::timeActivatedExplicitSource::timeActivatedExplicitSource
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& name,
|
||||
const fvMesh& mesh,
|
||||
const dimensionSet& dims
|
||||
)
|
||||
@ -79,51 +57,63 @@ Foam::timeActivatedExplicitSource::timeActivatedExplicitSource
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
sourceName + "Properties",
|
||||
name + "Properties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
sourceName_(sourceName),
|
||||
mesh_(mesh),
|
||||
runTime_(mesh.time()),
|
||||
name_(name),
|
||||
active_(lookup("active")),
|
||||
dimensions_(dims),
|
||||
volumeType_(volumeTypeNames_.read(lookup("volumeType"))),
|
||||
timeStart_(readScalar(lookup("timeStart"))),
|
||||
duration_(readScalar(lookup("duration"))),
|
||||
onValue_(readScalar(lookup("onValue"))),
|
||||
offValue_(readScalar(lookup("offValue"))),
|
||||
currentValue_(0.0),
|
||||
V_(0),
|
||||
cellSource_(lookup("cellSource")),
|
||||
cellSelector_
|
||||
(
|
||||
topoSetSource::New
|
||||
(
|
||||
cellSource_,
|
||||
mesh,
|
||||
subDict(cellSource_ + "Coeffs")
|
||||
)
|
||||
),
|
||||
selectedCellSet_
|
||||
(
|
||||
mesh,
|
||||
sourceName + "SourceCellSet",
|
||||
mesh.nCells()/10 + 1 // Reasonable size estimate.
|
||||
)
|
||||
{
|
||||
// Create the cell set
|
||||
updateCellSet();
|
||||
|
||||
// Initialise the value
|
||||
update();
|
||||
}
|
||||
duration_(readScalar(lookup("duration")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::fvMesh& Foam::timeActivatedExplicitSource::mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::Time& Foam::timeActivatedExplicitSource::runTime() const
|
||||
{
|
||||
return runTime_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::word& Foam::timeActivatedExplicitSource::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::Switch& Foam::timeActivatedExplicitSource::active() const
|
||||
{
|
||||
return active_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::dimensionSet& Foam::timeActivatedExplicitSource::dimensions() const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::timeActivatedExplicitSource::volumeType&
|
||||
Foam::timeActivatedExplicitSource::volume() const
|
||||
{
|
||||
return volumeType_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::timeActivatedExplicitSource::timeStart() const
|
||||
{
|
||||
return timeStart_;
|
||||
@ -136,100 +126,30 @@ Foam::scalar Foam::timeActivatedExplicitSource::duration() const
|
||||
}
|
||||
|
||||
|
||||
const Foam::dimensionedScalar
|
||||
Foam::timeActivatedExplicitSource::currentValue() const
|
||||
{
|
||||
return dimensionedScalar
|
||||
(
|
||||
sourceName_,
|
||||
dimensions_,
|
||||
currentValue_
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||
Foam::timeActivatedExplicitSource::Su() const
|
||||
{
|
||||
tmp<DimensionedField<scalar, volMesh> > tSource
|
||||
(
|
||||
new DimensionedField<scalar, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
sourceName_ + "Su",
|
||||
runTime_.timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimensions_, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(cellSet, selectedCellSet_, iter)
|
||||
{
|
||||
sourceField[iter.key()] = currentValue_/V_[i++];
|
||||
}
|
||||
|
||||
return tSource;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::timeActivatedExplicitSource::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
lookup("active") >> active_;
|
||||
if (active_)
|
||||
{
|
||||
volumeType_ = volumeTypeNames_.read(lookup("volumeType"));
|
||||
lookup("timeStart") >> duration_;
|
||||
lookup("duration") >> duration_;
|
||||
lookup("onValue") >> onValue_;
|
||||
lookup("offValue") >> offValue_;
|
||||
lookup("cellSource") >> cellSource_;
|
||||
cellSelector_ =
|
||||
topoSetSource::New
|
||||
(
|
||||
cellSource_,
|
||||
mesh_,
|
||||
subDict(cellSource_ + "Coeffs")
|
||||
);
|
||||
updateCellSet();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::timeActivatedExplicitSource::update()
|
||||
{
|
||||
// Set the source value
|
||||
if
|
||||
(
|
||||
(runTime_.time().value() >= timeStart_)
|
||||
&& (runTime_.time().value() <= timeStart_ + duration_)
|
||||
)
|
||||
{
|
||||
currentValue_ = onValue_;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentValue_ = offValue_;
|
||||
}
|
||||
|
||||
// Update the cell set if the mesh is changing
|
||||
if (mesh_.changing())
|
||||
{
|
||||
updateCellSet();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -23,15 +23,20 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::timeActivatedExplicitSourceNew
|
||||
Foam::timeActivatedExplicitSource
|
||||
|
||||
Description
|
||||
Creates a cell set source that is activated at a given time, and remains
|
||||
active for a specified duration. The source value is either in specific
|
||||
(XX/m3) or absolute (XX) units.
|
||||
Base class for field sources. Provides:
|
||||
- name
|
||||
- references to mesh and time
|
||||
- dimensions
|
||||
- volume type
|
||||
- startTime
|
||||
- duration
|
||||
- read (from <sourceName>Properties dictionary)
|
||||
|
||||
SourceFiles
|
||||
timeActivatedExplicitSourceNew.C
|
||||
timeActivatedExplicitSource.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -40,8 +45,6 @@ SourceFiles
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "autoPtr.H"
|
||||
#include "topoSetSource.H"
|
||||
#include "cellSet.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "NamedEnum.H"
|
||||
@ -72,19 +75,19 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
// Private member functions
|
||||
// Private Member Functions
|
||||
|
||||
//- Update the cell set that the source is acting on
|
||||
void updateCellSet();
|
||||
//- Disallow default bitwise copy construct
|
||||
timeActivatedExplicitSource(const timeActivatedExplicitSource&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const timeActivatedExplicitSource&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Name of the source
|
||||
word sourceName_;
|
||||
|
||||
//- Reference to the mesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
@ -94,6 +97,12 @@ protected:
|
||||
|
||||
// Source properties
|
||||
|
||||
//- Name of the source
|
||||
word name_;
|
||||
|
||||
//- Active flag
|
||||
Switch active_;
|
||||
|
||||
//- Dimensions
|
||||
const dimensionSet dimensions_;
|
||||
|
||||
@ -106,39 +115,6 @@ protected:
|
||||
//- Duration [s]
|
||||
scalar duration_;
|
||||
|
||||
//- Value when "on"
|
||||
scalar onValue_;
|
||||
|
||||
//- Value when "off"
|
||||
scalar offValue_;
|
||||
|
||||
//- Current source value
|
||||
scalar currentValue_;
|
||||
|
||||
|
||||
// Cell set
|
||||
|
||||
//- Cell volumes
|
||||
scalarList V_;
|
||||
|
||||
//- Name of cell source (XXXToCell)
|
||||
word cellSource_;
|
||||
|
||||
//- Method by which the cells will be selected
|
||||
autoPtr<topoSetSource> cellSelector_;
|
||||
|
||||
//- Set of selected cells
|
||||
cellSet selectedCellSet_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
timeActivatedExplicitSource(const timeActivatedExplicitSource&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const timeActivatedExplicitSource&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -157,24 +133,33 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the reference to the mesh
|
||||
virtual const fvMesh& mesh() const;
|
||||
|
||||
//- Return the reference to the time database
|
||||
virtual const Time& runTime() const;
|
||||
|
||||
//- Return the source name
|
||||
virtual const word& name() const;
|
||||
|
||||
//- Return the active flag
|
||||
virtual const Switch& active() const;
|
||||
|
||||
//- Return the dimensions
|
||||
virtual const dimensionSet& dimensions() const;
|
||||
|
||||
//- Return the volume type
|
||||
virtual const volumeType& volume() const;
|
||||
|
||||
//- Return the start time
|
||||
scalar timeStart() const;
|
||||
virtual scalar timeStart() const;
|
||||
|
||||
//- Return the duration
|
||||
scalar duration() const;
|
||||
|
||||
//- Return the current value of the source
|
||||
const dimensionedScalar currentValue() const;
|
||||
|
||||
//- Return a tmp field of the source
|
||||
virtual tmp<DimensionedField<scalar, volMesh> > Su() const;
|
||||
virtual scalar duration() const;
|
||||
|
||||
|
||||
//- Read properties dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Update
|
||||
virtual void update();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -79,6 +79,8 @@ Foam::porousZone::porousZone
|
||||
D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
|
||||
F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
|
||||
{
|
||||
Info<< "Creating porous zone: " << name_ << endl;
|
||||
|
||||
if (cellZoneID_ == -1 && !Pstream::parRun())
|
||||
{
|
||||
FatalErrorIn
|
||||
|
||||
@ -45,7 +45,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
|
||||
const labelList& faces = mesh.cells()[celli_];
|
||||
const vector& C = mesh.cellCentres()[celli_];
|
||||
|
||||
labelList faceList(0);
|
||||
DynamicList<label> faceList(10);
|
||||
forAll(faces, i)
|
||||
{
|
||||
label facei = faces[i];
|
||||
@ -53,12 +53,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
|
||||
|
||||
if ((lam > 0) && (lam < 1.0))
|
||||
{
|
||||
label n = faceList.size();
|
||||
faceList.setSize(n+1);
|
||||
faceList[n] = facei;
|
||||
faceList.append(facei);
|
||||
}
|
||||
}
|
||||
|
||||
faceList.shrink();
|
||||
|
||||
return faceList;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
|
||||
const labelList& faces = mesh.cells()[celli];
|
||||
const vector& C = mesh.cellCentres()[celli];
|
||||
|
||||
labelList faceList(0);
|
||||
DynamicList<label> faceList(10);
|
||||
forAll(faces, i)
|
||||
{
|
||||
label facei = faces[i];
|
||||
@ -83,12 +83,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
|
||||
|
||||
if ((lam > 0) && (lam < 1.0))
|
||||
{
|
||||
label n = faceList.size();
|
||||
faceList.setSize(n+1);
|
||||
faceList[n] = facei;
|
||||
faceList.append(facei);
|
||||
}
|
||||
}
|
||||
|
||||
faceList.shrink();
|
||||
|
||||
return faceList;
|
||||
}
|
||||
|
||||
@ -186,6 +186,17 @@ Foam::Particle<ParticleType>::Particle
|
||||
{}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::Particle<ParticleType>::Particle(const Particle<ParticleType>& p)
|
||||
:
|
||||
cloud_(p.cloud_),
|
||||
position_(p.position_),
|
||||
celli_(p.celli_),
|
||||
facei_(p.facei_),
|
||||
stepFraction_(p.stepFraction_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
@ -328,6 +339,8 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
|
||||
label patchi = patch(facei_);
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||
|
||||
if (!p.hitPatch(patch, td, patchi))
|
||||
{
|
||||
if (isA<wedgePolyPatch>(patch))
|
||||
{
|
||||
p.hitWedgePatch
|
||||
@ -363,21 +376,10 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
|
||||
static_cast<const wallPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<polyPatch>(patch))
|
||||
{
|
||||
p.hitPatch
|
||||
(
|
||||
static_cast<const polyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Particle::trackToFace"
|
||||
"(const vector& endPosition, scalar& trackFraction)"
|
||||
)<< "patch type " << patch.type() << " not suported" << nl
|
||||
<< abort(FatalError);
|
||||
p.hitPatch(patch, td);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -423,6 +425,19 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&)
|
||||
{}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
template<class TrackData>
|
||||
bool Foam::Particle<ParticleType>::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData&,
|
||||
const label
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
template<class TrackData>
|
||||
void Foam::Particle<ParticleType>::hitWedgePatch
|
||||
|
||||
@ -98,10 +98,7 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
inline trackData
|
||||
(
|
||||
Cloud<ParticleType>& cloud
|
||||
);
|
||||
inline trackData(Cloud<ParticleType>& cloud);
|
||||
|
||||
|
||||
// Member functions
|
||||
@ -171,6 +168,16 @@ protected:
|
||||
|
||||
// Patch interactions
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
template<class TrackData>
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData& td,
|
||||
const label patchI
|
||||
);
|
||||
|
||||
//- Overridable function to handle the particle hitting a wedgePatch
|
||||
template<class TrackData>
|
||||
void hitWedgePatch
|
||||
@ -256,6 +263,11 @@ public:
|
||||
friend class Cloud<ParticleType>;
|
||||
|
||||
|
||||
// Static data members
|
||||
|
||||
//- String representation of properties
|
||||
static string propHeader;
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Particle");
|
||||
|
||||
@ -278,13 +290,23 @@ public:
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
//- Construct as a copy
|
||||
Particle(const Particle& p);
|
||||
|
||||
//- Construct a clone
|
||||
autoPtr<ParticleType> clone() const
|
||||
{
|
||||
return autoPtr<Particle>(new Particle(*this));
|
||||
}
|
||||
|
||||
|
||||
//- Factory class to read-construct particles used for
|
||||
// parallel transfer
|
||||
class iNew
|
||||
{
|
||||
|
||||
// Private data
|
||||
|
||||
//- Reference to the cloud
|
||||
const Cloud<ParticleType>& cloud_;
|
||||
|
||||
|
||||
@ -303,7 +325,6 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
virtual ~Particle()
|
||||
{}
|
||||
|
||||
@ -344,6 +365,9 @@ public:
|
||||
//- Return the impact model to be used, soft or hard (default).
|
||||
inline bool softImpact() const;
|
||||
|
||||
//- Return the particle current time
|
||||
inline scalar currentTime() const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
@ -414,10 +438,7 @@ public:
|
||||
// I-O
|
||||
|
||||
//- Write the fields associated with the owner cloud
|
||||
static void writeFields
|
||||
(
|
||||
const Cloud<ParticleType>& c
|
||||
);
|
||||
static void writeFields(const Cloud<ParticleType>& c);
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
@ -345,6 +345,15 @@ inline bool Particle<ParticleType>::softImpact() const
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline scalar Particle<ParticleType>::currentTime() const
|
||||
{
|
||||
return
|
||||
cloud_.pMesh().time().value()
|
||||
+ stepFraction_*cloud_.pMesh().time().deltaT().value();
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline label Particle<ParticleType>::patch(const label facei) const
|
||||
{
|
||||
|
||||
@ -28,6 +28,12 @@ License
|
||||
#include "IOstreams.H"
|
||||
#include "IOPosition.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::string Foam::Particle<ParticleType>::propHeader = "(Px Py Pz) cellI";
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from Istream
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "ParticleTrackingData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::label Foam::ParticleTrackingData<ParcelType>::PARTICLE_COUNT = 0;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData
|
||||
(
|
||||
const Cloud<ParcelType>& cloud
|
||||
)
|
||||
:
|
||||
cloud_(cloud),
|
||||
origProc_(Pstream::myProcNo()),
|
||||
id_(PARTICLE_COUNT++)
|
||||
{}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData
|
||||
(
|
||||
const ParticleTrackingData& ptd
|
||||
)
|
||||
:
|
||||
cloud_(ptd.cloud_),
|
||||
origProc_(ptd.origProc_),
|
||||
id_(ptd.id_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::ParticleTrackingData<ParcelType>::~ParticleTrackingData()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "ParticleTrackingDataIO.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
166
src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H
Normal file
166
src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H
Normal file
@ -0,0 +1,166 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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
|
||||
Foam::ParticleTrackingData
|
||||
|
||||
Description
|
||||
Class to provide additional properties to allow construction of
|
||||
particle tracks
|
||||
|
||||
SourceFiles
|
||||
ParticleTrackingData.C
|
||||
ParticleTrackingDataIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ParticleTrackingData_H
|
||||
#define ParticleTrackingData_H
|
||||
|
||||
#include "Cloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes and friend functions
|
||||
template<class ParcelType>
|
||||
class ParticleTrackingData;
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const ParticleTrackingData<ParcelType>&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ParticleTrackingData Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class ParcelType>
|
||||
class ParticleTrackingData
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference to the cloud
|
||||
const Cloud<ParcelType>& cloud_;
|
||||
|
||||
//- Originating processor id
|
||||
label origProc_;
|
||||
|
||||
//- Local particle id
|
||||
label id_;
|
||||
|
||||
//- Cumulative particle count used for particle id
|
||||
static label PARTICLE_COUNT;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Write properties - particle count
|
||||
static void writeProperties(const Cloud<ParcelType>& cloud);
|
||||
|
||||
//- Read properties - particle count
|
||||
static void readProperties(const Cloud<ParcelType>& cloud);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from cloud
|
||||
ParticleTrackingData(const Cloud<ParcelType>& cloud);
|
||||
|
||||
//- Construct copy
|
||||
ParticleTrackingData(const ParticleTrackingData& ptd);
|
||||
|
||||
//- Construct from Istream and mesh
|
||||
ParticleTrackingData
|
||||
(
|
||||
const Cloud<ParcelType>& cloud,
|
||||
Istream& is,
|
||||
bool readFields
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~ParticleTrackingData();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the cloud
|
||||
inline const Cloud<ParcelType>& cloud() const;
|
||||
|
||||
//- Return const access to the originating processor id
|
||||
inline label origProc() const;
|
||||
|
||||
//- Return const access to the local particle id
|
||||
inline label id() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Read fields
|
||||
static void readFields(Cloud<ParcelType>& c);
|
||||
|
||||
//- Write fields
|
||||
static void writeFields(const Cloud<ParcelType>& c);
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<< <ParcelType>
|
||||
(
|
||||
Ostream&,
|
||||
const ParticleTrackingData<ParcelType>&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "ParticleTrackingDataI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ParticleTrackingData.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,49 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class ParcelType>
|
||||
inline const Foam::Cloud<ParcelType>&
|
||||
Foam::ParticleTrackingData<ParcelType>::cloud() const
|
||||
{
|
||||
return cloud_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::label Foam::ParticleTrackingData<ParcelType>::origProc() const
|
||||
{
|
||||
return origProc_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::label Foam::ParticleTrackingData<ParcelType>::id() const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,233 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "ParticleTrackingData.H"
|
||||
|
||||
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ParticleTrackingData<ParcelType>::readProperties
|
||||
(
|
||||
const Cloud<ParcelType>& cloud
|
||||
)
|
||||
{
|
||||
IOobject propsDictHeader
|
||||
(
|
||||
"particleTrackingProperties",
|
||||
cloud.db().time().timeName(),
|
||||
"uniform/Lagrangian"/cloud.name(),
|
||||
cloud.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (propsDictHeader.headerOk())
|
||||
{
|
||||
const IOdictionary propsDict(propsDictHeader);
|
||||
|
||||
word procName("processor" + name(Pstream::myProcNo()));
|
||||
if (propsDict.found(procName))
|
||||
{
|
||||
propsDict.subDict(procName).lookup("particleCount") >>
|
||||
PARTICLE_COUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ParticleTrackingData<ParcelType>::writeProperties
|
||||
(
|
||||
const Cloud<ParcelType>& cloud
|
||||
)
|
||||
{
|
||||
if (cloud.db().time().outputTime())
|
||||
{
|
||||
IOdictionary propsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"particleTrackingProperties",
|
||||
cloud.db().time().timeName(),
|
||||
"uniform/Lagrangian"/cloud.name(),
|
||||
cloud.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
word procName("processor" + name(Pstream::myProcNo()));
|
||||
propsDict.add(procName, dictionary());
|
||||
propsDict.subDict(procName).add("particleCount", PARTICLE_COUNT);
|
||||
|
||||
propsDict.regIOobject::write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData
|
||||
(
|
||||
const Cloud<ParcelType>& cloud,
|
||||
Istream& is,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
cloud_(cloud),
|
||||
origProc_(-1),
|
||||
id_(-1)
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
if (is.format() == IOstream::ASCII)
|
||||
{
|
||||
is >> origProc_ >> id_;
|
||||
}
|
||||
else
|
||||
{
|
||||
is.read
|
||||
(
|
||||
reinterpret_cast<char*>(&origProc_),
|
||||
sizeof(origProc_) + sizeof(id_)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Check state of Istream
|
||||
is.check
|
||||
(
|
||||
"ParticleTrackingData<ParcelType>::ParticleTrackingData"
|
||||
"("
|
||||
"Istream&, "
|
||||
"bool"
|
||||
")"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ParticleTrackingData<ParcelType>::readFields
|
||||
(
|
||||
Cloud<ParcelType>& c
|
||||
)
|
||||
{
|
||||
if (!c.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
readProperties(c);
|
||||
|
||||
IOField<label> origProc(c.fieldIOobject("origProc", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, origProc);
|
||||
|
||||
IOField<label> id(c.fieldIOobject("id", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, id);
|
||||
|
||||
label i = 0;
|
||||
forAllIter(typename Cloud<ParcelType>, c, iter)
|
||||
{
|
||||
ParcelType& p = iter();
|
||||
p.origProc_ = origProc[i];
|
||||
p.id_ = id[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ParticleTrackingData<ParcelType>::writeFields
|
||||
(
|
||||
const Cloud<ParcelType>& c
|
||||
)
|
||||
{
|
||||
writeProperties(c);
|
||||
|
||||
const label np = c.size();
|
||||
|
||||
IOField<label> origProc
|
||||
(
|
||||
c.fieldIOobject("origProc", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
IOField<label> id(c.fieldIOobject("id", IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
{
|
||||
const ParcelType& p = iter();
|
||||
|
||||
origProc[i] = p.origProc();
|
||||
id[i] = p.id();
|
||||
i++;
|
||||
}
|
||||
|
||||
origProc.write();
|
||||
id.write();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const ParticleTrackingData<ParcelType>& p
|
||||
)
|
||||
{
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << p.origProc_ << token::SPACE << p.id_ << token::SPACE;
|
||||
}
|
||||
else
|
||||
{
|
||||
os.write
|
||||
(
|
||||
reinterpret_cast<const char*>(&p.origProc_),
|
||||
sizeof(p.origProc_) + sizeof(p.id_)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Ostream
|
||||
os.check
|
||||
(
|
||||
"Ostream& operator<<"
|
||||
"("
|
||||
"Ostream&, "
|
||||
"const ParticleTrackingData<ParcelType>&"
|
||||
")"
|
||||
);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -87,6 +87,12 @@ public:
|
||||
Particle<indexedParticle>(c, is)
|
||||
{}
|
||||
|
||||
//- Construct as a copy
|
||||
indexedParticle(const indexedParticle& p)
|
||||
:
|
||||
Particle<indexedParticle>(p)
|
||||
{}
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<indexedParticle> clone() const
|
||||
{
|
||||
|
||||
@ -81,6 +81,12 @@ public:
|
||||
Particle<passiveParticle>(c, is)
|
||||
{}
|
||||
|
||||
//- Construct as copy
|
||||
passiveParticle(const passiveParticle& p)
|
||||
:
|
||||
Particle<passiveParticle>(p)
|
||||
{}
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<passiveParticle> clone() const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,53 +24,46 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "coalCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(coalCloud, 0);
|
||||
};
|
||||
|
||||
#include "CoalCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::coalCloud::coalCloud
|
||||
template<class ThermoType>
|
||||
Foam::CoalCloud<ThermoType>::CoalCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
hCombustionThermo& thermo,
|
||||
PtrList<specieReactingProperties>& gases
|
||||
hCombustionThermo& thermo
|
||||
)
|
||||
:
|
||||
ReactingMultiphaseCloud<coalParcel>
|
||||
ReactingMultiphaseCloud<CoalParcel<ThermoType> >
|
||||
(
|
||||
cloudType,
|
||||
cloudName,
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
thermo,
|
||||
gases
|
||||
thermo
|
||||
)
|
||||
{
|
||||
coalParcel::readFields(*this);
|
||||
CoalParcel<ThermoType>::readFields(*this);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::coalCloud::~coalCloud()
|
||||
template<class ThermoType>
|
||||
Foam::CoalCloud<ThermoType>::~CoalCloud()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::coalCloud::writeFields() const
|
||||
template<class ThermoType>
|
||||
void Foam::CoalCloud<ThermoType>::writeFields() const
|
||||
{
|
||||
coalParcel::writeFields(*this);
|
||||
CoalParcel<ThermoType>::writeFields(*this);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,20 +23,20 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
coalCloud
|
||||
CoalCloud
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
coalCloud.C
|
||||
CoalCloud.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef coalCloud_H
|
||||
#define coalCloud_H
|
||||
#ifndef CoalCloud_H
|
||||
#define CoalCloud_H
|
||||
|
||||
#include "ReactingMultiphaseCloud.H"
|
||||
#include "coalParcel.H"
|
||||
#include "CoalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,44 +44,44 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class coalCloud Declaration
|
||||
Class CoalCloud Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class coalCloud
|
||||
template<class ThermoType>
|
||||
class CoalCloud
|
||||
:
|
||||
public ReactingMultiphaseCloud<coalParcel>
|
||||
public ReactingMultiphaseCloud<CoalParcel<ThermoType> >
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
coalCloud(const coalCloud&);
|
||||
CoalCloud(const CoalCloud&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const coalCloud&);
|
||||
void operator=(const CoalCloud&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//-Runtime type information
|
||||
TypeName("coalCloud");
|
||||
TypeName("CoalCloud");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given carrier gas fields
|
||||
coalCloud
|
||||
CoalCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
hCombustionThermo& thermo,
|
||||
PtrList<specieReactingProperties>& gases
|
||||
hCombustionThermo& thermo
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~coalCloud();
|
||||
~CoalCloud();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -97,6 +97,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "CoalCloud.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,24 +24,14 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "coalParcel.H"
|
||||
#include "ReactingCloud.H"
|
||||
|
||||
#include "SingleMixtureFraction.H"
|
||||
#include "createReactingCloudTypes.H"
|
||||
#include "CoalCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeCompositionModel(ReactingCloud<coalParcel>);
|
||||
|
||||
// Add instances of composition model to the table
|
||||
makeCompositionModelType
|
||||
(
|
||||
SingleMixtureFraction,
|
||||
ReactingCloud,
|
||||
coalParcel
|
||||
);
|
||||
createReactingCloudType(CoalCloud);
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,25 +24,28 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "coalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(coalParcel, 0);
|
||||
defineParticleTypeNameAndDebug(coalParcel, 0);
|
||||
defineParcelTypeNameAndDebug(coalParcel, 0);
|
||||
};
|
||||
|
||||
#include "CoalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::coalParcel::coalParcel
|
||||
template<class ThermoType>
|
||||
Foam::CoalParcel<ThermoType>::CoalParcel
|
||||
(
|
||||
ReactingMultiphaseCloud<coalParcel>& owner,
|
||||
ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner,
|
||||
const vector& position,
|
||||
const label celli,
|
||||
const label cellI
|
||||
)
|
||||
:
|
||||
ReactingMultiphaseParcel<CoalParcel<ThermoType> >(owner, position, cellI)
|
||||
{}
|
||||
|
||||
|
||||
template<class ThermoType>
|
||||
Foam::CoalParcel<ThermoType>::CoalParcel
|
||||
(
|
||||
ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
@ -51,14 +54,16 @@ Foam::coalParcel::coalParcel
|
||||
const scalarField& YGas0,
|
||||
const scalarField& YLiquid0,
|
||||
const scalarField& YSolid0,
|
||||
const constantProperties& constProps
|
||||
const typename
|
||||
ReactingMultiphaseParcel<CoalParcel<ThermoType> >::
|
||||
constantProperties& constProps
|
||||
)
|
||||
:
|
||||
ReactingMultiphaseParcel<coalParcel>
|
||||
ReactingMultiphaseParcel<CoalParcel<ThermoType> >
|
||||
(
|
||||
owner,
|
||||
position,
|
||||
celli,
|
||||
cellI,
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
@ -72,20 +77,22 @@ Foam::coalParcel::coalParcel
|
||||
{}
|
||||
|
||||
|
||||
Foam::coalParcel::coalParcel
|
||||
template<class ThermoType>
|
||||
Foam::CoalParcel<ThermoType>::CoalParcel
|
||||
(
|
||||
const Cloud<coalParcel>& cloud,
|
||||
const Cloud<CoalParcel<ThermoType> >& cloud,
|
||||
Istream& is,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
ReactingMultiphaseParcel<coalParcel>(cloud, is, readFields)
|
||||
ReactingMultiphaseParcel<CoalParcel<ThermoType> >(cloud, is, readFields)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::coalParcel::~coalParcel()
|
||||
template<class ThermoType>
|
||||
Foam::CoalParcel<ThermoType>::~CoalParcel()
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,19 +23,19 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
coalParcel
|
||||
CoalParcel
|
||||
|
||||
Description
|
||||
|
||||
|
||||
SourceFiles
|
||||
coalParcel.C
|
||||
coalParcelIO.C
|
||||
CoalParcel.C
|
||||
CoalParcelIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef coalParcel_H
|
||||
#define coalParcel_H
|
||||
#ifndef CoalParcel_H
|
||||
#define CoalParcel_H
|
||||
|
||||
#include "ReactingMultiphaseParcel.H"
|
||||
|
||||
@ -44,27 +44,44 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
template<class ThermoType>
|
||||
class CoalParcel;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class coalParcel Declaration
|
||||
Class CoalParcel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class coalParcel
|
||||
template<class ThermoType>
|
||||
class CoalParcel
|
||||
:
|
||||
public ReactingMultiphaseParcel<coalParcel>
|
||||
public ReactingMultiphaseParcel<CoalParcel<ThermoType> >
|
||||
{
|
||||
public:
|
||||
|
||||
//- The type of thermodynamics this parcel was instantiated for
|
||||
typedef ThermoType thermoType;
|
||||
|
||||
// Run-time type information
|
||||
TypeName("coalParcel");
|
||||
TypeName("CoalParcel");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
coalParcel
|
||||
//- Construct from owner, position, and cloud owner
|
||||
// Other properties initialised as null
|
||||
CoalParcel
|
||||
(
|
||||
ReactingMultiphaseCloud<coalParcel>& owner,
|
||||
ReactingMultiphaseCloud<CoalParcel>& owner,
|
||||
const vector& position,
|
||||
const label celli,
|
||||
const label cellI
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
CoalParcel
|
||||
(
|
||||
ReactingMultiphaseCloud<CoalParcel>& owner,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
@ -73,42 +90,43 @@ public:
|
||||
const scalarField& YGas0,
|
||||
const scalarField& YLiquid0,
|
||||
const scalarField& YSolid0,
|
||||
const constantProperties& constProps
|
||||
const typename
|
||||
ReactingMultiphaseParcel<CoalParcel>::
|
||||
constantProperties& constProps
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
coalParcel
|
||||
CoalParcel
|
||||
(
|
||||
const Cloud<coalParcel>& c,
|
||||
const Cloud<CoalParcel>& c,
|
||||
Istream& is,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<coalParcel> clone() const
|
||||
autoPtr<CoalParcel> clone() const
|
||||
{
|
||||
return autoPtr<coalParcel>(new coalParcel(*this));
|
||||
return autoPtr<CoalParcel>(new CoalParcel(*this));
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~coalParcel();
|
||||
virtual ~CoalParcel();
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
inline bool contiguous<coalParcel>()
|
||||
{
|
||||
return false; // Now have scalar lists/fields (mass fractions)
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "CoalParcel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,21 +24,14 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "coalParcel.H"
|
||||
#include "KinematicCloud.H"
|
||||
|
||||
#include "NoDrag.H"
|
||||
#include "SphereDrag.H"
|
||||
#include "createCoalParcelTypes.H"
|
||||
#include "CoalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeDragModel(KinematicCloud<coalParcel>);
|
||||
|
||||
// Add instances of drag model to the table
|
||||
makeDragModelType(NoDrag, KinematicCloud, coalParcel);
|
||||
makeDragModelType(SphereDrag, KinematicCloud, coalParcel);
|
||||
createCoalParcelType(CoalParcel);
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,44 +24,47 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicKinematicParcel.H"
|
||||
#include "KinematicCloud.H"
|
||||
#include "CoalParcel.H"
|
||||
|
||||
#include "NoDispersion.H"
|
||||
#include "GradientDispersionRAS.H"
|
||||
#include "StochasticDispersionRAS.H"
|
||||
// Kinematic
|
||||
#include "makeReactingParcelDispersionModels.H"
|
||||
#include "makeReactingParcelDragModels.H"
|
||||
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
|
||||
#include "makeReactingParcelPatchInteractionModels.H"
|
||||
#include "makeReactingParcelPostProcessingModels.H"
|
||||
|
||||
// Thermodynamic
|
||||
#include "makeReactingParcelHeatTransferModels.H"
|
||||
|
||||
// Reacting
|
||||
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP variant
|
||||
#include "makeReactingParcelPhaseChangeModels.H"
|
||||
|
||||
// Reacting multiphase
|
||||
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
|
||||
#include "makeCoalParcelSurfaceReactionModels.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeDispersionModel(KinematicCloud<basicKinematicParcel>);
|
||||
// Kinematic sub-models
|
||||
makeReactingDispersionModels(CoalParcel);
|
||||
makeReactingDragModels(CoalParcel);
|
||||
makeReactingMultiphaseInjectionModels(CoalParcel);
|
||||
makeReactingPatchInteractionModels(CoalParcel);
|
||||
makeReactingPostProcessingModels(CoalParcel);
|
||||
|
||||
defineNamedTemplateTypeNameAndDebug
|
||||
(
|
||||
DispersionRASModel<KinematicCloud<basicKinematicParcel> >,
|
||||
0
|
||||
);
|
||||
// Thermo sub-models
|
||||
makeReactingHeatTransferModels(CoalParcel);
|
||||
|
||||
// Add instances of dispersion model to the table
|
||||
makeDispersionModelType
|
||||
(
|
||||
NoDispersion,
|
||||
KinematicCloud,
|
||||
basicKinematicParcel
|
||||
);
|
||||
makeDispersionModelType
|
||||
(
|
||||
GradientDispersionRAS,
|
||||
KinematicCloud,
|
||||
basicKinematicParcel
|
||||
);
|
||||
makeDispersionModelType
|
||||
(
|
||||
StochasticDispersionRAS,
|
||||
KinematicCloud,
|
||||
basicKinematicParcel
|
||||
);
|
||||
// Reacting sub-models
|
||||
makeReactingMultiphaseCompositionModels(CoalParcel);
|
||||
makeReactingPhaseChangeModels(CoalParcel);
|
||||
|
||||
// Reacting multiphase sub-models
|
||||
makeReactingMultiphaseDevolatilisationModels(CoalParcel);
|
||||
makeCoalSurfaceReactionModels(CoalParcel);
|
||||
};
|
||||
|
||||
|
||||
@ -1,22 +1,8 @@
|
||||
/* coal cloud */
|
||||
coalCloud/coalCloud.C
|
||||
|
||||
/* coal parcel and sub-models */
|
||||
coalParcel/coalParcel.C
|
||||
coalParcel/defineCoalParcel.C
|
||||
coalParcel/submodels/makeCoalParcelCompositionModels.C
|
||||
coalParcel/submodels/makeCoalParcelDevolatilisationModels.C
|
||||
coalParcel/submodels/makeCoalParcelDragModels.C
|
||||
coalParcel/submodels/makeCoalParcelDispersionModels.C
|
||||
coalParcel/submodels/makeCoalParcelInjectionModels.C
|
||||
coalParcel/submodels/makeCoalParcelHeatTransferModels.C
|
||||
coalParcel/submodels/makeCoalParcelPhaseChangeModels.C
|
||||
coalParcel/submodels/makeCoalParcelSurfaceReactionModels.C
|
||||
coalParcel/submodels/makeCoalParcelWallInteractionModels.C
|
||||
|
||||
submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C
|
||||
submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C
|
||||
submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C
|
||||
/* Coal cloud */
|
||||
CoalCloud/defineCoalCloud.C
|
||||
|
||||
/* Coal parcel and sub-models */
|
||||
CoalParcel/defineCoalParcel.C
|
||||
CoalParcel/makeCoalParcelSubmodels.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcoalCombustion
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "coalParcel.H"
|
||||
#include "ReactingMultiphaseCloud.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(Cloud<coalParcel>, 0);
|
||||
|
||||
defineParcelTypeNameAndDebug(KinematicParcel<coalParcel>, 0);
|
||||
// defineTemplateTypeNameAndDebug(KinematicParcel<coalParcel>, 0);
|
||||
defineParcelTypeNameAndDebug(ThermoParcel<coalParcel>, 0);
|
||||
defineTemplateTypeNameAndDebug(ThermoParcel<coalParcel>, 0);
|
||||
defineParcelTypeNameAndDebug(ReactingParcel<coalParcel>, 0);
|
||||
defineTemplateTypeNameAndDebug(ReactingParcel<coalParcel>, 0);
|
||||
defineParcelTypeNameAndDebug(ReactingMultiphaseParcel<coalParcel>, 0);
|
||||
defineTemplateTypeNameAndDebug(ReactingMultiphaseParcel<coalParcel>, 0);
|
||||
|
||||
defineParcelTypeNameAndDebug(KinematicCloud<coalParcel>, 0);
|
||||
defineParcelTypeNameAndDebug(ThermoCloud<coalParcel>, 0);
|
||||
defineParcelTypeNameAndDebug(ReactingCloud<coalParcel>, 0);
|
||||
defineParcelTypeNameAndDebug(ReactingMultiphaseCloud<coalParcel>, 0);
|
||||
};
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,65 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "coalParcel.H"
|
||||
#include "ReactingMultiphaseCloud.H"
|
||||
|
||||
#include "NoDevolatilisation.H"
|
||||
#include "ConstantRateDevolatilisation.H"
|
||||
#include "SingleKineticRateDevolatilisation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeDevolatilisationModel
|
||||
(
|
||||
ReactingMultiphaseCloud<coalParcel>
|
||||
);
|
||||
|
||||
// Add instances of devolatilisation model to the table
|
||||
makeDevolatilisationModelType
|
||||
(
|
||||
NoDevolatilisation,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
makeDevolatilisationModelType
|
||||
(
|
||||
ConstantRateDevolatilisation,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
makeDevolatilisationModelType
|
||||
(
|
||||
SingleKineticRateDevolatilisation,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,58 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "coalParcel.H"
|
||||
#include "ReactingCloud.H"
|
||||
|
||||
#include "NoPhaseChange.H"
|
||||
#include "LiquidEvaporation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePhaseChangeModel
|
||||
(
|
||||
ReactingCloud<coalParcel>
|
||||
);
|
||||
|
||||
// Add instances of phase change model to the table
|
||||
makePhaseChangeModelType
|
||||
(
|
||||
NoPhaseChange,
|
||||
ReactingCloud,
|
||||
coalParcel
|
||||
);
|
||||
makePhaseChangeModelType
|
||||
(
|
||||
LiquidEvaporation,
|
||||
ReactingCloud,
|
||||
coalParcel
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,69 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "coalParcel.H"
|
||||
#include "ReactingMultiphaseCloud.H"
|
||||
|
||||
#include "NoSurfaceReaction.H"
|
||||
#include "COxidationDiffusionLimitedRate.H"
|
||||
#include "COxidationKineticDiffusionLimitedRate.H"
|
||||
#include "COxidationMurphyShaddix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeSurfaceReactionModel(ReactingMultiphaseCloud<coalParcel>);
|
||||
|
||||
// Add instances of surface reaction model to the table
|
||||
makeSurfaceReactionModelType
|
||||
(
|
||||
NoSurfaceReaction,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
makeSurfaceReactionModelTypeInstance
|
||||
(
|
||||
COxidationDiffusionLimitedRate,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
makeSurfaceReactionModelTypeInstance
|
||||
(
|
||||
COxidationKineticDiffusionLimitedRate,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
makeSurfaceReactionModelTypeInstance
|
||||
(
|
||||
COxidationMurphyShaddix,
|
||||
ReactingMultiphaseCloud,
|
||||
coalParcel
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,55 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "coalParcel.H"
|
||||
#include "ReactingCloud.H"
|
||||
|
||||
#include "Rebound.H"
|
||||
#include "StandardWallInteraction.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeWallInteractionModel(KinematicCloud<coalParcel>);
|
||||
|
||||
// Add instances of wall interaction model to the table
|
||||
makeWallInteractionModelType
|
||||
(
|
||||
Rebound,
|
||||
KinematicCloud,
|
||||
coalParcel
|
||||
);
|
||||
makeWallInteractionModelType
|
||||
(
|
||||
StandardWallInteraction,
|
||||
KinematicCloud,
|
||||
coalParcel
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,98 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef createCoalParcelTypes_H
|
||||
#define createCoalParcelTypes_H
|
||||
|
||||
#include "makeParcelIOList.H"
|
||||
#include "reactingThermoTypes.H"
|
||||
#include "CoalCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define createCoalParcelType(ParcelType) \
|
||||
\
|
||||
createCoalParcelThermoType \
|
||||
( \
|
||||
ParcelType, \
|
||||
specieConstProperties \
|
||||
); \
|
||||
createCoalParcelThermoType \
|
||||
( \
|
||||
ParcelType, \
|
||||
specieReactingProperties \
|
||||
);
|
||||
|
||||
|
||||
#define createCoalParcelThermoType(ParcelType, ThermoType) \
|
||||
\
|
||||
typedef ParcelType<ThermoType> ParcelType##ThermoType; \
|
||||
\
|
||||
makeParcelIOList(ParcelType##ThermoType); \
|
||||
\
|
||||
defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \
|
||||
defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \
|
||||
defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \
|
||||
\
|
||||
defineParcelTypeNameAndDebug(KinematicParcel<ParcelType##ThermoType>, 0); \
|
||||
defineTemplateTypeNameAndDebug \
|
||||
( \
|
||||
KinematicParcel<ParcelType##ThermoType>, \
|
||||
0 \
|
||||
); \
|
||||
defineParcelTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \
|
||||
defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \
|
||||
defineParcelTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0); \
|
||||
defineTemplateTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0);\
|
||||
defineParcelTypeNameAndDebug \
|
||||
( \
|
||||
ReactingMultiphaseParcel<ParcelType##ThermoType>, \
|
||||
0 \
|
||||
); \
|
||||
defineTemplateTypeNameAndDebug \
|
||||
( \
|
||||
ReactingMultiphaseParcel<ParcelType##ThermoType>, \
|
||||
0 \
|
||||
); \
|
||||
defineParcelTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \
|
||||
defineTemplateTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \
|
||||
\
|
||||
defineParcelTypeNameAndDebug(KinematicCloud<ParcelType##ThermoType>, 0); \
|
||||
defineParcelTypeNameAndDebug(ThermoCloud<ParcelType##ThermoType>, 0); \
|
||||
defineParcelTypeNameAndDebug(ReactingCloud<ParcelType##ThermoType>, 0); \
|
||||
defineParcelTypeNameAndDebug \
|
||||
( \
|
||||
ReactingMultiphaseCloud<ParcelType##ThermoType>, \
|
||||
0 \
|
||||
); \
|
||||
defineParcelTypeNameAndDebug(CoalCloud<ParcelType##ThermoType>, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,97 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef makeCoalParcelSurfaceReactionModels_H
|
||||
#define makeCoalParcelSurfaceReactionModels_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "reactingThermoTypes.H"
|
||||
#include "ReactingMultiphaseCloud.H"
|
||||
|
||||
#include "NoSurfaceReaction.H"
|
||||
#include "COxidationDiffusionLimitedRate.H"
|
||||
#include "COxidationKineticDiffusionLimitedRate.H"
|
||||
#include "COxidationMurphyShaddix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeCoalSurfaceReactionModels(ParcelType) \
|
||||
\
|
||||
makeCoalSurfaceReactionModelThermoType \
|
||||
( \
|
||||
ParcelType, \
|
||||
specieConstProperties \
|
||||
); \
|
||||
makeCoalSurfaceReactionModelThermoType \
|
||||
( \
|
||||
ParcelType, \
|
||||
specieReactingProperties \
|
||||
);
|
||||
|
||||
|
||||
#define makeCoalSurfaceReactionModelThermoType(ParcelType, ThermoType) \
|
||||
\
|
||||
makeSurfaceReactionModel \
|
||||
( \
|
||||
ReactingMultiphaseCloud<ParcelType<ThermoType> > \
|
||||
); \
|
||||
\
|
||||
makeSurfaceReactionModelThermoType \
|
||||
( \
|
||||
NoSurfaceReaction, \
|
||||
ReactingMultiphaseCloud, \
|
||||
ParcelType, \
|
||||
ThermoType \
|
||||
); \
|
||||
makeSurfaceReactionModelThermoType \
|
||||
( \
|
||||
COxidationDiffusionLimitedRate, \
|
||||
ReactingMultiphaseCloud, \
|
||||
ParcelType, \
|
||||
ThermoType \
|
||||
); \
|
||||
makeSurfaceReactionModelThermoType \
|
||||
( \
|
||||
COxidationKineticDiffusionLimitedRate, \
|
||||
ReactingMultiphaseCloud, \
|
||||
ParcelType, \
|
||||
ThermoType \
|
||||
); \
|
||||
makeSurfaceReactionModelThermoType \
|
||||
( \
|
||||
COxidationMurphyShaddix, \
|
||||
ReactingMultiphaseCloud, \
|
||||
ParcelType, \
|
||||
ThermoType \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,18 +28,14 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate
|
||||
template<class CloudType>
|
||||
Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
|
||||
(
|
||||
const dictionary& dict,
|
||||
ReactingMultiphaseCloud<coalParcel>& owner
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
|
||||
(
|
||||
dict,
|
||||
owner,
|
||||
typeName
|
||||
),
|
||||
SurfaceReactionModel<CloudType>(dict, owner, typeName),
|
||||
Sb_(dimensionedScalar(this->coeffDict().lookup("Sb")).value()),
|
||||
D_(dimensionedScalar(this->coeffDict().lookup("D")).value()),
|
||||
CsLocalId_(-1),
|
||||
@ -63,10 +59,10 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"COxidationDiffusionLimitedRate"
|
||||
"COxidationDiffusionLimitedRate<CloudType>"
|
||||
"("
|
||||
"const dictionary&, "
|
||||
"ReactingMultiphaseCloud<coalParcel>&"
|
||||
"CloudType&"
|
||||
")"
|
||||
) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
|
||||
<< exit(FatalError);
|
||||
@ -76,19 +72,23 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::COxidationDiffusionLimitedRate::~COxidationDiffusionLimitedRate()
|
||||
template<class CloudType>
|
||||
Foam::COxidationDiffusionLimitedRate<CloudType>::
|
||||
~COxidationDiffusionLimitedRate()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::COxidationDiffusionLimitedRate::active() const
|
||||
template<class CloudType>
|
||||
bool Foam::COxidationDiffusionLimitedRate<CloudType>::active() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
@ -110,7 +110,8 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate
|
||||
) const
|
||||
{
|
||||
// Fraction of remaining combustible material
|
||||
const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_];
|
||||
const label idSolid = CloudType::parcelType::SLD;
|
||||
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
|
||||
|
||||
// Surface combustion active combustible fraction is consumed
|
||||
if (fComb < SMALL)
|
||||
@ -120,7 +121,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate
|
||||
|
||||
// Local mass fraction of O2 in the carrier phase
|
||||
const scalar YO2 =
|
||||
owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
|
||||
this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
|
||||
|
||||
// Change in C mass [kg]
|
||||
scalar dmC =
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,19 +38,23 @@ Description
|
||||
#define COxidationDiffusionLimitedRate_H
|
||||
|
||||
#include "SurfaceReactionModel.H"
|
||||
#include "coalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Forward class declarations
|
||||
template<class CloudType>
|
||||
class COxidationDiffusionLimitedRate;
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class COxidationDiffusionLimitedRate Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class COxidationDiffusionLimitedRate
|
||||
:
|
||||
public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
|
||||
public SurfaceReactionModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -99,7 +103,7 @@ public:
|
||||
COxidationDiffusionLimitedRate
|
||||
(
|
||||
const dictionary& dict,
|
||||
ReactingMultiphaseCloud<coalParcel>& owner
|
||||
CloudType& owner
|
||||
);
|
||||
|
||||
|
||||
@ -142,6 +146,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "COxidationDiffusionLimitedRate.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,14 +28,15 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::COxidationKineticDiffusionLimitedRate::
|
||||
template<class CloudType>
|
||||
Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
|
||||
COxidationKineticDiffusionLimitedRate
|
||||
(
|
||||
const dictionary& dict,
|
||||
ReactingMultiphaseCloud<coalParcel>& owner
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
|
||||
SurfaceReactionModel<CloudType>
|
||||
(
|
||||
dict,
|
||||
owner,
|
||||
@ -69,7 +70,7 @@ COxidationKineticDiffusionLimitedRate
|
||||
"COxidationKineticDiffusionLimitedRate"
|
||||
"("
|
||||
"const dictionary&, "
|
||||
"ReactingMultiphaseCloud<coalParcel>&"
|
||||
"CloudType&"
|
||||
")"
|
||||
) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
|
||||
<< exit(FatalError);
|
||||
@ -79,20 +80,23 @@ COxidationKineticDiffusionLimitedRate
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::COxidationKineticDiffusionLimitedRate::
|
||||
template<class CloudType>
|
||||
Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
|
||||
~COxidationKineticDiffusionLimitedRate()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::COxidationKineticDiffusionLimitedRate::active() const
|
||||
template<class CloudType>
|
||||
bool Foam::COxidationKineticDiffusionLimitedRate<CloudType>::active() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
@ -114,7 +118,8 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate
|
||||
) const
|
||||
{
|
||||
// Fraction of remaining combustible material
|
||||
const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_];
|
||||
const label idSolid = CloudType::parcelType::SLD;
|
||||
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
|
||||
|
||||
// Surface combustion active combustible fraction is consumed
|
||||
if (fComb < SMALL)
|
||||
@ -124,7 +129,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate
|
||||
|
||||
// Local mass fraction of O2 in the carrier phase
|
||||
const scalar YO2 =
|
||||
owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
|
||||
this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
|
||||
|
||||
// Diffusion rate coefficient
|
||||
const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,19 +39,24 @@ Description
|
||||
#define COxidationKineticDiffusionLimitedRate_H
|
||||
|
||||
#include "SurfaceReactionModel.H"
|
||||
#include "coalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward class declarations
|
||||
template<class CloudType>
|
||||
class COxidationKineticDiffusionLimitedRate;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class COxidationKineticDiffusionLimitedRate Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class COxidationKineticDiffusionLimitedRate
|
||||
:
|
||||
public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
|
||||
public SurfaceReactionModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -106,7 +111,7 @@ public:
|
||||
COxidationKineticDiffusionLimitedRate
|
||||
(
|
||||
const dictionary& dict,
|
||||
ReactingMultiphaseCloud<coalParcel>& owner
|
||||
CloudType& owner
|
||||
);
|
||||
|
||||
|
||||
@ -149,6 +154,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "COxidationKineticDiffusionLimitedRate.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,20 +28,23 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::COxidationMurphyShaddix::maxIters_ = 1000;
|
||||
template<class CloudType>
|
||||
Foam::label Foam::COxidationMurphyShaddix<CloudType>::maxIters_ = 1000;
|
||||
|
||||
Foam::scalar Foam::COxidationMurphyShaddix::tolerance_ = 1e-06;
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::tolerance_ = 1e-06;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::COxidationMurphyShaddix::COxidationMurphyShaddix
|
||||
template<class CloudType>
|
||||
Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
|
||||
(
|
||||
const dictionary& dict,
|
||||
ReactingMultiphaseCloud<coalParcel>& owner
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
|
||||
SurfaceReactionModel<CloudType>
|
||||
(
|
||||
dict,
|
||||
owner,
|
||||
@ -59,36 +62,37 @@ Foam::COxidationMurphyShaddix::COxidationMurphyShaddix
|
||||
O2GlobalId_(owner.composition().globalCarrierId("O2")),
|
||||
CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
|
||||
WC_(0.0),
|
||||
WO2_(0.0),
|
||||
HcCO2_(0.0)
|
||||
WO2_(0.0)
|
||||
{
|
||||
// Determine Cs ids
|
||||
label idSolid = owner.composition().idSolid();
|
||||
CsLocalId_ = owner.composition().localId(idSolid, "Cs");
|
||||
CsLocalId_ = owner.composition().localId(idSolid, "C");
|
||||
|
||||
// Set local copies of thermo properties
|
||||
WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W();
|
||||
scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W();
|
||||
WC_ = WCO2 - WO2_;
|
||||
HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::COxidationMurphyShaddix::~COxidationMurphyShaddix()
|
||||
template<class CloudType>
|
||||
Foam::COxidationMurphyShaddix<CloudType>::~COxidationMurphyShaddix()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::COxidationMurphyShaddix::active() const
|
||||
template<class CloudType>
|
||||
bool Foam::COxidationMurphyShaddix<CloudType>::active() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::COxidationMurphyShaddix::calculate
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
@ -110,7 +114,8 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
|
||||
) const
|
||||
{
|
||||
// Fraction of remaining combustible material
|
||||
const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_];
|
||||
const label idSolid = CloudType::parcelType::SLD;
|
||||
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
|
||||
|
||||
// Surface combustion until combustible fraction is consumed
|
||||
if (fComb < SMALL)
|
||||
@ -120,7 +125,7 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
|
||||
|
||||
// Cell carrier phase O2 species density [kg/m^3]
|
||||
const scalar rhoO2 =
|
||||
rhoc*owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
|
||||
rhoc*this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
|
||||
|
||||
if (rhoO2 < SMALL)
|
||||
{
|
||||
@ -186,8 +191,10 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
|
||||
|
||||
if (iter > maxIters_)
|
||||
{
|
||||
WarningIn("scalar Foam::COxidationMurphyShaddix::calculate(...)")
|
||||
<< "iter limit reached (" << maxIters_ << ")" << nl << endl;
|
||||
WarningIn
|
||||
(
|
||||
"scalar Foam::COxidationMurphyShaddix<CloudType>::calculate(...)"
|
||||
) << "iter limit reached (" << maxIters_ << ")" << nl << endl;
|
||||
}
|
||||
|
||||
// Calculate the number of molar units reacted
|
||||
@ -200,8 +207,16 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
|
||||
// Add to particle mass transfer
|
||||
dMassSolid[CsLocalId_] += dOmega*WC_;
|
||||
|
||||
const scalar HC =
|
||||
this->owner().composition().solids().properties()[CsLocalId_].Hf()
|
||||
+ this->owner().composition().solids().properties()[CsLocalId_].cp()*T;
|
||||
const scalar HCO2 =
|
||||
this->owner().composition().carrierSpecies()[CO2GlobalId_].H(T);
|
||||
const scalar HO2 =
|
||||
this->owner().composition().carrierSpecies()[O2GlobalId_].H(T);
|
||||
|
||||
// Heat of reaction
|
||||
return -HcCO2_*dOmega*WC_;
|
||||
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,19 +34,24 @@ Description
|
||||
#define COxidationMurphyShaddix_H
|
||||
|
||||
#include "SurfaceReactionModel.H"
|
||||
#include "coalParcel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward class declarations
|
||||
template<class CloudType>
|
||||
class COxidationMurphyShaddix;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class COxidationMurphyShaddix Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class COxidationMurphyShaddix
|
||||
:
|
||||
public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
|
||||
public SurfaceReactionModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -106,9 +111,6 @@ class COxidationMurphyShaddix
|
||||
//- Molecular weight of O2 [kg/kmol]
|
||||
scalar WO2_;
|
||||
|
||||
//- Chemical enthalpy of CO2 [J/kg]
|
||||
scalar HcCO2_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -122,7 +124,7 @@ public:
|
||||
COxidationMurphyShaddix
|
||||
(
|
||||
const dictionary& dict,
|
||||
ReactingMultiphaseCloud<coalParcel>& owner
|
||||
CloudType& owner
|
||||
);
|
||||
|
||||
|
||||
@ -165,6 +167,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "COxidationMurphyShaddix.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -696,6 +696,4 @@ void Foam::parcel::transformProperties(const vector&)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -527,20 +527,20 @@ void Foam::DsmcCloud<ParcelType>::addNewParcel
|
||||
template<class ParcelType>
|
||||
Foam::DsmcCloud<ParcelType>::DsmcCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const volScalarField& T,
|
||||
const volVectorField& U
|
||||
)
|
||||
:
|
||||
Cloud<ParcelType>(T.mesh(), cloudType, false),
|
||||
Cloud<ParcelType>(T.mesh(), cloudName, false),
|
||||
DsmcBaseCloud(),
|
||||
cloudType_(cloudType),
|
||||
cloudName_(cloudName),
|
||||
mesh_(T.mesh()),
|
||||
particleProperties_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
cloudType + "Properties",
|
||||
cloudName + "Properties",
|
||||
mesh_.time().constant(),
|
||||
mesh_,
|
||||
IOobject::MUST_READ,
|
||||
@ -639,19 +639,19 @@ Foam::DsmcCloud<ParcelType>::DsmcCloud
|
||||
template<class ParcelType>
|
||||
Foam::DsmcCloud<ParcelType>::DsmcCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
Cloud<ParcelType>(mesh, cloudType, false),
|
||||
Cloud<ParcelType>(mesh, cloudName, false),
|
||||
DsmcBaseCloud(),
|
||||
cloudType_(cloudType),
|
||||
cloudName_(cloudName),
|
||||
mesh_(mesh),
|
||||
particleProperties_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
cloudType + "Properties",
|
||||
cloudName + "Properties",
|
||||
mesh_.time().constant(),
|
||||
mesh_,
|
||||
IOobject::MUST_READ,
|
||||
|
||||
@ -76,7 +76,7 @@ class DsmcCloud
|
||||
|
||||
//- Cloud type - used to set the name of the parcel properties
|
||||
// dictionary by appending "Properties"
|
||||
const word cloudType_;
|
||||
const word cloudName_;
|
||||
|
||||
//- References to the mesh and time databases
|
||||
const fvMesh& mesh_;
|
||||
@ -181,7 +181,7 @@ public:
|
||||
//- Construct given name and mesh, will read Parcels from file
|
||||
DsmcCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const volScalarField& T,
|
||||
const volVectorField& U
|
||||
);
|
||||
@ -189,7 +189,7 @@ public:
|
||||
//- Construct given name and mesh. Used to initialise.
|
||||
DsmcCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
@ -205,7 +205,7 @@ public:
|
||||
// References to the mesh and databases
|
||||
|
||||
//- Return the cloud type
|
||||
inline const word& cloudType() const;
|
||||
inline const word& cloudName() const;
|
||||
|
||||
//- Return refernce to the mesh
|
||||
inline const fvMesh& mesh() const;
|
||||
|
||||
@ -27,9 +27,9 @@ License
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
inline const Foam::word& Foam::DsmcCloud<ParcelType>::cloudType() const
|
||||
inline const Foam::word& Foam::DsmcCloud<ParcelType>::cloudName() const
|
||||
{
|
||||
return cloudType_;
|
||||
return cloudName_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,12 +38,12 @@ namespace Foam
|
||||
|
||||
Foam::dsmcCloud::dsmcCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const volScalarField& T,
|
||||
const volVectorField& U
|
||||
)
|
||||
:
|
||||
DsmcCloud<dsmcParcel>(cloudType, T, U)
|
||||
DsmcCloud<dsmcParcel>(cloudName, T, U)
|
||||
{
|
||||
dsmcParcel::readFields(*this);
|
||||
}
|
||||
@ -51,11 +51,11 @@ Foam::dsmcCloud::dsmcCloud
|
||||
|
||||
Foam::dsmcCloud::dsmcCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const word& cloudName,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
DsmcCloud<dsmcParcel>(cloudType, mesh)
|
||||
DsmcCloud<dsmcParcel>(cloudName, mesh)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user