/[ascend]/branches/sid/models/johnpye/fprops/sat.c
ViewVC logotype

Diff of /branches/sid/models/johnpye/fprops/sat.c

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

revision 2116 by jpye, Wed Dec 9 01:34:31 2009 UTC revision 2117 by jpye, Wed Dec 9 04:30:18 2009 UTC
# Line 14  Line 14 
14  #ifdef TEST  #ifdef TEST
15  # include <stdio.h>  # include <stdio.h>
16  # include <assert.h>  # include <assert.h>
17    # include <stdlib.h>
18  #endif  #endif
19    
20  #define SQ(X) ((X)*(X))  #define SQ(X) ((X)*(X))
# Line 22  double fprops_psat_T_xiang(double T, con Line 23  double fprops_psat_T_xiang(double T, con
23    
24      double Zc = d->p_c / (8314. * d->rho_c * d->T_c);      double Zc = d->p_c / (8314. * d->rho_c * d->T_c);
25    
26    #ifdef TEST
27      fprintf(stderr,"Zc = %f\n",Zc);      fprintf(stderr,"Zc = %f\n",Zc);
28    #endif
29    
30      double theta = SQ(Zc - 0.29);      double theta = SQ(Zc - 0.29);
31    
32    #ifdef TEST
33      fprintf(stderr,"theta = %f\n",theta);      fprintf(stderr,"theta = %f\n",theta);
34    #endif
35    
36      double aa[] = {5.790206, 4.888195, 33.91196      double aa[] = {5.790206, 4.888195, 33.91196
37                  , 6.251894, 15.08591, -315.0248                  , 6.251894, 15.08591, -315.0248
# Line 62  double fprops_psat_T_xiang(double T, con Line 67  double fprops_psat_T_xiang(double T, con
67      Maxwell phase criterion as described in the IAPWS95 release.      Maxwell phase criterion as described in the IAPWS95 release.
68  */  */
69  void phase_criterion(double T, double rho_f, double rho_g, double p_sat, const HelmholtzData *D){  void phase_criterion(double T, double rho_f, double rho_g, double p_sat, const HelmholtzData *D){
70    #ifdef TEST
71      fprintf(stderr,"PHASE CRITERION: T = %f, rho_f = %f, rho_g = %f, p_sat = %f\n", T, rho_f, rho_g, p_sat);      fprintf(stderr,"PHASE CRITERION: T = %f, rho_f = %f, rho_g = %f, p_sat = %f\n", T, rho_f, rho_g, p_sat);
72    #endif
73      double delta_f, delta_g, tau;      double delta_f, delta_g, tau;
74      double eq1, eq2, eq3;      double eq1, eq2, eq3;
75      tau = D->T_c / T;      tau = D->T_c / T;
# Line 114  void phase_criterion(double T, double rh Line 121  void phase_criterion(double T, double rh
121              rho_f = rho_f1;              rho_f = rho_f1;
122          }          }
123          if(fabs(rho_f - rho_g) < 1e-5){          if(fabs(rho_f - rho_g) < 1e-5){
124    #ifdef TEST
125              fprintf(stderr,"%s:%d: rho_f = rho_g\n", __FILE__, __LINE__);              fprintf(stderr,"%s:%d: rho_f = rho_g\n", __FILE__, __LINE__);
126              exit(1);              exit(1);
127    #else
128                break;
129    #endif
130          }          }
131    
132    

Legend:
Removed from v.2116  
changed lines
  Added in v.2117

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