Beispiel #1
0
    def create_reach(self,
                     node_2,
                     section,
                     slope=None,
                     inverts=None,
                     length=None,
                     k_minor=None):
        """Create a new :class:`Reach` and assign the node to the upstream end.

        Args:
            node_2 (Node): The node to link at the downstream end.
            section (sections.Section): The cross sectional shape.
            slope (float): The rise/run of the reach, :math:`feet`/:math:`feet`.
            inverts (Tuple[float, float]): The elevations of each bottom end of the reach, in
                :math:`feet`. The first value is the upstream ("from") end, while the second value
                is the downstream ("to") end.
            length (float): The total longitudinal distance, end-to-end, in :math:`feet`.
            k_minor (float): An optional minor loss coefficient for including minor losses.

        Returns:
            hydra.links.Reach: The created instance.

        """
        reach = links.Reach(section,
                            slope,
                            inverts,
                            length,
                            k_minor,
                            node_1=self,
                            node_2=node_2)
        self.reach = reach
        self.links.append(reach)
        return reach
 def setUp(self):
     self.depth = 0.6
     self.section = sections.Trapezoid(l_slope=4.0,
                                       b_width=5.0,
                                       r_slope=6.0,
                                       n=0.06)
     self.channel = links.Reach(section=self.section, slope=0.005)
 def test_practice_problem_9(self):
     # The trapezoidal channel shown has a Manning coefficient of n = 0.013 and is laid at a
     # slope of 0.002. The depth of flow is 2 ft. What is the flow rate?
     # [Picture shows 1:3 slopes and 6 ft bottom]
     s = sections.Trapezoid(l_slope=3.0, b_width=6.0, r_slope=3.0, n=0.013)
     channel = links.Reach(section=s, slope=0.002)
     produced = channel.normal_flow(depth=2.0)
     expected = 150.0  # ft/s
     self.assertAlmostEqual(produced, expected, -1)
 def test_practice_problem_1(self):
     # A wooden flume (n = 0.012) with a rectangular cross section is 2ft wide. The flume carries
     # 3 CFS of water down a 1% slope. What is the depth of flow.
     s = sections.Rectangle(span=2.0, rise=9999.0, n=0.012)
     flume = links.Reach(section=s, slope=0.01)
     flow = 3.0
     produced = flume.normal_depth(flow)
     expected = 0.314  # ft
     self.assertAlmostEqual(produced, expected, 3)
Beispiel #5
0
 def test_same_node_reach_from_init(self):
     network = networks.Network()
     s101 = network.create_node()
     with self.assertRaises(ValueError):
         rc18 = sections.Circle(diameter=1.5, mannings=0.012)
         links.Reach(node_1=s101,
                     node_2=s101,
                     invert_1=8.0,
                     invert_2=7.0,
                     length=300.0,
                     section=rc18)
Beispiel #6
0
    def create_reach(self, node_2, invert_1, invert_2, length, section):
        """Create a new :class:`Reach` and assign the node to the upstream end.

        Args:
            node_2 (Node): The node to link at the downstream end.
            invert_1 (float): The reach bottom elevation at the upstream end, in :math:`feet`.
            invert_2 (float): The reach bottom elevation at the downstream end, in :math:`feet`.
            length (float): The total longitudinal distance, end-to-end, in :math:`feet`.
            section (sections.Section): The cross sectional shape.

        Returns:
            hydra.links.Reach: The created instance.

        """
        reach = links.Reach(invert_1,
                            invert_2,
                            length,
                            section,
                            node_1=self,
                            node_2=node_2)
        self.reach = reach
        self.links.append(reach)
        return reach
 def setUp(self):
     # A 24 in diameter pipe (n = 0.013) was installed 30 years ago on a 0.001 slope. Recent
     # tests indicate that the full-flow capacity of the pipe is 6.0 CFS.
     self.s = sections.Circle(diameter=2.0, n=0.013)
     self.pipe = links.Reach(section=self.s, slope=0.001)