reactingParticleFoam: Support singleComponentMixtures
This is useful for testing purposes in comparison with rhoPimpleFoam. Also made a fix to the handling of multivariate convection schemes in chtMultiRegionFoam.
This commit is contained in:
@ -3,7 +3,12 @@
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::ddt(rho, he) + fvm::div(phi, he)
|
||||
fvm::ddt(rho, he)
|
||||
+ (
|
||||
mvConvection.valid()
|
||||
? mvConvection->fvmDiv(phi, he)
|
||||
: fvm::div(phi, he)
|
||||
)
|
||||
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||
+ (
|
||||
he.name() == "e"
|
||||
|
||||
@ -1,19 +1,3 @@
|
||||
tmp<fv::convectionScheme<scalar>> mvConvection(nullptr);
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
mvConvection = tmp<fv::convectionScheme<scalar>>
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
reaction.correct();
|
||||
|
||||
@ -40,8 +24,7 @@ if (Y.size())
|
||||
|
||||
fvScalarMatrix YiEqn
|
||||
(
|
||||
fvm::ddt(rho, Yi)
|
||||
+ mvConvection->fvmDiv(phi, Yi)
|
||||
fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi)
|
||||
+ thermophysicalTransport.divj(Yi)
|
||||
==
|
||||
reaction.R(Yi)
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
tmp<fv::convectionScheme<scalar>> mvConvection(nullptr);
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
mvConvection = tmp<fv::convectionScheme<scalar>>
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
if (pimple.frozenFlow())
|
||||
{
|
||||
#include "createMvConvection.H"
|
||||
#include "EEqn.H"
|
||||
}
|
||||
else
|
||||
@ -10,6 +11,7 @@ else
|
||||
}
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "createMvConvection.H"
|
||||
#include "YEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
|
||||
@ -3,7 +3,12 @@
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
|
||||
fvm::ddt(rho, he)
|
||||
+ (
|
||||
mvConvection.valid()
|
||||
? mvConvection->fvmDiv(phi, he)
|
||||
: fvm::div(phi, he)
|
||||
)
|
||||
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||
+ (
|
||||
he.name() == "e"
|
||||
|
||||
@ -1,17 +1,36 @@
|
||||
tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
tmp<fv::convectionScheme<scalar>> mvConvection(nullptr);
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
mvConvection = tmp<fv::convectionScheme<scalar>>
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
combustion->correct();
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
tmp<volScalarField> Yt(nullptr);
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
Yt = tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject("Yt", runTime.timeName(), mesh),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
@ -40,10 +59,13 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
Yt.ref() += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
if (Y.size())
|
||||
{
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,15 +10,6 @@ SLGThermo slgThermo(mesh, thermo);
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
Info<< "Creating field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
|
||||
@ -1,4 +1,17 @@
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
label inertIndex = -1;
|
||||
if (Y.size())
|
||||
{
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||
<< "Inert specie " << inertSpecie
|
||||
<< " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
inertIndex = composition.species()[inertSpecie];
|
||||
}
|
||||
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
@ -10,15 +10,6 @@ SLGThermo slgThermo(mesh, thermo);
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
Info<< "Creating field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user