- Timestamp:
- Dec 7, 2010, 5:03:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/test_inlet_operator.py
r8079 r8092 9 9 import anuga 10 10 11 from anuga.utilities.system_tools import get_pathname_from_package12 from anuga.structures.boyd_box_operator import Boyd_box_operator13 11 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross 14 12 from anuga.shallow_water.shallow_water_domain import Domain 15 from anuga. shallow_water.forcing import Rainfall, Inflow13 from anuga.abstract_2d_finite_volumes.util import file_function 16 14 17 15 from anuga.structures.inlet_operator import Inlet_operator … … 83 81 return domain 84 82 85 def test_inlet_ Q(self):83 def test_inlet_constant_Q(self): 86 84 """test_inlet_Q 87 85 … … 129 127 assert numpy.allclose((Q1+Q2)*finaltime, vol1-vol0, rtol=1.0e-8) 130 128 129 def test_inlet_variable_Q(self): 130 """test_inlet_Q 131 131 132 This tests that the inlet operator adds the correct amount of water 133 """ 134 135 stage_0 = 11.0 136 stage_1 = 10.0 137 elevation_0 = 10.0 138 elevation_1 = 10.0 139 140 domain_length = 200.0 141 domain_width = 200.0 142 143 144 domain = self._create_domain(d_length=domain_length, 145 d_width=domain_width, 146 dx = 10.0, 147 dy = 10.0, 148 elevation_0 = elevation_0, 149 elevation_1 = elevation_1, 150 stage_0 = stage_0, 151 stage_1 = stage_1) 152 153 vol0 = domain.compute_total_volume() 154 155 finaltime = 3.0 156 line1 = [[95.0, 10.0], [105.0, 10.0]] 157 Q1 = file_function('inlet_operator_test1.tms', quantities=['hydrograph']) 158 159 line2 = [[10.0, 90.0], [20.0, 90.0]] 160 Q2 = file_function('inlet_operator_test2.tms', quantities=['hydrograph']) 161 162 Inlet_operator(domain, line1, Q1) 163 Inlet_operator(domain, line2, Q2) 164 165 for t in domain.evolve(yieldstep = 1.0, finaltime = finaltime): 166 #domain.write_time() 167 #print domain.volumetric_balance_statistics() 168 pass 169 170 171 vol1 = domain.compute_total_volume() 172 173 print vol1 - vol0 174 175 assert numpy.allclose(13.5, vol1-vol0, rtol=1.0e-8) 176 132 177 133 178
Note: See TracChangeset
for help on using the changeset viewer.