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

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

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

revision 1908 by jpye, Sat Sep 27 11:52:27 2008 UTC revision 1909 by jpye, Sun Sep 28 07:41:24 2008 UTC
# Line 213  double helmholtz_dpdT_rho(double T, doub Line 213  double helmholtz_dpdT_rho(double T, doub
213    
214      double phir_del = helm_resid_del(tau,delta,data);      double phir_del = helm_resid_del(tau,delta,data);
215      double phir_deltau = helm_resid_deltau(tau,delta,data);      double phir_deltau = helm_resid_deltau(tau,delta,data);
216    #ifdef TEST
217      assert(!isinf(phir_del));      assert(!isinf(phir_del));
218      assert(!isinf(phir_deltau));      assert(!isinf(phir_deltau));
219      assert(!isnan(phir_del));      assert(!isnan(phir_del));
# Line 220  double helmholtz_dpdT_rho(double T, doub Line 221  double helmholtz_dpdT_rho(double T, doub
221      assert(!isnan(data->R));      assert(!isnan(data->R));
222      assert(!isnan(rho));      assert(!isnan(rho));
223      assert(!isnan(tau));      assert(!isnan(tau));
224    #endif
225    
226      double res =  data->R * rho * (1 + delta*phir_del - delta*tau*phir_deltau);      double res =  data->R * rho * (1 + delta*phir_del - delta*tau*phir_deltau);
227    
228    #ifdef TEST
229      assert(!isnan(res));      assert(!isnan(res));
230      assert(!isinf(res));      assert(!isinf(res));
231    #endif
232      return res;      return res;
233  }  }
234    
# Line 237  double helmholtz_dpdrho_T(double T, doub Line 241  double helmholtz_dpdrho_T(double T, doub
241    
242      double phir_del = helm_resid_del(tau,delta,data);      double phir_del = helm_resid_del(tau,delta,data);
243      double phir_deldel = helm_resid_deldel(tau,delta,data);      double phir_deldel = helm_resid_deldel(tau,delta,data);
244    #ifdef TEST
245      assert(!isinf(phir_del));      assert(!isinf(phir_del));
246      assert(!isinf(phir_deldel));      assert(!isinf(phir_deldel));
247        #endif  
248      return data->R * T * (1 + 2*delta*phir_del + delta*delta* phir_deldel);      return data->R * T * (1 + 2*delta*phir_del + delta*delta* phir_deldel);
249  }  }
250    
# Line 514  double helm_resid_deltau(double tau,doub Line 519  double helm_resid_deltau(double tau,doub
519          }          }
520      }      }
521    
522    #ifdef TEST
523      assert(!isinf(res));      assert(!isinf(res));
524    #endif
525    
526      /* gaussian terms */      /* gaussian terms */
527      n = data->ng;      n = data->ng;
# Line 534  double helm_resid_deltau(double tau,doub Line 541  double helm_resid_deltau(double tau,doub
541    
542          //fprintf(stderr,"sum = %f\n",sum);          //fprintf(stderr,"sum = %f\n",sum);
543          res += sum;          res += sum;
544    #ifdef TEST
545          assert(!isinf(res));          assert(!isinf(res));
546    #endif
547          ++gt;          ++gt;
548      }      }
549    
# Line 543  double helm_resid_deltau(double tau,doub Line 551  double helm_resid_deltau(double tau,doub
551      fprintf(stderr,"phir = %f\n",res);      fprintf(stderr,"phir = %f\n",res);
552  #endif  #endif
553    
554    #ifdef TEST
555      assert(!isnan(res));      assert(!isnan(res));
556      assert(!isinf(res));      assert(!isinf(res));
557    #endif
558      return res;      return res;
559  }  }
560    

Legend:
Removed from v.1908  
changed lines
  Added in v.1909

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