|
142 | 142 | # Fields data is exported to the temporary folder as an AEDTPLT file. |
143 | 143 |
|
144 | 144 | for time_step in time_steps: |
145 | | - t = ansys.aedt.core.generic.constants.unit_converter( |
146 | | - time_step, |
147 | | - unit_system="Time", |
148 | | - input_units=data.units_sweeps["Time"], |
149 | | - output_units="ms", |
150 | | - ) |
| 145 | + time_step = time_step.to("ms") |
| 146 | + |
151 | 147 | m3d.post.create_fieldplot_surface( |
152 | 148 | assignment=m3d.modeler.objects_by_name["Coil_A2"], |
153 | 149 | quantity=quantity[0], |
154 | | - plot_name="J_{}_ms".format(t), |
155 | | - intrinsics={"Time": "{}ms".format(t)}, |
| 150 | + plot_name="J_{}_ms".format(time_step.value), |
| 151 | + intrinsics={"Time": time_step.expression}, |
156 | 152 | ) |
157 | 153 | mean_j_field_export = m3d.post.export_field_plot( |
158 | | - plot_name="J_{}_ms".format(t), |
| 154 | + plot_name="J_{}_ms".format(time_step.value), |
159 | 155 | output_dir=temp_folder.name, |
160 | 156 | file_format="aedtplt", |
161 | 157 | ) |
|
164 | 160 | o for o in m3d.modeler.solid_objects if o.material_name == "copper" |
165 | 161 | ], |
166 | 162 | quantity="Mag_J", |
167 | | - plot_name="Mag_J_Coils_{}_ms".format(t), |
168 | | - intrinsics={"Time": "{}ms".format(t)}, |
| 163 | + plot_name="Mag_J_Coils_{}_ms".format(time_step.value), |
| 164 | + intrinsics={"Time": time_step.expression}, |
169 | 165 | ) |
170 | 166 | mag_j_field_export = m3d.post.export_field_plot( |
171 | | - plot_name="Mag_J_Coils_{}_ms".format(t), |
| 167 | + plot_name="Mag_J_Coils_{}_ms".format(time_step.value), |
172 | 168 | output_dir=temp_folder.name, |
173 | 169 | file_format="aedtplt", |
174 | 170 | ) |
|
0 commit comments