Q3D Busbar Analysis

This example shows how you can use PyAEDT to create a busbar design in in Q3D and run a simulation.

# sphinx_gallery_thumbnail_path = 'Resources/busbar.png'

import os

from pyaedt.desktop import Desktop
from pyaedt import Q3d

Launch AEDT in Non-Graphical Mode

You can change the Boolean parameter NonGraphical to False to launch AEDT in graphical mode.

NonGraphical = True

Launch AEDT and Q3D

This example launches AEDT 2021.1 in graphical mode.

# This example use SI units.

d = Desktop("2021.1", NonGraphical, False)

q = Q3d()

Out:

Launching PyAEDT outside Electronics Desktop with CPython and Pythonnet
Launching AEDT installation C:\Program Files\AnsysEM\AnsysEM21.1\Win64
===================================================================================
pyaedt info: Launching AEDT with module Pythonnet.
pyaedt info:: Ansoft.ElectronicsDesktop.2021.1 Started with process ID 9592.
pyaedt info: Logger Started on C:\Users\ansys\Documents\Ansoft\pyaedt20211026_143022.log
pyaedt info: pyaedt v0.4.0
pyaedt info: Python version 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
pyaedt info: Project Project6077 has been created.
pyaedt info: No design is present. Inserting a new design.
pyaedt info: Design Loaded
pyaedt info: Successfully loaded project materials !
pyaedt info: Materials Loaded

Create Primitives

Create polylines for three busbars and a box for the substrate.

q.modeler.primitives.create_polyline(
    [[0, 0, 0], [-100, 0, 0]],
    name="Bar1",
    matname="copper",
    xsection_type="Rectangle",
    xsection_width="5mm",
    xsection_height="1mm",
)

q.modeler.primitives.create_polyline(
    [[0, -15, 0], [-150, -15, 0]],
    name="Bar2",
    matname="aluminum",
    xsection_type="Rectangle",
    xsection_width="5mm",
    xsection_height="1mm",
)

q.modeler.primitives.create_polyline(
    [[0, -30, 0], [-175, -30, 0], [-175, -10, 0]],
    name="Bar3",
    matname="copper",
    xsection_type="Rectangle",
    xsection_width="5mm",
    xsection_height="1mm",
)

q.modeler.primitives.create_box([50, 30, -0.5], [-250, -100, -3], name="substrate", matname="FR4_epoxy")

Out:

<pyaedt.modeler.Object3d.Object3d object at 0x000001CD7209E0D0>

Set Up Boundaries

Identify nets and assign sources and sinks to all nets. There is a source and sink for each busbar.

q.auto_identify_nets()

q.assign_source_to_objectface("Bar1", axisdir=q.AxisDir.XPos, source_name="Source1")

q.assign_sink_to_objectface("Bar1", axisdir=q.AxisDir.XNeg, sink_name="Sink1")

q.assign_source_to_objectface("Bar2", axisdir=q.AxisDir.XPos, source_name="Source2")
q.assign_sink_to_objectface("Bar2", axisdir=q.AxisDir.XNeg, sink_name="Sink2")
q.assign_source_to_objectface("Bar3", axisdir=q.AxisDir.XPos, source_name="Source3")
q.assign_sink_to_objectface("Bar3", axisdir=q.AxisDir.YPos, sink_name="Sink3")

Out:

<pyaedt.modules.Boundary.BoundaryObject object at 0x000001CD1C1CDC40>

Add a Q3D Setup

This command adds a setup to the project and defines the adaptive frequency value.

q.create_setup(props={"AdaptiveFreq": "100MHz"})

Out:

SetupName MySetupAuto with 0 Sweeps

Create a Rectangular Plot

This command creates a rectangular plot and a Data Table.

q.post.create_rectangular_plot(expression="C(Bar1,Bar1)", context="Original")

q.post.create_rectangular_plot(expression="C(Bar1,Bar1)", context="Original", plot_type="Data Table")

Out:

pyaedt info: Report Plot_6UZQ3B correctly created.
pyaedt info: Report Plot_4XHU23 correctly created.

True

Solve the Setup

This command solves the setup.

q.analyze_nominal()

Out:

pyaedt info: Solving design setup MySetupAuto
pyaedt info: Key Desktop/ActiveDSOConfigurations/Q3D Extractor correctly changed.
pyaedt info: Design setup MySetupAuto solved correctly

True

Get Report Data

This command get the report data into a Data Structure that allows to manipulate them.

a = q.post.get_report_data(expression="C(Bar1,Bar1)", domain=["Context:=", "Original"])
a.sweeps["Freq"]
a.data_magnitude()

Out:

pyaedt info: Solution Data Correctly Loaded.

[3.1361770740840296]

Close AEDT

After the simulaton is completed, you can close AEDT or release it using the release_desktop method. All methods provide for saving projects before exiting.

if os.name != "posix":
    d.release_desktop(close_projects=True, close_on_exit=True)

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

Gallery generated by Sphinx-Gallery