Additional options for treatment of Y fields.

This commit is contained in:
tlichtenegger
2018-04-09 12:30:31 +02:00
parent a2e3ad76ab
commit 09dba5d5d5
3 changed files with 23 additions and 14 deletions

View File

@ -19,10 +19,11 @@ tmp<fv::convectionScheme<scalar> > mvConvection
forAll(Y, i)
{
if (Y[i].name() != inertSpecie || ignoreInertSpecie)
if (Y[i].name() == inertSpecie) inertIndex = i;
if (Y[i].name() != inertSpecie || propagateInertSpecie)
{
volScalarField& Yi = Y[i];
fvScalarMatrix YiEqn
(
fvm::ddt(rhoeps, Yi)
@ -42,23 +43,27 @@ tmp<fv::convectionScheme<scalar> > mvConvection
fvOptions.correct(Yi);
#include "debugYEqn.H"
Yi.max(0.0);
Yt += Yi;
}
else
{
inertIndex = i;
if (Y[i].name() != inertSpecie) Yt += Yi;
}
}
if (ignoreInertSpecie)
if (inertIndex!=-1)
{
Y[inertIndex].max(inertLowerBound);
Y[inertIndex].min(inertUpperBound);
}
if (propagateInertSpecie)
{
if (inertIndex!=-1) Yt /= (1-Y[inertIndex] + VSMALL);
forAll(Y,i)
{
volScalarField& Yi = Y[i];
Yi = Yi/Yt;
if (i!=inertIndex)
{
volScalarField& Yi = Y[i];
Yi = Yi/(Yt+VSMALL);
}
}
}
else

View File

@ -17,10 +17,14 @@
// read molecular weight
volScalarField W(composition.W());
bool ignoreInertSpecie = true;
bool propagateInertSpecie = true;
const word inertSpecie(thermo.lookup("inertSpecie"));
const scalar inertLowerBound(thermo.lookupOrDefault<scalar>("inertLowerBound",0.0));
const scalar inertUpperBound(thermo.lookupOrDefault<scalar>("inertUpperBound",1.0));
if (!composition.contains(inertSpecie))
{
FatalErrorIn(args.executable())

View File

@ -21,7 +21,7 @@
Info << "\nartificial mass of species " << Y[i].name() << " per time step: "<< fvc::domainIntegrate(artMass) << endl;
if(lVCell > -1)
{
Pout << "lowest value of " << lowestValue << " at cell " << lVCell << " with coordinates" << endl;
Pout << Y[i].name() << ": time / lowest value " << runTime.timeName() << "\t" << lowestValue << "\n\tat cell " << lVCell << " with coordinates";
Pout << "\t" << mesh.C()[lVCell].component(0) << "\t" << mesh.C()[lVCell].component(1) << "\t" << mesh.C()[lVCell].component(2) << endl;
}
}