Ejemplo n.º 1
0
void Kinetics::getDestructionRates(doublereal* ddot)
{
    updateROP();

    fill(ddot, ddot + m_kk, 0.0);
    // the reverse direction destroys products in reversible reactions
    m_revProductStoich.incrementSpecies(m_ropr.data(), ddot);
    // the forward direction destroys reactants
    m_reactantStoich.incrementSpecies(m_ropf.data(), ddot);
}
Ejemplo n.º 2
0
void Kinetics::getNetProductionRates(doublereal* net)
{
    updateROP();

    fill(net, net + m_kk, 0.0);
    // products are created for positive net rate of progress
    m_revProductStoich.incrementSpecies(m_ropnet.data(), net);
    m_irrevProductStoich.incrementSpecies(m_ropnet.data(), net);
    // reactants are destroyed for positive net rate of progress
    m_reactantStoich.decrementSpecies(m_ropnet.data(), net);
}
Ejemplo n.º 3
0
  /**
   * Compute the forward rate constants.
   */
  void InterfaceKinetics::getFwdRateConstants(doublereal* kfwd) {

    updateROP();

    const vector_fp& rf = m_kdata->m_rfn;

    // copy rate coefficients into kfwd
    copy(rf.begin(), rf.end(), kfwd);

    // multiply by perturbation factor
    multiply_each(kfwd, kfwd + nReactions(), m_perturb.begin());
           
  }
Ejemplo n.º 4
0
void Kinetics::getCreationRates(double* cdot)
{
    updateROP();

    // zero out the output array
    fill(cdot, cdot + m_kk, 0.0);

    // the forward direction creates product species
    m_revProductStoich.incrementSpecies(m_ropf.data(), cdot);
    m_irrevProductStoich.incrementSpecies(m_ropf.data(), cdot);

    // the reverse direction creates reactant species
    m_reactantStoich.incrementSpecies(m_ropr.data(), cdot);
}
Ejemplo n.º 5
0
  /*
   * Compute the exchange current densities in A/m^2.
   * The exchange current density is the quotient of the 
   * forward rate constant and the equilibrium constant 
   * to the beta power.  The contribution of the 
   * concentrations is not included in this computation.
   * For non electrochemical reactions (those with no beta), 
   * the geometric mean between the forward and reverse 
   * reactions is returned in analogy. 
   */
  void InterfaceKinetics::getExchangeCurrentDensities(doublereal* i0) {

    updateROP();

    const vector_fp& rf = m_kdata->m_rfn;
    const vector_fp& rkc= m_kdata->m_rkcn;

    // copy rate coefficients into i0
    copy(rf.begin(), rf.end(), i0);

    int nct = m_ctrxn.size();
    for (int i = 0; i < nct; i++) {
      int irxn = m_ctrxn[i];
      if (m_beta[irxn] > 0.0)
	i0[irxn] *= pow(rkc[irxn], m_beta[irxn]);
      else
	// for non electrochemical reactions, the geometric mean between the forward and reverse reactions is interesting.
	//i0[irxn] = 0.0;
	i0[irxn] *= pow( rkc[irxn], 0.5 );
    }
    return;
  }
Ejemplo n.º 6
0
  /*
   * Species net production rates [kmol/m^2/s]. Return the species
   * net production rates (creation - destruction) in array
   * wdot, which must be dimensioned at least as large as the
   * total number of species in all phases of the kinetics
   * model
   *
   * @param net  Vector of species production rates.
   *             units kmol m-d s-1, where d is dimension.
   */
  void InterfaceKinetics::getNetProductionRates(doublereal* net) {
    updateROP();
    m_rxnstoich.getNetProductionRates(m_kk,
				      &m_kdata->m_ropnet[0],
				      net);
  }
Ejemplo n.º 7
0
  /*
   *  Return the species destruction rates in array ddot, which must be
   *  dimensioned at least as large as the total number of
   *  species in all phases of the kinetics model
   */
  void InterfaceKinetics::getDestructionRates(doublereal* ddot) {
    updateROP();
    m_rxnstoich.getDestructionRates(m_kk, &m_kdata->m_ropf[0],
				    &m_kdata->m_ropr[0], ddot);
  }
Ejemplo n.º 8
0
/*
 * Species creation rates [kmol/m^3]. Return the species
 * creation rates in array cdot, which must be
 * dimensioned at least as large as the total number of
 * species.
 *
 *  @param cdot  Array of species production rates.
 *              units kmol m-3 s-1
 */
void GasKinetics::getCreationRates(doublereal* cdot)
{
    updateROP();
    m_rxnstoich.getCreationRates(m_kk, &m_ropf[0], &m_ropr[0], cdot);
}
Ejemplo n.º 9
0
void Kinetics::getNetRatesOfProgress(doublereal* netROP)
{
    updateROP();
    std::copy(m_ropnet.begin(), m_ropnet.end(), netROP);
}
Ejemplo n.º 10
0
void Kinetics::getRevRatesOfProgress(doublereal* revROP)
{
    updateROP();
    std::copy(m_ropr.begin(), m_ropr.end(), revROP);
}
Ejemplo n.º 11
0
void Kinetics::getFwdRatesOfProgress(doublereal* fwdROP)
{
    updateROP();
    std::copy(m_ropf.begin(), m_ropf.end(), fwdROP);
}