From d1003a26b2930f1fc44e0d862beee465b8f71b07 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:31:37 +0200 Subject: [PATCH] Implement and test flprj argument for FluidSimulation (#487) * Implement and test flprj argument for FluidSimulation * Test result extraction for flprj --- src/ansys/dpf/post/fluid_simulation.py | 2 +- tests/test_fluid_simulation.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ansys/dpf/post/fluid_simulation.py b/src/ansys/dpf/post/fluid_simulation.py index 76067c1a2..b7420c2d0 100644 --- a/src/ansys/dpf/post/fluid_simulation.py +++ b/src/ansys/dpf/post/fluid_simulation.py @@ -154,7 +154,7 @@ def __init__( else: ds = dpf.DataSources() if flprj: - raise NotImplementedError("flprj input not accepted yet") + ds.set_result_file_path(flprj, "flprj") if cas: if not isinstance(cas, list): cas = [cas] diff --git a/tests/test_fluid_simulation.py b/tests/test_fluid_simulation.py index bae53acf2..cfd3622d0 100644 --- a/tests/test_fluid_simulation.py +++ b/tests/test_fluid_simulation.py @@ -47,6 +47,14 @@ def test_simulation_str(self, fluent_simulation): assert fluent_simulation is not None assert str(fluent_simulation) + def test_simulation_flprj(self): + simulation = post.FluidSimulation( + flprj=examples.download_fluent_axial_comp()["flprj"] + ) + assert len(simulation.time_freq_support.time_frequencies) == 3 + result = simulation.static_pressure(all_sets=True) + assert len(result.columns.set_ids) == 3 + @pytest.mark.parametrize( "result_name", [