/[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 2259 by jpye, Thu Aug 5 03:37:14 2010 UTC revision 2260 by jpye, Thu Aug 5 06:28:01 2010 UTC
# Line 51  Line 51 
51    
52  double helmholtz_p(double T, double rho, const HelmholtzData *d){  double helmholtz_p(double T, double rho, const HelmholtzData *d){
53      double p, rho_f, rho_g;      double p, rho_f, rho_g;
54        if(T < d->T_t){
55            fprintf(stderr,"%s: Unable to calculate pressure, T = %e is below triple point.\n", __func__, T);
56            return d->p_t;
57        }
58      if(T < d->T_c){      if(T < d->T_c){
59          int res = fprops_sat_T(T, &p, &rho_f, &rho_g, d);          int res = fprops_sat_T(T, &p, &rho_f, &rho_g, d);
60          if(res){          if(res){
# Line 882  double helm_resid_del(double tau,double Line 886  double helm_resid_del(double tau,double
886          }          }
887          double term = pt->a * pow(tau, pt->t) * ipow(delta, pt->d - 1) * (pt->d - ldell);          double term = pt->a * pow(tau, pt->t) * ipow(delta, pt->d - 1) * (pt->d - ldell);
888          sum += term;          sum += term;
889            if(__isinf(pow(tau, pt->t))){
890                MSGEXPR(tau);
891                MSGEXPR(pt->t);
892            }
893          assert(!__isnan(term));          assert(!__isnan(term));
894            assert(!__isinf(ipow(delta, pt->d - 1)));
895            assert(!__isinf(pow(tau, pt->t)));
896            assert(!__isinf((pt->d - ldell)));
897          assert(!__isinf(term));          assert(!__isinf(term));
898          if(__isnan(sum)){          if(__isnan(sum)){
899              MSGEXPR(pt->a * pow(tau, pt->t) * ipow(delta, pt->d - 1) * (pt->d - ldell));              MSGEXPR(pt->a * pow(tau, pt->t) * ipow(delta, pt->d - 1) * (pt->d - ldell));

Legend:
Removed from v.2259  
changed lines
  Added in v.2260

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