/[ascend]/branches/jacob/models/johnpye/fprops/jacob_mix_test1--whole-mix1.a4c
ViewVC logotype

Annotation of /branches/jacob/models/johnpye/fprops/jacob_mix_test1--whole-mix1.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3049 - (hide annotations) (download) (as text)
Fri Aug 7 00:54:02 2015 UTC (4 years, 1 month ago) by jacob
Original Path: branches/jacob/models/johnpye/fprops/jacob_mixture_test1.a4c
File MIME type: text/x-ascend
File size: 1157 byte(s)
Wrote new (phase-handling) property functions in 'mixture_properties.c'; tested & compared to older (one-phase) preliminary forms of property functions from 'init_mixfuncs.c'.

Tested property functions as created by macro(s) in 'mixture_properties.c' (mathematics are the same for many properties, but I wanted to check that ), for several conditions.

Added property functions to library to find density, internal energy, enthalpy for the whole mixture and mixture phases.

1 jacob 2980 (* Outline of ASCEND multi-component ideal-solution routine *)
2    
3     REQUIRE "atoms.a4l";
4     REQUIRE "johnpye/thermo_types.a4c";
5 jacob 2988 IMPORT "johnpye/fprops/mixture";
6 jacob 3049 REQUIRE "johnpye/fprops/mixtures.a4l";
7 jacob 2980
8 jacob 3049 (* The mixture_test model *)
9 jacob 2988 MODEL mixture_test; (* ///1 *)
10 jacob 3002 T IS_A temperature;
11 jacob 2980 p IS_A pressure;
12 jacob 2988 rho IS_A mass_density;
13 jacob 2980
14 jacob 2988 mixt IS_A mixture_spec;
15     mixt.npure :== 3;
16     mixt.components[1] :== 'ammonia';
17     mixt.components[2] :== 'carbondioxide';
18     mixt.components[3] :== 'cyclohexane';
19 jacob 3034 mixt.eos :== 'pengrob';
20 jacob 3040 mixt.xs[1] :== 0.4;
21     mixt.xs[2] :== 0.35;
22     mixt.xs[3] :== 0.25;
23 jacob 2980
24 jacob 3049 (*
25     phase_xs[1..3][1..mixt.npure] IS_A mass_fraction;
26     phase_frac[1..3] IS_A mass_fraction;
27     phase_rho[1..3][1..mixt.npure] IS_A mass_density;
28     *)
29    
30 jacob 2980 mix_density : mixture_rho(
31     T, p : INPUT;
32     rho : OUTPUT;
33 jacob 2988 mixt : DATA
34     );
35 jacob 2980
36     METHODS
37 jacob 2988 METHOD specify; (* ///2 *)
38 jacob 3049 (*RUN mixt.specify;*)
39 jacob 2988 FIX T;
40     FIX p;
41     END specify;
42     METHOD values; (* ///2 *)
43     T := 300 {K} + 273.15 {K};
44     p := 2 {bar};
45     END values;
46     METHOD options; (* ///2 *)
47     SOLVER QRSlv;
48     OPTION convopt 'RELNOM_SCALE';
49     END options;
50     METHOD setup; (* ///2 *)
51     RUN specify;
52     RUN values;
53     RUN options;
54     END setup;
55     END mixture_test; (* //\1 *)

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