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:
Will Bainbridge
2020-07-31 10:44:30 +01:00
parent 208e5f1b33
commit 5f3c604d05
10 changed files with 79 additions and 53 deletions

View File

@ -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"

View File

@ -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)

View File

@ -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)")
)
);
}

View File

@ -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"

View File

@ -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"

View File

@ -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);
}
}

View File

@ -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
(

View File

@ -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();

View File

@ -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
(