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

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

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

revision 165 by johnpye, Fri Dec 23 00:59:32 2005 UTC revision 166 by johnpye, Thu Jan 5 09:51:50 2006 UTC
# Line 505  END self_test; Line 505  END self_test;
505  END iapws95_1phase;  END iapws95_1phase;
506    
507  MODEL iapws95_2phase REFINES thermo_state;  MODEL iapws95_2phase REFINES thermo_state;
508        (* phase components *)
509      Sf IS_A iapws95_1phase;      Sf IS_A iapws95_1phase;
510      Sg IS_A iapws95_1phase;      Sg IS_A iapws95_1phase;
511        xf IS_A fraction;
512        xg IS_A fraction;
513        xfslack IS_A fraction;
514        xgslack IS_A fraction;
515        
516        z01: xf + xg = 1.0;
517    
518        (* complementarity... ??? *)
519        z02: xf * xfslack = 0.0; (* xfslack must be zero, else xf must be zero (ie no liquid) *)
520        z03: xg * xgslack = 0.0; (* xgslack must be zero, else xg must be zero (ie no gas) *)
521        (* so, if we have a non-zero slack variable, that phase will have disappeared and we don't need to worry! *)
522        
523        (* saturation conditions *)
524      sat IS_A iapws_sat_curves;      sat IS_A iapws_sat_curves;
525      sat.rhof, Sf.rho ARE_THE_SAME;      sat.rhof, Sf.rho ARE_THE_SAME;
526      sat.rhog, Sg.rho ARE_THE_SAME;      sat.rhog, Sg.rho ARE_THE_SAME;
# Line 516  MODEL iapws95_2phase REFINES thermo_stat Line 530  MODEL iapws95_2phase REFINES thermo_stat
530      T, Sf.T ARE_THE_SAME;      T, Sf.T ARE_THE_SAME;
531      p, Sf.p ARE_THE_SAME;      p, Sf.p ARE_THE_SAME;
532    
533      x IS_A fraction;      x ALIASES xg;
   
     rhog*rhof = rho*rhog + rho*(rhof - rhog) *x;  
   
     u = Sf.u + (Sg.u -Sf.u) *x;  
534    
535      h = Sf.h + (Sg.h -Sf.h) *x;      z04: rhof * rhog = rho * ( xf * rhog + xg * rhof);
536      s = Sf.s + (Sg.s -Sf.s) *x;      z05: u =  xf * Sf.u  + xg * Sg.u;
537      cp = Sf.cp + (Sg.cp -Sf.cp) *x;      z06: h  = xf * Sf.h  + xg * Sg.h;
538      cv = Sf.cv + (Sg.cv -Sf.cv) *x;      z07: s  = xf * Sf.s  + xg * Sg.s;
539      w = Sf.w + (Sg.w - Sf.w) *x; (* check this *)      z08: cp = xf * Sf.cp + xg * Sg.cp;
540        z09: cv = xf * Sf.cv + xg * Sg.cv;
541        z10: w  = xf * Sf.w  + xg * Sg.w; (* check this *)
542  METHODS  METHODS
543    
544  METHOD default_self;  METHOD default_self;
# Line 547  END values; Line 559  END values;
559            
560  END iapws95_2phase;      END iapws95_2phase;    
561    
562    (*
563  MODEL iapws95 REFINES thermo_state;  MODEL iapws95 REFINES thermo_state;
564      S1 IS_A iapws95_1phase;      S1 IS_A iapws95_1phase;
565      S2 IS_A iapws95_2phase;      S2 IS_A iapws95_2phase;

Legend:
Removed from v.165  
changed lines
  Added in v.166

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