示例#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_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"))
示例#3
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"))
示例#4
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"))
示例#5
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))
示例#6
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))
示例#7
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))
示例#8
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"))
示例#9
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"))
示例#10
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")

    """
    log_result_upon_loading(logger, method=method, converter="stanet")
    net_name = "district_N.json" if method.lower() in [
        "nikuradse", "n"
    ] else "district_PC.json"
    return from_json(
        os.path.join(water_stanet_path, "combined_networks", net_name))
示例#11
0
def water_combined_versatility(results_from="openmodelica", method="n"):
    """

    :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_combined_versatility(method="")

    """
    log_result_upon_loading(logger, method=method, converter=results_from)
    if results_from.lower() == "stanet":
        net_name = "versatility_N.json" if method.lower() in ["nikuradse", "n"] \
            else "versatility_PC.json"
        return from_json(
            os.path.join(water_stanet_path, "combined_networks", net_name))
    return from_json(
        os.path.join(water_modelica_path, "combined_networks",
                     "versatility.json"))
示例#12
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"))
示例#13
0
def water_meshed_delta(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, 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_meshed_delta(results_from="stanet")

    """
    method = "n" if results_from.lower() == "stanet" else method

    method_str = log_result_upon_loading(logger, method=method, converter=results_from)
    if results_from.lower() == "stanet":
        return from_json(os.path.join(water_stanet_path, "meshed_networks", "delta_N.json"))

    if method_str == "Prandtl-Colebrook":
        return from_json(os.path.join(water_modelica_colebrook_path, "meshed_networks", "delta.json"))
    return from_json(os.path.join(water_modelica_swamee_path, "meshed_networks", "delta.json"))