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

Diff of /trunk/test.py

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

revision 1264 by johnpye, Sun Jan 28 01:49:38 2007 UTC revision 1265 by johnpye, Thu Feb 1 13:54:56 2007 UTC
# Line 569  class TestSteam(AscendSelfTester): Line 569  class TestSteam(AscendSelfTester):
569          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
570          return M          return M
571    
572      def testintegLSODE(self):      def teststeadylsode(self):
573            "test that steady conditions are stable with LSODE"
574            M = self.testdsgsat()
575            #M.qdot_s.setRealValueWithUnits(1000,"W/m")
576            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
577            #M.setParameter('
578            I = ascpy.Integrator(M)
579            I.setEngine('LSODE')
580            I.setReporter(ascpy.IntegratorReporterConsole(I))
581            I.setLinearTimesteps(ascpy.Units("s"), 0, 5, 1)
582            I.analyse()
583            I.solve()
584    
585        def testpeturblsode(self):
586            "test that steady conditions are stable with LSODE"
587          M = self.testdsgsat()          M = self.testdsgsat()
588          M.qdot_s.setRealValueWithUnits(1000,"W/m")          M.qdot_s.setRealValueWithUnits(1000,"W/m")
589          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
590          #M.setParameter('          #M.setParameter('
591          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
592          I.setEngine('LSODE')          I.setEngine('LSODE')
         I.setParameter('meth','AM')  
         I.setParameter('maxord',12)  
593          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
594          I.setLinearTimesteps(ascpy.Units("s"), 0, 5, 1)          I.setLinearTimesteps(ascpy.Units("s"), 0, 5, 1)
595          I.analyse()          I.analyse()
596          I.solve()          I.solve()
597    
598      def testintegIDA(self):      def teststeadyida(self):    
599          M = self.testdsgsat()          M = self.testdsgsat()
600          self.assertAlmostEqual(M.dTw_dt[2],0.0)          self.assertAlmostEqual(M.dTw_dt[2],0.0)
601          Tw1 = float(M.T_w[2])          Tw1 = float(M.T_w[2])
# Line 593  class TestSteam(AscendSelfTester): Line 605  class TestSteam(AscendSelfTester):
605          I.setEngine('IDA')          I.setEngine('IDA')
606          I.setParameter('linsolver','DENSE')          I.setParameter('linsolver','DENSE')
607          I.setParameter('safeeval',True)          I.setParameter('safeeval',True)
608          I.setParameter('rtol',1e-8)          I.setParameter('rtol',1e-5)
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))
# Line 610  class TestSteam(AscendSelfTester): Line 622  class TestSteam(AscendSelfTester):
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          self.assertNotAlmostEqual(M.dTw_dt[2],0.0)          self.assertNotAlmostEqual(M.dTw_dt[2],0.0)
625  #       I = ascpy.Integrator(M)  
 #       I.setEngine('LSODE')  
 #       I.setReporter(ascpy.IntegratorReporterConsole(I))  
 #       I.setReporter(ascpy.IntegratorReporterConsole(I))  
 #       I.setLinearTimesteps(ascpy.Units("s"), 0, 5, 100)  
 #       I.setMinSubStep(0.0001)  
 #       I.setMaxSubStep(100)  
 #       I.setInitialSubStep(0.1)  
 #       I.analyse()  
 #       I.solve()  
           
626  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
627  # Testing of freesteam external steam properties functions  # Testing of freesteam external steam properties functions
628    

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

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