Skip to content

Commit

Permalink
Merge branch 'main' into update/maxwell_icepak
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin-Crawford authored Oct 22, 2024
2 parents f0a0232 + d053a73 commit 94cc9b0
Show file tree
Hide file tree
Showing 19 changed files with 683 additions and 126 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
name: Documentation style
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-style@v4
- uses: ansys/actions/doc-style@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -111,8 +111,10 @@ jobs:
needs: [doc-build]
steps:
- name: Deploy the documentation
uses: ansys/actions/doc-deploy-dev@v5
uses: ansys/actions/doc-deploy-dev@v8
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
doc-artifact-name: 'documentation-html'
5 changes: 1 addition & 4 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ Vocab = ANSYS

# Apply the following styles
BasedOnStyles = Vale, Google

# Removing Google-specific rule - Not applicable under some circumstances
Google.WordList = NO
Google.Colons = NO
Vale.Terms = NO
8 changes: 5 additions & 3 deletions doc/styles/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*
!Vocab
!Vocab/**
!.gitignore
!config
!config/vocabularies
!config/vocabularies/ANSYS
!config/vocabularies/ANSYS/**
!.gitignore
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/aedt/hfss/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ These examples use PyAEDT to show HFSS capabilities
:link: ../../electrothermal/ccoaxial_hfss_icepak
:link-type: doc

.. image:: ../../electrothermal/c_static/coaxial.png
.. image:: ../../electrothermal/_static/coaxial.png
:alt: Coaxial
:width: 250px
:height: 200px
Expand Down
2 changes: 1 addition & 1 deletion examples/aedt/icepak/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ These examples use PyAEDT to show Icepak capabilities.
.. toctree::
:hidden:

../../electrothermal/component_csv
../../electrothermal/components_csv
../../electrothermal/ecad_import
../../electrothermal/component_3d
../../electrothermal/graphic_card
Expand Down
14 changes: 14 additions & 0 deletions examples/aedt/twin_builder/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ These examples use PyAEDT to show Twin Builder capabilities.

This example shows how to use PyAEDT to create a dynamic reduced order model (ROM) in Twin Builder and run a Twin Builder time-domain simulation.

.. grid-item-card:: LTI ROM
:padding: 2 2 2 2
:link: ../../low_frequency/general/twin_builder/lti_rom_sml
:link-type: doc

.. image:: ../../low_frequency/general/twin_builder/_static/lti_rom.png
:alt: LTI ROM plot
:width: 250px
:height: 200px
:align: center

This example shows how you can use PyAEDT to create a Linear Time Invariant (LTI) ROM in Twin Builder
and run a Twin Builder time-domain simulation.

.. toctree::
:hidden:
Expand All @@ -66,3 +79,4 @@ These examples use PyAEDT to show Twin Builder capabilities.
../../low_frequency/general/twin_builder/rc_circuit
../../low_frequency/general/twin_builder/rectifier
../../low_frequency/general/twin_builder/static_rom
../../low_frequency/general/twin_builder/lti_rom_sml
219 changes: 219 additions & 0 deletions examples/high_frequency/layout/power_integrity/dcir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# # DC IR analysis
# This example shows how to configure EDB for DC IR analysis and load EDB into the HFSS 3D Layout UI for analysis and
# postprocessing.
#
# - Set up EDB:
#
# - Edit via padstack.
# - Assign SPICE model to components.
# - Create pin groups.
# - Create voltage and current sources.
# - Create SIwave DC analysis.
# - Create cutout.
#
# - Import EDB into HFSS 3D Layout:
#
# - Analyze.
# - Get DC IR analysis results.
#
# Keywords: **HFSS 3D Layout**, **DC IR**.

# ## Perform imports and define constants
# Perform required imports.

import json
import os
import tempfile
import time

import ansys.aedt.core
from ansys.aedt.core.downloads import download_file
from pyedb import Edb

# Define constants.

AEDT_VERSION = "2024.2"
NUM_CORES = 4
NG_MODE = False # Open AEDT UI when it is launched.

# Download example board.

temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
aedb = download_file(source="edb/ANSYS-HSD_V1.aedb", destination=temp_folder.name)
download_file(
source="spice", name="ferrite_bead_BLM15BX750SZ1.mod", destination=temp_folder.name
)

# ## Create configuration file
# This example uses a configuration file to set up the layout for analysis.
# Initialize and create an empty dictionary to host all configurations.

cfg = dict()

# Define model library paths.

cfg["general"] = {
"s_parameter_library": os.path.join(temp_folder.name, "touchstone"),
"spice_model_library": os.path.join(temp_folder.name, "spice"),
}

# ### Change via hole size and plating thickness

cfg["padstacks"] = {
"definitions": [
{"name": "v40h15-3", "hole_diameter": "0.2mm", "hole_plating_thickness": "25um"}
],
}

# ### Assign SPICE models

cfg["spice_models"] = [
{
"name": "ferrite_bead_BLM15BX750SZ1", # Give a name to the SPICE Mode.
"component_definition": "COIL-1008CS_V", # Part name of the components
"file_path": "ferrite_bead_BLM15BX750SZ1.mod", # File name or full file path to the SPICE file.
"sub_circuit_name": "BLM15BX750SZ1",
"apply_to_all": True, # If True, SPICE model is to be assigned to all components share the same part name.
# If False, only assign SPICE model to components in "components".
"components": [],
}
]

# ### Create voltage source
# Create a voltage source from a net.

cfg["sources"] = [
{
"name": "VSOURCE_5V",
"reference_designator": "U4",
"type": "voltage",
"magnitude": 5,
"positive_terminal": {"net": "5V"},
"negative_terminal": {"net": "GND"},
}
]

# ### Create current sources
# Create current sources between the net and pin group.

cfg["pin_groups"] = [{"name": "J5_GND", "reference_designator": "J5", "net": "GND"}]

cfg["sources"].append(
{
"name": "J5_VCCR",
"reference_designator": "J5",
"type": "current",
"magnitude": 0.5,
"positive_terminal": {"net": "SFPA_VCCR"},
"negative_terminal": {
"pin_group": "J5_GND" # Defined in "pin_groups" section.
},
}
)
cfg["sources"].append(
{
"name": "J5_VCCT",
"reference_designator": "J5",
"type": "current",
"magnitude": 0.5,
"positive_terminal": {"net": "SFPA_VCCT"},
"negative_terminal": {
"pin_group": "J5_GND" # Defined in "pin_groups" section.
},
}
)

# ### Create SIwave DC analysis

cfg["setups"] = [{"name": "siwave_dc", "type": "siwave_dc", "dc_slider_position": 0}]

# ### Define cutout

cfg["operations"] = {
"cutout": {
"signal_list": ["SFPA_VCCR", "SFPA_VCCT", "5V"],
"reference_list": ["GND"],
"extent_type": "ConvexHull",
"expansion_size": 0.002,
"use_round_corner": False,
"output_aedb_path": "",
"open_cutout_at_end": True,
"use_pyaedt_cutout": True,
"number_of_threads": 4,
"use_pyaedt_extent_computing": True,
"extent_defeature": 0,
"remove_single_pin_components": False,
"custom_extent": "",
"custom_extent_units": "mm",
"include_partial_instances": False,
"keep_voids": True,
"check_terminals": False,
"include_pingroups": False,
"expansion_factor": 0,
"maximum_iterations": 10,
"preserve_components_with_model": False,
"simple_pad_check": True,
"keep_lines_as_path": False,
}
}

# ### Save configuration as a JSON file

pi_json = os.path.join(temp_folder.name, "pi.json")
with open(pi_json, "w") as f:
json.dump(cfg, f, indent=4, ensure_ascii=False)

# ## Load configuration into EDB

# Load the configuration from the JSON file into EDB.

edbapp = Edb(aedb, edbversion=AEDT_VERSION)
edbapp.configuration.load(config_file=pi_json)
edbapp.configuration.run()

# # Load configuration into EDB
edbapp.nets.plot(None, None, color_by_net=True)

# ## Save and close EDB

edbapp.save()
edbapp.close()

# The configured EDB file is saved in the temporary folder.

print(temp_folder.name)

# ## Analyze DCIR with SIwave
#
# The HFSS 3D Layout interface to SIwave is used to open the EDB and run the DCIR analysis
# using SIwave

# ### Load EDB into HFSS 3D Layout.

siw = ansys.aedt.core.Hfss3dLayout(
aedb, version=AEDT_VERSION, non_graphical=NG_MODE, new_desktop=True
)

# ### Analyze

siw.analyze(cores=NUM_CORES)

# ### Get DC IR results

siw.get_dcir_element_data_current_source("siwave_dc")

# ## Release AEDT

siw.save_project()
siw.release_desktop()
# Wait 3 seconds to allow AEDT to shut down before cleaning the temporary directory.
time.sleep(3)

# ## Clean up
#
# All project files are saved in the folder ``temp_folder.name``.
# If you've run this example as a Jupyter notebook, you
# can retrieve those project files. The following cell
# removes all temporary files, including the project folder.

temp_folder.cleanup()
61 changes: 30 additions & 31 deletions examples/high_frequency/layout/power_integrity/dcir_q3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,9 @@

# ## Create a named expression
#
# Use the field calculator to create a named expression.
# Use PyAEDT advanced fields calculator to add from the expressions catalog the voltage drop.

drop_name = "Vdrop3_3"
fields = q3d.ofieldsreporter
q3d.ofieldsreporter.CalcStack("clear")
q3d.ofieldsreporter.EnterQty("Phidc")
q3d.ofieldsreporter.EnterScalar(3.3)
q3d.ofieldsreporter.CalcOp("+")
q3d.ofieldsreporter.AddNamedExpression(drop_name, "DC R/L Fields")
voltage_drop = q3d.post.fields_calculator.add_expression("voltage_drop", None)

# ## Create Phi plot
#
Expand All @@ -262,7 +256,7 @@
# +
plot1 = q3d.post.create_fieldplot_surface(
q3d.modeler.get_objects_by_material("copper"),
quantity=drop_name,
quantity=voltage_drop,
intrinsics={"Freq": "1GHz"},
)

Expand All @@ -281,33 +275,38 @@

# ## Compute voltage on source circles
#
# Use the field calculator to compute the voltage on source circles and get the value
# Use PyAEDT advanced field calculator to compute the voltage on source circles and get the value
# using the ``get_solution_data()`` method.

# +
curves = []
v_surface = {
"name": "",
"description": "Maximum value of voltage on a surface",
"design_type": ["Q3D Extractor"],
"fields_type": ["DC R/L Fields"],
"primary_sweep": "Freq",
"assignment": "",
"assignment_type": ["Face", "Sheet"],
"operations": [
f"NameOfExpression({voltage_drop})",
"EnterSurface('assignment')",
"Operation('SurfaceValue')",
"Operation('Maximum')",
],
"report": ["Field_3D"],
}
for source_circle, source_bound in zip(sources_objs, sources_bounds):
source_sheet_name = source_circle.name

curves.append("V{}".format(source_bound.name))

q3d.ofieldsreporter.CalcStack("clear")
q3d.ofieldsreporter.CopyNamedExprToStack(drop_name)
q3d.ofieldsreporter.EnterSurf(source_sheet_name)
q3d.ofieldsreporter.CalcOp("Maximum")
q3d.ofieldsreporter.AddNamedExpression(
"V{}".format(source_bound.name), "DC R/L Fields"
v_surface["name"] = "V{}".format(source_bound.name)
q3d.post.fields_calculator.add_expression(v_surface, source_circle.name)

data = q3d.post.get_solution_data(
"V{}".format(source_bound.name),
q3d.nominal_adaptive,
variations={"Freq": "1GHz"},
report_category="DC R/L Fields",
)

data = q3d.post.get_solution_data(
curves,
q3d.nominal_adaptive,
variations={"Freq": "1GHz"},
report_category="DC R/L Fields",
)
if data:
for curve in curves:
print(data.data_real(curve))
if data:
print(data.data_real("V{}".format(source_bound.name)))
# -

# ## Release AEDT
Expand Down
Loading

0 comments on commit 94cc9b0

Please sign in to comment.