/[ascend]/trunk/models/johnpye/fprops/ammonia.c
ViewVC logotype

Diff of /trunk/models/johnpye/fprops/ammonia.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1856 by jpye, Thu Sep 11 13:50:55 2008 UTC revision 1857 by jpye, Thu Sep 11 14:46:51 2008 UTC
# Line 92  const TestData td[]; const unsigned ntd; Line 92  const TestData td[]; const unsigned ntd;
92    
93  int main(void){  int main(void){
94      unsigned n, i;      unsigned n, i;
95      double rho, T, cp0, p, h, s;      double rho, T, cp0, p, u, h, s;
96      const HelmholtzData *d;      const HelmholtzData *d;
97    
98      d = &helmholtz_data_ammonia;      d = &helmholtz_data_ammonia;
# Line 143  int main(void){ Line 143  int main(void){
143          ASSERT_TOL(helmholtz_p, td[i].T+273.15, td[i].rho, d, p, p*2e-4);          ASSERT_TOL(helmholtz_p, td[i].T+273.15, td[i].rho, d, p, p*2e-4);
144      }      }
145    
146        double CORRECTION_u = 0;
147        fprintf(stderr,"INTERNAL ENERGY TESTS\n");
148        for(i=0; i<n;++i){
149            fprintf(stderr,"u = %f kJ/kg\n",td[i].u);
150            u = td[i].u*1e3 + CORRECTION_u;
151            ASSERT_TOL(helmholtz_u, td[i].T+273.15, td[i].rho, d, u, u*1e-3);
152        }
153    
154      fprintf(stderr,"ENTROPY TESTS\n");      fprintf(stderr,"ENTROPY TESTS\n");
155      for(i=0; i<n;++i){      for(i=0; i<n;++i){
156          s = td[i].s*1e3 + Y;          s = td[i].s*1e3 + Y;
157          ASSERT_TOL(helmholtz_s, td[i].T+273.15, td[i].rho, d, s, 100*s);          ASSERT_TOL(helmholtz_s, td[i].T+273.15, td[i].rho, d, s, 1e-3*s);
158      }      }
159    
160      fprintf(stderr,"ENTHALPY TESTS\n");      fprintf(stderr,"ENTHALPY TESTS\n");

Legend:
Removed from v.1856  
changed lines
  Added in v.1857

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22