/[ascend]/trunk/test.py
ViewVC logotype

Diff of /trunk/test.py

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

revision 1265 by johnpye, Thu Feb 1 13:54:56 2007 UTC revision 1266 by johnpye, Fri Feb 2 22:32:20 2007 UTC
# Line 585  class TestSteam(AscendSelfTester): Line 585  class TestSteam(AscendSelfTester):
585      def testpeturblsode(self):      def testpeturblsode(self):
586          "test that steady conditions are stable with LSODE"          "test that steady conditions are stable with LSODE"
587          M = self.testdsgsat()          M = self.testdsgsat()
588            # here is the peturbation...
589          M.qdot_s.setRealValueWithUnits(1000,"W/m")          M.qdot_s.setRealValueWithUnits(1000,"W/m")
590          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
         #M.setParameter('  
591          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
592          I.setEngine('LSODE')          I.setEngine('LSODE')
593          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
# Line 609  class TestSteam(AscendSelfTester): Line 609  class TestSteam(AscendSelfTester):
609          I.setInitialSubStep(0.01)          I.setInitialSubStep(0.01)
610          I.setMaxSubSteps(100)                I.setMaxSubSteps(100)      
611          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
612          I.setLinearTimesteps(ascpy.Units("s"), 0, 3600, 100)          I.setLinearTimesteps(ascpy.Units("s"), 0, 3600, 5)
613          try:          try:
614              I.analyse()              I.analyse()
615          except Exception,e:          except Exception,e:
# Line 621  class TestSteam(AscendSelfTester): Line 621  class TestSteam(AscendSelfTester):
621          M.qdot_s.setRealValueWithUnits(1000,"W/m")          M.qdot_s.setRealValueWithUnits(1000,"W/m")
622          self.assertAlmostEqual(M.qdot_s.as("W/m"),1000)          self.assertAlmostEqual(M.qdot_s.as("W/m"),1000)
623          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
624            print "dTw/dt = %f" % M.dTw_dt[2]
625          self.assertNotAlmostEqual(M.dTw_dt[2],0.0)          self.assertNotAlmostEqual(M.dTw_dt[2],0.0)
626    
627        def testpeturbida(self):    
628            M = self.testdsgsat()
629            self.assertAlmostEqual(M.dTw_dt[2],0.0)
630            T = self.L.findType('dsgsat3')
631            M.run(T.getMethod('free_states'))
632            # here is the peturbation...
633            M.qdot_s.setRealValueWithUnits(2000,"W/m")
634            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
635        
636            I = ascpy.Integrator(M)
637            I.setEngine('IDA')
638            I.setParameter('linsolver','DENSE')
639            I.setParameter('safeeval',True)
640            I.setParameter('rtol',1e-5)
641            I.setReporter(ascpy.IntegratorReporterConsole(I))
642            I.setLinearTimesteps(ascpy.Units("s"), 0, 10000, 10)
643            I.analyse()
644            I.solve()
645            
646  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
647  # Testing of freesteam external steam properties functions  # Testing of freesteam external steam properties functions
648    

Legend:
Removed from v.1265  
changed lines
  Added in v.1266

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