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

This commit is contained in:
mattijs
2012-11-02 16:28:17 +00:00
155 changed files with 1792 additions and 5180 deletions

View File

@ -60,14 +60,9 @@ int main(int argc, char *argv[])
#include "createFluidMeshes.H" #include "createFluidMeshes.H"
#include "createSolidMeshes.H" #include "createSolidMeshes.H"
#include "createPorousFluidRegions.H"
#include "createPorousSolidMeshes.H"
#include "createFluidFields.H" #include "createFluidFields.H"
#include "createSolidFields.H" #include "createSolidFields.H"
#include "createPorousFluidFields.H"
#include "createPorousSolidFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H" #include "readTimeControls.H"
@ -116,24 +111,6 @@ int main(int argc, char *argv[])
#include "solveFluid.H" #include "solveFluid.H"
} }
forAll(porousFluidRegions, i)
{
Info<< "\nSolving for fluid porous region "
<< porousFluidRegions[i].name() << endl;
#include "setPorousFluidFields.H"
#include "readPorousFluidRegionPIMPLEControls.H"
#include "solvePorousFluid.H"
}
forAll(porousSolidRegions, i)
{
Info<< "\nSolving for porous solid region "
<< porousSolidRegions[i].name() << endl;
#include "setPorousRegionSolidFields.H"
#include "readPorousSolidMultiRegionPIMPLEControls.H"
#include "solvePorousSolid.H"
}
forAll(solidRegions, i) forAll(solidRegions, i)
{ {
Info<< "\nSolving for solid region " Info<< "\nSolving for solid region "

View File

@ -1,8 +1,7 @@
EXE_INC = \ EXE_INC = \
-Ifluid \ -Ifluid \
-Isolid \ -Isolid \
-I./porousFluid \ -I../solid \
-I./porousSolid \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/cfdTools \

View File

@ -50,13 +50,9 @@ int main(int argc, char *argv[])
#include "createFluidMeshes.H" #include "createFluidMeshes.H"
#include "createSolidMeshes.H" #include "createSolidMeshes.H"
#include "createPorousFluidRegions.H"
#include "createPorousSolidMeshes.H"
#include "createFluidFields.H" #include "createFluidFields.H"
#include "createSolidFields.H" #include "createSolidFields.H"
#include "createPorousFluidFields.H"
#include "createPorousSolidFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
@ -74,24 +70,6 @@ int main(int argc, char *argv[])
#include "solveFluid.H" #include "solveFluid.H"
} }
forAll(porousFluidRegions, i)
{
Info<< "\nSolving for fluid porous region "
<< porousFluidRegions[i].name() << endl;
#include "setPorousFluidFields.H"
#include "readPorousFluidRegionSIMPLEControls.H"
#include "solvePorousFluid.H"
}
forAll(porousSolidRegions, i)
{
Info<< "\nSolving for porous solid region "
<< porousSolidRegions[i].name() << endl;
#include "setPorousRegionSolidFields.H"
#include "readPorousSolidMultiRegionSIMPLEControls.H"
#include "solvePorousSolid.H"
}
forAll(solidRegions, i) forAll(solidRegions, i)
{ {
Info<< "\nSolving for solid region " Info<< "\nSolving for solid region "

View File

@ -1,11 +0,0 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> porousUEqn
(
fvm::div(porousPhi, porousU)
+ turbPorous.divDevRhoReff(porousU)
+ porousSources(porousRho, porousU)
);
porousUEqn().relax();
solve(porousUEqn() == -fvc::grad(porousP));

View File

@ -1,181 +0,0 @@
// Initialise porous field pointer lists
PtrList<rhoThermo> thermoPorous(porousFluidRegions.size());
PtrList<volScalarField> rhoPorous(porousFluidRegions.size());
PtrList<volScalarField> kappaPorous(porousFluidRegions.size());
PtrList<volVectorField> UPorous(porousFluidRegions.size());
PtrList<surfaceScalarField> phiPorous(porousFluidRegions.size());
PtrList<compressible::turbulenceModel> turbulencePorous
(
porousFluidRegions.size()
);
PtrList<volScalarField> pPorous(porousFluidRegions.size());
List<scalar> initialMassFluidPorous(porousFluidRegions.size());
List<label> pRefCellFluidPorous(porousFluidRegions.size(),0);
List<scalar> pRefValueFluidPorous(porousFluidRegions.size(),0.0);
PtrList<dimensionedScalar> rhoMaxPorous(fluidRegions.size());
PtrList<dimensionedScalar> rhoMinPorous(fluidRegions.size());
PtrList<IObasicSourceList> heatPorousSources
(
porousFluidRegions.size()
);
forAll(porousFluidRegions, i)
{
Info<< "Reading fluid mesh thermophysical properties for porous "
<< porousFluidRegions[i].name() << nl << endl;
Info<< " Adding to thermoFluid porous\n" << endl;
thermoPorous.set
(
i,
rhoThermo::New(porousFluidRegions[i]).ptr()
);
Info<< " Adding to rhoPorous\n" << endl;
rhoPorous.set
(
i,
new volScalarField
(
IOobject
(
"rho",
runTime.timeName(),
porousFluidRegions[i],
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermoPorous[i].rho()
)
);
Info<< " Adding to UPorous\n" << endl;
UPorous.set
(
i,
new volVectorField
(
IOobject
(
"U",
runTime.timeName(),
porousFluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
porousFluidRegions[i]
)
);
Info<< " Adding to phiPorous\n" << endl;
phiPorous.set
(
i,
new surfaceScalarField
(
IOobject
(
"phi",
runTime.timeName(),
porousFluidRegions[i],
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(rhoPorous[i]*UPorous[i])
& porousFluidRegions[i].Sf()
)
);
Info<< " Adding turbulence to porous\n" << endl;
turbulencePorous.set
(
i,
compressible::turbulenceModel::New
(
rhoPorous[i],
UPorous[i],
phiPorous[i],
thermoPorous[i]
).ptr()
);
Info<< " Adding to kappaFluid\n" << endl;
kappaPorous.set
(
i,
new volScalarField
(
IOobject
(
"kappaPorous",
runTime.timeName(),
porousFluidRegions[i],
IOobject::NO_READ,
IOobject::NO_WRITE
),
thermoPorous[i].Cp()*thermoPorous[i].alpha()
)
);
pPorous.set
(
i,
new volScalarField
(
IOobject
(
"p",
runTime.timeName(),
porousFluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
porousFluidRegions[i]
)
);
setRefCell
(
thermoPorous[i].p(),
pPorous[i],
porousFluidRegions[i].solutionDict().subDict("SIMPLE"),
pRefCellFluidPorous[i],
pRefValueFluidPorous[i]
);
rhoMaxPorous.set
(
i,
new dimensionedScalar
(
porousFluidRegions[i].solutionDict().subDict("SIMPLE").lookup
(
"rhoMax"
)
)
);
rhoMinPorous.set
(
i,
new dimensionedScalar
(
porousFluidRegions[i].solutionDict().subDict("SIMPLE").lookup
(
"rhoMin"
)
)
);
heatPorousSources.set
(
i,
new IObasicSourceList(porousFluidRegions[i])
);
}

View File

@ -1,25 +0,0 @@
const wordList porousFluidNames(rp["porousFluid"]);
PtrList<fvMesh> porousFluidRegions(porousFluidNames.size());
forAll (porousFluidNames, iPorous)
{
const word porousFluidName = porousFluidNames[iPorous];
Info<< "Create porous fluid region " << porousFluidName
<< nl << endl;
porousFluidRegions.set
(
iPorous,
new fvMesh
(
IOobject
(
porousFluidName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
}

View File

@ -1,19 +0,0 @@
{
fvScalarMatrix hPorousEqn
(
fvm::div(porousPhi, porousH)
- fvm::laplacian(turbPorous.alphaEff(), porousH)
==
- fvc::div(porousPhi, 0.5*magSqr(porousU), "div(phi,K)")
+ porousSources(porousRho, porousH)
);
hPorousEqn.relax();
hPorousEqn.solve();
porousThermo.correct();
Info<< "Min/max in the porous T:"
<< min(porousThermo.T()).value() << ' '
<< max(porousThermo.T()).value() << endl;
}

View File

@ -1,53 +0,0 @@
porousRho = porousThermo.rho();
porousRho = max(porousRho, rhoMin);
porousRho = min(porousRho, rhoMax);
porousRho.relax();
volScalarField rAUPorous(1.0/porousUEqn().A());
porousU = rAUPorous*porousUEqn().H();
porousUEqn.clear();
bool closedVolume = false;
porousPhi =
fvc::interpolate(porousRho)
*(fvc::interpolate(porousU) & porousMesh.Sf());
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(porousRho*rAUPorous, porousP) == fvc::div(porousPhi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
porousPhi -= pEqn.flux();
}
}
porousP.relax();
porousU -= rAUPorous*fvc::grad(porousP);
porousU.correctBoundaryConditions();
if (closedVolume)
{
porousP += (initialMass - fvc::domainIntegrate(porousPsi*porousP))
/fvc::domainIntegrate(porousPsi);
}
porousRho = porousThermo.rho();
porousRho = max(porousRho, rhoMin);
porousRho = min(porousRho, rhoMax);
porousRho.relax();
Info<< "rho max/min : "
<< max(porousRho).value() << " "
<< min(porousRho).value() << endl;

View File

@ -1,4 +0,0 @@
const dictionary& simple = porousMesh.solutionDict().subDict("SIMPLE");
const int nNonOrthCorr =
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);

View File

@ -1,28 +0,0 @@
const fvMesh& porousMesh = porousFluidRegions[i];
rhoThermo& porousThermo = thermoPorous[i];
volScalarField& porousRho = rhoPorous[i];
volVectorField& porousU = UPorous[i];
surfaceScalarField& porousPhi = phiPorous[i];
compressible::turbulenceModel& turbPorous = turbulencePorous[i];
volScalarField& porousP = porousThermo.p();
const volScalarField& porousPsi = porousThermo.psi();
volScalarField& porousH = porousThermo.he();
const dimensionedScalar initialMass
(
"initialMass",
dimMass,
initialMassFluidPorous[i]
);
IObasicSourceList& porousSources = heatPorousSources[i];
const label pRefCell = pRefCellFluidPorous[i];
const scalar pRefValue = pRefValueFluidPorous[i];
const scalar rhoMax = rhoMaxPorous[i].value();
const scalar rhoMin = rhoMinPorous[i].value();

View File

@ -1,11 +0,0 @@
// Pressure-velocity SIMPLE corrector
porousP.storePrevIter();
porousRho.storePrevIter();
{
#include "UPorousFluidEqn.H"
#include "hPorousFluidEqn.H"
#include "pPorousFluidEqn.H"
}
turbPorous.correct();

View File

@ -1,43 +0,0 @@
// Initialise solid field pointer lists
PtrList<solidThermo> porousSolidThermos(porousSolidRegions.size());
PtrList<IObasicSourceList> solidHeatSources(porousSolidRegions.size());
PtrList<volScalarField> betavSolid(porousSolidRegions.size());
// Populate solid field pointer lists
forAll(porousSolidRegions, i)
{
Info<< "*** Reading porous solid mesh thermophysical "
<< "properties for region "
<< porousSolidRegions[i].name() << nl << endl;
Info<< " Adding to thermos\n" << endl;
porousSolidThermos.set
(
i,
solidThermo::New(porousSolidRegions[i])
);
Info<< " Adding sources\n" << endl;
solidHeatSources.set
(
i,
new IObasicSourceList(porousSolidRegions[i])
);
Info<< " Adding to betavSolid\n" << endl;
betavSolid.set
(
i,
new volScalarField
(
IOobject
(
"betavSolid",
runTime.timeName(),
porousSolidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
porousSolidRegions[i]
)
);
}

View File

@ -1,24 +0,0 @@
const wordList porousSolidNames(rp["porousSolid"]);
PtrList<fvMesh> porousSolidRegions(porousSolidNames.size());
forAll(porousSolidNames, i)
{
Info<< "Create solid mesh for region " << porousSolidNames[i]
<< " for time = " << runTime.timeName() << nl << endl;
porousSolidRegions.set
(
i,
new fvMesh
(
IOobject
(
porousSolidNames[i],
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
}

View File

@ -1,4 +0,0 @@
const dictionary& simple = mesh.solutionDict().subDict("SIMPLE");
const int nNonOrthCorr =
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);

View File

@ -1,23 +0,0 @@
const fvMesh& mesh = porousSolidRegions[i];
solidThermo& thermo = porousSolidThermos[i];
const volScalarField& betav = betavSolid[i];
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.kappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalKappa()*betav;
const volScalarField& kappa = tkappa();
//const volSymmTensorField& K = tK();
tmp<volScalarField> talpha = thermo.alpha();
const volScalarField& alpha = talpha();
volScalarField& h = thermo.he();
IObasicSourceList& sources = solidHeatSources[i];

View File

@ -1,18 +0,0 @@
scalar DiNum = -GREAT;
forAll(solidRegions, i)
{
# include "setRegionSolidFields.H"
DiNum = max
(
solidRegionDiffNo
(
solidRegions[i],
runTime,
rho*cp,
K
),
DiNum
);
}

View File

@ -1,17 +0,0 @@
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
tmp<fvScalarMatrix> hEqn
(
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
+ sources(rho, h)
);
hEqn().relax();
hEqn().solve();
}
}
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()) << ' ' << max(thermo.T()) << endl;

View File

@ -1,20 +0,0 @@
// Initialise solid field pointer lists
PtrList<solidThermo> thermos(solidRegions.size());
PtrList<radiation::radiationModel> radiations(solidRegions.size());
// Populate solid field pointer lists
forAll(solidRegions, i)
{
Info<< "*** Reading solid mesh thermophysical properties for region "
<< solidRegions[i].name() << nl << endl;
Info<< " Adding to thermos\n" << endl;
thermos.set
(
i,
solidThermo::New(solidRegions[i])
);
Info<< " Adding to radiations\n" << endl;
radiations.set(i, radiation::radiationModel::New(thermos[i].T()));
}

View File

@ -1,24 +0,0 @@
const wordList solidsNames(rp["solid"]);
PtrList<fvMesh> solidRegions(solidsNames.size());
forAll(solidsNames, i)
{
Info<< "Create solid mesh for region " << solidsNames[i]
<< " for time = " << runTime.timeName() << nl << endl;
solidRegions.set
(
i,
new fvMesh
(
IOobject
(
solidsNames[i],
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
}

View File

@ -1,18 +0,0 @@
fvMesh& mesh = solidRegions[i];
solidThermo& thermo = thermos[i];
const radiation::radiationModel& radiation = radiations[i];
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.kappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalkappa();
const volScalarField& kappa = tkappa();
tmp<volScalarField> talpha = thermo.alpha();
const volScalarField& alpha = talpha();
volScalarField& h = thermo.he();

View File

@ -3,7 +3,8 @@
{ {
fvScalarMatrix hEqn fvScalarMatrix hEqn
( (
-fvm::laplacian(alpha, h) - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
+ sources(rho, h)
); );
hEqn.relax(); hEqn.relax();
hEqn.solve(); hEqn.solve();

View File

@ -14,7 +14,7 @@
CoNum CoNum
); );
} }
/*
forAll (porousFluidRegions, porousI) forAll (porousFluidRegions, porousI)
{ {
CoNum = max CoNum = max
@ -29,3 +29,4 @@
CoNum CoNum
); );
} }
*/

View File

@ -1,24 +0,0 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> porousUEqn
(
fvm::ddt(porousRho, porousU)
+ fvm::div(porousPhi, porousU)
+ turbPorous.divDevRhoReff(porousU)
+ porousSources(porousRho, porousU)
);
porousUEqn().relax();
volScalarField rAUPorous(1.0/porousUEqn().A());
if (momentumPredictor)
{
solve(porousUEqn() == -fvc::grad(porousP));
}
else
{
porousU = rAUPorous*(porousUEqn().H() - fvc::grad(porousP));
porousU.correctBoundaryConditions();
}

View File

@ -1,147 +0,0 @@
// Initialise porous field pointer lists
PtrList<rhoThermo> thermoPorous(porousFluidRegions.size());
PtrList<volScalarField> rhoPorous(porousFluidRegions.size());
PtrList<volVectorField> UPorous(porousFluidRegions.size());
PtrList<surfaceScalarField> phiPorous(porousFluidRegions.size());
PtrList<volScalarField> KPorous(porousFluidRegions.size());
PtrList<volScalarField> dpdtPorous(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulencePorous
(
porousFluidRegions.size()
);
PtrList<volScalarField> pPorous(porousFluidRegions.size());
PtrList<IObasicSourceList> heatPorousSources
(
porousFluidRegions.size()
);
forAll(porousFluidRegions, i)
{
Info<< "Reading fluid mesh thermophysical properties for porous "
<< porousFluidRegions[i].name() << nl << endl;
Info<< " Adding to thermoFluid porous\n" << endl;
thermoPorous.set
(
i,
rhoThermo::New(porousFluidRegions[i]).ptr()
);
Info<< " Adding to rhoPorous\n" << endl;
rhoPorous.set
(
i,
new volScalarField
(
IOobject
(
"rho",
runTime.timeName(),
porousFluidRegions[i],
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermoPorous[i].rho()
)
);
Info<< " Adding to UPorous\n" << endl;
UPorous.set
(
i,
new volVectorField
(
IOobject
(
"U",
runTime.timeName(),
porousFluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
porousFluidRegions[i]
)
);
Info<< " Adding to phiPorous\n" << endl;
phiPorous.set
(
i,
new surfaceScalarField
(
IOobject
(
"phi",
runTime.timeName(),
porousFluidRegions[i],
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(rhoPorous[i]*UPorous[i])
& porousFluidRegions[i].Sf()
)
);
Info<< " Adding turbulence to porous\n" << endl;
turbulencePorous.set
(
i,
compressible::turbulenceModel::New
(
rhoPorous[i],
UPorous[i],
phiPorous[i],
thermoPorous[i]
).ptr()
);
Info<< " Adding to KPorous\n" << endl;
KPorous.set
(
i,
new volScalarField
(
"KPorous",
0.5*magSqr(UPorous[i])
)
);
Info<< " Adding to dpdtPorous\n" << endl;
dpdtPorous.set
(
i,
new volScalarField
(
"dpdtPorous",
fvc::ddt(thermoPorous[i].p())
)
);
pPorous.set
(
i,
new volScalarField
(
IOobject
(
"p",
runTime.timeName(),
porousFluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
porousFluidRegions[i]
)
);
heatPorousSources.set
(
i,
new IObasicSourceList(porousFluidRegions[i])
);
}

View File

@ -1,25 +0,0 @@
const wordList porousFluidNames(rp["porousFluid"]);
PtrList<fvMesh> porousFluidRegions(porousFluidNames.size());
forAll (porousFluidNames, iPorous)
{
const word porousFluidName = porousFluidNames[iPorous];
Info<< "Create porous fluid region " << porousFluidName
<< nl << endl;
porousFluidRegions.set
(
iPorous,
new fvMesh
(
IOobject
(
porousFluidName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
}

View File

@ -1,21 +0,0 @@
{
fvScalarMatrix hPorousEqn
(
fvm::ddt(porousRho, porousH)
+ fvm::div(porousPhi, porousH)
- fvm::laplacian(turbPorous.alphaEff(), porousH)
==
porousdpdt
- (fvc::ddt(porousRho, porousK) + fvc::div(porousPhi, porousK))
+ porousSources(porousRho, porousH)
);
hPorousEqn.relax();
hPorousEqn.solve();
porousThermo.correct();
Info<< "Min/max in the porous T:"
<< min(porousThermo.T()).value() << ' '
<< max(porousThermo.T()).value() << endl;
}

View File

@ -1,63 +0,0 @@
porousRho = porousThermo.rho();
porousU = rAUPorous*porousUEqn().H();
if (nCorr <= 1)
{
porousUEqn.clear();
}
porousPhi =
fvc::interpolate(porousRho)*
(
(fvc::interpolate(porousU) & porousMesh.Sf())
+ fvc::ddtPhiCorr(rAUPorous, porousRho, porousU, porousPhi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::ddt(porousPsi, porousP)
+ fvc::div(porousPhi)
- fvm::laplacian(porousRho*rAUPorous, porousP)
);
pEqn.solve
(
porousMesh.solver
(
porousP.select
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
if (nonOrth == nNonOrthCorr)
{
porousPhi += pEqn.flux();
}
}
solve(fvm::ddt(porousRho) + fvc::div(porousPhi));
// Explicitly relax pressure for momentum corrector
porousP.relax();
// Recalculate density from the relaxed pressure
porousRho = porousThermo.rho();
porousU -= rAUPorous*fvc::grad(porousP);
porousU.correctBoundaryConditions();
porousK = 0.5*magSqr(porousU);
// Update pressure time derivative if needed
if (porousThermo.dpdt())
{
porousdpdt = fvc::ddt(porousP);
}

View File

@ -1,11 +0,0 @@
const dictionary& pimple = porousMesh.solutionDict().subDict("PIMPLE");
const int nCorr =
pimple.lookupOrDefault<int>("nCorrectors", 1);
const int nNonOrthCorr =
pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
const bool momentumPredictor =
pimple.lookupOrDefault("momentumPredictor", true);

View File

@ -1,17 +0,0 @@
fvMesh& porousMesh = porousFluidRegions[i];
rhoThermo& porousThermo = thermoPorous[i];
volScalarField& porousRho = rhoPorous[i];
volVectorField& porousU = UPorous[i];
surfaceScalarField& porousPhi = phiPorous[i];
compressible::turbulenceModel& turbPorous = turbulencePorous[i];
volScalarField& porousK = KPorous[i];
volScalarField& porousdpdt = dpdtPorous[i];
volScalarField& porousP = porousThermo.p();
const volScalarField& porousPsi = porousThermo.psi();
volScalarField& porousH = porousThermo.he();
IObasicSourceList& porousSources = heatPorousSources[i];

View File

@ -1,28 +0,0 @@
if (finalIter)
{
porousMesh.data::add("finalIteration", true);
}
if (oCorr == 0)
{
solve(fvm::ddt(porousRho) + fvc::div(porousPhi));
}
#include "UPorousFluidEqn.H"
#include "hPorousFluidEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pPorousFluidEqn.H"
}
turbPorous.correct();
porousRho = porousThermo.rho();
if (finalIter)
{
porousMesh.data::remove("finalIteration");
}

View File

@ -1,43 +0,0 @@
// Initialise solid field pointer lists
PtrList<solidThermo> porousSolidThermos(porousSolidRegions.size());
PtrList<IObasicSourceList> solidHeatSources(porousSolidRegions.size());
PtrList<volScalarField> betavSolid(porousSolidRegions.size());
// Populate solid field pointer lists
forAll(porousSolidRegions, i)
{
Info<< "*** Reading porous solid mesh thermophysical "
<< "properties for region "
<< porousSolidRegions[i].name() << nl << endl;
Info<< " Adding to thermos\n" << endl;
porousSolidThermos.set
(
i,
solidThermo::New(porousSolidRegions[i])
);
Info<< " Adding sources\n" << endl;
solidHeatSources.set
(
i,
new IObasicSourceList(porousSolidRegions[i])
);
Info<< " Adding to betavSolid\n" << endl;
betavSolid.set
(
i,
new volScalarField
(
IOobject
(
"betavSolid",
runTime.timeName(),
porousSolidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
porousSolidRegions[i]
)
);
}

View File

@ -1,24 +0,0 @@
const wordList porousSolidNames(rp["porousSolid"]);
PtrList<fvMesh> porousSolidRegions(porousSolidNames.size());
forAll(porousSolidNames, i)
{
Info<< "Create solid mesh for region " << porousSolidNames[i]
<< " for time = " << runTime.timeName() << nl << endl;
porousSolidRegions.set
(
i,
new fvMesh
(
IOobject
(
porousSolidNames[i],
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
}

View File

@ -1,4 +0,0 @@
const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE");
int nNonOrthCorr =
pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);

View File

@ -1,26 +0,0 @@
fvMesh& mesh = porousSolidRegions[i];
solidThermo& thermo = porousSolidThermos[i];
const volScalarField& betav = betavSolid[i];
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.kappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalKappa()*betav;
const volScalarField& kappa = tkappa();
//const volSymmTensorField& K = tK();
//tmp<volScalarField> trhoCp = cp*rho;
//const volScalarField& rhoCp = trhoCp();
tmp<volScalarField> talpha = thermo.alpha();
const volScalarField& alpha = talpha();
volScalarField& h = thermo.he();
IObasicSourceList& sources = solidHeatSources[i];

View File

@ -1,18 +0,0 @@
scalar DiNum = -GREAT;
forAll(solidRegions, i)
{
# include "setRegionSolidFields.H"
DiNum = max
(
solidRegionDiffNo
(
solidRegions[i],
runTime,
rho*cp,
K
),
DiNum
);
}

View File

@ -1,28 +0,0 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
tmp<fvScalarMatrix> hEqn
(
fvm::ddt(betav*rho, h)
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
+ sources(rho, h)
);
hEqn().relax();
hEqn().solve(mesh.solver(h.select(finalIter)));
}
}
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()) << ' ' << max(thermo.T()) << endl;
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -1,6 +1,8 @@
// Initialise solid field pointer lists // Initialise solid field pointer lists
PtrList<solidThermo> thermos(solidRegions.size()); PtrList<solidThermo> thermos(solidRegions.size());
PtrList<radiation::radiationModel> radiations(solidRegions.size()); PtrList<radiation::radiationModel> radiations(solidRegions.size());
PtrList<IObasicSourceList> solidHeatSources(solidRegions.size());
PtrList<volScalarField> betavSolid(solidRegions.size());
// Populate solid field pointer lists // Populate solid field pointer lists
forAll(solidRegions, i) forAll(solidRegions, i)
@ -13,4 +15,49 @@
Info<< " Adding to radiations\n" << endl; Info<< " Adding to radiations\n" << endl;
radiations.set(i, radiation::radiationModel::New(thermos[i].T())); radiations.set(i, radiation::radiationModel::New(thermos[i].T()));
Info<< " Adding sources\n" << endl;
solidHeatSources.set
(
i,
new IObasicSourceList(solidRegions[i])
);
IOobject betavSolidIO
(
"betavSolid",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);
if (betavSolidIO.headerOk())
{
betavSolid.set
(
i,
new volScalarField(betavSolidIO, solidRegions[i])
);
}
else
{
betavSolid.set
(
i,
new volScalarField
(
IOobject
(
"betavSolid",
runTime.timeName(),
solidRegions[i],
IOobject::NO_READ,
IOobject::NO_WRITE
),
solidRegions[i],
dimensionedScalar("1", dimless, scalar(1.0))
)
);
}
} }

View File

@ -14,3 +14,7 @@
const volScalarField& kappa = tkappa(); const volScalarField& kappa = tkappa();
volScalarField& h = thermo.he(); volScalarField& h = thermo.he();
const volScalarField& betav = betavSolid[i];
IObasicSourceList& sources = solidHeatSources[i];

View File

@ -8,8 +8,9 @@ if (finalIter)
{ {
tmp<fvScalarMatrix> hEqn tmp<fvScalarMatrix> hEqn
( (
fvm::ddt(rho, h) fvm::ddt(betav*rho, h)
- fvm::laplacian(alpha, h) - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
+ sources(rho, h)
); );
hEqn().relax(); hEqn().relax();
hEqn().solve(mesh.solver(h.select(finalIter))); hEqn().solve(mesh.solver(h.select(finalIter)));

View File

@ -3,10 +3,10 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solid/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
@ -20,12 +20,13 @@ LIB_LIBS = \
-lmeshTools \ -lmeshTools \
-lchemistryModel \ -lchemistryModel \
-lspecie \ -lspecie \
-lsolidSpecie \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lsolidChemistryModel \ -lsolidChemistryModel \
-lsolidThermo \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lLESdeltas \ -lLESdeltas \
-lregionModels \ -lregionModels \
-lradiationModels -lradiationModels \
-lreactionThermophysicalModels

View File

@ -1,7 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solid/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \
@ -18,5 +17,4 @@ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lOpenFOAM \ -lOpenFOAM \
-lsolidSpecie \
-lradiationModels -lradiationModels

View File

@ -18,6 +18,7 @@ sampledSet/sampledSets/sampledSetsGrouping.C
sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C
sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C
sampledSet/uniform/uniformSet.C sampledSet/uniform/uniformSet.C
sampledSet/array/arraySet.C
setWriters = sampledSet/writers setWriters = sampledSet/writers

View File

@ -0,0 +1,195 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "arraySet.H"
#include "sampledSet.H"
#include "meshSearch.H"
#include "DynamicList.H"
#include "polyMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "word.H"
#include "transform.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(arraySet, 0);
addToRunTimeSelectionTable(sampledSet, arraySet, word);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::arraySet::calcSamples
(
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist
) const
{
const meshSearch& queryMesh = searchEngine();
label nTotalSamples
(
pointsDensity_.x()
*pointsDensity_.y()
*pointsDensity_.z()
);
List<point> sampleCoords(nTotalSamples);
const scalar deltax = spanBox_.x()/(pointsDensity_.x() + 1);
const scalar deltay = spanBox_.y()/(pointsDensity_.y() + 1);
const scalar deltaz = spanBox_.z()/(pointsDensity_.z() + 1);
label p(0);
for (label k=1; k<=pointsDensity_.z(); k++)
{
for (label j=1; j<=pointsDensity_.y(); j++)
{
for (label i=1; i<=pointsDensity_.x(); i++)
{
vector t(deltax*i , deltay*j, deltaz*k);
sampleCoords[p] = coordSys_.origin() + t;
p++;
}
}
}
forAll(sampleCoords, i)
{
sampleCoords[i] = transform(coordSys_.R(), sampleCoords[i]);
}
forAll(sampleCoords, sampleI)
{
label cellI = queryMesh.findCell(sampleCoords[sampleI]);
if (cellI != -1)
{
samplingPts.append(sampleCoords[sampleI]);
samplingCells.append(cellI);
samplingFaces.append(-1);
samplingSegments.append(0);
samplingCurveDist.append(1.0 * sampleI);
}
}
}
void Foam::arraySet::genSamples()
{
// Storage for sample points
DynamicList<point> samplingPts;
DynamicList<label> samplingCells;
DynamicList<label> samplingFaces;
DynamicList<label> samplingSegments;
DynamicList<scalar> samplingCurveDist;
calcSamples
(
samplingPts,
samplingCells,
samplingFaces,
samplingSegments,
samplingCurveDist
);
samplingPts.shrink();
samplingCells.shrink();
samplingFaces.shrink();
samplingSegments.shrink();
samplingCurveDist.shrink();
setSamples
(
samplingPts,
samplingCells,
samplingFaces,
samplingSegments,
samplingCurveDist
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::arraySet::arraySet
(
const word& name,
const polyMesh& mesh,
const meshSearch& searchEngine,
const word& axis,
const coordinateSystem& origin,
const Vector<label>& pointsDensity,
const Vector<scalar>& spanBox
)
:
sampledSet(name, mesh, searchEngine, axis),
coordSys_(origin),
pointsDensity_(pointsDensity),
spanBox_(spanBox)
{
genSamples();
if (debug)
{
write(Info);
}
}
Foam::arraySet::arraySet
(
const word& name,
const polyMesh& mesh,
const meshSearch& searchEngine,
const dictionary& dict
)
:
sampledSet(name, mesh, searchEngine, dict),
coordSys_(dict),
pointsDensity_(dict.lookup("pointsDensity")),
spanBox_(dict.lookup("spanBox"))
{
genSamples();
if (debug)
{
write(Info);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::arraySet::~arraySet()
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,103 +22,99 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::IrreversibleSolidReaction Foam::arraySet
Description Description
Simple extension of Reaction to handle reversible reactions
SourceFiles SourceFiles
IrreversibleSolidReaction.C arraySet.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef IrreversibleSolidReaction_H #ifndef arraySet_H
#define IrreversibleSolidReaction_H #define arraySet_H
#include "solidReaction.H" #include "sampledSet.H"
#include "DynamicList.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// Forward declaration of classes
class passiveParticle;
template<class Type> class particle;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class IrreversibleSolidReaction Declaration Class arraySet Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionRate> class arraySet
class IrreversibleSolidReaction
: :
public solidReaction public sampledSet
{ {
// Private data // Private data
// Reaction rate //- Coordinate syste
ReactionRate k_; coordinateSystem coordSys_;
// Reaction order //- Point density vector
scalar nReact_; Vector<label> pointsDensity_;
//- Span box
Vector<scalar> spanBox_;
// Private Member Functions // Private Member Functions
//- Disallow default bitwise assignment //- Samples all points in sampleCoords.
void operator= void calcSamples
( (
const IrreversibleSolidReaction<ReactionRate>& DynamicList<point>& samplingPts,
); DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist
) const;
//- Uses calcSamples to obtain samples. Copies them into *this.
void genSamples();
public: public:
//- Runtime type information //- Runtime type information
TypeName("irreversible"); TypeName("array");
// Constructors // Constructors
//- Construct from components //- Construct from components
IrreversibleSolidReaction arraySet
( (
const solidReaction& reaction, const word& name,
const ReactionRate& reactionRate, const polyMesh& mesh,
const scalar nReact const meshSearch& searchEngine,
const word& axis,
const coordinateSystem& coordSys,
const Vector<label>& pointsDensity,
const Vector<scalar>& spanBox
); );
//- Construct from dictionary
//- Construct from Istream arraySet
IrreversibleSolidReaction
( (
const speciesTable& components, const word& name,
Istream& is, const polyMesh& mesh,
const speciesTable& pyrolysisGases const meshSearch& searchEngine,
const dictionary& dict
); );
//- Destructor //- Destructor
virtual ~IrreversibleSolidReaction() virtual ~arraySet();
{}
// Member Functions
// IrreversibleSolidReaction rate coefficients
//- Forward rate constant
virtual scalar kf
(
const scalar p,
const scalar T,
const scalarField& c
) const;
//- Reaction order
virtual scalar nReact() const;
//- Write
virtual void write(Ostream&) const;
}; };
@ -128,12 +124,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "IrreversibleSolidReaction.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -164,17 +164,19 @@ void Foam::sampledSurfaces::write()
writeGeometry(); writeGeometry();
} }
sampleAndWrite<volScalarField>(mesh_); const IOobjectList objects(mesh_, mesh_.time().timeName());
sampleAndWrite<volVectorField>(mesh_);
sampleAndWrite<volSphericalTensorField>(mesh_);
sampleAndWrite<volSymmTensorField>(mesh_);
sampleAndWrite<volTensorField>(mesh_);
sampleAndWrite<surfaceScalarField>(mesh_); sampleAndWrite<volScalarField>(objects);
sampleAndWrite<surfaceVectorField>(mesh_); sampleAndWrite<volVectorField>(objects);
sampleAndWrite<surfaceSphericalTensorField>(mesh_); sampleAndWrite<volSphericalTensorField>(objects);
sampleAndWrite<surfaceSymmTensorField>(mesh_); sampleAndWrite<volSymmTensorField>(objects);
sampleAndWrite<surfaceTensorField>(mesh_); sampleAndWrite<volTensorField>(objects);
sampleAndWrite<surfaceScalarField>(objects);
sampleAndWrite<surfaceVectorField>(objects);
sampleAndWrite<surfaceSphericalTensorField>(objects);
sampleAndWrite<surfaceSymmTensorField>(objects);
sampleAndWrite<surfaceTensorField>(objects);
} }
} }

View File

@ -160,7 +160,7 @@ class sampledSurfaces
//- Sample and write all sampled fields //- Sample and write all sampled fields
template<class Type> template<class Type>
void sampleAndWrite(const fvMesh&); void sampleAndWrite(const IOobjectList&);
//- Disallow default bitwise copy construct and assignment //- Disallow default bitwise copy construct and assignment
sampledSurfaces(const sampledSurfaces&); sampledSurfaces(const sampledSurfaces&);

View File

@ -166,13 +166,18 @@ void Foam::sampledSurfaces::sampleAndWrite
template<class GeoField> template<class GeoField>
void Foam::sampledSurfaces::sampleAndWrite(const fvMesh& mesh) void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& allObjects)
{ {
forAll (fieldSelection_, fieldI) forAll (fieldSelection_, fieldI)
{ {
const wordRe field = fieldSelection_[fieldI]; const wordRe field = fieldSelection_[fieldI];
IOobject* fieldIOPtr = allObjects.lookup(field);
if (mesh.thisDb().foundObject<GeoField>(field)) if
(
fieldIOPtr != NULL
&& fieldIOPtr->headerClassName() == GeoField::typeName
)
{ {
if (Pstream::master() && verbose_) if (Pstream::master() && verbose_)
{ {
@ -181,17 +186,25 @@ void Foam::sampledSurfaces::sampleAndWrite(const fvMesh& mesh)
if (loadFromFiles_) if (loadFromFiles_)
{ {
const GeoField& geoField = const GeoField geoField
mesh.thisDb().lookupObject<GeoField>(field); (
IOobject
(
field,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ
),
mesh_
);
const_cast<GeoField&>(geoField).readOpt() = IOobject::MUST_READ;
sampleAndWrite(geoField); sampleAndWrite(geoField);
} }
else else
{ {
sampleAndWrite sampleAndWrite
( (
mesh.thisDb().lookupObject<GeoField>(field) mesh_.thisDb().lookupObject<GeoField>(field)
); );
} }
} }

View File

@ -4,6 +4,7 @@ makeType=${1:-libso}
set -x set -x
wmake $makeType specie wmake $makeType specie
wmake $makeType solidSpecie
wmake $makeType thermophysicalFunctions wmake $makeType thermophysicalFunctions
./properties/Allwmake $* ./properties/Allwmake $*
@ -14,7 +15,7 @@ wmake $makeType chemistryModel
wmake $makeType barotropicCompressibilityModel wmake $makeType barotropicCompressibilityModel
wmake $makeType SLGThermo wmake $makeType SLGThermo
wmake $makeType solidSpecie
wmake $makeType solidThermo wmake $makeType solidThermo
wmake $makeType solidChemistryModel wmake $makeType solidChemistryModel

View File

@ -87,6 +87,27 @@ public:
return mixture_; return mixture_;
} }
const ThermoType& cellVolMixture
(
const scalar,
const scalar,
const label
) const
{
return mixture_;
}
const ThermoType& patchFaceVolMixture
(
const scalar,
const scalar,
const label,
const label
) const
{
return mixture_;
}
//- Read dictionary //- Read dictionary
void read(const dictionary&); void read(const dictionary&);
}; };

View File

@ -27,7 +27,7 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "unitConversion.H" #include "unitConversion.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "basicSolidMixture.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -71,7 +71,7 @@ greyMeanSolidAbsorptionEmission::X(const word specie) const
} }
} }
const scalarField& Yj = mixture_.Y(specie); const scalarField& Yj = mixture_.Y(specie);
const label mySpecieI = mixture_.components()[specie]; const label mySpecieI = mixture_.species()[specie];
forAll(Xj, iCell) forAll(Xj, iCell)
{ {
Xj[iCell] = Yj[iCell]/mixture_.rho(mySpecieI, p[iCell], T[iCell]); Xj[iCell] = Yj[iCell]/mixture_.rho(mySpecieI, p[iCell], T[iCell]);
@ -93,10 +93,10 @@ greyMeanSolidAbsorptionEmission
coeffsDict_((dict.subDict(typeName + "Coeffs"))), coeffsDict_((dict.subDict(typeName + "Coeffs"))),
thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")), thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")),
speciesNames_(0), speciesNames_(0),
mixture_(dynamic_cast<const basicSolidMixture&>(thermo_)), mixture_(dynamic_cast<const basicMultiComponentMixture&>(thermo_)),
solidData_(mixture_.Y().size()) solidData_(mixture_.Y().size())
{ {
if (!isA<basicSolidMixture>(thermo_)) if (!isA<basicMultiComponentMixture>(thermo_))
{ {
FatalErrorIn FatalErrorIn
( (

View File

@ -90,7 +90,7 @@ private:
HashTable<label> speciesNames_; HashTable<label> speciesNames_;
//- Basic multicomponent mixture //- Basic multicomponent mixture
const basicSolidMixture& mixture_; const basicMultiComponentMixture& mixture_;
//- List of solid species data //- List of solid species data
List<FixedList<scalar, 2> > solidData_; List<FixedList<scalar, 2> > solidData_;

View File

@ -2,10 +2,13 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lspecie \ -lspecie \
-lsolidSpecie \
-lmeshTools -lmeshTools

View File

@ -25,6 +25,7 @@ License
#include "makeReactionThermo.H" #include "makeReactionThermo.H"
#include "thermoPhysicsTypes.H" #include "thermoPhysicsTypes.H"
#include "solidThermoPhysicsTypes.H"
#include "chemistryReader.H" #include "chemistryReader.H"
#include "foamChemistryReader.H" #include "foamChemistryReader.H"
@ -41,6 +42,8 @@ makeChemistryReader(gasThermoPhysics);
makeChemistryReader(constIncompressibleGasThermoPhysics); makeChemistryReader(constIncompressibleGasThermoPhysics);
makeChemistryReader(incompressibleGasThermoPhysics); makeChemistryReader(incompressibleGasThermoPhysics);
makeChemistryReader(icoPoly8ThermoPhysics); makeChemistryReader(icoPoly8ThermoPhysics);
makeChemistryReader(hConstSolidThermoPhysics);
makeChemistryReader(hExponentialSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics); makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); makeChemistryReaderType(foamChemistryReader, gasThermoPhysics);
@ -51,6 +54,8 @@ makeChemistryReaderType
); );
makeChemistryReaderType(foamChemistryReader, incompressibleGasThermoPhysics); makeChemistryReaderType(foamChemistryReader, incompressibleGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hConstSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hExponentialSolidThermoPhysics);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -41,6 +41,7 @@ License
#include "powerSeriesReactionRate.H" #include "powerSeriesReactionRate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
/* * * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * */
namespace Foam namespace Foam
@ -178,7 +179,8 @@ void Foam::chemkinReader::addReactionType
{ {
reactions_.append reactions_.append
( (
new IrreversibleReaction<gasThermoPhysics, ReactionRateType> new IrreversibleReaction
<Reaction, gasThermoPhysics, ReactionRateType>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -197,7 +199,8 @@ void Foam::chemkinReader::addReactionType
{ {
reactions_.append reactions_.append
( (
new ReversibleReaction<gasThermoPhysics, ReactionRateType> new ReversibleReaction
<Reaction, gasThermoPhysics, ReactionRateType>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -496,7 +499,7 @@ void Foam::chemkinReader::addReaction
reactions_.append reactions_.append
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<gasThermoPhysics, ArrheniusReactionRate> <Reaction, gasThermoPhysics, ArrheniusReactionRate>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -549,7 +552,11 @@ void Foam::chemkinReader::addReaction
reactions_.append reactions_.append
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<gasThermoPhysics, thirdBodyArrheniusReactionRate> <
Reaction,
gasThermoPhysics,
thirdBodyArrheniusReactionRate
>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -654,7 +661,7 @@ void Foam::chemkinReader::addReaction
reactions_.append reactions_.append
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<gasThermoPhysics, LandauTellerReactionRate> <Reaction, gasThermoPhysics, LandauTellerReactionRate>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (

View File

@ -77,7 +77,8 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
: :
basicMultiComponentMixture(thermoDict, specieNames, mesh), basicMultiComponentMixture(thermoDict, specieNames, mesh),
speciesData_(species_.size()), speciesData_(species_.size()),
mixture_("mixture", *thermoData[specieNames[0]]) mixture_("mixture", *thermoData[specieNames[0]]),
mixtureVol_("volMixture", *thermoData[specieNames[0]])
{ {
forAll(species_, i) forAll(species_, i)
{ {
@ -101,7 +102,8 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
: :
basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh), basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh),
speciesData_(species_.size()), speciesData_(species_.size()),
mixture_("mixture", constructSpeciesData(thermoDict)) mixture_("mixture", constructSpeciesData(thermoDict)),
mixtureVol_("volMixture", speciesData_[0])
{ {
correctMassFractions(); correctMassFractions();
} }
@ -148,6 +150,65 @@ const ThermoType& Foam::multiComponentMixture<ThermoType>::patchFaceMixture
} }
template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const
{
scalar rhoInv = 0.0;
forAll(speciesData_, i)
{
rhoInv += Y_[i][celli]/speciesData_[i].rho(p, T);
}
mixtureVol_ =
Y_[0][celli]/speciesData_[0].rho(p, T)/rhoInv*speciesData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n][celli]/speciesData_[n].rho(p, T)/rhoInv*speciesData_[n];
}
return mixtureVol_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::
patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const
{
scalar rhoInv = 0.0;
forAll(speciesData_, i)
{
rhoInv +=
Y_[i].boundaryField()[patchi][facei]/speciesData_[i].rho(p, T);
}
mixtureVol_ =
Y_[0].boundaryField()[patchi][facei]/speciesData_[0].rho(p, T)/rhoInv
* speciesData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n].boundaryField()[patchi][facei]/speciesData_[n].rho(p,T)
/ rhoInv*speciesData_[n];
}
return mixtureVol_;
}
template<class ThermoType> template<class ThermoType>
void Foam::multiComponentMixture<ThermoType>::read void Foam::multiComponentMixture<ThermoType>::read
( (

View File

@ -60,6 +60,10 @@ class multiComponentMixture
//- Temporary storage for the cell/face mixture thermo data //- Temporary storage for the cell/face mixture thermo data
mutable ThermoType mixture_; mutable ThermoType mixture_;
//- Temporary storage for the volume weighted
// cell/face mixture thermo data
mutable ThermoType mixtureVol_;
// Private Member Functions // Private Member Functions
@ -110,6 +114,21 @@ public:
const label facei const label facei
) const; ) const;
const ThermoType& cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const;
const ThermoType& patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const;
//- Return the raw specie thermodynamic data //- Return the raw specie thermodynamic data
const PtrList<ThermoType>& speciesData() const const PtrList<ThermoType>& speciesData() const
{ {

View File

@ -1,10 +1,11 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
@ -12,4 +13,5 @@ EXE_INC = \
LIB_LIBS = \ LIB_LIBS = \
-lchemistryModel \ -lchemistryModel \
-lfiniteVolume \ -lfiniteVolume \
-lODE -lODE\
-lreactionThermophysicalModels

View File

@ -24,7 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "ODESolidChemistryModel.H" #include "ODESolidChemistryModel.H"
#include "reactingSolidMixture.H" #include "reactingMixture.H"
#include "solidReaction.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -38,24 +39,20 @@ ODESolidChemistryModel
CompType(mesh), CompType(mesh),
ODE(), ODE(),
Ys_(this->solidThermo().composition().Y()), Ys_(this->solidThermo().composition().Y()),
pyrolisisGases_
(
mesh.lookupObject<dictionary>
("thermophysicalProperties").lookup("gaseousSpecies")
),
reactions_ reactions_
( (
dynamic_cast<const reactingSolidMixture<SolidThermo>& > dynamic_cast<const reactingMixture<SolidThermo>& >
( (
this->solidThermo() this->solidThermo()
) )
), ),
pyrolisisGases_(reactions_[0].gasSpecies()),
solidThermo_ solidThermo_
( (
dynamic_cast<const reactingSolidMixture<SolidThermo>& > dynamic_cast<const reactingMixture<SolidThermo>& >
( (
this->solidThermo() this->solidThermo()
).solidData() ).speciesData()
), ),
gasThermo_(pyrolisisGases_.size()), gasThermo_(pyrolisisGases_.size()),
nGases_(pyrolisisGases_.size()), nGases_(pyrolisisGases_.size()),
@ -184,7 +181,7 @@ ODESolidChemistryModel
mesh.lookupObject<dictionary> mesh.lookupObject<dictionary>
( (
"thermophysicalProperties" "thermophysicalProperties"
).subDict(pyrolisisGases_[gasI] + "Coeffs"); ).subDict(pyrolisisGases_[gasI]);
gasThermo_.set gasThermo_.set
( (
@ -193,14 +190,13 @@ ODESolidChemistryModel
); );
} }
Info<< "ODESolidChemistryModel: Number of solids = " << nSolids_ Info<< "solidChemistryModel: Number of solids = " << nSolids_ << endl;
<< " and reactions = " << nReaction_ << endl;
Info<< "Number of gases from pyrolysis = " << nGases_ << endl; Info<< "solidChemistryModel: Number of gases = " << nGases_ << endl;
forAll(reactions_, i) forAll(reactions_, i)
{ {
Info<< indent << "Reaction " << i << nl << reactions_[i] << nl; Info<< indent << reactions_[i] << nl;
} }
} }
@ -235,23 +231,23 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
forAll(reactions_, i) forAll(reactions_, i)
{ {
const solidReaction& R = reactions_[i]; const Reaction<SolidThermo>& R = reactions_[i];
scalar omegai = omega scalar omegai = omega
( (
R, c, T, p, pf, cf, lRef, pr, cr, rRef R, c, T, p, pf, cf, lRef, pr, cr, rRef
); );
scalar rhoL = 0.0; scalar rhoL = 0.0;
forAll(R.slhs(), s) forAll(R.lhs(), s)
{ {
label si = R.slhs()[s]; label si = R.lhs()[s].index;
om[si] -= omegai; om[si] -= omegai;
rhoL = solidThermo_[si].rho(p, T); rhoL = solidThermo_[si].rho(p, T);
} }
scalar sr = 0.0; scalar sr = 0.0;
forAll(R.srhs(), s) forAll(R.rhs(), s)
{ {
label si = R.srhs()[s]; label si = R.rhs()[s].index;
scalar rhoR = solidThermo_[si].rho(p, T); scalar rhoR = solidThermo_[si].rho(p, T);
sr = rhoR/rhoL; sr = rhoR/rhoL;
om[si] += sr*omegai; om[si] += sr*omegai;
@ -263,7 +259,7 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
} }
forAll(R.grhs(), g) forAll(R.grhs(), g)
{ {
label gi = R.grhs()[g]; label gi = R.grhs()[g].index;
om[gi + nSolids_] += (1.0 - sr)*omegai; om[gi + nSolids_] += (1.0 - sr)*omegai;
} }
} }
@ -276,7 +272,7 @@ template<class CompType, class SolidThermo, class GasThermo>
Foam::scalar Foam::scalar
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
( (
const solidReaction& R, const Reaction<SolidThermo>& R,
const scalarField& c, const scalarField& c,
const scalar T, const scalar T,
const scalar p, const scalar p,
@ -299,16 +295,17 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
scalar kf = R.kf(p, T, c1); scalar kf = R.kf(p, T, c1);
const scalar exponent = R.nReact(); //const scalar exponent = R.nReact();
const label Nl = R.slhs().size(); const label Nl = R.lhs().size();
for (label s=0; s<Nl; s++) for (label s=0; s<Nl; s++)
{ {
label si = R.slhs()[s]; label si = R.lhs()[s].index;
const scalar exp = R.lhs()[si].exponent;
kf *= kf *=
pow(c1[si]/Ys0_[si][cellI], exponent) pow(c1[si]/Ys0_[si][cellI], exp)
*(Ys0_[si][cellI]); *(Ys0_[si][cellI]);
} }
@ -390,18 +387,18 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
for (label ri=0; ri<reactions_.size(); ri++) for (label ri=0; ri<reactions_.size(); ri++)
{ {
const solidReaction& R = reactions_[ri]; const Reaction<SolidThermo>& R = reactions_[ri];
scalar kf0 = R.kf(p, T, c2); scalar kf0 = R.kf(p, T, c2);
forAll(R.slhs(), j) forAll(R.lhs(), j)
{ {
label sj = R.slhs()[j]; label sj = R.lhs()[j].index;
scalar kf = kf0; scalar kf = kf0;
forAll(R.slhs(), i) forAll(R.lhs(), i)
{ {
label si = R.slhs()[i]; label si = R.lhs()[i].index;
scalar exp = R.nReact(); scalar exp = R.lhs()[i].exponent;
if (i == j) if (i == j)
{ {
if (exp < 1.0) if (exp < 1.0)
@ -428,14 +425,14 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
} }
} }
forAll(R.slhs(), i) forAll(R.lhs(), i)
{ {
label si = R.slhs()[i]; label si = R.lhs()[i].index;
dfdc[si][sj] -= kf; dfdc[si][sj] -= kf;
} }
forAll(R.srhs(), i) forAll(R.rhs(), i)
{ {
label si = R.srhs()[i]; label si = R.rhs()[i].index;
dfdc[si][sj] += kf; dfdc[si][sj] += kf;
} }
} }
@ -551,7 +548,8 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::nEqns() const
template<class CompType, class SolidThermo, class GasThermo> template<class CompType, class SolidThermo, class GasThermo>
void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::calculate() void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
calculate()
{ {
if (!this->chemistry_) if (!this->chemistry_)
{ {

View File

@ -38,7 +38,7 @@ SourceFiles
#ifndef ODESolidChemistryModel_H #ifndef ODESolidChemistryModel_H
#define ODESolidChemistryModel_H #define ODESolidChemistryModel_H
#include "solidReaction.H" #include "Reaction.H"
#include "ODE.H" #include "ODE.H"
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "DimensionedField.H" #include "DimensionedField.H"
@ -72,12 +72,12 @@ protected:
//- Reference to solid mass fractions //- Reference to solid mass fractions
PtrList<volScalarField>& Ys_; PtrList<volScalarField>& Ys_;
//- Reactions
const PtrList<Reaction<SolidThermo> >& reactions_;
//- List of gas species present in reaction system //- List of gas species present in reaction system
speciesTable pyrolisisGases_; speciesTable pyrolisisGases_;
//- Reactions
const PtrList<solidReaction>& reactions_;
//- Thermodynamic data of solids //- Thermodynamic data of solids
const PtrList<SolidThermo>& solidThermo_; const PtrList<SolidThermo>& solidThermo_;
@ -149,7 +149,7 @@ public:
// Member Functions // Member Functions
//- The reactions //- The reactions
inline const PtrList<solidReaction>& reactions() const; inline const PtrList<Reaction<SolidThermo> >& reactions() const;
//- Thermodynamic data of gases //- Thermodynamic data of gases
inline const PtrList<GasThermo>& gasThermo() const; inline const PtrList<GasThermo>& gasThermo() const;
@ -180,7 +180,7 @@ public:
// species and charateristic times // species and charateristic times
virtual scalar omega virtual scalar omega
( (
const solidReaction& r, const Reaction<SolidThermo>& r,
const scalarField& c, const scalarField& c,
const scalar T, const scalar T,
const scalar p, const scalar p,

View File

@ -45,7 +45,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg()
template<class CompType, class SolidThermo, class GasThermo> template<class CompType, class SolidThermo, class GasThermo>
inline const Foam::PtrList<Foam::solidReaction>& inline const Foam::PtrList<Foam::Reaction<SolidThermo> >&
Foam::ODESolidChemistryModel<CompType, SolidThermo,GasThermo>::reactions() const Foam::ODESolidChemistryModel<CompType, SolidThermo,GasThermo>::reactions() const
{ {
return reactions_; return reactions_;

View File

@ -51,6 +51,7 @@ namespace Foam
hExponentialSolidThermoPhysics, hExponentialSolidThermoPhysics,
gasThermoPhysics gasThermoPhysics
) )
} }

View File

@ -1,4 +1,3 @@
reaction/Reactions/solidReaction/solidReaction.C
reaction/reactions/makeSolidReactions.C reaction/reactions/makeSolidReactions.C
LIB = $(FOAM_LIBBIN)/libsolidSpecie LIB = $(FOAM_LIBBIN)/libsolidSpecie

View File

@ -1,2 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
LIB_LIBS = \
-lspecie

View File

@ -1,92 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "IrreversibleSolidReaction.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionRate>
Foam::IrreversibleSolidReaction<ReactionRate>::IrreversibleSolidReaction
(
const solidReaction& reaction,
const ReactionRate& k,
const scalar nReact
)
:
solidReaction(reaction),
k_(k),
nReact_(nReact)
{}
template<class ReactionRate>
Foam::IrreversibleSolidReaction<ReactionRate>::IrreversibleSolidReaction
(
const speciesTable& components,
Istream& is,
const speciesTable& pyrolysisGases
)
:
solidReaction(components, is, pyrolysisGases),
k_(components, is),
nReact_(readScalar(is))
{
is.readEnd("solidArrheniusReactionRate(Istream&)");
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionRate>
Foam::scalar Foam::IrreversibleSolidReaction<ReactionRate>::kf
(
const scalar p,
const scalar T,
const scalarField& c
) const
{
return k_(p, T, c);
}
template<class ReactionRate>
Foam::scalar Foam::IrreversibleSolidReaction<ReactionRate>::nReact() const
{
return nReact_;
}
template<class ReactionRate>
void Foam::IrreversibleSolidReaction<ReactionRate>::write
(
Ostream& os
) const
{
solidReaction::write(os);
os << token::SPACE << "Reaction order: " << nReact_ << nl << k_;
}
// ************************************************************************* //

View File

@ -26,299 +26,118 @@ License
#include "solidReaction.H" #include "solidReaction.H"
#include "DynamicList.H" #include "DynamicList.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
defineTypeNameAndDebug(solidReaction, 0);
defineRunTimeSelectionTable(solidReaction, Istream);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidReaction::solidReaction template<class ReactionThermo>
Foam::solidReaction<ReactionThermo>::solidReaction
( (
const speciesTable& componets, const Reaction<ReactionThermo>& reaction,
const speciesTable& pyrolisisGases, const speciesTable& pyrolisisGases,
const List<label>& slhs, const List<specieCoeffs>& glhs,
const List<label>& srhs, const List<specieCoeffs>& grhs
const List<label>& grhs
) )
: :
components_(componets), Reaction<ReactionThermo>(reaction),
pyrolisisGases_(pyrolisisGases), pyrolisisGases_(pyrolisisGases),
slhs_(slhs), glhs_(glhs),
srhs_(srhs),
grhs_(grhs) grhs_(grhs)
{} {}
Foam::solidReaction::solidReaction template<class ReactionThermo>
Foam::solidReaction<ReactionThermo>::solidReaction
( (
const solidReaction& r, const solidReaction<ReactionThermo>& r,
const speciesTable& componets,
const speciesTable& pyrolisisGases const speciesTable& pyrolisisGases
) )
: :
components_(componets), Reaction<ReactionThermo>(r),
pyrolisisGases_(pyrolisisGases), pyrolisisGases_(pyrolisisGases),
slhs_(r.slhs_), glhs_(r.glhs_),
srhs_(r.srhs_),
grhs_(r.grhs_) grhs_(r.grhs_)
{} {}
Foam::solidReaction::solidReaction template<class ReactionThermo>
( Foam::solidReaction<ReactionThermo>::solidReaction
const speciesTable& components,
Istream& is,
const speciesTable& pyrolisisGases
)
:
components_(components),
pyrolisisGases_(pyrolisisGases)
{
setLRhs(is);
}
Foam::label Foam::solidReaction::componentIndex
(
bool& isGas,
Istream& is
)
{
token t(is);
if (t.isWord())
{
word componentName = t.wordToken();
size_t i = componentName.find('=');
if (i != word::npos)
{
string exponentStr = componentName
(
i + 1,
componentName.size() - i - 1
);
componentName = componentName(0, i);
}
if (components_.contains(componentName))
{
isGas = false;
return (components_[componentName]);
}
else if (pyrolisisGases_.contains(componentName))
{
isGas = true;
return (pyrolisisGases_[componentName]);
}
else
{
FatalIOErrorIn
(
"solidReaction::componentIndex(bool&, Istream& is)",
is
)
<< "Cannot find component" << componentName
<< "in tables :" << pyrolisisGases_ << " or "
<< components_
<< exit(FatalIOError);
return -1;
}
}
else
{
FatalIOErrorIn("solidReaction::componentIndex(bool&, Istream& is)", is)
<< "Expected a word but found " << t.info()
<< exit(FatalIOError);
return -1;
}
}
void Foam::solidReaction::setLRhs(Istream& is)
{
DynamicList<label> dlsrhs;
label index = 0;
while (is)
{
bool isGas = false;
index = componentIndex(isGas, is);
if (index != -1)
{
dlsrhs.append(index);
token t(is);
if (t.isPunctuation())
{
if (t == token::ADD)
{
if (isGas)
{
grhs_ = dlsrhs.shrink();
dlsrhs.clear();
//is.putBack(t);
//return;
}
else
{
srhs_ = dlsrhs.shrink();
dlsrhs.clear(); //is.putBack(t);
//return;
}
}
else if (t == token::ASSIGN)
{
if (isGas)
{
Info << "Pyrolysis Gases should appear on lhs of the"
"reaction" << endl;
}
else
{
slhs_ = dlsrhs.shrink();
dlsrhs.clear();
}
}
else if (isGas)
{
grhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
else
{
srhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
}
else if (isGas)
{
grhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
else
{
srhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
}
else
{
FatalIOErrorIn("solidReaction::lsrhs(Istream& is)", is)
<< "Cannot find component in tables"
<< exit(FatalIOError);
}
}
FatalIOErrorIn("solidReaction::lsrhs(Istream& is)", is)
<< "Cannot continue reading reaction data from stream"
<< exit(FatalIOError);
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidReaction> Foam::solidReaction::New
( (
const speciesTable& species, const speciesTable& species,
Istream& is, const HashPtrTable<ReactionThermo>& thermoDatabase,
const speciesTable& pyrolisisGases Istream& is
) )
:
Reaction<ReactionThermo>(species, thermoDatabase, is),
pyrolisisGases_(),
glhs_(),
grhs_()
{ {
if (is.eof()) notImplemented
{
FatalIOErrorIn
(
"solidReaction::New(const speciesTable& species,"
" const HashPtrTable& thermoDatabase, Istream&)",
is
) << "solidReaction type not specified" << nl << nl
<< "Valid solidReaction types are :" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
const word reactionTypeName(is);
IstreamConstructorTable::iterator cstrIter
= IstreamConstructorTablePtr_->find(reactionTypeName);
if (cstrIter == IstreamConstructorTablePtr_->end())
{
FatalIOErrorIn
(
"solidReaction::New(const speciesTable& species,"
" const HashPtrTable& thermoDatabase, Istream&)",
is
) << "Unknown reaction type "
<< reactionTypeName << nl << nl
<< "Valid reaction types are :" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<solidReaction>
( (
cstrIter()(species, is, pyrolisisGases) "template<class ReactionThermo>"
"Foam::solidReaction<ReactionThermo>::solidReaction"
"("
" const speciesTable& species,"
" const HashPtrTable<ReactionThermo>& thermoDatabase,"
" Istream& is"
")"
);
}
template<class ReactionThermo>
Foam::solidReaction<ReactionThermo>::solidReaction
(
const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict
)
:
Reaction<ReactionThermo>(species, thermoDatabase, dict),
pyrolisisGases_(dict.parent().parent().lookup("gaseousSpecies")),
glhs_(),
grhs_()
{
this->setLRhs
(
IStringStream(dict.lookup("reaction"))(),
pyrolisisGases_,
glhs_,
grhs_
); );
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solidReaction::write(Ostream& os) const template<class ReactionThermo>
const Foam::List<typename Foam::solidReaction<ReactionThermo>::specieCoeffs>&
Foam::solidReaction<ReactionThermo>::glhs() const
{ {
os << type() << nl << " "; return glhs_;
forAll(slhs_, i)
{
os << components_[slhs_[i]];
}
os << " = ";
forAll(srhs_, i)
{
os << components_[srhs_[i]];
}
os << " + ";
forAll(grhs_, i)
{
os << pyrolisisGases_[grhs_[i]];
}
os << endl << " ";
} }
Foam::scalar Foam::solidReaction::kf template<class ReactionThermo>
( const Foam::List<typename Foam::Reaction<ReactionThermo>::specieCoeffs>&
const scalar p, Foam::solidReaction<ReactionThermo>::grhs() const
const scalar T,
const scalarField& c
) const
{ {
return 0.0; return grhs_;
} }
Foam::scalar Foam::solidReaction::nReact() const template<class ReactionThermo>
const Foam::speciesTable& Foam::solidReaction<ReactionThermo>::
gasSpecies() const
{ {
return 1.0; return pyrolisisGases_;
}
template<class ReactionThermo>
void Foam::solidReaction<ReactionThermo>::write(Ostream& os) const
{
Reaction<ReactionThermo>::write(os);
} }

View File

@ -38,9 +38,7 @@ SourceFiles
#define solidReaction_H #define solidReaction_H
#include "speciesTable.H" #include "speciesTable.H"
#include "scalarField.H" #include "Reaction.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,44 +46,40 @@ namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
template<class ReactionThermo>
class solidReaction; class solidReaction;
inline Ostream& operator<<(Ostream&, const solidReaction&); template<class ReactionThermo>
inline Ostream& operator<<(Ostream&, const solidReaction<ReactionThermo>&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class solidReaction Declaration Class solidReaction Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionThermo>
class solidReaction class solidReaction
:
public Reaction<ReactionThermo>
{ {
private: private:
// Private data // Private data
//- List of solid names present in reaction system typedef typename Reaction<ReactionThermo>::specieCoeffs specieCoeffs;
const speciesTable& components_;
//- List of gas species present in reaction system //- List of gas species present in reaction system
speciesTable pyrolisisGases_; speciesTable pyrolisisGases_;
//- Solid components index for the left-hand-side of the reaction //- Gas specie index for the left-hand-side of the reaction
List<label> slhs_; List<specieCoeffs> glhs_;
//- Solid components index for the right-hand-side of the reaction //- Gas specie index for the right-hand-side of the reaction
List<label> srhs_; List<specieCoeffs> grhs_;
//- Specie index for the right-hand-side of the reaction
List<label> grhs_;
// Private Member Functions // Private Member Functions
//- Set rhs and lhs of the reaction
void setLRhs(Istream&);
//- Look for the component index in the reaction
label componentIndex(bool& isGas, Istream& is);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const solidReaction&); void operator=(const solidReaction&);
@ -94,58 +88,7 @@ private:
public: public:
//- Runtime type information //- Runtime type information
TypeName("Reaction"); TypeName("SolidReaction");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
solidReaction,
Istream,
(
const speciesTable& components,
Istream& is,
const speciesTable& pyrolysisGases
),
(components, is, pyrolysisGases)
);
// Public classes
//- Class used for the read-construction of PtrLists of reaction
class iNew
{
const speciesTable& components_;
speciesTable pyrolisisGases_;
public:
iNew
(
const speciesTable& components,
Istream& pyrolisisGases
)
:
components_(components),
pyrolisisGases_(pyrolisisGases)
{}
autoPtr<solidReaction> operator()(Istream& is) const
{
return autoPtr<solidReaction>
(
solidReaction::New
(
components_,
is,
pyrolisisGases_
)
);
}
};
// Constructors // Constructors
@ -153,48 +96,59 @@ public:
//- Construct from components //- Construct from components
solidReaction solidReaction
( (
const speciesTable& components, const Reaction<ReactionThermo>& reaction,
const speciesTable& pyrolisisGases, const speciesTable& pyrolisisGases,
const List<label>& slhs, const List<specieCoeffs>& glhs,
const List<label>& srhs, const List<specieCoeffs>& grhs
const List<label>& grhs
); );
//- Construct as copy given new speciesTable //- Construct as copy given new speciesTable
solidReaction solidReaction
( (
const solidReaction&, const solidReaction<ReactionThermo>&,
const speciesTable& components,
const speciesTable& pyrolisisGases const speciesTable& pyrolisisGases
); );
//- Construct from Istream //- Construct from Istream
solidReaction solidReaction
( (
const speciesTable& components, const speciesTable& pyrolisisGases,
Istream& is, const HashPtrTable<ReactionThermo>& thermoDatabase,
const speciesTable& pyrolisisGases Istream& is
); );
//- Construct from dictionary
solidReaction
(
const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict
);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<solidReaction > clone() const virtual autoPtr<Reaction<ReactionThermo> > clone() const
{ {
return autoPtr<solidReaction > return autoPtr<Reaction<ReactionThermo> >
( (
new solidReaction(*this) new solidReaction<ReactionThermo>(*this)
); );
} }
//- Construct and return a clone with new speciesTable
// Selectors virtual autoPtr<Reaction<ReactionThermo> > clone
//- Return a pointer to a new patchField created on freestore from input
static autoPtr<solidReaction > New
( (
const speciesTable& components, const speciesTable& species
Istream&, ) const
const speciesTable& pyrolisisGases {
); return autoPtr<Reaction<ReactionThermo> >
(
new solidReaction<ReactionThermo>(*this, species)
);
}
//- Destructor //- Destructor
@ -206,23 +160,13 @@ public:
// Access // Access
inline const List<label>& slhs() const;
inline const List<label>& srhs() const;
inline const List<label>& grhs() const;
inline const speciesTable& pyrolisisGases() const; // - Acces to gas components of the reaction
virtual const List<specieCoeffs>& grhs() const;
virtual const List<specieCoeffs>& glhs() const;
// - Access to gas specie list
// solidReaction rate coefficients virtual const speciesTable& gasSpecies() const;
virtual scalar kf
(
const scalar p,
const scalar T,
const scalarField& c
) const;
virtual scalar nReact() const;
//- Write //- Write
@ -231,10 +175,10 @@ public:
// Ostream Operator // Ostream Operator
friend Ostream& operator<< friend Ostream& operator<< <ReactionThermo>
( (
Ostream&, Ostream&,
const solidReaction& const solidReaction<ReactionThermo>&
); );
}; };
@ -249,6 +193,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "solidReaction.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -30,38 +30,13 @@ License
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const List<label>& solidReaction::slhs() const
{
return slhs_;
}
inline const List<label>& solidReaction::srhs() const
{
return srhs_;
}
inline const List<label>& solidReaction::grhs() const
{
return grhs_;
}
inline const speciesTable& solidReaction::pyrolisisGases() const
{
return pyrolisisGases_;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class ReactionThermo>
inline Ostream& operator<< inline Ostream& operator<<
( (
Ostream& os, Ostream& os,
const solidReaction& r const solidReaction<ReactionThermo>& r
) )
{ {
r.write(os); r.write(os);

View File

@ -75,13 +75,25 @@ public:
Istream& is Istream& is
); );
//- Construct from dictionary
inline solidArrheniusReactionRate
(
const speciesTable& species,
const dictionary& dict
);
//- Destructor
virtual ~solidArrheniusReactionRate()
{}
// Member Functions // Member Functions
//- Return the type name //- Return the type name
static word type() static word type()
{ {
return "SolidArrhenius"; return "Arrhenius";
} }
inline scalar operator() inline scalar operator()
@ -92,6 +104,10 @@ public:
) const; ) const;
//- Write to stream
inline void write(Ostream& os) const;
// Ostream Operator // Ostream Operator
inline friend Ostream& operator<< inline friend Ostream& operator<<

View File

@ -30,6 +30,7 @@ inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
const scalar A, const scalar A,
const scalar Ta, const scalar Ta,
const scalar Tcrit const scalar Tcrit
//const scalar nReact
) )
: :
A_(A), A_(A),
@ -50,6 +51,18 @@ inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
{} {}
inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
(
const speciesTable&,
const dictionary& dict
)
:
A_(readScalar(dict.lookup("A"))),
Ta_(readScalar(dict.lookup("Ta"))),
Tcrit_(readScalar(dict.lookup("Tcrit")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::scalar Foam::solidArrheniusReactionRate::operator() inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
@ -74,6 +87,14 @@ inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
} }
inline void Foam::solidArrheniusReactionRate::write(Ostream& os) const
{
os.writeKeyword("A") << A_ << token::END_STATEMENT << nl;
os.writeKeyword("Ta") << Ta_ << token::END_STATEMENT << nl;
os.writeKeyword("Tcrit") << Tcrit_ << token::END_STATEMENT << nl;
}
inline Foam::Ostream& Foam::operator<< inline Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,

View File

@ -33,7 +33,9 @@ Description
#define makeSolidReactionThermo_H #define makeSolidReactionThermo_H
#include "solidReaction.H" #include "solidReaction.H"
#include "IrreversibleSolidReaction.H" #include "IrreversibleReaction.H"
#include "Reaction.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,32 +45,46 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReaction(ReactionType, ReactionRate) \ #define makeSolidReaction(ReactionType, Thermo, ReactionRate) \
\ \
typedef solidReaction Reaction; \ typedef solidReaction<Thermo> solidReaction##Thermo; \
\ \
typedef ReactionType<ReactionRate> \ typedef Reaction<Thermo> Reaction##Thermo; \
ReactionType##ReactionRate; \ \
typedef ReactionType<solidReaction, Thermo, ReactionRate> \
ReactionType##Thermo##ReactionRate; \
\
defineTemplateRunTimeSelectionTable(Reaction##Thermo, Istream); \
defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \
\
defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0); \
defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \
\ \
template<> \ template<> \
const word ReactionType##ReactionRate::typeName \ const word ReactionType##Thermo##ReactionRate::typeName \
( \ ( \
ReactionType::typeName_() \ ReactionType::typeName_() \
+ ReactionRate::type() \ + ReactionRate::type() \
+ Reaction::typeName_() \ + solidReaction##Thermo::typeName_() \
); \ ); \
\ \
addToRunTimeSelectionTable \ addToRunTimeSelectionTable \
( \ ( \
Reaction, \ Reaction##Thermo, \
ReactionType##ReactionRate, \ ReactionType##Thermo##ReactionRate, \
Istream \ Istream \
); \
\
addToRunTimeSelectionTable \
( \
Reaction##Thermo, \
ReactionType##Thermo##ReactionRate, \
dictionary \
); );
#define makeSolidIRReactions(Thermo, ReactionRate) \
#define makeIRReactions(ReactionRate) \
\ \
makeReaction(IrreversibleSolidReaction, ReactionRate) makeSolidReaction(IrreversibleReaction, Thermo, ReactionRate)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,6 +25,7 @@ License
#include "makeSolidReaction.H" #include "makeSolidReaction.H"
#include "solidArrheniusReactionRate.H" #include "solidArrheniusReactionRate.H"
#include "solidThermoPhysicsTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -33,7 +34,13 @@ namespace Foam
// * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * // // * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * //
makeIRReactions(solidArrheniusReactionRate) makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate)
makeSolidIRReactions
(
hExponentialSolidThermoPhysics,
solidArrheniusReactionRate
)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,7 +26,7 @@ Class
Description Description
Constant properties Transport package. Constant properties Transport package.
Templated into a given thermodynamics package (needed for thermal Templated into a given Thermodynamics package (needed for thermal
conductivity). conductivity).
SourceFiles SourceFiles
@ -44,20 +44,20 @@ SourceFiles
namespace Foam namespace Foam
{ {
template<class thermo> class constAnIsoSolidTransport; template<class Thermo> class constAnIsoSolidTransport;
template<class thermo> template<class Thermo>
inline constAnIsoSolidTransport<thermo> operator* inline constAnIsoSolidTransport<Thermo> operator*
( (
const scalar, const scalar,
const constAnIsoSolidTransport<thermo>& const constAnIsoSolidTransport<Thermo>&
); );
template<class thermo> template<class Thermo>
Ostream& operator<< Ostream& operator<<
( (
Ostream&, Ostream&,
const constAnIsoSolidTransport<thermo>& const constAnIsoSolidTransport<Thermo>&
); );
@ -65,10 +65,10 @@ Ostream& operator<<
Class constAnIsoSolidTransport Declaration Class constAnIsoSolidTransport Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class thermo> template<class Thermo>
class constAnIsoSolidTransport class constAnIsoSolidTransport
: :
public thermo public Thermo
{ {
// Private data // Private data
@ -79,7 +79,7 @@ class constAnIsoSolidTransport
// Private Member Functions // Private Member Functions
//- Construct from components //- Construct from components
inline constAnIsoSolidTransport(const thermo& t, const vector kappa); inline constAnIsoSolidTransport(const Thermo& t, const vector kappa);
public: public:
@ -93,18 +93,36 @@ public:
const constAnIsoSolidTransport& const constAnIsoSolidTransport&
); );
//- Construct from Istream //- Construct from dictionary
//constAnIsoSolidTransport(Istream&);
constAnIsoSolidTransport(const dictionary&); constAnIsoSolidTransport(const dictionary&);
// Selector from dictionary
inline static autoPtr<constAnIsoSolidTransport> New
(
const dictionary& dict
);
// Member functions // Member functions
//- Return the instantiated type name
static word typeName()
{
return "constAnIso<" + Thermo::typeName() + '>';
}
//- Isotropic thermal conductivity [W/mK] //- Isotropic thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Un-isotropic thermal conductivity [W/mK] //- Un-isotropic thermal conductivity [W/mK]
inline vector Kappa(const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline vector alphah(const scalar p, const scalar T) const;
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;
@ -121,7 +139,7 @@ public:
// Friend operators // Friend operators
friend constAnIsoSolidTransport operator* <thermo> friend constAnIsoSolidTransport operator* <Thermo>
( (
const scalar, const scalar,
const constAnIsoSolidTransport& const constAnIsoSolidTransport&
@ -130,7 +148,7 @@ public:
// Ostream Operator // Ostream Operator
friend Ostream& operator<< <thermo> friend Ostream& operator<< <Thermo>
( (
Ostream&, Ostream&,
const constAnIsoSolidTransport& const constAnIsoSolidTransport&

View File

@ -25,53 +25,89 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
( (
const thermo& t, const Thermo& t,
const vector kappa const vector kappa
) )
: :
thermo(t), Thermo(t),
kappa_(kappa) kappa_(kappa)
{} {}
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
( (
const word& name, const word& name,
const constAnIsoSolidTransport& ct const constAnIsoSolidTransport& ct
) )
: :
thermo(name, ct), Thermo(name, ct),
kappa_(ct.kappa_) kappa_(ct.kappa_)
{} {}
template<class Thermo>
inline Foam::autoPtr<Foam::constAnIsoSolidTransport<Thermo> >
Foam::constAnIsoSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<constAnIsoSolidTransport<Thermo> >
(
new constAnIsoSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::scalar Foam::constAnIsoSolidTransport<thermo>:: inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
kappa(const scalar T) const kappa(const scalar p, const scalar T) const
{ {
return mag(kappa_); return mag(kappa_);
} }
template<class thermo> template<class Thermo>
inline Foam::vector Foam::constAnIsoSolidTransport<thermo>:: inline Foam::vector Foam::constAnIsoSolidTransport<Thermo>::
Kappa(const scalar T) const Kappa(const scalar p, const scalar T) const
{ {
return kappa_; return kappa_;
} }
template<class Thermo>
inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const
{
notImplemented
(
"Foam::scalar Foam::constAnIsoSolidTransport<Thermo>mu::"
"("
" const scalar p, const scalar T"
") const"
);
return scalar(0);
}
template<class Thermo>
inline Foam::vector Foam::constAnIsoSolidTransport<Thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa_/this->Cpv(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo>& inline Foam::constAnIsoSolidTransport<Thermo>&
Foam::constAnIsoSolidTransport<thermo>::operator= Foam::constAnIsoSolidTransport<Thermo>::operator=
( (
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
kappa_ = ct.kappa_; kappa_ = ct.kappa_;
@ -80,10 +116,10 @@ Foam::constAnIsoSolidTransport<thermo>::operator=
} }
template<class thermo> template<class Thermo>
inline void Foam::constAnIsoSolidTransport<thermo>::operator+= inline void Foam::constAnIsoSolidTransport<Thermo>::operator+=
( (
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
@ -95,10 +131,10 @@ inline void Foam::constAnIsoSolidTransport<thermo>::operator+=
} }
template<class thermo> template<class Thermo>
inline void Foam::constAnIsoSolidTransport<thermo>::operator-= inline void Foam::constAnIsoSolidTransport<Thermo>::operator-=
( (
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
@ -113,16 +149,16 @@ inline void Foam::constAnIsoSolidTransport<thermo>::operator-=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo> Foam::operator* inline Foam::constAnIsoSolidTransport<Thermo> Foam::operator*
( (
const scalar s, const scalar s,
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
return constAnIsoSolidTransport<thermo> return constAnIsoSolidTransport<Thermo>
( (
s*static_cast<const thermo&>(ct), s*static_cast<const Thermo&>(ct),
ct.kappa_ ct.kappa_
); );
} }

View File

@ -28,26 +28,26 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport
( (
const dictionary& dict const dictionary& dict
) )
: :
thermo(dict), Thermo(dict),
kappa_(readScalar(dict.subDict("transport").lookup("kappa"))) kappa_(readScalar(dict.subDict("transport").lookup("kappa")))
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
void Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport::write void Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport::write
( (
Ostream& os Ostream& os
) const ) const
{ {
thermo::write(os); Thermo::write(os);
dictionary dict("transport"); dictionary dict("transport");
dict.add("kappa", kappa_); dict.add("kappa", kappa_);
@ -57,14 +57,14 @@ void Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport::write
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,
const constIsoSolidTransport<thermo>& ct const constIsoSolidTransport<Thermo>& ct
) )
{ {
operator<<(os, static_cast<const thermo&>(ct)); operator<<(os, static_cast<const Thermo&>(ct));
os << tab << ct.kappa_; os << tab << ct.kappa_;
os.check os.check

View File

@ -97,6 +97,12 @@ public:
//- Construct from Istream //- Construct from Istream
constIsoSolidTransport(const dictionary& dict); constIsoSolidTransport(const dictionary& dict);
// Selector from dictionary
inline static autoPtr<constIsoSolidTransport> New
(
const dictionary& dict
);
// Member functions // Member functions
@ -107,10 +113,17 @@ public:
} }
//- Isotropic thermal conductivity [W/mK] //- Isotropic thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Un-isotropic thermal conductivity [W/mK] //- Un-isotropic thermal conductivity [W/mK]
inline vector Kappa(const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar p, const scalar T) const;
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;

View File

@ -49,23 +49,58 @@ inline Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport
{} {}
template<class Thermo>
inline Foam::autoPtr<Foam::constIsoSolidTransport<Thermo> >
Foam::constIsoSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<constIsoSolidTransport<Thermo> >
(
new constIsoSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>:: inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
kappa(const scalar T) const kappa(const scalar p, const scalar T) const
{ {
return kappa_; return kappa_;
} }
template<class thermo> template<class thermo>
inline Foam::vector Foam::constIsoSolidTransport<thermo>:: inline Foam::vector Foam::constIsoSolidTransport<thermo>::
Kappa(const scalar T) const Kappa(const scalar p, const scalar T) const
{ {
return vector(kappa_, kappa_, kappa_); return vector(kappa_, kappa_, kappa_);
} }
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
mu(const scalar p, const scalar T) const
{
notImplemented
(
"Foam::scalar Foam::constIsoSolidTransport<thermo>mu::"
"("
" const scalar p, const scalar T"
") const"
);
return scalar(0);
}
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa_/this->Cpv(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo> template<class thermo>

View File

@ -103,10 +103,15 @@ public:
const exponentialSolidTransport& const exponentialSolidTransport&
); );
//- Construct from dictionary //- Construct from dictionary
exponentialSolidTransport(const dictionary&); exponentialSolidTransport(const dictionary&);
// Selector from dictionary
inline static autoPtr<exponentialSolidTransport> New
(
const dictionary& dict
);
// Member functions // Member functions
@ -117,10 +122,16 @@ public:
} }
//- Thermal conductivity [W/mK] //- Thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Thermal conductivity [W/mK] //- Thermal conductivity [W/mK]
inline vector Kappa(const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar p, const scalar T) const;
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;

View File

@ -55,12 +55,25 @@ inline Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
{} {}
template<class Thermo>
inline Foam::autoPtr<Foam::exponentialSolidTransport<Thermo> >
Foam::exponentialSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<exponentialSolidTransport<Thermo> >
(
new exponentialSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa
( (
const scalar T const scalar p, const scalar T
) const ) const
{ {
return (kappa0_*pow(T/Tref_, n0_)); return (kappa0_*pow(T/Tref_, n0_));
@ -70,7 +83,7 @@ inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa
template<class thermo> template<class thermo>
inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa
( (
const scalar T const scalar p, const scalar T
) const ) const
{ {
const scalar kappa(kappa0_*pow(T/Tref_, n0_)); const scalar kappa(kappa0_*pow(T/Tref_, n0_));
@ -78,6 +91,28 @@ inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa
} }
template<class thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::
mu(const scalar p, const scalar T) const
{
notImplemented
(
"Foam::scalar Foam::exponentialSolidTransport<thermo>mu::"
"("
" const scalar p, const scalar T"
") const"
);
return scalar(0);
}
template<class thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa(p, T)/this->Cpv(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //

View File

@ -1,7 +1,6 @@
solidThermo/solidThermo.C solidThermo/solidThermo.C
solidThermo/solidThermos.C solidThermo/solidThermos.C
mixtures/basicSolidMixture/basicSolidMixture.C
solidReactionThermo/solidReactionThermo.C solidReactionThermo/solidReactionThermo.C
solidReactionThermo/solidReactionThermos.C solidReactionThermo/solidReactionThermos.C

View File

@ -3,11 +3,13 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
-lspecie \ -lspecie \
-lsolidSpecie \ -lsolidSpecie \
-lfluidThermophysicalModels -lfluidThermophysicalModels \
-lreactionThermophysicalModels

View File

@ -1,105 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "basicSolidMixture.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicSolidMixture::basicSolidMixture
(
const wordList& solidNames,
const fvMesh& mesh
)
:
components_(solidNames),
Y_(components_.size())
{
forAll(components_, i)
{
IOobject header
(
"Y" + components_[i],
mesh.time().timeName(),
mesh,
IOobject::NO_READ
);
// check if field exists and can be read
if (header.headerOk())
{
Y_.set
(
i,
new volScalarField
(
IOobject
(
"Y" + components_[i],
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
}
else
{
volScalarField Ydefault
(
IOobject
(
"Ydefault",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Y_.set
(
i,
new volScalarField
(
IOobject
(
"Y" + components_[i],
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Ydefault
)
);
}
}
}
// ************************************************************************* //

View File

@ -1,214 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::basicSolidMixture
Description
Foam::basicSolidMixture
\*---------------------------------------------------------------------------*/
#ifndef basicSolidMixture_H
#define basicSolidMixture_H
#include "volFields.H"
#include "speciesTable.H"
#include "PtrList.H"
#include "error.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class basicSolidMixture Declaration
\*---------------------------------------------------------------------------*/
class basicSolidMixture
{
protected:
// Protected data
typedef speciesTable solidsTable;
//- The names of the solids
solidsTable components_;
//- Solid mass fractions
PtrList<volScalarField> Y_;
public:
//- The base class of the mixture
typedef basicSolidMixture basicMixtureType;
// Constructors
//- Construct from word list and mesh
basicSolidMixture
(
const wordList& solidNames,
const fvMesh&
);
//- Destructor
virtual ~basicSolidMixture()
{}
// Member Functions
//- Return the solid table
const solidsTable& components() const
{
return components_;
}
//- Return the mass-fraction fields
inline PtrList<volScalarField>& Y();
//- Return the const mass-fraction fields
inline const PtrList<volScalarField>& Y() const;
//- Return the mass-fraction field for a specie given by index
inline volScalarField& Y(const label i);
//- Return the const mass-fraction field for a specie given by index
inline const volScalarField& Y(const label i) const;
//- Return the mass-fraction field for a specie given by name
inline volScalarField& Y(const word& specieName);
//- Return the const mass-fraction field for a specie given by name
inline const volScalarField& Y(const word& specieName) const;
//- Does the mixture include this specie?
inline bool contains(const word& specieName) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const = 0;
//- Density [Kg/m3]
virtual scalar rho
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
// Per specie transport properties
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- An-isotropic thermal conductivity [W/m/K]
virtual vector Kappa
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Thermal diffusivity of enthalpy/internal energy [kg/m/s]
virtual scalar alpha
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
// Cell based properties with on the run mixture calculation
//- Density
virtual scalar rho(scalar p, scalar T, label celli) const = 0;
//- Thermal conductivity
virtual scalar kappa(scalar p, scalar T, label celli) const = 0;
//- Specific heat capacity
virtual scalar Cp(scalar p, scalar T, label celli) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "basicSolidMixtureI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,76 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
inline Foam::PtrList<Foam::volScalarField>& Foam::basicSolidMixture::Y()
{
return Y_;
}
inline const Foam::PtrList<Foam::volScalarField>& Foam::basicSolidMixture::Y()
const
{
return Y_;
}
inline Foam::volScalarField& Foam::basicSolidMixture::Y(const label i)
{
return Y_[i];
}
inline const Foam::volScalarField& Foam::basicSolidMixture::Y
(
const label i
) const
{
return Y_[i];
}
inline Foam::volScalarField& Foam::basicSolidMixture::Y(const word& specieName)
{
return Y_[components_[specieName]];
}
inline const Foam::volScalarField& Foam::basicSolidMixture::Y
(
const word& specieName
) const
{
return Y_[components_[specieName]];
}
inline bool Foam::basicSolidMixture::contains(const word& specieName) const
{
return components_.contains(specieName);
}
// ************************************************************************* //

View File

@ -1,108 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Mixture instantiation
\*---------------------------------------------------------------------------*/
#include "basicMixture.H"
#include "makeBasicMixture.H"
#include "rhoConst.H"
#include "hConstThermo.H"
#include "hExponentialThermo.H"
#include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H"
#include "sensibleInternalEnergy.H"
#include "sensibleEnthalpy.H"
#include "thermo.H"
#include "pureSolidMixture.H"
#include "multiComponentSolidMixture.H"
#include "reactingSolidMixture.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
makeBasicMixture
(
pureSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
makeBasicMixture
(
pureSolidMixture,
constAnIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
makeBasicMixture
(
pureSolidMixture,
exponentialSolidTransport,
sensibleEnthalpy,
hExponentialThermo,
rhoConst
);
makeBasicMixture
(
multiComponentSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
makeBasicMixture
(
reactingSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,363 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "multiComponentSolidMixture.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::
constructSolidData
(
const dictionary& thermoSolidDict
)
{
forAll(components_, i)
{
solidData_.set
(
i,
new ThermoType
(
thermoSolidDict.subDict(components_[i] + "Coeffs")
)
);
}
return solidData_[0];
}
template<class ThermoType>
void Foam::multiComponentSolidMixture<ThermoType>::correctMassFractions()
{
volScalarField Yt("Yt", Y_[0]);
for (label n=1; n<Y_.size(); n++)
{
Yt += Y_[n];
}
forAll(Y_, n)
{
Y_[n] /= Yt;
}
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::X
(
label specieI, label celli, scalar p, scalar T
) const
{
scalar rhoInv = 0.0;
forAll(solidData_, i)
{
rhoInv += Y_[i][celli]/solidData_[i].rho(p, T);
}
scalar X = Y_[specieI][celli]/solidData_[specieI].rho(p, T);
return (X/rhoInv);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::multiComponentSolidMixture<ThermoType>::multiComponentSolidMixture
(
const dictionary& thermoSolidDict,
const fvMesh& mesh
)
:
basicSolidMixture
(
thermoSolidDict.lookup("solidComponents"),
mesh
),
solidData_(components_.size()),
mixture_("mixture", constructSolidData(thermoSolidDict)),
mixtureVol_("mixture", constructSolidData(thermoSolidDict))
{
correctMassFractions();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const
{
scalar rhoInv = 0.0;
forAll(solidData_, i)
{
rhoInv += Y_[i][celli]/solidData_[i].rho(p, T);
}
mixtureVol_ = Y_[0][celli]/solidData_[0].rho(p, T)/rhoInv*solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n][celli]/solidData_[n].rho(p, T)/rhoInv*solidData_[n];
}
return mixtureVol_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::cellMixture
(
const label celli
) const
{
mixture_ = Y_[0][celli]*solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixture_ += Y_[n][celli]*solidData_[n];
}
return mixture_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::
patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const
{
scalar rhoInv = 0.0;
forAll(solidData_, i)
{
rhoInv += Y_[i].boundaryField()[patchi][facei]/solidData_[i].rho(p, T);
}
mixtureVol_ =
Y_[0].boundaryField()[patchi][facei]
/ solidData_[0].rho(p, T)
/ rhoInv
* solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n].boundaryField()[patchi][facei]
/ solidData_[n].rho(p,T)
/ rhoInv
* solidData_[n];
}
return mixtureVol_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::
patchFaceMixture
(
const label patchi,
const label facei
) const
{
mixture_ =
Y_[0].boundaryField()[patchi][facei]*solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixture_ += Y_[n].boundaryField()[patchi][facei]*solidData_[n];
}
return mixture_;
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Cp
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Cp(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Cv
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Cv(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Ha
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Ha(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Hs
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Hs(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Hc
(
const label specieI
) const
{
return solidData_[specieI].Hc();
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::rho
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].rho(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::kappa
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].kappa(T);
}
template<class ThermoType>
Foam::vector Foam::multiComponentSolidMixture<ThermoType>::Kappa
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::alpha
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].kappa(T)/solidData_[specieI].Cpv(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::rho
(
scalar p, scalar T, label celli
) const
{
scalar tmp = 0.0;
forAll(solidData_, i)
{
tmp += solidData_[i].rho(p, T)*X(i, celli, p, T);
}
return tmp;
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::kappa
(
scalar p, scalar T, label celli
) const
{
scalar tmp = 0.0;
forAll(solidData_, i)
{
tmp += solidData_[i].kappa(T)*X(i, celli, p, T);
}
return tmp;
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Cp
(
scalar p, scalar T, label celli
) const
{
scalar tmp = 0.0;
forAll(solidData_, i)
{
tmp += solidData_[i].Cp(p, T)*Y_[i][celli];
}
return tmp;
}
template<class ThermoType>
void Foam::multiComponentSolidMixture<ThermoType>::read
(
const dictionary& thermoDict
)
{
forAll(components_, i)
{
solidData_[i] =
ThermoType(thermoDict.subDict(components_[i] + "Coeffs"));
}
}
// ************************************************************************* //

View File

@ -1,233 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::multiComponentSolidMixture
Description
Foam::multiComponentSolidMixture
\*---------------------------------------------------------------------------*/
#ifndef multiComponentSolidMixture_H
#define multiComponentSolidMixture_H
#include "PtrList.H"
#include "autoPtr.H"
#include "basicSolidMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class multiComponentSolidMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class multiComponentSolidMixture
:
public basicSolidMixture
{
// Private data
//- Solid data
PtrList<ThermoType> solidData_;
//- Temporary storage for the mass cell/face mixture thermo data
mutable ThermoType mixture_;
//- Temporary storage for the volume weighted
// cell/face mixture thermo data
mutable ThermoType mixtureVol_;
// Private Member Functions
//- Correct the mass fractions to sum to 1
void correctMassFractions();
//- Return molar fraction for specieI in celli
scalar X(label specieI, label celli, scalar p, scalar T) const;
//- Construct solid data
const ThermoType& constructSolidData(const dictionary&);
public:
//- The type of thermodynamics this mixture is instantiated for
typedef ThermoType thermoType;
// Constructors
//- Construct from dictionary and mesh
multiComponentSolidMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~multiComponentSolidMixture()
{}
// Member Functions
const ThermoType& cellMixture(const label celli) const;
const ThermoType& patchFaceMixture
(
const label patchi,
const label facei
) const;
const ThermoType& cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const;
const ThermoType& patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const;
//- Return the raw solid data
const PtrList<ThermoType>& solidData() const
{
return solidData_;
}
//- Read dictionary
void read(const dictionary&);
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Density [Kg/m3]
virtual scalar rho
(
const label specieI,
const scalar p,
const scalar T
) const;
// Per specie transport properties
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label specieI,
const scalar p,
const scalar T
) const;
//- An-isotropic thermal conductivity [W/m/K]
virtual vector Kappa
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Thermal diffusivity of enthalpy/internal energy [kg/m/s]
virtual scalar alpha
(
const label specieI,
const scalar p,
const scalar T
) const;
// Cell based properties with on the run mixture calculation.
//- Density
virtual scalar rho(scalar p, scalar T, label celli) const;
//- Thermal conductivity
virtual scalar kappa(scalar p, scalar T, label celli) const;
//- Specific heat capacity
virtual scalar Cp(scalar p, scalar T, label celli) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "multiComponentSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,68 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "pureSolidMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
pureSolidMixture<ThermoType>::pureSolidMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
)
:
basicMixture(thermoDict, mesh),
mixture_(thermoDict.subDict("mixture"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ThermoType>
pureSolidMixture<ThermoType>::~pureSolidMixture()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
void pureSolidMixture<ThermoType>::read(const dictionary& thermoDict)
{
mixture_ = ThermoType(thermoDict.subDict("mixture"));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,134 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::pureSolidMixture
Description
Foam::pureSolidMixture
SourceFiles
pureSolidMixture.C
\*---------------------------------------------------------------------------*/
#ifndef pureSolidMixture_H
#define pureSolidMixture_H
#include "basicMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pureSolidMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class pureSolidMixture
:
public basicMixture
{
// Private data
ThermoType mixture_;
//- Construct as copy (not implemented)
pureSolidMixture(const pureSolidMixture<ThermoType>&);
public:
//- The type of thermodynamics this mixture is instantiated for
typedef ThermoType thermoType;
// Constructors
//- Construct from dictionary and mesh
pureSolidMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~pureSolidMixture();
// Member functions
const ThermoType& cellMixture(const label) const
{
return mixture_;
}
const ThermoType& cellVolMixture
(
const scalar,
const scalar,
const label
) const
{
return mixture_;
}
const ThermoType& patchFaceMixture
(
const label,
const label
) const
{
return mixture_;
}
const ThermoType& patchFaceVolMixture
(
const scalar,
const scalar,
const label,
const label
) const
{
return mixture_;
}
//- Read dictionary
void read(const dictionary&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#ifdef NoRepository
# include "pureSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,67 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "reactingSolidMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoSolidType>
Foam::reactingSolidMixture<ThermoSolidType>::reactingSolidMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
)
:
multiComponentSolidMixture<ThermoSolidType>
(
thermoDict,
mesh
),
PtrList<solidReaction>
(
mesh.lookupObject<dictionary>
("chemistryProperties").lookup("reactions"),
solidReaction::iNew
(
this->components_,
mesh.lookupObject<dictionary>
("thermophysicalProperties").lookup("gaseousSpecies")
)
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoSolidType>
void Foam::reactingSolidMixture<ThermoSolidType>::read
(
const dictionary& thermoDict
)
{}
// ************************************************************************* //

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::reactingSolidMixture
Description
Foam::reactingSolidMixture
SourceFiles
reactingSolidMixture.C
\*---------------------------------------------------------------------------*/
#ifndef reactingSolidMixture_H
#define reactingSolidMixture_H
#include "multiComponentSolidMixture.H"
#include "solidReaction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class reactingSolidMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoSolidType>
class reactingSolidMixture
:
public multiComponentSolidMixture<ThermoSolidType>,
public PtrList<solidReaction>
{
// Private Member Functions
//- Disallow default bitwise copy construct
reactingSolidMixture(const reactingSolidMixture&);
//- Disallow default bitwise assignment
void operator=(const reactingSolidMixture&);
public:
//- The type of thermo package this mixture is instantiated for
typedef ThermoSolidType thermoType;
// Constructors
//- Construct from dictionary and mesh
reactingSolidMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~reactingSolidMixture()
{}
// Member functions
//- Read dictionary
void read(const dictionary&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "reactingSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
Foam::solidThermo
Description
Macros for creating reacting solid thermo packages
\*---------------------------------------------------------------------------*/
#ifndef makeReactingSolidThermo_H
#define makeReactingSolidThermo_H
#include "addToRunTimeSelectionTable.H"
#include "SpecieMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeSolidReactionMixtureThermo(BaseThermo,Cthermo,Mixture,ThermoPhys) \
\
typedef SpecieMixture \
< \
Mixture \
< \
ThermoPhys \
> \
> SpecieMixture##Mixture##ThermoPhys; \
\
typedef \
heThermo \
< \
BaseThermo, \
SpecieMixture##Mixture##ThermoPhys \
> heThermo##Mixture##ThermoPhys; \
\
typedef \
Cthermo \
< \
BaseThermo, \
SpecieMixture##Mixture##ThermoPhys \
> Cthermo##Mixture##ThermoPhys; \
\
\
defineTemplateTypeNameAndDebugWithName \
( \
Cthermo##Mixture##ThermoPhys, \
( \
#Cthermo"<"#Mixture"<" \
+ ThermoPhys::typeName() \
+ ">>" \
).c_str(), \
0 \
); \
\
addToRunTimeSelectionTable \
( \
basicThermo, \
Cthermo##Mixture##ThermoPhys, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##ThermoPhys, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##ThermoPhys, \
dictionary \
);
#define makeReactingSolidThermo(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
\
typedef \
Transport \
< \
species::thermo \
< \
Thermo \
< \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> Transport##Type##Thermo##EqnOfState##Specie; \
\
makeSolidReactionMixtureThermo \
( \
BaseThermo, \
CThermo, \
Mixture, \
Transport##Type##Thermo##EqnOfState##Specie \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef solidReactionThermo_H #ifndef solidReactionThermo_H
#define solidReactionThermo_H #define solidReactionThermo_H
#include "basicSolidMixture.H" #include "basicMultiComponentMixture.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
@ -109,10 +109,11 @@ public:
// Member functions // Member functions
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual basicSolidMixture& composition() = 0; virtual basicMultiComponentMixture& composition() = 0;
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual const basicSolidMixture& composition() const = 0; virtual const basicMultiComponentMixture& composition() const = 0;
}; };

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "makeSolidThermo.H" #include "makeReactingSolidThermo.H"
#include "solidReactionThermo.H" #include "solidReactionThermo.H"
#include "heSolidThermo.H" #include "heSolidThermo.H"
@ -34,7 +34,10 @@ License
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H" #include "exponentialSolidTransport.H"
#include "reactingSolidMixture.H"
#include "reactingMixture.H"
#include "multiComponentMixture.H"
#include "sensibleEnthalpy.H" #include "sensibleEnthalpy.H"
#include "thermo.H" #include "thermo.H"
@ -46,11 +49,24 @@ namespace Foam
/* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */
makeSolidThermo makeReactingSolidThermo
( (
solidReactionThermo, solidReactionThermo,
heSolidThermo, heSolidThermo,
reactingSolidMixture, reactingMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst,
specie
);
makeReactingSolidThermo
(
solidThermo,
heSolidThermo,
multiComponentMixture,
constIsoSolidTransport, constIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hConstThermo, hConstThermo,

View File

@ -56,7 +56,7 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
rhoCells[celli] = volMixture_.rho(pCells[celli], TCells[celli]); rhoCells[celli] = volMixture_.rho(pCells[celli], TCells[celli]);
alphaCells[celli] = alphaCells[celli] =
volMixture_.kappa(TCells[celli]) volMixture_.kappa(pCells[celli], TCells[celli])
/ /
mixture_.Cpv(pCells[celli], TCells[celli]); mixture_.Cpv(pCells[celli], TCells[celli]);
} }
@ -86,10 +86,12 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
facei facei
); );
ph[facei] = mixture_.HE(pp[facei], pT[facei]); ph[facei] = mixture_.HE(pp[facei], pT[facei]);
prho[facei] = volMixture_.rho(pp[facei], pT[facei]); prho[facei] = volMixture_.rho(pp[facei], pT[facei]);
palpha[facei] = palpha[facei] =
volMixture_.kappa(pT[facei]) volMixture_.kappa(pp[facei], pT[facei])
/ mixture_.Cpv(pp[facei], pT[facei]); / mixture_.Cpv(pp[facei], pT[facei]);
} }
} }
@ -111,8 +113,9 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
pT[facei] = mixture_.THE(ph[facei], pp[facei] ,pT[facei]); pT[facei] = mixture_.THE(ph[facei], pp[facei] ,pT[facei]);
prho[facei] = volMixture_.rho(pp[facei], pT[facei]); prho[facei] = volMixture_.rho(pp[facei], pT[facei]);
palpha[facei] = palpha[facei] =
volMixture_.kappa(pT[facei]) volMixture_.kappa(pp[facei], pT[facei])
/ mixture_.Cpv(pp[facei], pT[facei]); / mixture_.Cpv(pp[facei], pT[facei]);
} }
} }
@ -204,7 +207,7 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const
pCells[celli], pCells[celli],
TCells[celli], TCells[celli],
celli celli
).Kappa(TCells[celli]); ).Kappa(pCells[celli], TCells[celli]);
} }
forAll(Kappa.boundaryField(), patchi) forAll(Kappa.boundaryField(), patchi)
@ -222,7 +225,7 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const
pT[facei], pT[facei],
patchi, patchi,
facei facei
).Kappa(pT[facei]); ).Kappa(pp[facei], pT[facei]);
} }
} }
@ -252,7 +255,7 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa
Tp[facei], Tp[facei],
patchi, patchi,
facei facei
).Kappa(Tp[facei]); ).Kappa(pp[facei], Tp[facei]);
} }
return tKappa; return tKappa;

View File

@ -32,31 +32,55 @@ Description
#ifndef makeSolidThermo_H #ifndef makeSolidThermo_H
#define makesolidThermo_H #define makesolidThermo_H
#include "makeThermo.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie)\ #define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie)\
\ \
makeThermoTypedefs \
( \
BaseThermo, \
Cthermo, \
Mixture, \
Transport, \
Type, \
Thermo, \
EqnOfState, \
Specie \
) \
\ \
addToRunTimeSelectionTable \ typedef \
Transport \
< \
species::thermo \
< \
Thermo \
< \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> Transport##Type##Thermo##EqnOfState##Specie; \
\
typedef \
heThermo \
< \
BaseThermo, \
Mixture<Transport##Type##Thermo##EqnOfState##Specie> \
> heThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
typedef \
Cthermo \
< \
BaseThermo, \
Mixture<Transport##Type##Thermo##EqnOfState##Specie> \
> Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
\
defineTemplateTypeNameAndDebugWithName \
( \ ( \
basicThermo, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
fvMesh \ ( \
#Cthermo"<"#Mixture"<" \
+ Transport##Type##Thermo##EqnOfState##Specie::typeName() \
+ ">>" \
).c_str(), \
0 \
); \ ); \
\ \
\
addToRunTimeSelectionTable \ addToRunTimeSelectionTable \
( \ ( \
BaseThermo, \ BaseThermo, \

View File

@ -40,7 +40,6 @@ SourceFiles
#include "fvMesh.H" #include "fvMesh.H"
#include "IOdictionary.H" #include "IOdictionary.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "basicSolidMixture.H"
#include "basicThermo.H" #include "basicThermo.H"
#include "autoPtr.H" #include "autoPtr.H"

View File

@ -34,9 +34,7 @@ License
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H" #include "exponentialSolidTransport.H"
#include "pureSolidMixture.H" #include "pureMixture.H"
#include "multiComponentSolidMixture.H"
#include "reactingSolidMixture.H"
#include "sensibleEnthalpy.H" #include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H" #include "sensibleInternalEnergy.H"
#include "thermo.H" #include "thermo.H"
@ -53,7 +51,7 @@ makeSolidThermo
( (
solidThermo, solidThermo,
heSolidThermo, heSolidThermo,
pureSolidMixture, pureMixture,
constIsoSolidTransport, constIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hConstThermo, hConstThermo,
@ -65,7 +63,7 @@ makeSolidThermo
( (
solidThermo, solidThermo,
heSolidThermo, heSolidThermo,
pureSolidMixture, pureMixture,
constAnIsoSolidTransport, constAnIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hConstThermo, hConstThermo,
@ -77,7 +75,7 @@ makeSolidThermo
( (
solidThermo, solidThermo,
heSolidThermo, heSolidThermo,
pureSolidMixture, pureMixture,
exponentialSolidTransport, exponentialSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hExponentialThermo, hExponentialThermo,
@ -85,19 +83,6 @@ makeSolidThermo
specie specie
); );
makeSolidThermo
(
solidThermo,
heSolidThermo,
multiComponentSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst,
specie
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -27,60 +27,94 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& k const ReactionRate& k
) )
: :
Reaction<ReactionThermo>(reaction), ReactionType<ReactionThermo>(reaction),
k_(k) k_(k)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const speciesTable& species, const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase, const HashPtrTable<ReactionThermo>& thermoDatabase,
Istream& is Istream& is
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, is), ReactionType<ReactionThermo>(species, thermoDatabase, is),
k_(species, is) k_(species, is)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const speciesTable& species, const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase, const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict const dictionary& dict
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, dict), ReactionType<ReactionThermo>(species, thermoDatabase, dict),
k_(species, dict) k_(species, dict)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const IrreversibleReaction<ReactionThermo, ReactionRate>& irr, const IrreversibleReaction<ReactionType, ReactionThermo,ReactionRate>& irr,
const speciesTable& species const speciesTable& species
) )
: :
Reaction<ReactionThermo>(irr, species), ReactionType<ReactionThermo>(irr, species),
k_(irr.k_) k_(irr.k_)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::scalar Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::kf <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kf
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -91,13 +125,19 @@ Foam::scalar Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::kf
} }
template<class ReactionThermo, class ReactionRate> template
void Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::write <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
void Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
write
( (
Ostream& os Ostream& os
) const ) const
{ {
Reaction<ReactionThermo>::write(os); ReactionType<ReactionThermo>::write(os);
k_.write(os); k_.write(os);
} }

View File

@ -47,10 +47,15 @@ namespace Foam
Class IrreversibleReaction Declaration Class IrreversibleReaction Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
class IrreversibleReaction class IrreversibleReaction
: :
public Reaction<ReactionThermo> public ReactionType<ReactionThermo>
{ {
// Private data // Private data
@ -62,7 +67,12 @@ class IrreversibleReaction
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator= void operator=
( (
const IrreversibleReaction<ReactionThermo, ReactionRate>& const IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>&
); );
@ -77,14 +87,19 @@ public:
//- Construct from components //- Construct from components
IrreversibleReaction IrreversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& reactionRate const ReactionRate& reactionRate
); );
//- Construct as copy given new speciesTable //- Construct as copy given new speciesTable
IrreversibleReaction IrreversibleReaction
( (
const IrreversibleReaction<ReactionThermo, ReactionRate>&, const IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>&,
const speciesTable& species const speciesTable& species
); );
@ -109,7 +124,12 @@ public:
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<Reaction<ReactionThermo> >
( (
new IrreversibleReaction<ReactionThermo, ReactionRate>(*this) new IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>(*this)
); );
} }
@ -121,7 +141,12 @@ public:
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<Reaction<ReactionThermo> >
( (
new IrreversibleReaction<ReactionThermo, ReactionRate> new IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>
( (
*this, *this,
species species

View File

@ -27,24 +27,44 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& forwardReactionRate, const ReactionRate& forwardReactionRate,
const ReactionRate& reverseReactionRate const ReactionRate& reverseReactionRate
) )
: :
Reaction<ReactionThermo>(reaction), ReactionType<ReactionThermo>(reaction),
fk_(forwardReactionRate), fk_(forwardReactionRate),
rk_(reverseReactionRate) rk_(reverseReactionRate)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const speciesTable& species, const speciesTable& species,
@ -52,14 +72,24 @@ NonEquilibriumReversibleReaction
Istream& is Istream& is
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, is), ReactionType<ReactionThermo>(species, thermoDatabase, is),
fk_(species, is), fk_(species, is),
rk_(species, is) rk_(species, is)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const speciesTable& species, const speciesTable& species,
@ -67,21 +97,36 @@ NonEquilibriumReversibleReaction
const dictionary& dict const dictionary& dict
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, dict), ReactionType<ReactionThermo>(species, thermoDatabase, dict),
fk_(species, dict.subDict("forward")), fk_(species, dict.subDict("forward")),
rk_(species, dict.subDict("reverse")) rk_(species, dict.subDict("reverse"))
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>& nerr, const NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>& nerr,
const speciesTable& species const speciesTable& species
) )
: :
Reaction<ReactionThermo>(nerr, species), ReactionType<ReactionThermo>(nerr, species),
fk_(nerr.fk_), fk_(nerr.fk_),
rk_(nerr.rk_) rk_(nerr.rk_)
{} {}
@ -89,9 +134,19 @@ NonEquilibriumReversibleReaction
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::scalar
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kf
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -102,9 +157,19 @@ Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
} }
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::scalar
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kr
( (
const scalar, const scalar,
const scalar p, const scalar p,
@ -116,9 +181,19 @@ Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
} }
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::scalar
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kr
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -129,13 +204,23 @@ Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
} }
template<class ReactionThermo, class ReactionRate> template
void Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
void Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::write
( (
Ostream& os Ostream& os
) const ) const
{ {
Reaction<ReactionThermo>::write(os); ReactionType<ReactionThermo>::write(os);
os << indent << "forward" << nl; os << indent << "forward" << nl;
os << indent << token::BEGIN_BLOCK << nl; os << indent << token::BEGIN_BLOCK << nl;

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