예제 #1
0
def water_2eg_two_pipes(method="nikuradse", results_from="openmodelica"):
    """

    :param results_from: which converted net should be loaded: openmodelica or stanet
    :type results_from: str, default "openmodelica"
    :param method: if results_from = "stanet", which results should be loaded: nikuradse or prandtl-colebrook
    :type method: str, default "nikuradse"
    :return: net - STANET resp. OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_2eg_two_pipes()

    """
    log_result_upon_loading(logger, method=method, converter=results_from)
    net_name = "two_pipes_N.json" if method.lower() in [
        "nikuradse", "n"
    ] else "two_pipes_PC.json"
    if results_from.lower() == "stanet":
        return from_json(
            os.path.join(water_stanet_path, "two_pressure_junctions",
                         net_name))
    return from_json(
        os.path.join(water_modelica_path, "two_pressure_junctions",
                     "two_pipes.json"))
예제 #2
0
def water_tcross_valves(method="colebrook"):
    """
    :param method: Which results should be loaded: prandtl-colebrook or swamee-jain
    :type method: str, default "colebrook"
    :return: net - OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_tcross_valves()

    """
    method_str = log_result_upon_loading(logger, method=method, converter="openmodelica")

    if method_str == "Prandtl-Colebrook":
        return from_json(os.path.join(water_modelica_colebrook_path, "t_cross", "valves.json"))
    return from_json(os.path.join(water_modelica_swamee_path, "t_cross", "valves.json"))
예제 #3
0
def schutterwald(include_houses=True, max_length_house_conn_m=None):
    """
    Load natural gas distribution network for a town in the MV Oberrhein region (cf. pandapower).

    The default pressure is set to 1 bar. Geodata is provided.
    Around 1500 houses are connected with theoretical house connection pipes. It is recommended
    to set a reasonable maximum length for the house connection pipes, e.g. 50 m.

    The corresponding publication in which the net has been provided in the supplementary
    material and more information on building ages etc. can be found here:
    Kisse, J.M.; Braun, M.; Letzgus, S.; Kneiske, T.M. "A GIS-Based Planning Approach for Urban
    Power and Natural Gas Distribution Grids with Different Heat Pump Scenarios".
    Energies 2020, 13, 4052 https://doi.org/10.3390/en13164052

    :param include_houses: Include 1506 houses as sinks. If False, all sinks and respective
                           junctions and connection pipes are dropped.
    :type include_houses: bool, default 'True'
    :param max_length_house_conn_m: Limit the maximum linear distance between houses and
                                    distribution grid. All house connection pipes that are longer
                                    than the given limit are set out of service.
                                    If None, linear connections for all houses are assumed.
    :type max_length_house_conn_m: float, default 'None'
    :return: gas distribution net
    :rtype: pandapipesNet
    """
    net = from_json(
        os.path.join(pp_dir, 'networks', 'network_files',
                     'gas_net_schutterwald_1bar.json'))
    if not include_houses:
        drop_junctions(net, net.sink.junction.values)

    if max_length_house_conn_m is not None:
        net.pipe.in_service.loc[(net.pipe.type == "house_connection") & (
            net.pipe.length_km > max_length_house_conn_m / 1000)] = False
    return net
예제 #4
0
def water_meshed_delta(results_from="openmodelica"):
    """

    :param results_from: which converted net should be loaded: openmodelica or stanet
    :type results_from: str, default "openmodelica"
    :return: net - STANET resp. OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_meshed_delta(results_from="stanet")

    """
    log_result_upon_loading(logger, method="n", converter=results_from)
    if results_from.lower() == "stanet":
        return from_json(
            os.path.join(water_stanet_path, "meshed_networks", "delta_N.json"))
    return from_json(
        os.path.join(water_modelica_path, "meshed_networks", "delta.json"))
예제 #5
0
def water_strand_cross(results_from="openmodelica"):
    """

    :param results_from: which converted net should be loaded: openmodelica or stanet
    :type results_from: str, default "openmodelica"
    :return: net - STANET resp. OpenModelica network converted to a pandapipes network (method = "prandtl-colebrook")
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_strand_cross(results_from="stanet")

    """
    log_result_upon_loading(logger, method="pc", converter=results_from)
    if results_from.lower() == "stanet":
        return from_json(
            os.path.join(water_stanet_path, "strand_net", "cross_PC.json"))
    return from_json(
        os.path.join(water_modelica_path, "strand_net", "cross_3ext.json"))
예제 #6
0
def heat_transfer_one_pipe():
    """

    :return: net - OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.heat_transfer_one_pipe()

    """
    return from_json(os.path.join(heat_tranfer_modelica_path, "one_pipe.json"))
예제 #7
0
def water_strand_pump():
    """

    :return: net - STANET network converted to a pandapipes network  (method = "nikuradse")
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_meshed_pump()

    """
    log_result_upon_loading(logger, method="n", converter="stanet")
    return from_json(os.path.join(water_stanet_path, "strand_net", "pump_N.json"))
예제 #8
0
def water_strand_net_2pumps():
    """

    :return: net - OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_strand_net_2pumps()

    """
    return from_json(
        os.path.join(water_modelica_path, "strand_net", "two_pumps.json"))
예제 #9
0
def gas_meshed_delta():
    """

    :return: net - STANET network converted to a pandapipes network (method = "prandtl-colebrook")
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_gas_networks.gas_meshed_delta()

    """
    log_result_upon_loading(logger, method="pc", converter="stanet")
    return from_json(
        os.path.join(gas_stanet_path, "meshed_networks", "delta_PC.json"))
예제 #10
0
def water_combined_versatility(results_from="openmodelica", method="colebrook"):
    """

    :param results_from: Which converted net should be loaded: openmodelica or stanet
    :type results_from: str, default "openmodelica"
    :param method: results_from = "stanet" -> nikuradse or prandtl-colebrook, results_from = "openmodelica" -> prandtl-colebrook or swamee-jain
    :type method: str, default "colebrook"
    :return: net - STANET resp. OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_combined_versatility(method="")

    """
    method_str = log_result_upon_loading(logger, method=method, converter=results_from)
    if results_from.lower() == "stanet":
        net_name = "versatility_N.json" if method_str == "Nikuradse" else "versatility_PC.json"
        return from_json(os.path.join(water_stanet_path, "combined_networks", net_name))

    if method_str == "Prandtl-Colebrook":
        return from_json(os.path.join(water_modelica_colebrook_path, "combined_networks", "versatility.json"))
    return from_json(os.path.join(water_modelica_swamee_path, "combined_networks", "versatility.json"))
예제 #11
0
def water_tcross_valves():
    """

    :return: net - OpenModelica network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_tcross_valves()

    """
    log_result_upon_loading(logger, method="", converter="openmodelica")
    return from_json(
        os.path.join(water_modelica_path, "t_cross", "valves.json"))
예제 #12
0
def gas_versatility():
    """

    :return: net - STANET network converted to a pandapipes network (method = "prandtl-colebrook")
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_gas_networks.gas_versatility()

    """
    log_result_upon_loading(logger, method="pc", converter="stanet")
    net_name = "versatility_PC.json"
    return from_json(
        os.path.join(gas_stanet_path, "combined_networks", net_name))
예제 #13
0
def water_district_grid(method="nikuradse"):
    """

    :param method: Which results should be loaded: nikuradse or prandtl-colebrook
    :type method: str, default "nikuradse"
    :return: net - STANET network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_water_networks.water_district_grid(method="pc")

    """
    method_str = log_result_upon_loading(logger, method=method, converter="stanet")
    net_name = "district_N.json" if method_str == "Nikuradse" else "district_PC.json"
    return from_json(os.path.join(water_stanet_path, "combined_networks", net_name))
예제 #14
0
def gas_one_pipe2(method="nikuradse"):
    """

    :param method: Which results should be loaded: nikuradse or prandtl-colebrook
    :type method: str, default "nikuradse"
    :return: net - STANET network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_gas_networks.gas_one_pipe2()

    """
    log_result_upon_loading(logger, method=method, converter="stanet")
    net_name = "pipe_2_N.json" if method.lower() in ["nikuradse", "n"
                                                     ] else "pipe_2_PC.json"
    return from_json(os.path.join(gas_stanet_path, "one_pipe", net_name))
예제 #15
0
def gas_2eg_hnet(method="nikuradse"):
    """

    :param method: If results_from = "stanet", which results should be loaded: nikuradse or prandtl-colebrook
    :type method: str, default "nikuradse"
    :return: net - STANET network converted to a pandapipes network
    :rtype: pandapipesNet

    :Example:
        >>> pandapipes.networks.simple_gas_networks.gas_2eg_hnet(method="n")

    """
    log_result_upon_loading(logger, method=method, converter="stanet")
    net_name = "H_net_N.json" if method.lower() in ["nikuradse", "n"
                                                    ] else "H_net_PC.json"
    return from_json(
        os.path.join(gas_stanet_path, "two_pressure_junctions", net_name))