mixtureAdiabaticFlameT: Add conversion of volume fraction to mass fractions

This commit is contained in:
Henry Weller
2019-08-22 18:54:42 +01:00
parent 37204c1559
commit 54509a7968

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
dictionary properties(propertiesFile);
scalar P(readScalar(properties.lookup("P")));
scalar p(readScalar(properties.lookup("P")));
scalar T0(readScalar(properties.lookup("T0")));
mixture rMix(properties.lookup("reactants"));
mixture pMix(properties.lookup("products"));
@ -97,31 +97,27 @@ int main(int argc, char *argv[])
dictionary thermoData(thermoDataFile);
thermo reactants
(
rMix[0].volFrac()*thermo(thermoData.subDict(rMix[0].name()))
);
const thermo reactant0(thermoData.subDict(rMix[0].name()));
for (label i = 1; i < rMix.size(); i++)
thermo reactants(rMix[0].volFrac()*reactant0.rho(p, T0)*reactant0);
for (label i=1; i<rMix.size(); i++)
{
reactants = reactants
+ rMix[i].volFrac()*thermo(thermoData.subDict(rMix[i].name()));
const thermo reactanti(thermoData.subDict(rMix[i].name()));
reactants += rMix[i].volFrac()*reactanti.rho(p, T0)*reactanti;
}
const thermo product0(thermoData.subDict(pMix[0].name()));
thermo products(pMix[0].volFrac()*product0.rho(p, T0)*product0);
thermo products
(
2*pMix[0].volFrac()*thermo(thermoData.subDict(pMix[0].name()))
);
for (label i = 1; i < pMix.size(); i++)
for (label i=1; i<pMix.size(); i++)
{
products = products
+ 2*pMix[i].volFrac()*thermo(thermoData.subDict(pMix[i].name()));
const thermo producti(thermoData.subDict(pMix[i].name()));
products += pMix[i].volFrac()*producti.rho(p, T0)*producti;
}
Info<< "Adiabatic flame temperature of mixture " << rMix.name() << " = "
<< products.THa(reactants.Ha(P, T0), P, 1000.0) << " K" << endl;
<< products.THa(reactants.Ha(p, T0), p, 1000.0) << " K" << endl;
return 0;
}