Skip to content

Commit d1c3dc3

Browse files
anur7pyansys-ci-botgmalinveSamuelopez-ansys
authored
FIX: adding missing argument for 2d electrostatic balloon BC (#6011)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: gmalinve <[email protected]> Co-authored-by: Samuel Lopez <[email protected]>
1 parent 824117f commit d1c3dc3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

doc/changelog.d/6011.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
adding missing argument for 2d electrostatic balloon BC

src/ansys/aedt/core/maxwell.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,7 +3364,7 @@ def read_design_data(self):
33643364
return read_configuration_file(design_file)
33653365

33663366
@pyaedt_function_handler(edge_list="assignment", bound_name="boundary")
3367-
def assign_balloon(self, assignment, boundary=None):
3367+
def assign_balloon(self, assignment, boundary=None, is_voltage=False):
33683368
"""Assign a balloon boundary to a list of edges.
33693369
33703370
Parameters
@@ -3374,6 +3374,10 @@ def assign_balloon(self, assignment, boundary=None):
33743374
boundary : str, optional
33753375
Name of the boundary. The default is ``None``, in which
33763376
case the default name is used.
3377+
is_voltage: bool, optional
3378+
Balloon type. This option is valid for Electrostatic solvers only.
3379+
If ``True`` boundary type is "Voltage" otherwise is "Charge".
3380+
The default is ``False´´ in which case the "Charge" type is selected.
33773381
33783382
Returns
33793383
-------
@@ -3399,8 +3403,9 @@ def assign_balloon(self, assignment, boundary=None):
33993403

34003404
if not boundary:
34013405
boundary = generate_unique_name("Balloon")
3402-
3403-
props = dict({"Edges": assignment})
3406+
props = {"Edges": assignment}
3407+
if self.solution_type == "Electrostatic":
3408+
props["IsOfTypeVoltage"] = is_voltage
34043409
return self._create_boundary(boundary, props, "Balloon")
34053410

34063411
@pyaedt_function_handler(input_edge="assignment", vectorvalue="vector_value", bound_name="boundary")

tests/system/general/test_27_Maxwell2D.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def test_create_setup(self, aedtapp):
174174
def test_assign_balloon(self, aedtapp):
175175
region = aedtapp.modeler["Region"]
176176
aedtapp.assign_balloon(region.edges)
177+
aedtapp.solution_type = "Electrostatic"
178+
aedtapp.assign_balloon(region.edges, is_voltage=True)
177179

178180
def test_generate_design_data(self, aedtapp):
179181
assert aedtapp.generate_design_data()

0 commit comments

Comments
 (0)