Skip to content

Commit e999092

Browse files
committed
Addition example edits
1 parent 726cad7 commit e999092

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+851
-839
lines changed

examples/02-aedt_general/components/reuse_component.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
# You can easily assign a boundary to a face or to an object by taking advantage of
9898
# Object-Oriented Programming (OOP) available in PyAEDT.
9999

100-
# ### Assign perfect e to sheets
100+
# ### Assign Perfect E boundary to sheets
101101
#
102-
# Assign perfect e to sheets.
102+
# Assign a Perfect E boundary to sheets.
103103

104104
hfss.assign_perfecte_to_sheets(patch)
105105

examples/02-aedt_general/modeler/coordinate_system.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
# ### Create a dependent coordinate system
200200
#
201201
# The use of dependent coordinate systems can simplify model creation. The following
202-
# cell demonstrates how to create a coordinate system whose reference is the face coordinate system.
202+
# cell shows how to create a coordinate system whose reference is the face coordinate system.
203203

204204
face = box.faces[1]
205205
fcs6 = hfss.modeler.create_face_coordinate_system(

examples/03-high_frequency/antenna/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Antenna
22
~~~~~~~
3-
These examples use PyAEDT to show some antenna examples
3+
These examples use PyAEDT to show some antenna applications.
44

55
.. nbgallery::
66

examples/03-high_frequency/antenna/interferences/interference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# # Classify Interference Type
1+
# # Interference type classification
22
#
33
# This example shows how to load an existing AEDT EMIT
44
# design and analyze the results to classify the

examples/03-high_frequency/antenna/interferences/interference_type.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# # Classify interference type GUI
1+
# # Interference type classification using a GUI
22
#
33
# This example uses a GUI to open an AEDT project with
44
# an EMIT design and analyze the results to classify the

examples/03-high_frequency/emc/armoured_cable.py

+32-25
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
# This example shows how to use PyAEDT to perform these tasks:
44
#
5-
# - Create a Q2D design using modeler primitives and imported CAD.
5+
# - Create a Q2D design using modeler primitives and an imported CAD.
66
# - Set up the simulation.
77
# - Link the solution to a Simplorer design.
88
#
9-
# For information on the cable model used in this example please see the following link:
10-
#
11-
# - [4 Core Armoured Power Cable]
12-
# (https://www.luxingcable.com/low-voltage-cables/4-core-armoured-power-cable.html)
9+
# For information on the cable model used in this example, see
10+
# [4 Core Armoured Power Cable](https://www.luxingcable.com/low-voltage-cables/4-core-armoured-power-cable.html).
1311
#
1412
# Keywords: **Q2D**, **EMC**, **cable**.
1513

16-
# ## Perform required imports
14+
# ## Perform imports and define constants
1715
#
16+
# Perform required imports.
1817

1918
import math
2019
import os
@@ -23,18 +22,23 @@
2322

2423
import ansys.aedt.core
2524

26-
# ## Create temporary directory
27-
28-
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
29-
3025
# Define constants.
3126

3227
AEDT_VERSION = "2024.2"
3328
NG_MODE = False # Open AEDT UI when it is launched.
3429

30+
# ## Create temporary directory
31+
#
32+
# Create a temporary directory where downloaded data or
33+
# dumped data can be stored.
34+
# If you'd like to retrieve the project data for subsequent use,
35+
# the temporary folder name is given by ``temp_folder.name``.
36+
37+
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
38+
3539
# ## Set up for model creation
3640
#
37-
# Initialize cable sizing - radii in mm.
41+
# Initialize cable sizing by specifying radii in millimeters.
3842

3943
c_strand_radius = 2.575
4044
cable_n_cores = 4
@@ -58,8 +62,8 @@
5862
arm_strand_rad = armour_thickness / 2.0 - 0.2
5963
n_arm_strands = 30
6064

61-
# Start an instance of the Q2D extractor, providing the version, project name, design
62-
# name and type.
65+
# Start an instance of Q2D Extractor, providing the version, project name, design
66+
# name, and type.
6367

6468
project_name = os.path.join(temp_folder.name, "Q2D_ArmouredCableExample.aedt")
6569
q2d_design_name = "2D_Extractor_Cable"
@@ -74,7 +78,7 @@
7478
)
7579
q2d.modeler.model_units = "mm"
7680

77-
# Assign the variables to the Q3D design.
81+
# Assign variables to the Q3D design.
7882

7983
core_params = {
8084
"n_cores": str(cable_n_cores),
@@ -101,22 +105,23 @@
101105
q2d[k] = v
102106

103107
# Cable insulators require the definition of specific materials since they are not
104-
# included in the Sys Library.
105-
# Plastic, PE (cross-linked, wire, and cable grade)
108+
# included in the ``Sys`` library.
109+
#
110+
# Define Plastic, PE (cross-linked, wire, and cable grade):
106111

107112
mat_pe_cable_grade = q2d.materials.add_material("plastic_pe_cable_grade")
108113
mat_pe_cable_grade.conductivity = "1.40573e-16"
109114
mat_pe_cable_grade.permittivity = "2.09762"
110115
mat_pe_cable_grade.dielectric_loss_tangent = "0.000264575"
111116
mat_pe_cable_grade.update()
112117

113-
# Plastic, PP (10% carbon fiber)
118+
# Define Plastic, PP (10% carbon fiber):
114119

115120
mat_pp = q2d.materials.add_material("plastic_pp_carbon_fiber")
116121
mat_pp.conductivity = "0.0003161"
117122
mat_pp.update()
118123

119-
# ## Model Creation
124+
# ## Create model
120125
#
121126
# Create the geometry for core strands, fill, and XLPE insulation.
122127

@@ -191,7 +196,7 @@
191196
)
192197
arm_fill_id.color = (255, 255, 255)
193198

194-
# Create geometry for the outer sheath.
199+
# Create the geometry for the outer sheath.
195200

196201
outer_sheath_id = q2d.modeler.create_circle(
197202
origin=["0mm", "0mm", "0mm"],
@@ -201,7 +206,7 @@
201206
)
202207
outer_sheath_id.color = (0, 0, 0)
203208

204-
# Create the geometry for armature steel strands.
209+
# Create the geometry for the armature steel strands.
205210

206211
arm_strand_1_id = q2d.modeler.create_circle(
207212
origin=["0mm", "armour_centre_pos", "0mm"],
@@ -240,23 +245,25 @@
240245
model = q2d.plot(show=False)
241246
model.plot(os.path.join(temp_folder.name, "Image.jpg"))
242247

243-
# Specify the design settings
248+
# Specify the design settings.
244249

245250
lumped_length = "100m"
246251
q2d.design_settings["LumpedLength"] = lumped_length
247252

248-
# ## Solve the model
253+
# ## Solve model
249254
#
250-
# Insert setup and frequency sweep
255+
# Insert the setup and frequency sweep.
251256

252257
q2d_setup = q2d.create_setup(name=setup_name)
253258
q2d_sweep = q2d_setup.add_sweep(name=sweep_name)
254259

255260
# The cable model is generated by running two solution types:
261+
#
256262
# 1. Capacitance and conductance per unit length (CG).
257263
# For this model, the CG solution runs in a few seconds.
264+
#
258265
# 2. Series resistance and inductance (RL).
259-
# For this model the solution time can range from 15-20 minutes,
266+
# For this model, the solution time can range from 15-20 minutes,
260267
# depending on the available hardware.
261268
#
262269
# Uncomment the following line to run the analysis.
@@ -267,7 +274,7 @@
267274

268275
# ## Evaluate results
269276
#
270-
# Add a Simplorer/Twin Builder design and the Q3D dynamic component
277+
# Add a Simplorer/Twin Builder design and the Q3D dynamic component.
271278

272279
tb = ansys.aedt.core.TwinBuilder(design=tb_design_name, version=AEDT_VERSION)
273280

examples/03-high_frequency/emc/busbar.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Keywords: **Q3D**, **EMC*, **busbar**.
77

8-
# ## Perform required imports
8+
# ## Perform imports and define constants
99
#
1010
# Perform required imports.
1111

@@ -15,15 +15,16 @@
1515

1616
import ansys.aedt.core
1717

18-
# ## Define constants
18+
# Define constants.
1919

2020
AEDT_VERSION = "2024.2"
2121
NUM_CORES = 4
2222
NG_MODE = False
2323

2424
# ## Create temporary directory
2525
#
26-
# Create temporary directory.
26+
# Create a temporary directory where downloaded data or
27+
# dumped data can be stored.
2728
# If you'd like to retrieve the project data for subsequent use,
2829
# the temporary folder name is given by ``temp_folder.name``.
2930

@@ -125,9 +126,9 @@
125126
sweep.props["RangeStep"] = "5MHz"
126127
sweep.update()
127128

128-
# ### Setup for postprocessing
129+
# ### Set up for postprocessing
129130
#
130-
# Specify the traces that will be displayed after solving the model.
131+
# Specify the traces to display after solving the model.
131132

132133
data_plot_self = q3d.matrices[0].get_sources_for_plot(
133134
get_self_terms=True, get_mutual_terms=False
@@ -136,7 +137,7 @@
136137
get_self_terms=False, get_mutual_terms=True, category="C"
137138
)
138139

139-
# Define a plot and a data table in Electronics Desktop for visualizing results.
140+
# Define a plot and a data table in AEDT for visualizing results.
140141

141142
q3d.post.create_report(expressions=data_plot_self)
142143
q3d.post.create_report(

examples/03-high_frequency/emc/choke.py

+22-28
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Keywords: **HFSS**, **EMC**, **choke**, .
66

7-
# ## Perform required imports
7+
# ## Perform imports and define constants
88
#
99
# Perform required imports.
1010

@@ -15,15 +15,15 @@
1515

1616
import ansys.aedt.core
1717

18-
# ## Define constants
18+
# Define constants.
1919

2020
AEDT_VERSION = "2024.2"
2121
NG_MODE = False # Open AEDT UI when it is launched.
2222

2323
# ## Create temporary directory
2424
#
25-
# Create a temporary directory where we store downloaded data or
26-
# dumped data.
25+
# Create a temporary directory where downloaded data or
26+
# dumped data can be stored.
2727
# If you'd like to retrieve the project data for subsequent use,
2828
# the temporary folder name is given by ``temp_folder.name``.
2929

@@ -40,7 +40,7 @@
4040
solution_type="Terminal",
4141
)
4242

43-
# ## Rules and information of use
43+
# ## Define parameters
4444
#
4545
# The dictionary values contain the different parameter values of the core and
4646
# the windings that compose the choke. You must not change the main structure of
@@ -58,23 +58,23 @@
5858
# correct one by default. For the dictionaries from ``"Core"`` through ``"Inner Winding"``,
5959
# values must be strings, floats, or integers.
6060
#
61-
# Descriptions follow for primary keys:
61+
# Descriptions follow for the primary keys:
6262
#
63-
# - ``"Number of Windings"``: Number of windings around the core
64-
# - ``"Layer"``: Number of layers of all windings
63+
# - ``"Number of Windings"``: Number of windings around the core.
64+
# - ``"Layer"``: Number of layers of all windings.
6565
# - ``"Layer Type"``: Whether layers of a winding are linked to each other
6666
# - ``"Similar Layer"``: Whether layers of a winding have the same number of turns and
67-
# same spacing between turns
68-
# - ``"Mode"``: When there are only two windows, whether they are in common or differential mode
69-
# - ``"Wire Section"``: Type of wire section and number of segments
70-
# - ``"Core"``: Design of the core
67+
# same spacing between turns.
68+
# - ``"Mode"``: When there are only two windows, whether they are in common or differential mode.
69+
# - ``"Wire Section"``: Type of wire section and number of segments.
70+
# - ``"Core"``: Design of the core.
7171
# - ``"Outer Winding"``: Design of the first layer or outer layer of a winding and the common
72-
# parameters for all layers
73-
# - ``"Mid Winding"``: Turns and turns spacing ("Coil Pit") for the second or
74-
# mid layer if it is necessary
75-
# - ``"Inner Winding"``: Turns and turns spacing ("Coil Pit") for the third or inner
76-
# layer if it is necessary
77-
# - ``"Occupation(%)"``: An informative parameter that is useless to modify
72+
# parameters for all layers.
73+
# - ``"Mid Winding"``: Turns and turns spacing (``Coil Pit``) for the second or
74+
# mid layer if it is necessary.
75+
# - ``"Inner Winding"``: Turns and turns spacing (``Coil Pit``) for the third or inner
76+
# layer if it is necessary.
77+
# - ``"Occupation(%)"``: An informative parameter that is useless to modify.
7878
#
7979
# The following parameter values work. You can modify them if you want.
8080

@@ -110,7 +110,7 @@
110110

111111
# ## Convert dictionary to JSON file
112112
#
113-
# Convert a dictionary to a JSON file. You must supply the path of the
113+
# Convert the dictionary to a JSON file. You must supply the path of the
114114
# JSON file as an argument.
115115

116116
json_path = os.path.join(hfss.working_directory, "choke_example.json")
@@ -119,11 +119,11 @@
119119

120120
# ## Verify parameters of JSON file
121121
#
122-
# Verify parameters of the JSON file. The ``check_choke_values`` method takes
122+
# Verify parameters of the JSON file. The ``check_choke_values()`` method takes
123123
# the JSON file path as an argument and does the following:
124124
#
125-
# - Checks if the JSON file is correctly written (as explained in the rules)
126-
# - Checks in equations on windings parameters to avoid having unintended intersections
125+
# - Checks if the JSON file is correctly written (as explained earlier).
126+
# - Checks equations on windings parameters to avoid having unintended intersections.
127127

128128
dictionary_values = hfss.modeler.check_choke_values(
129129
json_path, create_another_file=False
@@ -142,8 +142,6 @@
142142
second_winding_list = list_object[3]
143143

144144
# ## Create ground
145-
#
146-
# Create a ground.
147145

148146
ground_radius = 1.2 * dictionary_values[1]["Outer Winding"]["Outer Radius"]
149147
ground_position = [0, 0, first_winding_list[1][0][2] - 2]
@@ -154,8 +152,6 @@
154152
ground.transparency = 0.9
155153

156154
# ## Create lumped ports
157-
#
158-
# Create lumped ports.
159155

160156
port_position_list = [
161157
[
@@ -192,8 +188,6 @@
192188
)
193189

194190
# ## Create mesh
195-
#
196-
# Create the mesh.
197191

198192
# +
199193
cylinder_height = 2.5 * dictionary_values[1]["Outer Winding"]["Height"]

0 commit comments

Comments
 (0)