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

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

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

revision 2659 by jpye, Wed Jan 16 02:34:24 2013 UTC revision 2660 by jpye, Wed Jan 16 05:57:03 2013 UTC
# Line 544  int fprops_Tvsx_ph_calc(struct BBoxInter Line 544  int fprops_Tvsx_ph_calc(struct BBoxInter
544          outputs[1] = 1./ rhoft;          outputs[1] = 1./ rhoft;
545          outputs[2] = FLUID->s_fn(TTRIP(FLUID), rhoft, FLUID->data, &err);          outputs[2] = FLUID->s_fn(TTRIP(FLUID), rhoft, FLUID->data, &err);
546          outputs[3] = 0;          outputs[3] = 0;
547          return 6;          return 7;
548      }      }
549    
550      if(p < PCRIT(FLUID)){      if(p < PCRIT(FLUID)){
551          double T_sat, rho_f, rho_g;          double T_sat, rho_f, rho_g;
552            
553          fprops_sat_p(p, &T_sat, &rho_f, &rho_g, FLUID, &err);          fprops_sat_p(p, &T_sat, &rho_f, &rho_g, FLUID, &err);
554          if(err){          if(err){
555              ERROR_REPORTER_HERE(ASC_PROG_ERR              ERROR_REPORTER_HERE(ASC_PROG_ERR
# Line 559  int fprops_Tvsx_ph_calc(struct BBoxInter Line 560  int fprops_Tvsx_ph_calc(struct BBoxInter
560              outputs[1] = 1./rhoft;              outputs[1] = 1./rhoft;
561              outputs[2] = FLUID->s_fn(TTRIP(FLUID), rhoft, FLUID->data, &err);              outputs[2] = FLUID->s_fn(TTRIP(FLUID), rhoft, FLUID->data, &err);
562              outputs[3] = 0;              outputs[3] = 0;
563              return 1;              return 8;
564          }          }
565                    
566          FluidState Sf = fprops_set_Trho(T_sat,rho_f,FLUID,&err);          FluidState Sf = fprops_set_Trho(T_sat,rho_f,FLUID,&err);
# Line 591  int fprops_Tvsx_ph_calc(struct BBoxInter Line 592  int fprops_Tvsx_ph_calc(struct BBoxInter
592    
593      double rho;      double rho;
594      fprops_solve_ph(p,h, &T, &rho, 0, FLUID, &err);      fprops_solve_ph(p,h, &T, &rho, 0, FLUID, &err);
595        if(err){
596            ERROR_REPORTER_HERE(ASC_PROG_ERR,"Failed to solve for (p,h): %s",fprops_error(err));
597            return 9;
598        }
599      /* non-saturated */      /* non-saturated */
600      v = 1./rho;      v = 1./rho;
601      FluidState S = fprops_set_Trho(T,rho,FLUID,&err);      FluidState S = fprops_set_Trho(T,rho,FLUID,&err);
# Line 604  int fprops_Tvsx_ph_calc(struct BBoxInter Line 609  int fprops_Tvsx_ph_calc(struct BBoxInter
609  #ifdef ASC_FPROPS_DEBUG  #ifdef ASC_FPROPS_DEBUG
610      ERROR_REPORTER_HERE(ASC_PROG_NOTE,"Non-saturated state, p = %f bar, h = %f kJ/kg",p/1e5,h/1e3);      ERROR_REPORTER_HERE(ASC_PROG_NOTE,"Non-saturated state, p = %f bar, h = %f kJ/kg",p/1e5,h/1e3);
611  #endif  #endif
612      return err;      return 0;
613  }  }
614    
615    

Legend:
Removed from v.2659  
changed lines
  Added in v.2660

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