add_nodes_from_dictionaries#

NetworkObject.add_nodes_from_dictionaries(nodes)#

Add nodes to the network from dictionary.

Parameters:
nodeslist or dict

A dictionary or list of dictionaries containing nodes to add to the network. Different node types require different key and value pairs:

  • Face nodes must contain the "ID" key associated with an integer containing the face ID. Optional keys and values pairs are:

    • "ThermalResistance": a string specifying the type of thermal resistance.

      Options are "NoResistance" (default), "Compute", and "Specified".

    • "Thickness": a string with the thickness value and unit (required if "Compute"

    is selected for "ThermalResistance"). - "Material": a string with the name of the material (required if "Compute" is selected for "ThermalResistance"). - "Resistance": a string with the resistance value and unit (required if

    "Specified" is selected for "ThermalResistance").

    • "Name": a string with the name of the node. If not

      specified, a name is generated automatically.

  • Internal nodes must contain the following keys and values pairs:

    • "Name": a string with the node name

    • "Power": a string with the assigned power or a dictionary for transient or

    temperature-dependent assignment Optional keys and values pairs: - "Mass": a string with the mass value and unit - "SpecificHeat": a string with the specific heat value and unit

  • Boundary nodes must contain the following keys and values pairs:

    • "Name": a string with the node name

    • "ValueType": a string specifying the type of value ("Power" or

    "Temperature") Depending on the "ValueType" choice, one of the following keys and values pairs must be used: - "Power": a string with the power value and unit or a dictionary for transient or temperature-dependent assignment - "Temperature": a string with the temperature value and unit or a dictionary for transient or temperature-dependent assignment According to the "ValueType" choice, "Power" or "Temperature" key must be used. Their associated value a string with the value and unit of the quantity prescribed or a dictionary for transient or temperature dependent assignment.

All the temperature dependent or thermal dictionaries should contain three keys: "Type", "Function", and "Values". Accepted "Type" values are: "Temp Dep" and "Transient". Accepted "Function" are: "Linear", "Power Law", "Exponential", "Sinusoidal", "Square Wave", and "Piecewise Linear". "Temp Dep" only support the latter. "Values" contains a list of strings containing the parameters required by the "Function" selection (e.g. "Linear" requires two parameters: the value of the variable at t=0 and the slope of the line). The parameters required by each Function option is in Icepak documentation. The parameters must contain the units where needed.

Returns:
bool

True if successful. False otherwise.

Examples

>>> import ansys.aedt.core
>>> app = ansys.aedt.core.Icepak()
>>> network = ansys.aedt.core.modules.boundary.Network(app)
>>> box = app.modeler.create_box([5, 5, 5],[20, 50, 80])
>>> faces_ids = [face.id for face in box.faces]
>>> nodes_dict = [
>>>         {"FaceID": faces_ids[0]},
>>>         {"Name": "TestNode", "FaceID": faces_ids[1],
>>>          "ThermalResistance": "Compute", "Thickness": "2mm"},
>>>         {"FaceID": faces_ids[2], "ThermalResistance": "Specified", "Resistance": "2cel_per_w"},
>>>         {"Name": "Junction", "Power": "1W"}]
>>> network.add_nodes_from_dictionaries(nodes_dict)