Skip to content

FIX: Correct unit for h-field in set_non_linear() for bh curve definition #6156

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

Merged
merged 8 commits into from
May 14, 2025
1 change: 1 addition & 0 deletions doc/changelog.d/6156.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct unit for h-field in set_non_linear() for bh curve definition
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/modules/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@
if self.name == "permeability":
if not y_unit:
y_unit = "tesla"
if not y_unit:
if not x_unit:

Check warning on line 968 in src/ansys/aedt/core/modules/material.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modules/material.py#L968

Added line #L968 was not covered by tests
x_unit = "A_per_meter"
self.bunit = y_unit
self.hunit = x_unit
Expand Down
1 change: 1 addition & 0 deletions tests/system/general/test_03_Materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def test_09_non_linear_materials(self, add_app):
assert app.materials["myMat"].conductivity.type == "nonlinear"
assert app.materials["myMat"].permittivity.type == "nonlinear"
assert app.materials["myMat"].permeability.bunit == "tesla"
assert app.materials["myMat"].permeability.hunit == "A_per_meter"
mat2 = app.materials.add_material("myMat2")
assert not mat2.is_used
assert app.modeler.create_box([0, 0, 0], [10, 10, 10], material="myMat2")
Expand Down