/[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 329 by johnpye, Fri Feb 24 02:04:49 2006 UTC revision 330 by johnpye, Sun Feb 26 05:48:10 2006 UTC
# Line 583  END bound_self; Line 583  END bound_self;
583    
584  END iapws95_2phase;      END iapws95_2phase;    
585    
586    (*
587        the following models are me trying to work out a robust way of calculating
588        properties in terms of (p,h).
589    
590        Art suggested that I must first solve for a related point in terms (T,rho)
591        (the 'natural parameters' then reorganise and solve for (p,h) at the
592        point I need.
593    *)
594    
595    (*
596        Superheaded region in terms of (p,h).
597        First load and run 'default_self' then solve. Then run 'default_ph' and
598        try to solve again -- fails.
599    *)
600  MODEL iapws95_2phase_ph_test REFINES iapws95_2phase;  MODEL iapws95_2phase_ph_test REFINES iapws95_2phase;
601    
602  METHODS  METHODS
603  METHOD specify;  METHOD specify;
604      FIX p,h;      FIX T, rho;
605  END specify;  END specify;
606    
607  METHOD values;  METHOD values;
608        T := 452 {K};
609        x := 1;
610        rho := 4 {kg/m^3};
611    END values;
612    
613    METHOD specify_ph;
614        FIX p,h;
615    END specify_ph;
616    METHOD values_ph;
617      p := 10 {bar};      p := 10 {bar};
618      h := 2998 {kJ/kg};      h := 2998 {kJ/kg};
619  END values;  END values_ph;
620        
621    METHOD default_ph;
622        RUN ClearAll; RUN specify_ph; RUN values_ph;
623    END default_ph;
624    
625  METHOD self_test;  METHOD self_test;
626      ASSERT abs(T - 548.15 {K}) < 1 {K};      ASSERT abs(T - 548.15 {K}) < 1 {K};
627      ASSERT abs(rho - 8.43 {kg/m^3}) < 0.2 {kg/m^3};      ASSERT abs(rho - 8.43 {kg/m^3}) < 0.2 {kg/m^3};
# Line 602  END self_test; Line 629  END self_test;
629            
630  END iapws95_2phase_ph_test;  END iapws95_2phase_ph_test;
631    
632    (*
633        Subcooled. This one works: run the 'default_self' then solve. Then
634        run 'default_ph' and solve: it converges fine.
635    *)
636  MODEL iapws95_2phase_ph_test2 REFINES iapws95_2phase;  MODEL iapws95_2phase_ph_test2 REFINES iapws95_2phase;
637    
638  METHODS  METHODS
639  METHOD specify;  METHOD specify;
640      FIX p,h;      FIX T,rho;
641  END specify;  END specify;
642  METHOD values;  METHOD values;
643        T := 290 {K};
644        rho := 999 {kg/m^3};
645    END values;
646    METHOD default_ph;
647        RUN ClearAll; RUN specify_ph; RUN values_ph;
648    END default_ph;
649    METHOD specify_ph;
650        FIX p,h;
651    END specify_ph;
652    METHOD values_ph;
653      p := 10 {bar};      p := 10 {bar};
654      h := 418.7 {kJ/kg};      h := 418.7 {kJ/kg};
655  END values;  END values_ph;
656  METHOD self_test;  METHOD self_test;
657      ASSERT abs(T - 373.15 {K}) < 1 {K};      ASSERT abs(T - 373.15 {K}) < 1 {K};
658      ASSERT abs(rho - 959 {kg/m^3}) < 3 {kg/m^3};      ASSERT abs(rho - 959 {kg/m^3}) < 3 {kg/m^3};

Legend:
Removed from v.329  
changed lines
  Added in v.330

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