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

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

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

revision 1902 by jpye, Wed Sep 10 09:17:43 2008 UTC revision 1903 by jpye, Thu Sep 25 08:47:22 2008 UTC
# Line 59  better later on, hopefully. */ Line 59  better later on, hopefully. */
59  ExtBBoxInitFunc helmholtz_prepare;  ExtBBoxInitFunc helmholtz_prepare;
60  ExtBBoxFunc helmholtz_p_calc;  ExtBBoxFunc helmholtz_p_calc;
61  ExtBBoxFunc helmholtz_u_calc;  ExtBBoxFunc helmholtz_u_calc;
62    ExtBBoxFunc helmholtz_s_calc;
63  ExtBBoxFunc helmholtz_h_calc;  ExtBBoxFunc helmholtz_h_calc;
64    ExtBBoxFunc helmholtz_a_calc;
65    
66  /*------------------------------------------------------------------------------  /*------------------------------------------------------------------------------
67    GLOBALS    GLOBALS
# Line 71  static symchar *helmholtz_symbols[1]; Line 73  static symchar *helmholtz_symbols[1];
73    
74  static const char *helmholtz_p_help = "Calculate pressure from temperature and density, using Helmholtz fundamental correlation";  static const char *helmholtz_p_help = "Calculate pressure from temperature and density, using Helmholtz fundamental correlation";
75  static const char *helmholtz_u_help = "Calculate specific internal energy from temperature and density, using Helmholtz fundamental correlation";  static const char *helmholtz_u_help = "Calculate specific internal energy from temperature and density, using Helmholtz fundamental correlation";
76    static const char *helmholtz_s_help = "Calculate specific entropy from temperature and density, using Helmholtz fundamental correlation";
77  static const char *helmholtz_h_help = "Calculate specific enthalpy from temperature and density, using Helmholtz fundamental correlation";  static const char *helmholtz_h_help = "Calculate specific enthalpy from temperature and density, using Helmholtz fundamental correlation";
78    static const char *helmholtz_a_help = "Calculate specific Helmholtz energy from temperature and density, using Helmholtz fundamental correlation";
79    
80  /*------------------------------------------------------------------------------  /*------------------------------------------------------------------------------
81    REGISTRATION FUNCTION    REGISTRATION FUNCTION
# Line 102  ASC_EXPORT int helmholtz_register(){ Line 106  ASC_EXPORT int helmholtz_register(){
106    
107      CALCFN(helmholtz_p,2,1);      CALCFN(helmholtz_p,2,1);
108      CALCFN(helmholtz_u,2,1);      CALCFN(helmholtz_u,2,1);
109        CALCFN(helmholtz_s,2,1);
110      CALCFN(helmholtz_h,2,1);      CALCFN(helmholtz_h,2,1);
111        CALCFN(helmholtz_a,2,1);
112    
113  #undef CALCFN  #undef CALCFN
114    
# Line 217  int helmholtz_u_calc(struct BBoxInterp * Line 223  int helmholtz_u_calc(struct BBoxInterp *
223      @param jacobian ignored      @param jacobian ignored
224      @return 0 on success      @return 0 on success
225  */  */
226    int helmholtz_s_calc(struct BBoxInterp *bbox,
227            int ninputs, int noutputs,
228            double *inputs, double *outputs,
229            double *jacobian
230    ){
231        CALCPREPARE;
232    
233        /* first input is temperature, second is molar density */
234        outputs[0] = helmholtz_s(inputs[0], inputs[1], helmholtz_data);
235    
236        /* no need to worry about error states etc. */
237        return 0;
238    }
239    
240    
241    /**
242        Evaluation function for 'helmholtz_h'
243        @param jacobian ignored
244        @return 0 on success
245    */
246  int helmholtz_h_calc(struct BBoxInterp *bbox,  int helmholtz_h_calc(struct BBoxInterp *bbox,
247          int ninputs, int noutputs,          int ninputs, int noutputs,
248          double *inputs, double *outputs,          double *inputs, double *outputs,
# Line 232  int helmholtz_h_calc(struct BBoxInterp * Line 258  int helmholtz_h_calc(struct BBoxInterp *
258  }  }
259    
260    
261    /**
262        Evaluation function for 'helmholtz_h'
263        @param jacobian ignored
264        @return 0 on success
265    */
266    int helmholtz_a_calc(struct BBoxInterp *bbox,
267            int ninputs, int noutputs,
268            double *inputs, double *outputs,
269            double *jacobian
270    ){
271        CALCPREPARE;
272    
273        /* first input is temperature, second is molar density */
274        outputs[0] = helmholtz_a(inputs[0], inputs[1], helmholtz_data);
275    
276        /* no need to worry about error states etc. */
277        return 0;
278    }
279    
280    
281    

Legend:
Removed from v.1902  
changed lines
  Added in v.1903

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