Skip to content

Commit

Permalink
test: test issue reported in Fluent console (#2543)
Browse files Browse the repository at this point in the history
test added
  • Loading branch information
seanpearsonuk authored Mar 7, 2024
1 parent e98ab21 commit 09b600c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ def test_ansys_units_integration(load_mixing_elbow_mesh):
assert hot_inlet.momentum.velocity.value.state_with_units() == velocity
velocity = ansys.units.Quantity(12.0, "m s^-1")
hot_inlet.momentum.velocity = velocity
assert hot_inlet.momentum.velocity.value() == velocity.value
assert hot_inlet.momentum.velocity.value.as_quantity() == velocity
assert hot_inlet.momentum.velocity.state_with_units() == {
"option": "value",
Expand Down Expand Up @@ -1087,6 +1088,30 @@ def test_ansys_units_integration_nested_state(load_mixing_elbow_mesh):
}


@pytest.mark.fluent_version(">=24.2")
def test_bug_1001124_quantity_assignment(load_mixing_elbow_mesh):
speed = ansys.units.Quantity(100, "m s^-1")
solver = load_mixing_elbow_mesh
solver.setup.boundary_conditions.velocity_inlet[
"hot-inlet"
].momentum.velocity.value = speed.value
assert (
solver.setup.boundary_conditions.velocity_inlet[
"hot-inlet"
].momentum.velocity.value()
== speed.value
)
solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].momentum.velocity = (
speed
)
assert (
solver.setup.boundary_conditions.velocity_inlet[
"hot-inlet"
].momentum.velocity.value()
== speed.value
)


def test_assert_type():
types = [
bool,
Expand Down

0 comments on commit 09b600c

Please sign in to comment.