Skip to content

Commit f6b4fda

Browse files
committed
Remaining edits
1 parent 26417a5 commit f6b4fda

25 files changed

+398
-462
lines changed

examples/03-high_frequency/layout/signal_integrity/multizone.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# # Simulate multi-zone layout with SIwave
1+
# # Multi-zone simulation with SIwave
22
#
33
# This example shows how to simulate multiple zones with SIwave.
44
#

examples/03-high_frequency/radiofrequency_mmwave/lumped_element.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# # Lumped element filter
1+
# # Lumped element filter design
22
#
33
# This example shows how to use PyAEDT to use the ``FilterSolutions`` module to design and
44
# visualize the frequency response of a band-pass Butterworth filter.

examples/04-low_frequency/general/control_program.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# ## Download project file
3535
#
36-
# The files required to run this example are downloaded to the temporary working folder.
36+
# The files required to run this example Download the files required to run this example to the temporary working folder.
3737

3838
aedt_file = downloads.download_file(
3939
source="maxwell_ctrl_prg",

examples/04-low_frequency/index.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ These end-to-end examples show how to use PyAEDT for low-frequency applications.
1717
:height: 200px
1818
:align: center
1919

20-
This section shows some general workflows
20+
General examples
2121

2222
.. grid-item-card:: Motor
2323
:padding: 2 2 2 2
@@ -30,7 +30,7 @@ These end-to-end examples show how to use PyAEDT for low-frequency applications.
3030
:height: 200px
3131
:align: center
3232

33-
This section shows some layout automation examples
33+
Motor examples
3434

3535
.. grid-item-card:: Magnetics
3636
:padding: 2 2 2 2
@@ -43,14 +43,14 @@ These end-to-end examples show how to use PyAEDT for low-frequency applications.
4343
:height: 200px
4444
:align: center
4545

46-
This section shows some RF and millimeter wave workflows
46+
Magnetics examples
4747

48-
.. grid-item-card:: TEAM problems
48+
.. grid-item-card:: T.E.A.M
4949
:padding: 2 2 2 2
5050
:link: team_problem/index
5151
:link-type: doc
5252

53-
This section shows some T.E.A.M. examples
53+
T.E.A.M. examples
5454

5555
.. grid-item-card:: Multiphysics
5656
:padding: 2 2 2 2
@@ -63,7 +63,7 @@ These end-to-end examples show how to use PyAEDT for low-frequency applications.
6363
:height: 200px
6464
:align: center
6565

66-
This section shows some multiphysics examples
66+
Multiphysics examples
6767

6868
.. grid-item-card:: Report
6969
:padding: 2 2 2 2
@@ -76,7 +76,7 @@ These end-to-end examples show how to use PyAEDT for low-frequency applications.
7676
:height: 200px
7777
:align: center
7878

79-
This section shows report examples
79+
Report examples
8080

8181
.. toctree::
8282
:hidden:

examples/04-low_frequency/magnetic/choke.py

+26-33
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Keywords: **Maxwell 3D**, **choke**.
66

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

@@ -15,17 +15,18 @@
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

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,
28-
# the temporary folder name is given by ``temp_folder.name``.
29+
# the temporary folder name is given by ``temp_folder.name``
2930

3031
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
3132

@@ -42,9 +43,9 @@
4243
new_desktop=True,
4344
)
4445

45-
# ## Rules and information of use
46+
# ## Define parameters
4647
#
47-
# The dictionary values containing the different parameters of the core and
48+
# The dictionary values contain the different parameter values of the core and
4849
# the windings that compose the choke. You must not change the main structure of
4950
# the dictionary. The dictionary has many primary keys, including
5051
# ``"Number of Windings"``, ``"Layer"``, and ``"Layer Type"``, that have
@@ -55,28 +56,28 @@
5556
# You must not modify the primary or secondary keys. You can modify only their values.
5657
# You must not change the data types for these keys. For the dictionaries from
5758
# ``"Number of Windings"`` through ``"Wire Section"``, values must be Boolean. Only
58-
# one value per dictionary can be ``"True"``. If all values are ``True``, only the first one
59+
# one value per dictionary can be ``True``. If all values are ``True``, only the first one
5960
# remains set to ``True``. If all values are ``False``, the first value is chosen as the
6061
# correct one by default. For the dictionaries from ``"Core"`` through ``"Inner Winding"``,
6162
# values must be strings, floats, or integers.
6263
#
63-
# Descriptions follow for primary keys:
64+
# Descriptions follow for the primary keys:
6465
#
65-
# - ``"Number of Windings"``: Number of windings around the core
66-
# - ``"Layer"``: Number of layers of all windings
66+
# - ``"Number of Windings"``: Number of windings around the core.
67+
# - ``"Layer"``: Number of layers of all windings.
6768
# - ``"Layer Type"``: Whether layers of a winding are linked to each other
6869
# - ``"Similar Layer"``: Whether layers of a winding have the same number of turns and
69-
# same spacing between turns
70-
# - ``"Mode"``: When there are only two windows, whether they are in common or differential mode
71-
# - ``"Wire Section"``: Type of wire section and number of segments
72-
# - ``"Core"``: Design of the core
70+
# same spacing between turns.
71+
# - ``"Mode"``: When there are only two windows, whether they are in common or differential mode.
72+
# - ``"Wire Section"``: Type of wire section and number of segments.
73+
# - ``"Core"``: Design of the core.
7374
# - ``"Outer Winding"``: Design of the first layer or outer layer of a winding and the common
74-
# parameters for all layers
75-
# - ``"Mid Winding"``: Turns and turns spacing ("Coil Pit") for the second or mid layer if
76-
# it is necessary
77-
# - ``"Inner Winding"``: Turns and turns spacing ("Coil Pit") for the third or inner layer
78-
# if it is necessary
79-
# - ``"Occupation(%)"``: An informative parameter that is useless to modify
75+
# parameters for all layers.
76+
# - ``"Mid Winding"``: Turns and turns spacing (``Coil Pit``) for the second or
77+
# mid layer if it is necessary.
78+
# - ``"Inner Winding"``: Turns and turns spacing (``Coil Pit``) for the third or inner
79+
# layer if it is necessary.
80+
# - ``"Occupation(%)"``: An informative parameter that is useless to modify.
8081
#
8182
# The following parameter values work. You can modify them if you want.
8283

@@ -112,7 +113,7 @@
112113

113114
# ## Convert dictionary to JSON file
114115
#
115-
# Convert a dictionary to a JSON file. PyAEDT methods ask for the path of the
116+
# Convert the dictionary to a JSON file. PyAEDT methods ask for the path of the
116117
# JSON file as an argument. You can convert a dictionary to a JSON file.
117118

118119
# +
@@ -124,11 +125,11 @@
124125

125126
# ## Verify parameters of JSON file
126127
#
127-
# Verify parameters of the JSON file. The ``check_choke_values`` method takes
128+
# Verify parameters of the JSON file. The ``check_choke_values()`` method takes
128129
# the JSON file path as an argument and does the following:
129130
#
130-
# - Checks if the JSON file is correctly written (as explained in the rules)
131-
# - Checks inequations on windings parameters to avoid having unintended intersections
131+
# - Checks if the JSON file is correctly written (as explained earlier)
132+
# - Checks equations on windings parameters to avoid having unintended intersections
132133

133134
dictionary_values = m3d.modeler.check_choke_values(
134135
input_dir=json_path, create_another_file=False
@@ -137,7 +138,7 @@
137138

138139
# ## Create choke
139140
#
140-
# Create the choke. The ``create_choke`` method takes the JSON file path as an
141+
# Create the choke. The ``create_choke()`` method takes the JSON file path as an
141142
# argument.
142143

143144
list_object = m3d.modeler.create_choke(input_file=json_path)
@@ -148,8 +149,6 @@
148149
third_winding_list = list_object[4]
149150

150151
# ## Assign excitations
151-
#
152-
# Assign excitations.
153152

154153
first_winding_faces = m3d.modeler.get_object_faces(
155154
assignment=first_winding_list[0].name
@@ -204,16 +203,12 @@
204203
)
205204

206205
# ## Assign matrix
207-
#
208-
# Assign the matrix.
209206

210207
m3d.assign_matrix(
211208
assignment=["phase_1_in", "phase_2_in", "phase_3_in"], matrix_name="current_matrix"
212209
)
213210

214211
# ## Create mesh operation
215-
#
216-
# Create the mesh operation.
217212

218213
mesh = m3d.mesh
219214
mesh.assign_skin_depth(
@@ -253,8 +248,6 @@
253248
)
254249

255250
# ## Save project
256-
#
257-
# Save the project.
258251

259252
m3d.save_project()
260253
m3d.modeler.fit_all()

examples/04-low_frequency/magnetic/lorentz_actuator.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# This example uses PyAEDT to set up a Lorentz actuator
44
# and solve it using the Maxwell 2D transient solver.
55
#
6-
# Keywords: **Maxwell2D**, **Transient**, **translational motion**, **mechanical transient**
6+
# Keywords: **Maxwell2D**, **transient**, **translational motion**, **mechanical transient**
77

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

@@ -15,25 +15,28 @@
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 # Open AEDT UI when it is launched.
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

3031
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
3132

3233
# ## Initialize dictionaries
3334
#
34-
# Initialize electric and geometric parameters for the actuator.
35-
# Initialize simulation specification.
36-
# Initialize materials for the actuator component.
35+
# Initialize the following:
36+
#
37+
# - Electric and geometric parameters for the actuator
38+
# - Simulation specifications
39+
# - Materials for the actuator component
3740

3841
dimensions = {
3942
"Core_outer_x": "100mm",
@@ -73,7 +76,7 @@
7376
# Launch AEDT and Maxwell 2D after first setting up the project name.
7477
# The following code also creates an instance of the
7578
# ``Maxwell2d`` class named ``m2d`` by providing
76-
# the project name, the design name, the solver, the version and the graphical mode.
79+
# the project name, the design name, the solver, the version, and the graphical mode.
7780

7881
project_name = os.path.join(temp_folder.name, "Lorentz_actuator.aedt")
7982
m2d = ansys.aedt.core.Maxwell2d(
@@ -100,7 +103,7 @@
100103
for k, v in simulation_specifications.items():
101104
m2d[k] = v
102105

103-
# Materials.
106+
# Definem materials.
104107

105108
m2d.variable_manager.set_variable(name="Material data")
106109
m2d.logger.clear_messages()
@@ -119,7 +122,7 @@
119122

120123
# ## Create geometry
121124
#
122-
# Create magnetic core, coils, and magnets. Assign materials and create a new coordinate system to
125+
# Create magnetic core, coils, and magnets. Assign materials and create a coordinate system to
123126
# define the magnet orientation.
124127

125128
core_id = m2d.modeler.create_rectangle(
@@ -203,8 +206,8 @@
203206

204207
# ## Assign motion
205208
#
206-
# Create band objects: all the objects within the band move. Inner band ensures that the mesh is good,
207-
# and additionally it is required when there more than 1 moving objects.
209+
# Create band objects. All the objects within the band move. The inner band ensures that the mesh is good,
210+
# and additionally it is required when there is more than one moving object.
208211
# Assign linear motion with mechanical transient.
209212

210213
band_id = m2d.modeler.create_rectangle(
@@ -245,14 +248,14 @@
245248

246249
# ## Create simulation domain
247250
#
248-
# Create region and assign zero vector potential on the region edges.
251+
# Create a region and assign zero vector potential on the region edges.
249252

250253
region_id = m2d.modeler.create_region(pad_percent=2)
251254
m2d.assign_vector_potential(assignment=region_id.edges, boundary="VectorPotential1")
252255

253256
# ## Assign mesh operations
254257
#
255-
# Transient solver does not have adaptive mesh refinement, so the mesh operations have to be assigned.
258+
# The transient solver does not have adaptive mesh refinement, so the mesh operations must be assigned.
256259

257260
m2d.mesh.assign_length_mesh(
258261
assignment=[band_id, inner_band_id],
@@ -269,19 +272,17 @@
269272

270273
# ## Turn on eddy effects
271274
#
272-
# Assign eddy effects to magnets.
275+
# Assign eddy effects to the magnets.
273276

274277
m2d.eddy_effects_on(assignment=["magnet_n", "magnet_s"])
275278

276279
# ## Turn on core loss
277280
#
278-
# Enable core loss for core.
281+
# Enable core loss for the core.
279282

280283
m2d.set_core_losses(assignment="Core")
281284

282-
# ## Create setup
283-
#
284-
# Create the simulation setup.
285+
# ## Create simulation setup
285286

286287
setup = m2d.create_setup(name="Setup1")
287288
setup.props["StopTime"] = "Stop_time"
@@ -293,7 +294,8 @@
293294

294295
# ## Create report
295296
#
296-
# Create a XY-report with force on coil and the position of the coil on Y-axis, time on X-axis.
297+
# Create an XY-report with force on the coil, the position of the coil on the Y axis,
298+
# and time on the X axis.
297299

298300
m2d.post.create_report(
299301
expressions=["Moving1.Force_x", "Moving1.Position"],
@@ -302,8 +304,6 @@
302304
)
303305

304306
# ## Analyze project
305-
#
306-
# Analyze the project.
307307

308308
setup.analyze(cores=NUM_CORES, use_auto_settings=False)
309309

0 commit comments

Comments
 (0)