|
4 | 4 | #
|
5 | 5 | # Keywords: **Maxwell 3D**, **choke**.
|
6 | 6 |
|
7 |
| -# ## Perform required imports |
| 7 | +# ## Perform imports and define constants |
8 | 8 | #
|
9 | 9 | # Perform required imports.
|
10 | 10 |
|
|
15 | 15 |
|
16 | 16 | import ansys.aedt.core
|
17 | 17 |
|
18 |
| -# ## Define constants |
| 18 | +# Define constants. |
19 | 19 |
|
20 | 20 | AEDT_VERSION = "2024.2"
|
21 | 21 | NG_MODE = False # Open AEDT UI when it is launched.
|
22 | 22 |
|
23 | 23 |
|
24 | 24 | # ## Create temporary directory
|
25 | 25 | #
|
26 |
| -# Create temporary directory. |
| 26 | +# Create a temporary directory where downloaded data or |
| 27 | +# dumped data can be stored. |
27 | 28 | # 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`` |
29 | 30 |
|
30 | 31 | temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
|
31 | 32 |
|
|
42 | 43 | new_desktop=True,
|
43 | 44 | )
|
44 | 45 |
|
45 |
| -# ## Rules and information of use |
| 46 | +# ## Define parameters |
46 | 47 | #
|
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 |
48 | 49 | # the windings that compose the choke. You must not change the main structure of
|
49 | 50 | # the dictionary. The dictionary has many primary keys, including
|
50 | 51 | # ``"Number of Windings"``, ``"Layer"``, and ``"Layer Type"``, that have
|
|
55 | 56 | # You must not modify the primary or secondary keys. You can modify only their values.
|
56 | 57 | # You must not change the data types for these keys. For the dictionaries from
|
57 | 58 | # ``"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 |
59 | 60 | # remains set to ``True``. If all values are ``False``, the first value is chosen as the
|
60 | 61 | # correct one by default. For the dictionaries from ``"Core"`` through ``"Inner Winding"``,
|
61 | 62 | # values must be strings, floats, or integers.
|
62 | 63 | #
|
63 |
| -# Descriptions follow for primary keys: |
| 64 | +# Descriptions follow for the primary keys: |
64 | 65 | #
|
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. |
67 | 68 | # - ``"Layer Type"``: Whether layers of a winding are linked to each other
|
68 | 69 | # - ``"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. |
73 | 74 | # - ``"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. |
80 | 81 | #
|
81 | 82 | # The following parameter values work. You can modify them if you want.
|
82 | 83 |
|
|
112 | 113 |
|
113 | 114 | # ## Convert dictionary to JSON file
|
114 | 115 | #
|
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 |
116 | 117 | # JSON file as an argument. You can convert a dictionary to a JSON file.
|
117 | 118 |
|
118 | 119 | # +
|
|
124 | 125 |
|
125 | 126 | # ## Verify parameters of JSON file
|
126 | 127 | #
|
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 |
128 | 129 | # the JSON file path as an argument and does the following:
|
129 | 130 | #
|
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 |
132 | 133 |
|
133 | 134 | dictionary_values = m3d.modeler.check_choke_values(
|
134 | 135 | input_dir=json_path, create_another_file=False
|
|
137 | 138 |
|
138 | 139 | # ## Create choke
|
139 | 140 | #
|
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 |
141 | 142 | # argument.
|
142 | 143 |
|
143 | 144 | list_object = m3d.modeler.create_choke(input_file=json_path)
|
|
148 | 149 | third_winding_list = list_object[4]
|
149 | 150 |
|
150 | 151 | # ## Assign excitations
|
151 |
| -# |
152 |
| -# Assign excitations. |
153 | 152 |
|
154 | 153 | first_winding_faces = m3d.modeler.get_object_faces(
|
155 | 154 | assignment=first_winding_list[0].name
|
|
204 | 203 | )
|
205 | 204 |
|
206 | 205 | # ## Assign matrix
|
207 |
| -# |
208 |
| -# Assign the matrix. |
209 | 206 |
|
210 | 207 | m3d.assign_matrix(
|
211 | 208 | assignment=["phase_1_in", "phase_2_in", "phase_3_in"], matrix_name="current_matrix"
|
212 | 209 | )
|
213 | 210 |
|
214 | 211 | # ## Create mesh operation
|
215 |
| -# |
216 |
| -# Create the mesh operation. |
217 | 212 |
|
218 | 213 | mesh = m3d.mesh
|
219 | 214 | mesh.assign_skin_depth(
|
|
253 | 248 | )
|
254 | 249 |
|
255 | 250 | # ## Save project
|
256 |
| -# |
257 |
| -# Save the project. |
258 | 251 |
|
259 | 252 | m3d.save_project()
|
260 | 253 | m3d.modeler.fit_all()
|
|
0 commit comments