/[ascend]/branches/jacob/models/johnpye/fprops/jacob_mix_test4--bubble-dew2.a4c
ViewVC logotype

Diff of /branches/jacob/models/johnpye/fprops/jacob_mix_test4--bubble-dew2.a4c

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

revision 3078 by jacob, Fri Aug 14 00:03:58 2015 UTC revision 3079 by jacob, Thu Aug 20 02:17:28 2015 UTC
# Line 1  Line 1 
1  (* Outline of ASCEND multi-component ideal-solution routine *)  (* ASCEND multi-component ideal-solution routine
2  (* To perform the simulation, load the file into ASCEND and run 'setup'. *)  
3       To perform the simulation, load the file into ASCEND and run 'setup'.
4    
5       This file performs further dew-point calculations, with the goal of
6       confirming that a user can simply set the temperature equal to the
7       dew or bubble temperature, and find other properties normally.
8    
9       Since temperature is set at the dew temperature, there should be no
10       liquid, or only a negligible amount.
11     *)
12    
13  REQUIRE "atoms.a4l";  REQUIRE "atoms.a4l";
14  REQUIRE "johnpye/thermo_types.a4c";  REQUIRE "johnpye/thermo_types.a4c";
# Line 8  REQUIRE "johnpye/fprops/mixtures.a4l"; Line 17  REQUIRE "johnpye/fprops/mixtures.a4l";
17    
18  (* The mixture_test model *)  (* The mixture_test model *)
19  MODEL mixture_test;  MODEL mixture_test;
20      T IS_A temperature;      (* Declare variables to hold various mixture properties *)
21      p IS_A pressure;      T IS_A temperature;         (* mixture (dew) temperature *)
22        p IS_A pressure;            (* mixture pressure; with 'T' this sets the state *)
23      ii IS_A phase_count;      rho IS_A mass_density;      (* mixture density *)
24      nphase IS_A phase_count;      u,                          (* mixture internal energy *)
25      phase_frac[1..3] IS_A mass_fraction;      u_ph1 IS_A specific_energy; (* phase 1 internal energy *)
26        h IS_A specific_enthalpy;   (* mixture enthalpy *)
27      rho IS_A mass_density;      s IS_A specific_entropy;    (* mixture entropy *)
28      u,  
29      u_ph1 IS_A specific_energy;      (* Declare variables to hold phase-accounting data *)
30      h IS_A specific_enthalpy;      nphase,                              (* number of phases *)
31      s IS_A specific_entropy;      ph IS_A phase_count;                 (* first phase *)
32      (* g,      phase_frac[1..3] IS_A mass_fraction; (* mass fraction of each phase *)
     a IS_A specific_secondary_energy; *)  
33    
34        (* Declare and specify a mixture with its composition *)
35      mixt IS_A mixture_spec;      mixt IS_A mixture_spec;
36      mixt.npure :== 4;      mixt.npure :== 4;
37      mixt.components[1] :== 'ammonia';      mixt.components[1] :== 'ammonia';
# Line 66  MODEL mixture_test; Line 75  MODEL mixture_test;
75          mixt : DATA          mixt : DATA
76      );      );
77      mix_phase_u : mixture_phase_u(      mix_phase_u : mixture_phase_u(
78          T, p, ii : INPUT;          T, p, ph : INPUT;
79          u_ph1 : OUTPUT;          u_ph1 : OUTPUT;
80          mixt : DATA          mixt : DATA
81      );      );
# Line 80  MODEL mixture_test; Line 89  MODEL mixture_test;
89          s : OUTPUT;          s : OUTPUT;
90          mixt : DATA          mixt : DATA
91      );      );
     (* mix_g : mixture_g(  
         T, p : INPUT;  
         g : OUTPUT;  
         mixt : DATA  
     );  
     mix_a : mixture_a(  
         T, p : INPUT;  
         a : OUTPUT;  
         mixt : DATA  
     ); *)  
92            
93  METHODS  METHODS
94    (* Fix the variables that are to be fixed *)
95  METHOD specify;  METHOD specify;
     (* FIX T; *)  
96      FIX p;      FIX p;
97      FIX ii;      FIX ph;
98  END specify;  END specify;
99    (* Set values of the fixed variables *)
100  METHOD values;  METHOD values;
     (* T := 100 {K} + 273.15 {K}; *)  
101      p := 2 {bar};      p := 2 {bar};
102      ii := 1;      ph := 1;
103  END values;  END values;
104    (* Set solver and other options *)
105  METHOD options;  METHOD options;
106      SOLVER QRSlv;      SOLVER QRSlv;
107      OPTION convopt 'RELNOM_SCALE';      OPTION convopt 'RELNOM_SCALE';
108  END options;  END options;
109    (* Quick alias for all preceeding methods; readies the model for solving *)
110  METHOD setup;  METHOD setup;
111      RUN specify;      RUN specify;
112      RUN values;      RUN values;

Legend:
Removed from v.3078  
changed lines
  Added in v.3079

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