HFSS 3D Layout Parametric Via Analysis

This example shows how to use HFSS 3D Layout to create and solve a parametric design.

# sphinx_gallery_thumbnail_path = 'Resources/3dlayout.png'

# Import the Hfss3dlayout Object

This example imports the Hfss3dlayout object and initializes it on version 2021.1.

from pyaedt import Hfss3dLayout
import os

h3d = Hfss3dLayout(specified_version="2021.1", new_desktop_session=True, non_graphical=True)

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 4916.
pyaedt info: Logger Started on C:\Users\ansys\Documents\Ansoft\pyaedt20211026_141427.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
pyaedt info: Analysis Loaded
pyaedt info: Loading Modeler.
pyaedt info: Modeler loaded.
pyaedt info: EDB loaded.
pyaedt info: Layers loaded.
pyaedt info: Primitives loaded.
pyaedt info: Modeler Loaded

Set Up Parametric Variables

This example sets up all parametric variables to use in the layout.

h3d["viatotrace"] = "5mm"
h3d["viatovia"] = "10mm"
h3d["w1"] = "1mm"
h3d["sp"] = "0.5mm"
h3d["len"] = "50mm"

Create a Stackup

This example creates a stackup.

h3d.modeler.layers.add_layer("GND", "signal", thickness="0", isnegative=True)
h3d.modeler.layers.add_layer("diel", "dielectric", thickness="0.2mm", material="FR4_epoxy")
h3d.modeler.layers.add_layer("TOP", "signal", thickness="0.035mm", elevation="0.2mm")

Out:

<pyaedt.modules.LayerStackup.Layer object at 0x000001CD1C2F83A0>

Create a Signal Net and Ground Planes

This example create a signal net and ground planes.

h3d.modeler.primitives.create_line("TOP", [[0, 0], ["len", 0]], lw="w1", netname="microstrip", name="microstrip")
h3d.modeler.primitives.create_rectangle("TOP", [0, "-w1/2-sp"], ["len", "-w1/2-sp-20mm"])
h3d.modeler.primitives.create_rectangle("TOP", [0, "w1/2+sp"], ["len", "w1/2+sp+20mm"])

Out:

'NewObject_R0XHIO'

Create Vias with Parametric Positions

This example creates vias with parametric positions.

h3d.modeler.primitives.create_via(x="viatovia", y="-viatotrace", name="via1")
h3d.modeler.primitives.create_via(x="viatovia", y="viatotrace", name="via2")
h3d.modeler.primitives.create_via(x="2*viatovia", y="-viatotrace")
h3d.modeler.primitives.create_via(x="2*viatovia", y="viatotrace")
h3d.modeler.primitives.create_via(x="3*viatovia", y="-viatotrace")
h3d.modeler.primitives.create_via(x="3*viatovia", y="viatotrace")

Out:

'NewObject_M5K9T8'

Add Circuit Ports

This example adds circuit ports to the setup.

h3d.create_edge_port("microstrip", 0)
h3d.create_edge_port("microstrip", 2)

Out:

'Port2'

Create a Setup and Sweep

This example create a setup and sweep.

setup = h3d.create_setup()
h3d.create_linear_count_sweep(
    setupname=setup.name,
    unit="GHz",
    freqstart=3,
    freqstop=7,
    num_of_freq_points=1001,
    sweepname="sweep1",
    sweep_type="Interpolating",
    interpolation_tol_percent=1,
    interpolation_max_solutions=255,
    save_fields=False,
    use_q3d_for_dc=False,
)

Out:

pyaedt info: Linear count sweep sweep1 has been correctly created

<pyaedt.modules.SetupTemplates.SweepHFSS3DLayout object at 0x000001CD1C3B6FD0>

Solve and Plot Results

This example solves and plots results.

h3d.analyze_nominal()
h3d.post.create_rectangular_plot(
    ["db(S(Port1,Port1))", "db(S(Port1,Port2))"], families_dict=h3d.available_variations.nominal_w_values_dict
)

Out:

pyaedt info: Solving design setup MySetupAuto
pyaedt info: Key Desktop/ActiveDSOConfigurations/HFSS 3D Layout Design correctly changed.
pyaedt info: Design setup MySetupAuto solved correctly
pyaedt info: Report Plot_VY67EZ correctly created.

True

Close AEDT

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

if os.name != "posix":
    h3d.close_desktop()

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

Gallery generated by Sphinx-Gallery