-
Notifications
You must be signed in to change notification settings - Fork 201
Added method for Inception Voltage Evaluation for electrostatic Maxwell analyses. Issue #5310 #6869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
4a7a89a
3adb514
49b081b
3bb851d
9df171e
757f729
9200422
31ed72d
8275d5f
577a536
cc58ca2
c8a964a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -33,6 +33,8 @@ | |||
|
|
||||
| from ansys.aedt.core.base import PyAedtBase | ||||
| from ansys.aedt.core.generic.general_methods import pyaedt_function_handler | ||||
| from ansys.aedt.core.internal.checks import min_aedt_version | ||||
| from ansys.aedt.core.internal.errors import AEDTRuntimeError | ||||
| from ansys.aedt.core.visualization.post.field_data import FieldPlot | ||||
| from ansys.aedt.core.visualization.post.post_3dlayout import PostProcessor3DLayout | ||||
| from ansys.aedt.core.visualization.post.post_common_3d import PostProcessor3D | ||||
|
|
@@ -348,3 +350,60 @@ def create_fieldplot_layers_nets( | |||
| return self.post_3dlayout.create_fieldplot_layers_nets( | ||||
| layers_nets, quantity, setup, intrinsics, plot_on_surface, plot_name | ||||
| ) | ||||
|
|
||||
| @pyaedt_function_handler() | ||||
| @min_aedt_version("2026.1") | ||||
| def evaluate_inception_voltage(self, plot_name, field_line_number=None): | ||||
| """Perform Inception voltage evaluation on selected field line traces. | ||||
|
|
||||
| .. note:: | ||||
| This method requires field line traces to be computed beforehand. | ||||
|
|
||||
| Parameters | ||||
| ---------- | ||||
| plot_name : str | ||||
| Name of the field fine trace plot as it appears in the AEDT GUI project manager tree. | ||||
| field_line_number: list of int, optional | ||||
| List of line objects on which the evaluation will be performed. | ||||
| If the field line traces plot does not exist, this can be created with ``app.post.create_fieldplot_line_traces``. | ||||
| The default value is ``None``, in which case the inception voltage evaluation will be carried out for all existing field line traces. | ||||
|
|
||||
| Returns | ||||
| ------- | ||||
| bool | ||||
| ``True`` when successful. | ||||
|
|
||||
| References | ||||
| ---------- | ||||
| >>> oModule.EvaluateInceptionVoltage | ||||
|
|
||||
| Examples | ||||
| -------- | ||||
| Create an instance of Maxwell and link to a project named | ||||
| ``projectname``. If this project does not exist, create one with | ||||
| this name. | ||||
|
|
||||
| >>> from ansys.aedt.core import Maxwell2d | ||||
| >>> m2d = Maxwell2d(project_name) | ||||
|
|
||||
| Create a field line traces plot in the Region from seeding faces (insulator faces). | ||||
| >>> plot = m2d.post.create_fieldplot_line_traces( | ||||
| >>> seeding_faces = (["Ground", "Electrode", "Region"],) | ||||
| >>> in_volume_tracing_objs = (["Region"],) | ||||
| >>> plot_name="LineTracesTest") | ||||
|
Comment on lines
+390
to
+393
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add the tabs here? |
||||
|
|
||||
| Now the inception voltage evaluation can be performed on all (or a subset) of the created field line traces. | ||||
| >>> m2d.post.evaluate_inception_voltage(plot_name=plot.name, field_line_number=[1, 2, 4]) | ||||
| >>> m2d.desktop_class.release_desktop() | ||||
|
|
||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| """ | ||||
| if self._app.solution_type != "Electrostatic": | ||||
| raise AEDTRuntimeError("Field line traces is valid only for electrostatic solution") | ||||
| if plot_name not in (self.field_plot_names): | ||||
| raise AEDTRuntimeError("The Field Line Tracing Plot needs to be generated.") | ||||
| if not field_line_number: | ||||
| self.ofieldsreporter.EvaluateInceptionVoltage(plot_name) | ||||
| return True | ||||
| else: | ||||
| self.ofieldsreporter.EvaluateInceptionVoltage(plot_name, field_line_number) | ||||
| return True | ||||
tizianrot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ | |
| from ansys.aedt.core import TwinBuilder | ||
| from ansys.aedt.core.generic.general_methods import is_linux | ||
| from ansys.aedt.core.generic.settings import settings | ||
| from ansys.aedt.core.internal.errors import AEDTRuntimeError | ||
| from ansys.aedt.core.visualization.plot.pyvista import _parse_aedtplt | ||
| from ansys.aedt.core.visualization.plot.pyvista import _parse_streamline | ||
| from tests import TESTS_VISUALIZATION_PATH | ||
|
|
@@ -795,3 +796,15 @@ def test_twinbuilder_spectral(self, tb_app): | |
| new_report.time_start = "0ns" | ||
| new_report.time_stop = "40ms" | ||
| assert new_report.create() | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here add the decorator skipif |
||
| @pytest.mark.skipif(config["desktopVersion"] < "2026.1", reason="Method not available before 2026.1") | ||
| def test_m2d_evaluate_inception_voltage(self, m2dtest): | ||
| m2dtest.set_active_design("field_line_trace") | ||
| with pytest.raises(AEDTRuntimeError): | ||
| m2dtest.post.evaluate_inception_voltage("my_plot", [1, 2, 4]) | ||
| plot = m2dtest.post.create_fieldplot_line_traces(["Ground", "Electrode"], "Region") | ||
| assert m2dtest.post.evaluate_inception_voltage(plot.name) | ||
| assert m2dtest.post.evaluate_inception_voltage(plot.name, [1, 2, 4]) | ||
| m2dtest.solution_type = "Magnetostatic" | ||
| with pytest.raises(AEDTRuntimeError): | ||
| m2dtest.post.evaluate_inception_voltage("my_plot", [1, 2, 4]) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.