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

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

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

revision 1897 by jpye, Thu Sep 25 03:46:29 2008 UTC revision 1898 by jpye, Thu Sep 25 07:01:05 2008 UTC
# Line 28  int helm_run_test_cases(const HelmholtzD Line 28  int helm_run_test_cases(const HelmholtzD
28      }      }
29  #undef CP0_TEMP  #undef CP0_TEMP
30    
31        /* Checking pressure values (proves phir_delta) */
32        fprintf(stderr,"PRESSURE TESTS\n");
33        for(i=16; i<n;++i){
34            T = td[i].T+273.15;
35            rho = td[i].rho;
36            p = td[i].p*1e6;
37            ASSERT_TOL(helmholtz_p, T, rho, d, p, p*1e-3);
38        }
39    
40    #if 0
41      /* Checking internal energy values (proves phi0_tau, phir_tau) */      /* Checking internal energy values (proves phi0_tau, phir_tau) */
42    
43      fprintf(stderr,"INTERNAL ENERGY TESTS\n");      fprintf(stderr,"INTERNAL ENERGY TESTS\n");
# Line 35  int helm_run_test_cases(const HelmholtzD Line 45  int helm_run_test_cases(const HelmholtzD
45          T = td[i].T+273.15;          T = td[i].T+273.15;
46          rho = td[i].rho;          rho = td[i].rho;
47          u = td[i].u*1e3;          u = td[i].u*1e3;
48          ASSERT_TOL(helmholtz_u, T, rho, d, u, u);          ASSERT_TOL(helmholtz_u, T, rho, d, u, 1e3*u);
49      }      }
50    
51      /* Checking entropy values */      /* Checking entropy values */
# Line 71  int helm_run_test_cases(const HelmholtzD Line 81  int helm_run_test_cases(const HelmholtzD
81      exit(1);      exit(1);
82  #endif  #endif
83    
     /* Checking pressure values (proves phir_delta) */  
     fprintf(stderr,"PRESSURE TESTS\n");  
     for(i=0; i<n;++i){  
         T = td[i].T+273.15;  
         rho = td[i].rho;  
         p = td[i].p*1e6;  
         ASSERT_TOL(helmholtz_p, T, rho, d, p, p*1e-2);  
     }  
   
   
84      /* Checking helmholtz energy values */      /* Checking helmholtz energy values */
85    
86      fprintf(stderr,"HELMHOLTZ ENERGY TESTS\n");      fprintf(stderr,"HELMHOLTZ ENERGY TESTS\n");
# Line 92  int helm_run_test_cases(const HelmholtzD Line 92  int helm_run_test_cases(const HelmholtzD
92          ASSERT_TOL(helmholtz_a, T, rho, d, a, a*1e-6);          ASSERT_TOL(helmholtz_a, T, rho, d, a, a*1e-6);
93      }      }
94            
95    #endif
96      fprintf(stderr,"Tests completed OK (maximum error = %0.5f%%)\n",maxerr);      fprintf(stderr,"Tests completed OK (maximum error = %0.5f%%)\n",maxerr);
97      exit(0);      exit(0);
98  }  }

Legend:
Removed from v.1897  
changed lines
  Added in v.1898

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