/[ascend]/branches/fprops2/test.py
ViewVC logotype

Diff of /branches/fprops2/test.py

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

revision 1195 by johnpye, Mon Jan 22 01:30:56 2007 UTC revision 1196 by johnpye, Mon Jan 22 05:41:59 2007 UTC
# Line 512  class TestSteam(AscendSelfTester): Line 512  class TestSteam(AscendSelfTester):
512  #       M = self._run('testiapwssat1',filename='steam/iapwssat.a4c')  #       M = self._run('testiapwssat1',filename='steam/iapwssat.a4c')
513    
514      def testdsgsat(self):      def testdsgsat(self):
515          self.L.load('steam/dsgsat2.a4c')          self.L.load('steam/dsgsat3.a4c')
516          T = self.L.findType('dsgsat2')          T = self.L.findType('dsgsat3')
517          M = T.getSimulation('sim',False)          M = T.getSimulation('sim',False)
518          M.run(T.getMethod('on_load'))          M.run(T.getMethod('on_load'))
519          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
# Line 540  class TestSteam(AscendSelfTester): Line 540  class TestSteam(AscendSelfTester):
540          M = self.testdsgsat()          M = self.testdsgsat()
541          self.assertAlmostEqual(M.dTw_dt[2],0.0)          self.assertAlmostEqual(M.dTw_dt[2],0.0)
542          Tw1 = float(M.T_w[2])          Tw1 = float(M.T_w[2])
543          T = self.L.findType('dsgsat2')          T = self.L.findType('dsgsat3')
544          M.run(T.getMethod('free_states'))          M.run(T.getMethod('free_states'))
545          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
546          I.setEngine('IDA')          I.setEngine('IDA')
# Line 554  class TestSteam(AscendSelfTester): Line 554  class TestSteam(AscendSelfTester):
554          I.setLinearTimesteps(ascpy.Units("s"), 0, 3600, 100)          I.setLinearTimesteps(ascpy.Units("s"), 0, 3600, 100)
555          I.analyse()          I.analyse()
556          I.solve()          I.solve()
         I.analyse()  
         I.solve()  
557          self.assertAlmostEqual(float(M.T_w[2]),Tw1)          self.assertAlmostEqual(float(M.T_w[2]),Tw1)
558          M.qdot_s.setRealValueWithUnits(1000,"W/m")          M.qdot_s.setRealValueWithUnits(1000,"W/m")
559          self.assertAlmostEqual(M.qdot_s.as("W/m"),1000)          self.assertAlmostEqual(M.qdot_s.as("W/m"),1000)

Legend:
Removed from v.1195  
changed lines
  Added in v.1196

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