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

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

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

revision 2460 by jpye, Mon Apr 18 14:39:32 2011 UTC revision 2461 by jpye, Mon Apr 25 09:09:57 2011 UTC
# Line 61  END ideal_gas_node; Line 61  END ideal_gas_node;
61      Add cross-sectional area to the above model; not needed for normal shock      Add cross-sectional area to the above model; not needed for normal shock
62      calculations, but useful in nozzle calcs.      calculations, but useful in nozzle calcs.
63  *)  *)
64  MODEL ideal_gas_duct_node REFINES ideal_gas_node;  MODEL ideal_gas_duct_node;
65        (* we incorporate state as submodel so we can ARE_THE_SAME non-duct nodes *)
66        state IS_A ideal_gas_node;
67        M ALIASES state.M;
68        p ALIASES state.p;
69        T ALIASES state.T;
70        v ALIASES state.v;
71        rho ALIASES state.rho;
72        Vel ALIASES state.Vel;
73        MM ALIASES state.MM;
74        R ALIASES state.R;
75        k ALIASES state.k;
76        c ALIASES state.c;
77    
78      A IS_A area;      A IS_A area;
79      mdot IS_A mass_rate;      mdot IS_A mass_rate;
80      mdot = rho * A * Vel;      mdot = rho * A * Vel;
# Line 80  MODEL air_duct_node REFINES ideal_gas_du Line 93  MODEL air_duct_node REFINES ideal_gas_du
93      k :== 1.4;      k :== 1.4;
94  END air_duct_node;  END air_duct_node;
95    
 (*-----------------------NORMAL SHOCK IN ISENTROPIC FLOW----------------------*)  
   
 (*  
     Model of a stationary normal shock in air. Using a moving frame of  
     reference, it can be used to model a moving shock wave as well.  
   
     Equations from Potter & Wiggert, 3rd SI edition, sects 9.1, 9.2 and 9.4.  
 *)  
 MODEL air_normal_shock;  
     S1, S2 IS_A air_node;  
     k ALIASES S1.k;  
       
     S2.M^2 = ( S1.M^2 + 2/(k-1) ) / (2*k/(k-1)*S1.M^2 - 1);  
   
     S2.p / S1.p = 2*k/(k+1)*S1.M^2 - (k-1)/(k+1);  
   
     S2.T / S1.T = ( 1 + (k-1)/2*S1.M^2) * (2*k/(k-1)*S1.M^2 - 1)/ ((k+1)^2/2/(k-1)*S1.M^2);  
 END air_normal_shock;  
   
 (*------------------------------EXAMPLE MODELS -------------------------------*)  
   
 (*  
     This model reproduces the results of Example 9.5 from Potter & Wiggert,  
     3rd SI edition. The question asks to determine the pressure and temperature  
     conditions downstream of a shock wave passing through ambient air of given  
     state.  
   
     Tested, works OK -- JP  
 *)  
 MODEL example_potter_wiggert_ex_9_5 REFINES air_normal_shock;  
 METHODS  
 METHOD on_load;  
     FIX S1.Vel, S1.p, S1.T;  
     S1.Vel := 450 {m/s};  
     S1.p := 80 {kPa};  
     S1.T := 15 {K} + 273.15 {K};  
 END on_load;  
 END example_potter_wiggert_ex_9_5;  
   
 (*  
     This model reproduces the results of Example 9.5 from Potter & Wiggert,  
     3rd SI edition. This problem shows the wind speeds implicit behind a strong  
     shock wave such as that arising from a high-powered bomb explosions.  
   
     Although the problem as given in P&W can be solved even without doing so,  
     we have added an assumption that the ambient air pressure is 101.3 kPa. This  
     allows the model to be 'square' and the pressure and temperature behind the  
     shock wave (4.83 bar, 500 K) to also be calculated.  
   
     Tested, works OK -- JP  
 *)  
 MODEL example_potter_wiggert_ex_9_6 REFINES air_normal_shock;  
     Vel_induced IS_A speed;  
     Vel_induced = S2.Vel - S1.Vel;  
 METHODS  
 METHOD on_load;  
     FIX S1.Vel, S1.T, S1.p;  
     S1.Vel := 700 {m/s};  
     S1.T := 15 {K} + 273.15 {K};  
     S1.p := 101.3 {kPa};  
 END on_load;  
 END example_potter_wiggert_ex_9_6;  
   
   
96  (*----------------------------STAGNATION CONDITIONS---------------------------*)  (*----------------------------STAGNATION CONDITIONS---------------------------*)
97    
98    
# Line 237  METHOD on_load; Line 186  METHOD on_load;
186  END on_load;  END on_load;
187  END example_potter_wiggert_ex_9_2;  END example_potter_wiggert_ex_9_2;
188    
189    
190  (*  (*
191        Potter & Wiggert 3rd SI ed, Example 9.3.
192      Converging-diverging nozzle with exit 40 cm² and throat 10 cm², with flow      Converging-diverging nozzle with exit 40 cm² and throat 10 cm², with flow
193      coming from reservoir at 20 °C, 500 kPa. Two different exit pressures can      coming from reservoir at 20 °C, 500 kPa. Two different exit pressures can
194      result in M = 1 at the throat -- we calculate what those pressure are.      result in M = 1 at the throat -- we calculate what those pressure are.
     Potter & Wiggert 3rd SI ed, Example 9.3.  
195    
196      For this problem, saturation states are the upstream reservoir, and we      For this problem, saturation states are the upstream reservoir, and we
197      assert that A_star is the throat area and A is the exit area. These areas      assert that A_star is the throat area and A is the exit area. These areas
# Line 277  METHOD on_load; Line 227  METHOD on_load;
227  END on_load;  END on_load;
228  END example_potter_wiggert_ex_9_3;  END example_potter_wiggert_ex_9_3;
229    
230    (*-----------------------NORMAL SHOCK IN ISENTROPIC FLOW----------------------*)
231    
232    (*
233        Model of a stationary normal shock in air. Using a moving frame of
234        reference, it can be used to model a moving shock wave as well.
235    
236        Equations from Potter & Wiggert, 3rd SI edition, sects 9.1, 9.2 and 9.4.
237    *)
238    MODEL air_normal_shock;
239        S1, S2 IS_A air_node;
240        k ALIASES S1.k;
241        
242        S2.M^2 = ( S1.M^2 + 2/(k-1) ) / (2*k/(k-1)*S1.M^2 - 1);
243    
244        S2.p / S1.p = 2*k/(k+1)*S1.M^2 - (k-1)/(k+1);
245    
246        S2.T / S1.T = ( 1 + (k-1)/2*S1.M^2) * (2*k/(k-1)*S1.M^2 - 1)/ ((k+1)^2/2/(k-1)*S1.M^2);
247    END air_normal_shock;
248    
249    MODEL air_duct_normal_shock;
250        S1, S2 IS_A air_duct_node;
251        shock IS_A air_normal_shock;
252        S1.state, shock.S1 ARE_THE_SAME;
253        S2.state, shock.S2 ARE_THE_SAME;
254        S1.A, S2.A ARE_THE_SAME;
255    END air_duct_normal_shock;
256    
257    (*------------------------------EXAMPLE MODELS -------------------------------*)
258    
259    (*
260        This model reproduces the results of Example 9.5 from Potter & Wiggert,
261        3rd SI edition. The question asks to determine the pressure and temperature
262        conditions downstream of a shock wave passing through ambient air of given
263        state.
264    
265        Tested, works OK -- JP
266    *)
267    MODEL example_potter_wiggert_ex_9_5 REFINES air_normal_shock;
268    METHODS
269    METHOD on_load;
270        FIX S1.Vel, S1.p, S1.T;
271        S1.Vel := 450 {m/s};
272        S1.p := 80 {kPa};
273        S1.T := 15 {K} + 273.15 {K};
274    END on_load;
275    END example_potter_wiggert_ex_9_5;
276    
277    (*
278        This model reproduces the results of Example 9.5 from Potter & Wiggert,
279        3rd SI edition. This problem shows the wind speeds implicit behind a strong
280        shock wave such as that arising from a high-powered bomb explosions.
281    
282        Although the problem as given in P&W can be solved even without doing so,
283        we have added an assumption that the ambient air pressure is 101.3 kPa. This
284        allows the model to be 'square' and the pressure and temperature behind the
285        shock wave (4.83 bar, 500 K) to also be calculated.
286    
287        Tested, works OK -- JP
288    *)
289    MODEL example_potter_wiggert_ex_9_6 REFINES air_normal_shock;
290        Vel_induced IS_A speed;
291        Vel_induced = S2.Vel - S1.Vel;
292    METHODS
293    METHOD on_load;
294        FIX S1.Vel, S1.T, S1.p;
295        S1.Vel := 700 {m/s};
296        S1.T := 15 {K} + 273.15 {K};
297        S1.p := 101.3 {kPa};
298    END on_load;
299    END example_potter_wiggert_ex_9_6;
300    
301    (*
302        This model reproduces the results of Example 9.7 from Potter & Wiggert,
303        3rd SI edition. The problem relates to the calculation of outlet conditions
304        and flow rate for a converging-diverging nozzle, given specified upstream
305        reservoir pressure and temperature, given the throat and exit areas, and
306        subject to the fact that there is a normal shock at the nozzle's exit plane.
307    
308        For a shock to exist at the exit, we know that we must have M = 1 at the
309        throat, so A* = A_t.
310    *)
311    MODEL example_potter_wiggert_ex_9_7;
312        noz IS_A isentropic_stagnation;
313        A_star ALIASES noz.A_star;
314        A ALIASES noz.A;
315        p_0 ALIASES noz.p_0;
316        T_0 ALIASES noz.T_0;
317    
318        shock IS_A air_duct_normal_shock;
319        shock.S1, noz.flow ARE_THE_SAME;
320        
321        rec IS_A isentropic_stagnation;
322        rec.flow, shock.S2 ARE_THE_SAME;
323    
324        p_2 ALIASES rec.p;
325        mdot ALIASES noz.mdot;
326    METHODS
327    METHOD on_load;
328        FIX A_star, A;
329        A_star := 5 {cm^2};
330        A := 10 {cm^2};
331        FIX p_0, T_0;
332        p_0 := 90 {kPa};
333        T_0 := 20 {K} + 273.15 {K};
334    END on_load;
335    END example_potter_wiggert_ex_9_7;
336    
337    

Legend:
Removed from v.2460  
changed lines
  Added in v.2461

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