/[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 2668 by jpye, Wed Jan 23 04:57:19 2013 UTC revision 2669 by jpye, Wed Jan 23 05:38:50 2013 UTC
# Line 61  double helmholtz_dudrho_T(double T, doub Line 61  double helmholtz_dudrho_T(double T, doub
61    
62  //#define HELM_DEBUG  //#define HELM_DEBUG
63  #define HELM_ERRORS  #define HELM_ERRORS
64    //#define SAT_DEBUG
65    
66  #ifdef HELM_DEBUG  #ifdef HELM_DEBUG
67  # include "color.h"  # include "color.h"
# Line 609  double helmholtz_sat(double T, double *r Line 610  double helmholtz_sat(double T, double *r
610      double pc = data->p_c;      double pc = data->p_c;
611    
612  #ifdef SAT_DEBUG  #ifdef SAT_DEBUG
613      MSG("initial guess rho_f = %f, rho_g = %f\n",rhof,rhog);      MSG("initial guess rho_f = %f, rho_g = %f",rhof,rhog);
614      MSG("calculating for %s, T = %.12e",d->name,T);      MSG("calculating at T = %.12e",T);
615  #endif  #endif
616    
617      int i = 0;      int i = 0;
618      while(i++ < 70){      while(i++ < 200){
619          assert(!isnan(rhog));          assert(!isnan(rhog));
620          assert(!isnan(rhof));          assert(!isnan(rhof));
621  #ifdef SAT_DEBUG  #ifdef SAT_DEBUG
# Line 652  double helmholtz_sat(double T, double *r Line 653  double helmholtz_sat(double T, double *r
653          //MSG("DET = %f",DET);          //MSG("DET = %f",DET);
654    
655          // 'gamma' needs to be increased to 0.5 for water to solve correctly (see 'test/sat.c')          // 'gamma' needs to be increased to 0.5 for water to solve correctly (see 'test/sat.c')
656  #define gamma 0.45  #define gamma 1
657          rhof += gamma/DET * (Fg*G - Gg*F);          rhof += gamma/DET * (Fg*G - Gg*F);
658          rhog += gamma/DET * ( Gf*F - Ff*G);          rhog += gamma/DET * ( Gf*F - Ff*G);
659  #undef gamma  #undef gamma
# Line 785  double helm_resid(double tau, double del Line 786  double helm_resid(double tau, double del
786      n = HD->np;      n = HD->np;
787      pt = &(HD->pt[0]);      pt = &(HD->pt[0]);
788    
789      MSG("tau=%f, del=%f",tau,delta);      //MSG("tau=%f, del=%f",tau,delta);
790      //if(isinf(tau))abort();      //if(isinf(tau))abort();
791    
792      /* power terms */      /* power terms */

Legend:
Removed from v.2668  
changed lines
  Added in v.2669

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