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

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

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

revision 1854 by jpye, Wed Sep 10 09:17:43 2008 UTC revision 1855 by jpye, Thu Sep 11 13:50:55 2008 UTC
# Line 46  double helm_cp0(double T, const IdealDat Line 46  double helm_cp0(double T, const IdealDat
46    
47      /* power terms */      /* power terms */
48      pt = &(data->pt[0]);      pt = &(data->pt[0]);
49  #ifdef TEST  #if 0
50      fprintf(stderr,"np = %d\n",data->np);      fprintf(stderr,"np = %d\n",data->np);
51  #endif  #endif
52      for(i = 0; i<data->np; ++i, ++pt){      for(i = 0; i<data->np; ++i, ++pt){
53          term = pt->a0 * pow(T, pt->t0);          term = pt->a0 * pow(T, pt->t0);
54  #ifdef TEST  #if 0
55          fprintf(stderr,"i = %d: ",i);          fprintf(stderr,"i = %d: ",i);
56          fprintf(stderr,"power term, a = %f, t = %f, val = %f\n",pt->a0, pt->t0, term);          fprintf(stderr,"power term, a = %f, t = %f, val = %f\n",pt->a0, pt->t0, term);
57  #endif  #endif
# Line 61  double helm_cp0(double T, const IdealDat Line 61  double helm_cp0(double T, const IdealDat
61      /* 'exponential' terms */      /* 'exponential' terms */
62      et = &(data->et[0]);      et = &(data->et[0]);
63      for(i=0; i<data->ne; ++i, ++et){      for(i=0; i<data->ne; ++i, ++et){
64  #ifdef TEST  #if 0
65          fprintf(stderr,"exp term\n");          fprintf(stderr,"exp term\n");
66  #endif  #endif
67          double x = et->beta / T;          double x = et->beta / T;
68          double e = exp(-x);          double e = exp(-x);
69          double d = (1-e)*(1-e);          double d = (1-e)*(1-e);
70          term = et->b * x*x * e / d;          term = et->b * x*x * e / d;
71  #ifdef TEST  #if 0
72          fprintf(stderr,"exp term, b = %f, beta = %f, val = %f\n",et->b, et->beta, term);          fprintf(stderr,"exp term, b = %f, beta = %f, val = %f\n",et->b, et->beta, term);
73  #endif  #endif
74          sum += term;          sum += term;
75      }      }
76    
77  #ifdef TEST  #if 0
78      fprintf(stderr,"Mult by cp0* = %f\n",data->cp0star);      fprintf(stderr,"Mult by cp0* = %f\n",data->cp0star);
79  #endif  #endif
80      return data->cp0star * sum;      return data->cp0star * sum;

Legend:
Removed from v.1854  
changed lines
  Added in v.1855

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