/[ascend]/trunk/models/steam/dsgsat2.a4c
ViewVC logotype

Diff of /trunk/models/steam/dsgsat2.a4c

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

revision 1048 by johnpye, Fri Jan 5 11:15:16 2007 UTC revision 1049 by johnpye, Fri Jan 5 13:45:13 2007 UTC
# Line 121  METHOD on_load; Line 121  METHOD on_load;
121          RUN node[i].bound_self;          RUN node[i].bound_self;
122      END FOR;      END FOR;
123      RUN values;      RUN values;
124        RUN ode_init;
125      EXTERNAL solvernotes(SELF);      EXTERNAL solvernotes(SELF);
126      (* RUN ode_init;      (* RUN ode_init;
127      RUN solve; *) (* after fixing the states and freeing the derivatives *)      RUN solve; *) (* after fixing the states and freeing the derivatives *)
128  END on_load;  END on_load;
129  METHOD ode_init;  METHOD fixed_states;
     (* get the model into the required state for solving as ODE *)  
     t.ode_type := -1;  
130      t := 0 {s};      t := 0 {s};
131      qdot_s := 10 {W/m};      qdot_s := 10 {W/m};
132      FOR i IN [2..n] DO      FOR i IN [2..n] DO
133          FREE drho_dt[i];  FREE node[i].rho;          FREE drho_dt[i];  FIX node[i].rho;
134          FREE dmdot_dt[i]; FREE node[i].mdot;          FREE dmdot_dt[i]; FIX node[i].mdot;
135          FREE drhou_dt[i]; FREE rhou[i];          FREE drhou_dt[i]; FIX rhou[i];
136          FREE dTw_dt[i];   FREE T_w[i];          FREE dTw_dt[i];   FIX T_w[i];
137        END FOR;
138    END free_derivs;
139    METHOD fixed_derivs;
140        FOR i IN [2..n] DO
141            FIX drho_dt[i];  FREE node[i].rho;
142            FIX dmdot_dt[i]; FREE node[i].mdot;
143            FIX drhou_dt[i]; FREE rhou[i];
144            FIX dTw_dt[i];   FREE T_w[i];
145      END FOR;      END FOR;
146    END fix_states;
147    METHOD ode_init;
148        (* get the model into the required state for solving as ODE *)
149        t.ode_type := -1;
150    
151      FOR i IN [2..n] DO      FOR i IN [2..n] DO
152          drho_dt[i].ode_id := 4*i;     node[i].rho.ode_id := 4*i;          drho_dt[i].ode_id := 4*i;     node[i].rho.ode_id := 4*i;
# Line 173  METHOD fix_outlet_quality; Line 184  METHOD fix_outlet_quality;
184      FREE node[1].mdot;      FREE node[1].mdot;
185  END fix_outlet_quality;  END fix_outlet_quality;
186    
187    METHOD reinit;
188        RUN on_load;
189        EXTERNAL solve(SELF);
190        RUN fixed_states;
191    END reinit;
192    
193  END dsgsat2;  END dsgsat2;
194  ADD NOTES IN dsgsat2;  ADD NOTES IN dsgsat2;
195      'QRSlv' iterationlimit {50}      'QRSlv' iterationlimit {50}

Legend:
Removed from v.1048  
changed lines
  Added in v.1049

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