From 47c5b6b51adf1595db0ae83de7c9aa85ed4b6809 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 24 Jul 2025 09:44:19 +0200 Subject: [PATCH 1/2] Modify test for new fluid variables --- tests/test_resultinfo.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index b3a9f5ed7c0..5482a0bb895 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -31,6 +31,7 @@ SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1, SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0, SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0, + SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0, ) if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0: @@ -206,13 +207,33 @@ def test_print_available_result_with_qualifiers(cfx_heating_coil, server_type): ) def test_print_result_info_with_qualifiers(cfx_heating_coil, server_type): model = Model(cfx_heating_coil(server=server_type), server=server_type) - if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: + if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0: ref = """Static analysis Unit system: Custom: m, kg, N, s, V, A, K Physics Type: Fluid Available results: - specific_heat: Nodal Specific Heat - epsilon: Nodal Epsilon + - aspect_ratio: Nodal Aspect Ratio + - static_enthalpy_beta: Nodal Static Enthalpy Beta + - velocity_u_beta: Nodal Velocity U Beta + - velocity_v_beta: Nodal Velocity V Beta + - velocity_w_beta: Nodal Velocity W Beta + - courant_number: Nodal Courant Number + - volume_of_finite_volumes: Nodal Volume Of Finite Volumes + - volume_porosity: Nodal Volume Porosity + - static_enthalpy_gradient: Nodal Static Enthalpy Gradient + - pressure_gradient: Nodal Pressure Gradient + - velocity_u_gradient: Nodal Velocity U Gradient + - velocity_v_gradient: Nodal Velocity V Gradient + - velocity_w_gradient: Nodal Velocity W Gradient + - mesh_expansion_factor: Nodal Mesh Expansion Factor + - orthogonality_angle: Nodal Orthogonality Angle + - absolute_pressure: Nodal Absolute Pressure + - specific_heat_capacity_at_constant_volume: Nodal Specific Heat Capacity At Constant Volume + - specific_volume: Nodal Specific Volume + - shear_strain_rate: Nodal Shear Strain Rate + - turbulence_eddy_frequency: Nodal Turbulence Eddy Frequency - enthalpy: Nodal Enthalpy - turbulent_kinetic_energy: Nodal Turbulent Kinetic Energy - thermal_conductivity: Nodal Thermal Conductivity @@ -228,7 +249,7 @@ def test_print_result_info_with_qualifiers(cfx_heating_coil, server_type): Available qualifier labels:""" # noqa else: ref = """Static analysis -Unit system: SI: m, kg, N, s, V, A, K +Unit system: ... Physics Type: Fluid Available results: - specific_heat: Nodal Specific Heat From a6dd1c7050af1a423de63d42ff533ad583e18fe5 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 24 Jul 2025 13:19:18 +0200 Subject: [PATCH 2/2] Modification --- tests/test_resultinfo.py | 103 ++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 60 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index 5482a0bb895..449bfc385ee 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -207,67 +207,50 @@ def test_print_available_result_with_qualifiers(cfx_heating_coil, server_type): ) def test_print_result_info_with_qualifiers(cfx_heating_coil, server_type): model = Model(cfx_heating_coil(server=server_type), server=server_type) + available_results_names = [] + for result in model.metadata.result_info.available_results: + available_results_names.append(result.name) + + expected_results = [ + "specific_heat", + "epsilon", + "enthalpy", + "turbulent_kinetic_energy", + "thermal_conductivity", + "dynamic_viscosity", + "turbulent_viscosity", + "static_pressure", + "total_pressure", + "density", + "entropy", + "temperature", + "total_temperature", + "velocity", + ] if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0: - ref = """Static analysis -Unit system: Custom: m, kg, N, s, V, A, K -Physics Type: Fluid -Available results: - - specific_heat: Nodal Specific Heat - - epsilon: Nodal Epsilon - - aspect_ratio: Nodal Aspect Ratio - - static_enthalpy_beta: Nodal Static Enthalpy Beta - - velocity_u_beta: Nodal Velocity U Beta - - velocity_v_beta: Nodal Velocity V Beta - - velocity_w_beta: Nodal Velocity W Beta - - courant_number: Nodal Courant Number - - volume_of_finite_volumes: Nodal Volume Of Finite Volumes - - volume_porosity: Nodal Volume Porosity - - static_enthalpy_gradient: Nodal Static Enthalpy Gradient - - pressure_gradient: Nodal Pressure Gradient - - velocity_u_gradient: Nodal Velocity U Gradient - - velocity_v_gradient: Nodal Velocity V Gradient - - velocity_w_gradient: Nodal Velocity W Gradient - - mesh_expansion_factor: Nodal Mesh Expansion Factor - - orthogonality_angle: Nodal Orthogonality Angle - - absolute_pressure: Nodal Absolute Pressure - - specific_heat_capacity_at_constant_volume: Nodal Specific Heat Capacity At Constant Volume - - specific_volume: Nodal Specific Volume - - shear_strain_rate: Nodal Shear Strain Rate - - turbulence_eddy_frequency: Nodal Turbulence Eddy Frequency - - enthalpy: Nodal Enthalpy - - turbulent_kinetic_energy: Nodal Turbulent Kinetic Energy - - thermal_conductivity: Nodal Thermal Conductivity - - dynamic_viscosity: Nodal Dynamic Viscosity - - turbulent_viscosity: Nodal Turbulent Viscosity - - static_pressure: Nodal Static Pressure - - total_pressure: Nodal Total Pressure - - density: Nodal Density - - entropy: Nodal Entropy - - temperature: Nodal Temperature - - total_temperature: Nodal Total Temperature - - velocity: Nodal Velocity -Available qualifier labels:""" # noqa - else: - ref = """Static analysis -Unit system: ... -Physics Type: Fluid -Available results: - - specific_heat: Nodal Specific Heat - - epsilon: Nodal Epsilon - - enthalpy: Nodal Enthalpy - - turbulent_kinetic_energy: Nodal Turbulent Kinetic Energy - - thermal_conductivity: Nodal Thermal Conductivity - - dynamic_viscosity: Nodal Dynamic Viscosity - - turbulent_viscosity: Nodal Turbulent Viscosity - - static_pressure: Nodal Static Pressure - - total_pressure: Nodal Total Pressure - - density: Nodal Density - - entropy: Nodal Entropy - - temperature: Nodal Temperature - - total_temperature: Nodal Total Temperature - - velocity: Nodal Velocity -Available qualifier labels:""" # noqa - assert ref in str(model.metadata.result_info) + expected_results.append("aspect_ratio") + expected_results.append("static_enthalpy_beta") + expected_results.append("velocity_u_beta") + expected_results.append("velocity_v_beta") + expected_results.append("velocity_w_beta") + expected_results.append("courant_number") + expected_results.append("volume_of_finite_volumes") + expected_results.append("volume_porosity") + expected_results.append("static_enthalpy_gradient") + expected_results.append("pressure_gradient") + expected_results.append("velocity_u_gradient") + expected_results.append("velocity_v_gradient") + expected_results.append("velocity_w_gradient") + expected_results.append("mesh_expansion_factor") + expected_results.append("orthogonality_angle") + expected_results.append("absolute_pressure") + expected_results.append("specific_heat_capacity_at_constant_volume") + expected_results.append("specific_volume") + expected_results.append("shear_strain_rate") + expected_results.append("turbulence_eddy_frequency") + + for result in expected_results: + assert result in available_results_names @pytest.mark.skipif(True, reason="Used to test memory leaks")