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

Diff of /trunk/models/johnpye/dsg_array.a4c

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

revision 774 by johnpye, Fri Jul 14 08:01:48 2006 UTC revision 775 by johnpye, Sat Jul 15 07:18:54 2006 UTC
# Line 10  MODEL dsg_array; Line 10  MODEL dsg_array;
10    
11      node[1..n] IS_A dsg;      node[1..n] IS_A dsg;
12            
13      (* consistent design *)      (* design variables shared *)
14      node[1..n].rhow ARE_THE_SAME;      rhow ALIASES node[1].rhow;   node[1..n].rhow ARE_THE_SAME;
15      node[1..n].D2 ARE_THE_SAME;      eps ALIASES node[1].eps;     node[1..n].eps ARE_THE_SAME;
16      node[1..n].cw ARE_THE_SAME;      D ALIASES node[1].D;         node[1..n].D ARE_THE_SAME;
17      node[1..n].hw ARE_THE_SAME;      D2 ALIASES node[1].D2;       node[1..n].D2 ARE_THE_SAME;
18      node[1..n].qdots ARE_THE_SAME;      cw ALIASES node[1].cw;       node[1..n].cw ARE_THE_SAME;
19      node[1..n].Tamb ARE_THE_SAME;      hw ALIASES node[1].hw;       node[1..n].hw ARE_THE_SAME;
20        qdots ALIASES node[1].qdots; node[1..n].qdots ARE_THE_SAME;
21        Tamb ALIASES node[1].Tamb;   node[1..n].Tamb ARE_THE_SAME;
22            
23      (* central difference *)      (* central difference *)
24      FOR i IN [2..(n-1)] CREATE      FOR i IN [2..(n-1)] CREATE
25          node[i].dp_dz = (node[i+1].p - node[i-1].p)/(2*dz);          z_cd_p[i]:      node[i].dp_dz = (node[i+1].p - node[i-1].p)/(2*dz);
26          node[i].dmdot_dz = (node[i+1].mdot - node[i-1].mdot)/(2*dz);          z_cd_mdot[i]:   node[i].dmdot_dz = (node[i+1].mdot - node[i-1].mdot)/(2*dz);
27          node[i].dmdoth_dz = (node[i+1].mdoth - node[i-1].mdoth)/(2*dz);          z_cd_mdoth[i]:  node[i].dmdoth_dz = (node[i+1].mdoth - node[i-1].mdoth)/(2*dz);
28          node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i-1].rhovel2)/(2*dz);          z_cd_rhovel2[i]:node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i-1].rhovel2)/(2*dz);
29          node[i].dekdot_dz = (node[i+1].ekdot - node[i-1].ekdot)/(2*dz);          z_cd_ekdot[i]:  node[i].dekdot_dz = (node[i+1].ekdot - node[i-1].ekdot)/(2*dz);
30      END FOR;      END FOR;
31    
32      (* backward difference *)      (* backward difference *)
33      FOR i IN [n] CREATE      FOR i IN [n] CREATE
34          dz_p[i]:       node[i].dp_dz = (node[i].p - node[i-1].p)/dz;          z_bd_p[i]:       node[i].dp_dz = (node[i].p - node[i-1].p)/dz;
35          dz_mdot[i]:    node[i].dmdot_dz = (node[i].mdot - node[i-1].mdot)/dz;          z_bd_mdot[i]:    node[i].dmdot_dz = (node[i].mdot - node[i-1].mdot)/dz;
36          dz_mdoth[i]:   node[i].dmdoth_dz = (node[i].mdoth - node[i-1].mdoth)/dz;          z_bd_mdoth[i]:   node[i].dmdoth_dz = (node[i].mdoth - node[i-1].mdoth)/dz;
37          dz_rhovel2[i]: node[i].drhovel2_dz = (node[i].rhovel2 - node[i-1].rhovel2)/dz;          z_bd_rhovel2[i]: node[i].drhovel2_dz = (node[i].rhovel2 - node[i-1].rhovel2)/dz;
38          dz_ekdot[i]:   node[i].dekdot_dz = (node[i].ekdot - node[i-1].ekdot)/dz;          z_bd_ekdot[i]:   node[i].dekdot_dz = (node[i].ekdot - node[i-1].ekdot)/dz;
39      END FOR;      END FOR;
40    
41      (* forward difference *)      (* forward difference *)
42      FOR i IN [1] CREATE      FOR i IN [1] CREATE
43          node[i].dp_dz = (node[i+1].p - node[i].p)/dz;          z_fd_p[i]:       node[i].dp_dz = (node[i+1].p - node[i].p)/dz;
44          node[i].dmdot_dz = (node[i+1].mdot - node[i].mdot)/dz;          z_fd_mdot[i]:    node[i].dmdot_dz = (node[i+1].mdot - node[i].mdot)/dz;
45          node[i].dmdoth_dz = (node[i+1].mdoth - node[i].mdoth)/dz;          z_fd_mdoth[i]:   node[i].dmdoth_dz = (node[i+1].mdoth - node[i].mdoth)/dz;
46          node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i].rhovel2)/dz;          z_fd_rhovel2[i]: node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i].rhovel2)/dz;
47          node[i].dekdot_dz = (node[i+1].ekdot - node[i].ekdot)/dz;          z_fd_ekdot[i]:   node[i].dekdot_dz = (node[i+1].ekdot - node[i].ekdot)/dz;
48      END FOR;      END FOR;
49            
50  METHODS  METHODS
51  METHOD specify;  METHOD specify;
52        (* steady state solution, hopefully... *)
53      FIX dz;      FIX dz;
54  (*  FOR i IN [1..n] DO      RUN fix_design;
55          RUN node[i].fix_design;      FOR i IN [1..n] DO
56          RUN node[i].fix_states;          RUN node[i].fix_temporals;
57      END FOR;      END FOR;
     RUN node[1].fix_temporals;  
     RUN node[2].fix_temporals;  
 *)  
58  END specify;  END specify;
59    
60    METHOD fix_design;
61        RUN node[1].fix_design;
62    END fix_design;
63    
64  METHOD values;  METHOD values;
65      dz := 1.0 {m};      dz := 1.0 {m};
66        t := 0 {s};
67      FOR i IN [1..n] DO      FOR i IN [1..n] DO
68          RUN node[i].values;          RUN node[i].values;
69      END FOR;      END FOR;

Legend:
Removed from v.774  
changed lines
  Added in v.775

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