Skip to content
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

FEAT: implement resistive sheet #5473

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions src/ansys/aedt/core/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2961,6 +2961,89 @@
return bound
return False

@pyaedt_function_handler()
def assign_resistive_sheet(
self,
assignment,
resistance,
name=None,
non_linear=False,
anode_a=300000000,
anode_b=5,
anode_c=110000000000000,
anode_d=2,
cathode_a=300000000,
cathode_b=10,
cathode_c=110000000000000,
cathode_d=2,
):
"""Assign a resistive sheet boundary between two conductors.

Available for Maxwell 3D Magnetostatic, Eddy Current and Transient designs.
For 3D Magnetostatic designs, the user can specify the nonlinear anode and cathode coefficients.

Parameters
----------
assignment : list of int or :class:`ansys.aedt.core.modeler.cad.object_3d.Object3d`
List of objects to assign an end connection to.
resistance : str
Resistance value with unit.
For 3D Magnetostatic designs if non_linear is ``True``, it is not available.
name : str, optional
Name of the boundary. The default is ``None``, in which case the default name is used.
non_linear: bool, optional
Whether the boundary is non-linear. The default is ``False``.
Valid for 3D Magnetostatic designs only.

Returns
-------
:class:`ansys.aedt.core.modules.boundary.BoundaryObject`
Newly created object. ``False`` if it fails.

References
----------
>>> oModule.AssignResistiveSheet

Examples
--------

"""
if self.solution_type not in ["EddyCurrent", "Transient", "Magnetostatic"]:
self.logger.error(

Check warning on line 3012 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3011-L3012

Added lines #L3011 - L3012 were not covered by tests
"Resistive sheet is applicable only to Eddy current, transient and magnetostatic solvers."
)
return False

Check warning on line 3015 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3015

Added line #L3015 was not covered by tests

assignment = self.modeler.convert_to_selections(assignment, True)

Check warning on line 3017 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3017

Added line #L3017 was not covered by tests

if not name:
boundary = generate_unique_name("ResistiveSheet")

Check warning on line 3020 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3019-L3020

Added lines #L3019 - L3020 were not covered by tests

props = dict(

Check warning on line 3022 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3022

Added line #L3022 was not covered by tests
{
"Faces": assignment,
}
)

if self.solution_type in ["EddyCurrent", "Transient"]:
props["Resistance"] = resistance
elif self.solution_type == "Magnetostatic":
props["Nonlinear"] = non_linear
props["AnodeParA"] = anode_a
props["AnodeParB"] = anode_b
props["AnodeParC"] = anode_c
props["AnodeParD"] = anode_d
props["CathodeParA"] = cathode_a
props["CathodeParB"] = cathode_b
props["CathodeParC"] = cathode_c
props["CathodeParD"] = cathode_d

Check warning on line 3039 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3028-L3039

Added lines #L3028 - L3039 were not covered by tests

bound = BoundaryObject(self, boundary, props, "ResistiveSheet")
if bound.create():
self._boundaries[bound.name] = bound
return bound
return False

Check warning on line 3045 in src/ansys/aedt/core/maxwell.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/maxwell.py#L3041-L3045

Added lines #L3041 - L3045 were not covered by tests


class Maxwell2d(Maxwell, FieldAnalysis3D, object):
"""Provides the Maxwell 2D app interface.
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/aedt/core/modules/boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,8 @@
self._app.oboundary.AssignFluxTangential(self._get_args())
elif bound_type == "Plane Incident Wave":
self._app.oboundary.AssignPlaneWave(self._get_args())
elif bound_type == "ResistiveSheet":
self._app.oboundary.AssignResistiveSheet(self._get_args())

Check warning on line 1780 in src/ansys/aedt/core/modules/boundary.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modules/boundary.py#L1779-L1780

Added lines #L1779 - L1780 were not covered by tests
else:
return False
return True
Expand Down
Loading