Esempio n. 1
0
    def create_pit_node_entries(cls, net, node_pit, node_name):
        """
        Function which creates pit node entries.

        :param net: The pandapipes network
        :type net: pandapipesNet
        :param node_pit:
        :type node_pit:
        :return: No Output.
        """
        ft_lookup = get_lookup(net, "node", "from_to")
        table_nr = get_table_number(get_lookup(net, "node", "table"),
                                    cls.table_name())
        f, t = ft_lookup[cls.table_name()]

        junctions = net[cls.table_name()]
        junction_pit = node_pit[f:t, :]
        junction_pit[:, :] = np.array([table_nr, 0, L] + [0] * (node_cols - 3))

        junction_pit[:, ELEMENT_IDX] = junctions.index.values
        junction_pit[:, HEIGHT] = junctions.height_m.values
        junction_pit[:, PINIT] = junctions.pn_bar.values
        junction_pit[:, TINIT] = junctions.tfluid_k.values
        junction_pit[:, RHO] = get_fluid(net).get_density(junction_pit[:,
                                                                       TINIT])
        junction_pit[:, PAMB] = p_correction_height_air(junction_pit[:,
                                                                     HEIGHT])
        junction_pit[:, ACTIVE_ND] = junctions.in_service.values
Esempio n. 2
0
    def create_pit_node_entries(cls, net, node_pit, node_name):
        """
        Function which creates pit node entries.

        :param net: The pandapipes network
        :type net: pandapipesNet
        :param node_pit:
        :type node_pit:
        :return: No Output.
        """
        table_nr, int_node_number, int_node_pit, junction_pit, from_junctions, to_junctions = \
            super().create_pit_node_entries(net, node_pit, node_name)
        if table_nr is None:
            return
        int_node_pit[:, HEIGHT] = vinterp(junction_pit[from_junctions, HEIGHT],
                                          junction_pit[to_junctions, HEIGHT],
                                          int_node_number)
        int_node_pit[:, PINIT] = vinterp(junction_pit[from_junctions, PINIT],
                                         junction_pit[to_junctions,
                                                      PINIT], int_node_number)
        int_node_pit[:, TINIT_NODE] = vinterp(
            junction_pit[from_junctions, TINIT_NODE],
            junction_pit[to_junctions, TINIT_NODE], int_node_number)
        int_node_pit[:, PAMB] = p_correction_height_air(int_node_pit[:,
                                                                     HEIGHT])
        int_node_pit[:, RHO_NODES] = get_fluid(net).get_density(
            int_node_pit[:, TINIT_NODE])
        int_node_pit[:, ACTIVE_ND] = np.repeat(
            net[cls.table_name()][cls.active_identifier()].values,
            int_node_number)