Пример #1
0
void Phase::setMassFractionsByName(const compositionMap& yMap)
{
    size_t kk = nSpecies();
    vector_fp mf(kk, 0.0);
    for (size_t k = 0; k < kk; k++) {
        mf[k] = std::max(getValue(yMap, speciesName(k), 0.0), 0.0);
    }
    setMassFractions(&mf[0]);
}
Пример #2
0
 void Phase::setMassFractionsByName(compositionMap& yMap) {
   int kk = nSpecies();
   doublereal y;
   vector_fp mf(kk, 0.0);
   for (int k = 0; k < kk; k++) { 
     y = yMap[speciesName(k)];
     if (y > 0.0) mf[k] = y;
   }
   setMassFractions(&mf[0]);
 }
Пример #3
0
void Phase::setMassFractionsByName(const compositionMap& yMap)
{
    vector_fp mf(m_kk, 0.0);
    for (const auto& sp : yMap) {
        try {
            mf[getValue(m_speciesIndices, sp.first)] = sp.second;
        } catch (std::out_of_range&) {
            throw CanteraError("Phase::setMassFractionsByName",
                               "Unknown species '{}'", sp.first);
        }
    }
    setMassFractions(&mf[0]);
}
Пример #4
0
void Phase::setState_RY(doublereal rho, doublereal* y)
{
    setMassFractions(y);
    setDensity(rho);
}
Пример #5
0
void Phase::setState_TY(doublereal t, doublereal* y)
{
    setTemperature(t);
    setMassFractions(y);
}
Пример #6
0
void Phase::setState_TRY(doublereal t, doublereal dens, const doublereal* y)
{
    setMassFractions(y);
    setTemperature(t);
    setDensity(dens);
}
void ThermoPhase::setState_PY(doublereal p, doublereal* y)
{
    setMassFractions(y);
    setPressure(p);
}
void ThermoPhase::setState_RPY(doublereal rho, doublereal p, const doublereal* y)
{
    setMassFractions(y);
    setState_RP(rho,p);
}
void ThermoPhase::setState_TPY(doublereal t, doublereal p, const doublereal* y)
{
    setMassFractions(y);
    setState_TP(t,p);
}