Ejemplo n.º 1
0
void IdealSolidSolnPhase::calcDensity()
{
    /*
     * Calculate the molarVolume of the solution (m**3 kmol-1)
     */
    const doublereal* const dtmp = moleFractdivMMW();
    double invDens = dot(m_speciesMolarVolume.begin(),
                         m_speciesMolarVolume.end(), dtmp);
    /*
     * Set the density in the parent State object directly,
     * by calling the Phase::setDensity() function.
     */
    Phase::setDensity(1.0/invDens);
}
Ejemplo n.º 2
0
  void IdealSolnGasVPSS::calcDensity() {
    /*
     * Calculate the molarVolume of the solution (m**3 kmol-1)
     */
    if (m_idealGas) {
      double dens =  (m_Pcurrent * meanMolecularWeight()
		      /(GasConstant * temperature()));
      State::setDensity(dens);
    } else {
      const doublereal * const dtmp = moleFractdivMMW();
      const vector_fp& vss = m_VPSS_ptr->standardVolumes();
      double invDens = dot(vss.begin(), vss.end(), dtmp);
      /*
       * Set the density in the parent State object directly,
       * by calling the State::setDensity() function.
       */
      double dens = 1.0/invDens;
      State::setDensity(dens);
    }
  }
Ejemplo n.º 3
0
void IdealSolidSolnPhase::getActivityConcentrations(doublereal* c) const
{
    const doublereal* const dtmp = moleFractdivMMW();
    const double mmw = meanMolecularWeight();
    switch (m_formGC) {
    case 0:
        for (size_t k = 0; k < m_kk; k++) {
            c[k] = dtmp[k] * mmw;
        }
        break;
    case 1:
        for (size_t k = 0; k < m_kk; k++) {
            c[k] = dtmp[k] * mmw / m_speciesMolarVolume[k];
        }
        break;
    case 2:
        double atmp = mmw / m_speciesMolarVolume[m_kk-1];
        for (size_t k = 0; k < m_kk; k++) {
            c[k] = dtmp[k] * atmp;
        }
        break;
    }
}