Esempio n. 1
0
double hydrogen::sp()
{
    double rt = 1.0/T;
    double rt2 = rt*rt;
    double rt3 = rt*rt2;
    double egrho = exp(-Gamma*Rho*Rho);
    double sum = s0 - R*log(Rho);
    for (int i=0; i<14; i++) {
        sum -= Cprime(i, rt, rt2, rt3)*I(i, egrho);
    }

    //   add \int c_{v,0}/T term
    sum += Ghydro[0] * log(std::min(T, T1)/ To);
    if (T > T1) {
        double xlg = log(std::min(T, T2)/T1);
        for (int i = 0; i < 12; i++) {
            sum += Ghydro[i] / (i + 1) * pow(xlg, i+1);
        }
    }
    if (T > T2) {
        double xlg = log(T/T2);
        for (int i = 0; i < 5; i++) {
            sum += Ghydro[i+12] / (i + 1) * pow(xlg, i+1);
        }
    }

    return sum + m_entropy_offset;
}
Esempio n. 2
0
double hydrogen::up()
{
    double rt = 1.0/T;
    double rt2 = rt*rt;
    double rt3 = rt*rt2;
    double egrho = exp(-Gamma*Rho*Rho);
    double sum = u0;
    for (int i=0; i<14; i++) {
        sum += (C(i, rt, rt2) - T*Cprime(i, rt, rt2, rt3))*I(i, egrho);
    }

    //   add \int c_{v,0} term
    sum += Ghydro[0] * (std::min(T, T1) - To);
    if (T > T1) {
        double x = std::min(T, T2) / T1;
        for (int i = 0; i < 12; i++) {
            sum += Ghydro[i] * T1 * icv(i, x, log(x));
        }
    }
    if (T > T2) {
        double x = T/T2;
        for (int i = 0; i < 5; i++) {
            sum += Ghydro[i+12] * T2 * icv(i, x, log(x));
        }
    }

    return sum + m_energy_offset;
}
Esempio n. 3
0
double water::up()
{
    double sum = 0.0;
    int i;
    for (i=0; i<7; i++) {
        sum += (C(i) - T*Cprime(i))*I(i);
    }
    for (i=1; i<6; i++) {
        sum += G[i]*(pow(T,i) - pow(To,i))/double(i);
    }
    sum += G[0]*log(T/To) + u0;
    return sum + m_energy_offset;
}
Esempio n. 4
0
double water::sp()
{
    double sum = 0.0;
    int i;
    for (i=2; i<6; i++) {
        sum += G[i]*(pow(T,i-1) - pow(To,i-1))/double(i-1);
    }
    sum += G[1]*log(T/To);
    sum -= G[0]*(1.0/T - 1.0/To);
    sum += s0 - R*log(Rho);
    for (i=0; i<7; i++) {
        sum -= Cprime(i)*I(i);
    }
    return sum + m_entropy_offset;
}
Esempio n. 5
0
double oxygen::up()
{
    double rt = 1.0/T;
    double rt2 = rt*rt;
    double rt3 = rt*rt2;
    double egrho = exp(-Gamma*Rho*Rho);

    double sum = 0.0;
    for (int i=0; i<14; i++) {
        sum += (C(i,rt,rt2) - T*Cprime(i,rt,rt2,rt3))*I(i,egrho);
    }

    sum += (((0.25*Goxy[6]*T + Goxy[5]/3.0)*T + 0.5*Goxy[4])*T + Goxy[3])*T + Goxy[2]*log(T)
           - (Goxy[1] + 0.5*Goxy[0]*rt)*rt + Goxy[7]*beta/(exp(beta*rt) - 1.0) + u0;

    return sum + m_energy_offset;
}
Esempio n. 6
0
double methane::sp()
{
    double rt = 1.0/T;
    double rt2 = rt*rt;
    double rt3 = rt*rt2;
    double egrho = exp(-Gamma*Rho*Rho);
    double t3 = pow(T,1.0/3.0);
    double sum = 0.0;
    sum = s0 - R*log(Rho);
    for (int i=0; i<14; i++) {
        sum -= Cprime(i, rt, rt2, rt3)*I(i, egrho);
    }
    sum += Gmeth[0]*log(T) + 3.0*Gmeth[1]*t3 + 1.5*Gmeth[2]*t3*t3 + Gmeth[3]*T
           + Gmeth[4]*(beta*rt + beta*rt/(exp(beta*rt) - 1.0)
                       - log(exp(beta*rt) - 1.0));
    return sum + m_entropy_offset;
}
Esempio n. 7
0
double methane::up()
{
    double rt = 1.0/T;
    double rt2 = rt*rt;
    double rt3 = rt*rt2;
    double egrho = exp(-Gamma*Rho*Rho);
    double t3 = pow(T,1.0/3.0);

    double sum = 0.0;
    for (int i=0; i<14; i++) {
        sum += (C(i, rt, rt2) - T*Cprime(i, rt, rt2, rt3))*I(i, egrho);
    }

    sum += T*(Gmeth[0] + 0.75*Gmeth[1]*t3 + 0.6*Gmeth[2]*t3*t3 + 0.5*Gmeth[3]*T)
           + Gmeth[4]*beta/(exp(beta*rt) - 1.0) + u0;
    return sum + m_energy_offset;
}
Esempio n. 8
0
double oxygen::sp()
{
    double rt = 1.0/T;
    double rt2 = rt*rt;
    double rt3 = rt*rt2;
    double egrho = exp(-Gamma*Rho*Rho);

    double sum = 0.0;
    sum = s0 - R*log(Rho);
    for (int i=0; i<14; i++) {
        sum -= Cprime(i,rt,rt2,rt3)*I(i,egrho);
    }

    sum += (((Goxy[6]/3.0)*T + 0.5*Goxy[5])*T + Goxy[4])*T + Goxy[3]*log(T)
           -((Goxy[0]*rt/3.0 + 0.5*Goxy[1])*rt + Goxy[2])*rt
           + Goxy[7]*(beta*rt + beta*rt/(exp(beta*rt) - 1.0)
                      - log(exp(beta*rt) - 1.0));
    return sum + m_entropy_offset;
}
Esempio n. 9
0
/*
 *  entropy
 *  see Reynolds eqn (16) section 2
 */
double Heptane::sp() {
    double T2inverse = pow(T, -2);
    double T3inverse = pow(T, -3);
    double T4inverse = pow(T, -4);
    double egrho = exp(-Gamma*Rho*Rho);

    double sum = 0.0;

    for (int i=2; i<=5; i++)
        sum += G[i]*(pow(T,i-1) - pow(To,i-1))/double(i-1);

    sum += G[1]*log(T/To);
    sum -= G[0]*(1.0/T - 1.0/To);

    for (int i=0; i<=6; i++) {
        sum -= Cprime(i,T2inverse, T3inverse, T4inverse)*I(i,egrho, Gamma);
    }

    sum += s0 - R*log(Rho);

    return sum + m_entropy_offset;
}
Esempio n. 10
0
/* 
 * internal energy
 *  see Reynolds eqn (15) section 2
 *  u = (the integral from T to To of co(T)dT) +
 *         sum from i to N ([C(i) - T*Cprime(i)] + uo
 */
double Heptane::up() {
   double Tinverse = 1.0/T;   
   double T2inverse = pow(T, -2);
   double T3inverse = pow(T, -3);
   double T4inverse = pow(T, -4);
   double egrho = exp(-Gamma*Rho*Rho);

   double sum = 0.0;
   int i;
   for (i=1; i<=5; i++)
      sum += G[i]*(pow(T,i) - pow(To,i))/double(i);

   sum += G[0]*log(T/To);   

   for (i=0; i<=6; i++) {
      sum += (C(i, Tinverse, T2inverse, T3inverse, T4inverse) - T*Cprime(i,T2inverse, T3inverse, T4inverse))*I(i,egrho, Gamma);   
   }
    
   sum += u0;

   return sum + m_energy_offset;
 }