/[ascend]/trunk/models/johnpye/dsg.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/dsg.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 736 - (show annotations) (download) (as text)
Wed Jul 5 04:56:26 2006 UTC (14 years, 2 months ago) by johnpye
File MIME type: text/x-ascend
File size: 2498 byte(s)
Relation expressions shown in diagnose window
(click in incidence matrix, then (i) or alt-r)
1 REQUIRE "atoms.a4l";
2 REQUIRE "johnpye/thermo_types.a4c";
3 IMPORT "freesteam";
4 IMPORT "dsg";
5
6 (*
7 This model requires the 'freesteam' library be installed on your system.
8 You must compile it with the 'ASCEND_CONFIG=`which ascend-config`' flag
9 to ensure that the required external library is installed where ASCEND
10 can find it. Alternatively, you can specify the location by adding to the
11 ASCENDLIBRARY path variable
12 *)
13
14 MODEL dsg;
15 (* temporal derivatives *)
16 drho_dt IS_A density_rate;
17 dmdot_dt IS_A mass_rate_rate;
18 drhou_dt IS_A solver_var;
19 dTw_dt IS_A temperature_rate;
20
21 (* spatial derivatives *)
22 dmdot_dz IS_A mass_rate_per_length;
23 dmdoth_dz IS_A solver_var;
24 dekdot_dz IS_A solver_var;
25 dp_dz IS_A pressure_per_length;
26 drhovel2_dz IS_A pressure_per_length;
27
28 (* wall properties *)
29 rhow IS_A mass_density;
30 Aw IS_A area;
31 cw IS_A specific_heat_capacity;
32
33 (* conservation equations *)
34 drho_dt = -1/A * dmdot_dz;
35 1/A * dmdot_dt = -dp_dz - f/D/2*rho*vel^2 - drhovel2_dz;
36 drhou_dt = 1/A * ( qdott - dmdoth_dz + mdot * dekdot_dz );
37 dTw_dt = 1/rhow/Aw/cw * (qdots - qdotl - qdott);
38
39 rho IS_A mass_density;
40 mdot IS_A mass_rate;
41 p IS_A pressure;
42 f IS_A factor; (* pipe friction factor *)
43 u IS_A specific_energy;
44 h IS_A specific_enthalpy;
45 vel IS_A speed;
46 qdott, qdotl,qdots IS_A power_per_length;
47 mu IS_A viscosity;
48 v IS_A specific_volume;
49
50 rho * v = 1;
51
52 thermo_props: iapws97_phmu_uv(
53 u,v : INPUT;
54 p,h,mu : OUTPUT
55 );
56
57 vel = rho*mdot/A;
58
59 A IS_A area;
60
61 Re IS_A factor;
62 Re_rel: Re = rho*vel*D/mu;
63 eps_on_D IS_A factor;
64 eps_on_D_rel: eps_on_D = eps/D;
65
66 D IS_A distance;
67 eps IS_A distance;
68 A = 1{PI}* D^2 / 4;
69
70 friction: dsg_fric_factor_two_phase(
71 Re, eps_on_D : INPUT;
72 f : OUTPUT
73 );
74
75 cavity_losses: dsg_ext_heat_loss(
76 T2 : INPUT;
77 qdotl : OUTPUT
78 );
79
80 Tw,T1,T2 IS_A temperature;
81
82 Tw = (T1 + T2)/2;
83
84 METHODS
85 METHOD on_load;
86 RUN reset;
87 RUN values;
88 END on_load;
89
90 METHOD values;
91 (* derivative variables *)
92 drho_dt := 0 {kg/m^3/s};
93 dmdot_dt := 0 {kg/s/s};
94 drhou_dt := 0 {kg/m^3*kJ/kg/s};
95 dTw_dt := 0 {K/s};
96
97 D := 25 {mm};
98 eps := 0.05 {mm};
99
100 dp_dz := -500 {Pa/m};
101 dmdot_dz := 0 {kg/s/m};
102
103 (* bounds *)
104 f.lower_bound := 0.0;
105 END values;
106
107 METHOD specify;
108 (* derivative variables *)
109 FIX drhou_dt;
110
111 (* design parameters, geometry, materials of construction *)
112 FIX rhow,Aw,cw;
113 FIX D, eps;
114 FIX qdots;
115
116 (* spatial derivs *)
117 FIX dmdot_dz, dmdoth_dz, dekdot_dz, dp_dz, drhovel2_dz;
118
119 (* states *)
120 FIX T1, T2, rho, u, mdot;
121 END specify;
122
123 END dsg;

Properties

Name Value
svn:executable *

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