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

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

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

revision 1844 by jpye, Sat Aug 30 07:33:11 2008 UTC revision 1845 by jpye, Sat Aug 30 15:02:45 2008 UTC
# Line 125  const TestData td[]; const unsigned ntd; Line 125  const TestData td[]; const unsigned ntd;
125    
126  int main(void){  int main(void){
127    
128      double rho, T, p, h, u;      double rho, T, p, h, s;
129      const HelmholtzData *d;      const HelmholtzData *d;
130    
131      d = &helmholtz_data_nitrogen;      d = &helmholtz_data_nitrogen;
# Line 160  int main(void){ Line 160  int main(void){
160          ASSERT_TOL(helmholtz_p, T, rho, d, p, p*1e-6);          ASSERT_TOL(helmholtz_p, T, rho, d, p, p*1e-6);
161      }      }
162    
163      /* offset required to attain agreement with REFPROP */      /* enthalpy offset is required to attain agreement with values from REFPROP */
164      double Y = -471.596704;      double Z =  -5.2444122479e+05;
165    
166      fprintf(stderr,"ENTROPY TESTS\n");      fprintf(stderr,"ENTHALPY TESTS\n");
167      for(i=0; i<n;++i){      for(i=0; i<n;++i){
168          ASSERT_TOL(helmholtz_s, td[i].T+273.15, td[i].rho, d, td[i].s*1e3 + Y, 1E3);          fprintf(stderr,"h = %f kJ/kg = %f kJ/kmol\n",td[i].h,td[i].h*d->M);
169            fprintf(stderr,"hbar corr = %.10e\n",td[i].h*1e3 - helmholtz_h(td[i].T+273.15, td[i].rho, d));
170            h = td[i].h*1e3 + Z;
171            ASSERT_TOL(helmholtz_h, td[i].T+273.15, td[i].rho, d, h, 1E3);
172      }      }
173    
174      /* this offset is required to attain agreement with values from REFPROP */      /* entropy offset required to attain agreement with REFPROP */
175      double Z = -1635.7e3 + 1492.411e3;      double Y = 0;
176    
177      fprintf(stderr,"ENTHALPY TESTS\n");      fprintf(stderr,"ENTROPY TESTS\n");
178      for(i=0; i<n;++i){      for(i=0; i<n;++i){
179          ASSERT_TOL(helmholtz_h, td[i].T+273.15, td[i].rho, d, td[i].h*1e3 + Z, 1E3);          s = td[i].s*1e3 + Y;
180            ASSERT_TOL(helmholtz_s, td[i].T+273.15, td[i].rho, d, s, fabs(s*1e-3));
181      }      }
182    
183      fprintf(stderr,"Tests completed OK (maximum error = %0.2f%%)\n",maxerr);      fprintf(stderr,"Tests completed OK (maximum error = %0.2f%%)\n",maxerr);

Legend:
Removed from v.1844  
changed lines
  Added in v.1845

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