コード例 #1
0
    void DustyGasTransport::eval_H_matrix() {
        updateBinaryDiffCoeffs();
        updateKnudsenDiffCoeffs();
        int k,l,j;
        doublereal sum;
        for (k = 0; k < m_nsp; k++) {

            // evaluate off-diagonal terms
            for (l = 0; l < m_nsp; l++) m_multidiff(k,l) = -m_x[k]/m_d(k,l);

            // evaluate diagonal term
            sum = 0.0;
            for (j = 0; j < m_nsp; j++) if (j != k) sum += m_x[j]/m_d(k,j);
            m_multidiff(k,k) = 1.0/m_dk[k] + sum;
        }
    }
コード例 #2
0
void DustyGasTransport::eval_H_matrix()
{
    updateBinaryDiffCoeffs();
    updateKnudsenDiffCoeffs();
    for (size_t k = 0; k < m_nsp; k++) {
        // evaluate off-diagonal terms
        for (size_t j = 0; j < m_nsp; j++) {
            m_multidiff(k,j) = -m_x[k]/m_d(k,j);
        }

        // evaluate diagonal term
        double sum = 0.0;
        for (size_t j = 0; j < m_nsp; j++) {
            if (j != k) {
                sum += m_x[j]/m_d(k,j);
            }
        }
        m_multidiff(k,k) = 1.0/m_dk[k] + sum;
    }
}