/[ascend]/trunk/models/johnpye/fprops/python/fprops.i
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/python/fprops.i

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2467 - (show annotations) (download)
Fri May 27 06:33:38 2011 UTC (8 years, 6 months ago) by jpye
File size: 1386 byte(s)
Add 'solve_Tx' function for convenience.
Add 'helmholtz_u_raw' and change 'helmholtz_u' so that it tests for saturation conditions.
Fixed pv.py to use new 'fprops_fluid' function.
Add example of solve_Tx function.
Fix separate build of FPROPS (independent of ASCEND).
1 %module fprops
2
3 %feature("autodoc");
4
5 %{
6 #include "../helmholtz.h"
7 #include "../sat.h"
8 #include "../solve_ph.h"
9 #include "../solve_Tx.h"
10 #include "../fluids.h"
11 %}
12
13 %include exception.i
14
15 // strip 'fprops' prefix from function names, since module name is already 'fprops'.
16 //%rename(solve_Tx) fprops_solve_Tx;
17 //%rename(solve_ph) fprops_solve_ph;
18 //%rename(sat_T) fprops_sat_T;
19 //%rename(sat_p) fprops_sat_p;
20 //%rename(fluid) fprops_fluid;
21 //%rename(num_fluids) fprops_num_fluids;
22 //%rename(get_fluid) fprops_get_fluid;
23
24 %include "../helmholtz.h"
25
26 %apply double *OUTPUT {double *p_sat};
27 %apply double *OUTPUT {double *T_sat};
28 %apply double *OUTPUT {double *rho_f};
29 %apply double *OUTPUT {double *rho_g};
30 %include "../sat.h"
31 %clear double *p_sat;
32 %clear double *T_sat;
33 %clear double *rho_f;
34 %clear double *rho_g;
35
36 %apply double *OUTPUT {double *T};
37 %apply double *OUTPUT {double *rho};
38 int fprops_solve_ph(double p, double h, double *T, double *rho, int use_guess, const HelmholtzData *D);
39 %clear double *T;
40 %clear double *rho;
41
42 %apply double *OUTPUT {double *rho};
43 int fprops_solve_Tx(double T, double x, double *rho, const HelmholtzData *D);
44 %clear double *rho;
45
46 %exception;
47
48 %include "../fluids.h"
49
50 /*
51 If you're not using SCons, then try something like...
52 swig -python fprops.i
53 gcc -I /usr/include/python2.5 -shared fprops_wrap.c ../helmholtz.c ../ideal.c ../water.c -o _fprops.so
54 */

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