Icepak: setup from Sherlock inputs#

This example shows how you can create an Icepak project from Sherlock files (STEP and CSV) and an AEDB board.

Perform required imports#

Perform required imports and set paths.

import time
import os
import pyaedt
import datetime

# Set paths
project_folder = pyaedt.generate_unique_folder_name()
input_dir = pyaedt.downloads.download_sherlock()

Set non-graphical mode#

Set non-graphical mode. "PYAEDT_NON_GRAPHICAL" is needed to generate documentation only. You can set non_graphical value either to True or False.

non_graphical = False

Define variables#

Define input variables. The following code creates all input variables that are needed to run this example.

material_name = "MaterialExport.csv"
component_properties = "TutorialBoardPartsList.csv"
component_step = "TutorialBoard.stp"
aedt_odb_project = "SherlockTutorial.aedt"
aedt_odb_design_name = "PCB"
stackup_thickness = 2.11836
outline_polygon_name = "poly_14188"

Launch AEDT#

Launch AEDT 2023 R1 in graphical mode.

Create Icepak project#

Create an Icepak project.

ipk = pyaedt.Icepak(project_name)

Delete region to speed up import#

Delete the region and disable autosave to speed up the import.

component_name = "from_ODB"

Import PCB from AEDB file#

Import a PCB from an AEDB file.

odb_path = os.path.join(input_dir, aedt_odb_project)
ipk.create_pcb_from_3dlayout(component_name=component_name, project_name=odb_path, design_name=aedt_odb_design_name,
                             extenttype="Polygon", outlinepolygon=outline_polygon_name)
c:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyaedt\ DeprecationWarning: ``extenttype`` was deprecated in 0.6.43. Use ``extent_type`` instead.
c:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyaedt\ DeprecationWarning: ``outlinepolygon`` was deprecated in 0.6.43. Use ``outline_polygon`` instead.

<pyaedt.modules.Boundary.NativeComponentObject object at 0x000001BC24F355B0>

Create offset coordinate system#

Create an offset coordinate system to match ODB++ with the Sherlock STEP file.

ipk.modeler.create_coordinate_system(origin=[0, 0, stackup_thickness / 2], mode="view", view="XY")
<pyaedt.modeler.cad.Modeler.CoordinateSystem object at 0x000001BC25223C70>

Import CAD file#

Import a CAD file.

ipk.modeler.import_3d_cad(file_path, refresh_all_ids=False)

Save CAD file#

Save the CAD file and refresh the properties from the parsing of the AEDT file.


Plot model#

Plot the model.

ipk.plot(show=False, export_path=os.path.join(project_folder, "Sherlock_Example.jpg"), plot_air_objects=False)
Sherlock Example
<pyaedt.generic.plot.ModelPlotter object at 0x000001BC25223DC0>

Delete PCB objects#

Delete the PCB objects.

ipk.modeler.delete_objects_containing("pcb", False)

Create region#

Create an air region.

ipk.modeler.create_air_region(*[20, 20, 300, 20, 20, 300])
<pyaedt.modeler.cad.object3d.Object3d object at 0x000001BC23B27AC0>

Assign materials#

Assign materials from Sherlock file.

ipk.assignmaterial_from_sherlock_files(component_list, material_list)

Delete objects with no material assignments#

Delete objects with no materials assignments.

no_material_objs = ipk.modeler.get_objects_by_material("")

Assign power to component blocks#

Assign power to component blocks.

all_objects = ipk.modeler.object_names

Assign power blocks#

Assign power blocks from the Sherlock file.

total_power = ipk.assign_block_from_sherlock_file(csv_name=component_list)

Plot model#

Plot the model again now that materials are assigned.

ipk.plot(show=False, export_path=os.path.join(project_folder, "Sherlock_Example.jpg"), plot_air_objects=False)
Sherlock Example
<pyaedt.generic.plot.ModelPlotter object at 0x000001BC254C2460>

Set up boundaries#

Set up boundaries.


setup1 = ipk.create_setup()
setup1.props["Solution Initialization - Y Velocity"] = "1m_per_sec"
setup1.props["Radiation Model"] = "Discrete Ordinates Model"
setup1.props["Include Gravity"] = True
setup1.props["Secondary Gradient"] = True
<pyaedt.modules.Boundary.BoundaryObject object at 0x000001BC26D7CAF0>

Check for intersections#

Check for intersections using validation and fix them by assigning priorities.


Save project and release AEDT#

Save the project and release AEDT.


end = time.time() - start
print("Elapsed time: {}".format(datetime.timedelta(seconds=end)))
print("Project Saved in {} ".format(ipk.project_file))
Elapsed time: 0:00:52.085131
Project Saved in D:/Temp/pyaedt_prj_VPO/TutorialBoard.aedt


Total running time of the script: ( 1 minutes 29.830 seconds)

Gallery generated by Sphinx-Gallery