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

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

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

revision 2630 by jpye, Mon Aug 6 13:42:14 2012 UTC revision 2631 by jpye, Wed Aug 8 03:32:55 2012 UTC
# Line 95  extern Line 95  extern
95  ASC_EXPORT int heatex_pinch_register(){  ASC_EXPORT int heatex_pinch_register(){
96      int result = 0;      int result = 0;
97    
98      ERROR_REPORTER_HERE(ASC_USER_WARNING,"FPROPS is still EXPERIMENTAL. Use with caution.\n");      ERROR_REPORTER_HERE(ASC_USER_WARNING,"HEATEX is still EXPERIMENTAL.\n");
99    
100      result += CreateUserFunctionBlackBox("heatex_DT_phmphmQ"      result += CreateUserFunctionBlackBox("heatex_DT_phmphmQ"
101          ,heatex_prepare          ,heatex_prepare
# Line 213  int heatex_calc(struct BBoxInterp *bbox, Line 213  int heatex_calc(struct BBoxInterp *bbox,
213          double *inputs, double *outputs,          double *inputs, double *outputs,
214          double *jacobian          double *jacobian
215  ){  ){
216      CALCPREPARE(7,5);      CALCPREPARE(7,1);
217    
218      StreamData cold = {inputs[0],inputs[1],inputs[2]};      StreamData cold = {inputs[0],inputs[1],inputs[2]};
219      StreamData hot = {inputs[3],inputs[4],inputs[5]};      StreamData hot = {inputs[3],inputs[4],inputs[5]};
220      double Q = inputs[6];      double Q = inputs[6];
221      double DT_min = DBL_MAX;      double DT_min = DBL_MAX;
222      int i, n = heatex_data->n;      int i, n = heatex_data->n;
223    
224        CONSOLE_DEBUG("hot: p = %f bar, h = %f kJ/kg, mdot = %f kg/s",hot.p/1e5, hot.h/1e3, hot.mdot);
225        CONSOLE_DEBUG("cold: p = %f bar, h = %f kJ/kg, mdot = %f kg/s",cold.p/1e5, cold.h/1e3, cold.mdot);
226            
227      double Th,Tc,rhoh,rhoc;      double Th,Tc,rhoh,rhoc;
228      /* loop from i=0 (cold inlet) to i=n (cold outlet) */      /* loop from i=0 (cold inlet) to i=n (cold outlet) */
# Line 237  int heatex_calc(struct BBoxInterp *bbox, Line 240  int heatex_calc(struct BBoxInterp *bbox,
240          if(DT<DT_min)DT_min = DT;          if(DT<DT_min)DT_min = DT;
241      }      }
242    
243        CONSOLE_DEBUG("DT = %f K",DT_min);
244    
245      /* non-saturated */      /* non-saturated */
246      outputs[0] = DT_min;      outputs[0] = DT_min;
247      return 0;      return 0;

Legend:
Removed from v.2630  
changed lines
  Added in v.2631

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