コード例 #1
0
void IdealSolidSolnPhase::getGibbs_RT_ref(doublereal* grt) const
{
    _updateThermo();
    for (size_t k = 0; k != m_kk; k++) {
        grt[k] = m_g0_RT[k];
    }
}
コード例 #2
0
void IdealSolidSolnPhase::getCp_R_ref(doublereal* cpr) const
{
    _updateThermo();
    for (size_t k = 0; k != m_kk; k++) {
        cpr[k] = m_cp0_R[k];
    }
}
コード例 #3
0
void IdealSolidSolnPhase::getEnthalpy_RT_ref(doublereal* hrt) const
{
    _updateThermo();
    for (size_t k = 0; k != m_kk; k++) {
        hrt[k] = m_h0_RT[k];
    }
}
コード例 #4
0
void LatticeSolidPhase::getGibbs_RT_ref(doublereal* grt) const
{
    _updateThermo();
    for (size_t n = 0; n < m_nlattice; n++) {
        m_lattice[n]->getGibbs_RT_ref(grt + lkstart_[n]);
    }
}
コード例 #5
0
ファイル: SurfPhase.cpp プロジェクト: anujg1991/cantera
void SurfPhase::
getEnthalpy_RT(doublereal* hrt) const
{
    _updateThermo();
    double rrt = 1.0/(GasConstant*temperature());
    scale(m_h0.begin(), m_h0.end(), hrt, rrt);
}
コード例 #6
0
void MaskellSolidSolnPhase::getPureGibbs(doublereal* gpure) const
{
    _updateThermo();
    for (size_t sp=0; sp < m_kk; ++sp) {
        gpure[sp] = RT() * m_g0_RT[sp];
    }
}
コード例 #7
0
void LatticePhase::getGibbs_RT_ref(doublereal* grt) const
{
    _updateThermo();
    for (size_t k = 0; k < m_kk; k++) {
        grt[k] = m_g0_RT[k];
    }
}
コード例 #8
0
ファイル: SurfPhase.cpp プロジェクト: anujg1991/cantera
void SurfPhase::getStandardVolumes(doublereal* vol) const
{
    _updateThermo();
    for (size_t k = 0; k < m_kk; k++) {
        vol[k] = 1.0/standardConcentration(k);
    }
}
コード例 #9
0
void IdealSolidSolnPhase::getEntropy_R_ref(doublereal* er) const
{
    _updateThermo();
    for (size_t k = 0; k != m_kk; k++) {
        er[k] = m_s0_R[k];
    }
}
コード例 #10
0
void IdealSolidSolnPhase::getGibbs_ref(doublereal* g) const
{
    _updateThermo();
    double tmp = GasConstant * temperature();
    for (size_t k = 0; k != m_kk; k++) {
        g[k] = tmp * m_g0_RT[k];
    }
}
コード例 #11
0
doublereal MaskellSolidSolnPhase::enthalpy_mole() const
{
    _updateThermo();
    const doublereal h0 = RT() * mean_X(m_h0_RT);
    const doublereal r = moleFraction(product_species_index);
    const doublereal fmval = fm(r);
    return h0 + r * fmval * h_mixing;
}
コード例 #12
0
ファイル: SurfPhase.cpp プロジェクト: anujg1991/cantera
doublereal SurfPhase::enthalpy_mole() const
{
    if (m_n0 <= 0.0) {
        return 0.0;
    }
    _updateThermo();
    return mean_X(DATA_PTR(m_h0));
}
コード例 #13
0
void MaskellSolidSolnPhase::getPureGibbs(doublereal* gpure) const
{
    _updateThermo();
    const doublereal RT = GasConstant * temperature();
    for (size_t sp=0; sp < m_kk; ++sp) {
        gpure[sp] = RT * m_g0_RT[sp];
    }
}
コード例 #14
0
doublereal MaskellSolidSolnPhase::entropy_mole() const
{
    _updateThermo();
    const doublereal s0 = GasConstant * mean_X(m_s0_R);
    const doublereal r = moleFraction(product_species_index);
    const doublereal fmval = fm(r);
    const doublereal rfm = r * fmval;
    return s0 + GasConstant * (xlogx(1-rfm) - xlogx(rfm) - xlogx(1-r-rfm) - xlogx((1-fmval)*r) - xlogx(1-r) - xlogx(r));
}
コード例 #15
0
doublereal LatticeSolidPhase::cp_mole() const
{
    _updateThermo();
    doublereal sum = 0.0;
    for (size_t n = 0; n < m_nlattice; n++) {
        sum += theta_[n] * m_lattice[n]->cp_mole();
    }
    return sum;
}
コード例 #16
0
 void LatticeSolidPhase::getActivityConcentrations(doublereal* c) const {
     _updateThermo();
     int n;
     int strt = 0;
     for (n = 0; n < m_nlattice; n++) {
         m_lattice[n]->getMoleFractions(c+strt);
         strt += m_lattice[n]->nSpecies();
     }
 }
コード例 #17
0
void LatticeSolidPhase::getStandardChemPotentials(doublereal* mu0) const
{
    _updateThermo();
    size_t strt = 0;
    for (size_t n = 0; n < m_nlattice; n++) {
        m_lattice[n]->getStandardChemPotentials(mu0+strt);
        strt += m_lattice[n]->nSpecies();
    }
}
コード例 #18
0
ファイル: SurfPhase.cpp プロジェクト: anujg1991/cantera
doublereal SurfPhase::entropy_mole() const
{
    _updateThermo();
    doublereal s = 0.0;
    for (size_t k = 0; k < m_kk; k++) {
        s += moleFraction(k) * (m_s0[k] -
            GasConstant * log(std::max(concentration(k) * size(k)/m_n0, SmallNumber)));
    }
    return s;
}
コード例 #19
0
void LatticeSolidPhase::getPartialMolarEnthalpies(doublereal* hbar) const
{
    _updateThermo();
    size_t strt = 0;
    for (size_t n = 0; n < m_lattice.size(); n++) {
        size_t nlsp = m_lattice[n]->nSpecies();
        m_lattice[n]->getPartialMolarEnthalpies(hbar + strt);
        strt += nlsp;
    }
}
コード例 #20
0
 doublereal LatticeSolidPhase::intEnergy_mole() const {
     _updateThermo();
     doublereal ndens, sum = 0.0;
     int n;
     for (n = 0; n < m_nlattice; n++) {
         ndens = m_lattice[n]->molarDensity();
         sum += ndens * m_lattice[n]->intEnergy_mole();
     }
     return sum/molarDensity();
 }
コード例 #21
0
void LatticeSolidPhase::getPartialMolarVolumes(doublereal* vbar) const
{
    _updateThermo();
    size_t strt = 0;
    for (size_t n = 0; n < m_nlattice; n++) {
        size_t nlsp =  m_lattice[n]->nSpecies();
        m_lattice[n]->getPartialMolarVolumes(vbar + strt);
        strt += nlsp;
    }
}
コード例 #22
0
void LatticeSolidPhase::getChemPotentials(doublereal* mu) const
{
    _updateThermo();
    size_t strt = 0;
    for (size_t n = 0; n < m_nlattice; n++) {
        size_t nlsp =  m_lattice[n]->nSpecies();
        m_lattice[n]->getChemPotentials(mu+strt);
        strt += nlsp;
    }
}
コード例 #23
0
ファイル: SurfPhase.cpp プロジェクト: anujg1991/cantera
  void SurfPhase::getChemPotentials(doublereal* mu) const {
    _updateThermo();
    copy(m_mu0.begin(), m_mu0.end(), mu);
    int k;
    getActivityConcentrations(DATA_PTR(m_work));
    for (k = 0; k < m_kk; k++) {
      mu[k] += GasConstant * temperature() * 
	(log(m_work[k]) - logStandardConc(k));
    } 
  }
コード例 #24
0
void LatticeSolidPhase::modifyOneHf298SS(const size_t k, const doublereal Hf298New)
{
    for (size_t n = 0; n < m_lattice.size(); n++) {
        if (lkstart_[n+1] < k) {
            size_t kk = k-lkstart_[n];
            MultiSpeciesThermo& l_spthermo = m_lattice[n]->speciesThermo();
            l_spthermo.modifyOneHf298(kk, Hf298New);
        }
    }
    invalidateCache();
    _updateThermo();
}
コード例 #25
0
 void LatticeSolidPhase::getStandardChemPotentials(doublereal* mu0) const {
     _updateThermo();
     int n;
     int strt = 0;
     double dratio;
     for (n = 0; n < m_nlattice; n++) {
         dratio = m_lattice[n]->molarDensity()/molarDensity();
         m_lattice[n]->getStandardChemPotentials(mu0+strt);
         scale(mu0 + strt, mu0 + strt + m_lattice[n]->nSpecies(), mu0 + strt, dratio);
         strt += m_lattice[n]->nSpecies();
     }
 }
コード例 #26
0
void LatticeSolidPhase::modifyOneHf298SS(const size_t k, const doublereal Hf298New)
{
    for (size_t n = 0; n < m_nlattice; n++) {
        if (lkstart_[n+1] < k) {
            size_t kk = k-lkstart_[n];
            SpeciesThermo& l_spthermo =  m_lattice[n]->speciesThermo();
            l_spthermo.modifyOneHf298(kk, Hf298New);
        }
    }
    m_tlast += 0.0001234;
    _updateThermo();
}
コード例 #27
0
void MaskellSolidSolnPhase::getChemPotentials(doublereal* mu) const
{
    _updateThermo();
    const doublereal r = moleFraction(product_species_index);
    const doublereal pval = p(r);
    const doublereal rfm = r * fm(r);
    const doublereal DgbarDr = pval * h_mixing +
                               RT() *
                               std::log( (std::pow(1 - rfm, pval) * std::pow(rfm, pval) * std::pow(r - rfm, 1 - pval) * r) /
                               (std::pow(1 - r - rfm, 1 + pval) * (1 - r)) );
    mu[product_species_index] = RT() * m_g0_RT[product_species_index] + DgbarDr;
    mu[reactant_species_index] = RT() * m_g0_RT[reactant_species_index] - DgbarDr;
}
コード例 #28
0
void LatticeSolidPhase::resetHf298(const size_t k)
{
    if (k != npos) {
        for (size_t n = 0; n < m_lattice.size(); n++) {
            if (lkstart_[n+1] < k) {
                size_t kk = k-lkstart_[n];
                m_lattice[n]->speciesThermo().resetHf298(kk);
            }
        }
    } else {
        for (size_t n = 0; n < m_lattice.size(); n++) {
            m_lattice[n]->speciesThermo().resetHf298(npos);
        }
    }
    invalidateCache();
    _updateThermo();
}
コード例 #29
0
void MaskellSolidSolnPhase::getActivityCoefficients(doublereal* ac) const
{
    _updateThermo();
    static const int cacheId = m_cache.getId();
    CachedArray cached = m_cache.getArray(cacheId);
    if (!cached.validate(temperature(), pressure(), stateMFNumber())) {
        cached.value.resize(2);

        const doublereal r = moleFraction(product_species_index);
        const doublereal pval = p(r);
        const doublereal rfm = r * fm(r);
        const doublereal A = (std::pow(1 - rfm, pval) * std::pow(rfm, pval) * std::pow(r - rfm, 1 - pval)) /
                             (std::pow(1 - r - rfm, 1 + pval) * (1 - r));
        const doublereal B = pval * h_mixing / RT();
        cached.value[product_species_index] = A * std::exp(B);
        cached.value[reactant_species_index] = 1 / (A * r * (1-r) ) * std::exp(-B);
    }
    std::copy(cached.value.begin(), cached.value.end(), ac);
}
コード例 #30
0
doublereal IdealSolidSolnPhase::logStandardConc(size_t k) const
{
    _updateThermo();
    double res;
    switch (m_formGC) {
    case 0:
        res = 0.0;
        break;
    case 1:
        res = log(1.0/m_speciesMolarVolume[k]);
        break;
    case 2:
        res = log(1.0/m_speciesMolarVolume[m_kk-1]);
        break;
    default:
        throw CanteraError("eosType", "Unknown type");
        break;
    }
    return res;
}