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

revision 758 by johnpye, Thu Jul 13 01:15:58 2006 UTC revision 772 by johnpye, Fri Jul 14 06:03:47 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 *)
14        node[1..n].rhow ARE_THE_SAME;
15        node[1..n].D2 ARE_THE_SAME;
16        node[1..n].cw ARE_THE_SAME;
17        node[1..n].hw ARE_THE_SAME;
18        node[1..n].qdots ARE_THE_SAME;
19        node[1..n].Tamb ARE_THE_SAME;
20
21      (* central difference *)      (* central difference *)
(*
22      FOR i IN [2..(n-1)] CREATE      FOR i IN [2..(n-1)] CREATE
23          node[i].dp_dz = (node[i+1].p - node[i-1].p)/(2*dz);          node[i].dp_dz = (node[i+1].p - node[i-1].p)/(2*dz);
24          node[i].dmdot_dz = (node[i+1].mdot - node[i-1].mdot)/(2*dz);          node[i].dmdot_dz = (node[i+1].mdot - node[i-1].mdot)/(2*dz);
# Line 19  MODEL dsg_array; Line 26  MODEL dsg_array;
26          node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i-1].rhovel2)/(2*dz);          node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i-1].rhovel2)/(2*dz);
27          node[i].dekdot_dz = (node[i+1].ekdot - node[i-1].ekdot)/(2*dz);          node[i].dekdot_dz = (node[i+1].ekdot - node[i-1].ekdot)/(2*dz);
28      END FOR;      END FOR;
*)
29
30      (* backward difference *)      (* backward difference *)
31      FOR i IN [2..n] CREATE      FOR i IN [n] CREATE
32          dz_p[i]:       node[i].dp_dz = (node[i].p - node[i-1].p)/dz;          dz_p[i]:       node[i].dp_dz = (node[i].p - node[i-1].p)/dz;
33          dz_mdot[i]:    node[i].dmdot_dz = (node[i].mdot - node[i-1].mdot)/dz;          dz_mdot[i]:    node[i].dmdot_dz = (node[i].mdot - node[i-1].mdot)/dz;
34          dz_mdoth[i]:   node[i].dmdoth_dz = (node[i].mdoth - node[i-1].mdoth)/dz;          dz_mdoth[i]:   node[i].dmdoth_dz = (node[i].mdoth - node[i-1].mdoth)/dz;
# Line 31  MODEL dsg_array; Line 37  MODEL dsg_array;
37      END FOR;      END FOR;
38
39      (* forward difference *)      (* forward difference *)
(*
40      FOR i IN [1] CREATE      FOR i IN [1] CREATE
41          node[i].dp_dz = (node[i+1].p - node[i].p)/dz;          node[i].dp_dz = (node[i+1].p - node[i].p)/dz;
42          node[i].dmdot_dz = (node[i+1].mdot - node[i].mdot)/dz;          node[i].dmdot_dz = (node[i+1].mdot - node[i].mdot)/dz;
# Line 39  MODEL dsg_array; Line 44  MODEL dsg_array;
44          node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i].rhovel2)/dz;          node[i].drhovel2_dz = (node[i+1].rhovel2 - node[i].rhovel2)/dz;
45          node[i].dekdot_dz = (node[i+1].ekdot - node[i].ekdot)/dz;          node[i].dekdot_dz = (node[i+1].ekdot - node[i].ekdot)/dz;
46      END FOR;      END FOR;
*)
47
48  METHODS  METHODS
49  METHOD specify;  METHOD specify;
50        FIX dz;
51      FOR i IN [1..n] DO      FOR i IN [1..n] DO
52          RUN node[i].specify;          RUN node[i].fix_design;
53            RUN node[i].fix_states;
54      END FOR;      END FOR;
55        RUN node[1].fix_temporals;
56        RUN node[2].fix_temporals;
57  END specify;  END specify;
58
59  METHOD values;  METHOD values;
60        dz := 1.0 {m};
61      FOR i IN [1..n] DO      FOR i IN [1..n] DO
62          RUN node[i].values;          RUN node[i].values;
63      END FOR;      END FOR;

Legend:
 Removed from v.758 changed lines Added in v.772