diff --git a/flow360/component/simulation/translator/solver_translator.py b/flow360/component/simulation/translator/solver_translator.py index 2e8489517..c12e9171d 100644 --- a/flow360/component/simulation/translator/solver_translator.py +++ b/flow360/component/simulation/translator/solver_translator.py @@ -1649,6 +1649,8 @@ def boundary_spec_translator(model: SurfaceModelTypes, op_acoustic_to_static_pre boundary["totalTemperatureRatio"] = model_dict["totalTemperature"] if model.velocity_direction is not None: boundary["velocityDirection"] = list(model_dict["velocityDirection"]) + if model.rotate_velocity_direction_with_mesh: + boundary["rotateVelocityDirectionWithMesh"] = True if isinstance(model.spec, TotalPressure): boundary["type"] = "SubsonicInflow" total_pressure_ratio = model_dict["spec"]["value"] diff --git a/pyproject.toml b/pyproject.toml index a2cd89392..6d2e02a0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ pydantic = ">=2.8,<2.12" # -- Local dev (editable install, schema changes take effect immediately): # flow360-schema = { path = "../../../../flex/share/flow360-schema", develop = true } # -- CI / release (install from CodeArtifact, swap comments before pushing): -flow360-schema = { version = "~0.1.24", source = "codeartifact" } +flow360-schema = { version = "= 25.10.1b2", source = "codeartifact" } pytest = "^7.1.2" click = "^8.1.3" toml = "^0.10.2" diff --git a/tests/simulation/translator/test_solver_translator.py b/tests/simulation/translator/test_solver_translator.py index faef5fbd6..a5c525f90 100644 --- a/tests/simulation/translator/test_solver_translator.py +++ b/tests/simulation/translator/test_solver_translator.py @@ -943,6 +943,51 @@ def test_boundaries(): translate_and_compare(param, mesh_unit=1 * u.m, ref_json_file="Flow360_boundaries.json") +def test_rotate_velocity_direction_with_mesh(): + """Verify rotateVelocityDirectionWithMesh is emitted only when set to True.""" + operating_condition = AerospaceCondition(velocity_magnitude=10 * u.m / u.s) + with SI_unit_system: + param_default = SimulationParams( + operating_condition=operating_condition, + models=[ + Inflow( + name="exhaust", + total_temperature=750 * u.K, + surfaces=Surface(name="engine_face"), + spec=Supersonic( + total_pressure=3e6 * u.Pa, + static_pressure=101325 * u.Pa, + ), + velocity_direction=(0, -1, 0), + ), + ], + ) + param_enabled = SimulationParams( + operating_condition=operating_condition, + models=[ + Inflow( + name="exhaust", + total_temperature=750 * u.K, + surfaces=Surface(name="engine_face"), + spec=Supersonic( + total_pressure=3e6 * u.Pa, + static_pressure=101325 * u.Pa, + ), + velocity_direction=(0, -1, 0), + rotate_velocity_direction_with_mesh=True, + ), + ], + ) + + translated_default = get_solver_json(param_default, mesh_unit=1 * u.m) + bc_default = translated_default["boundaries"]["engine_face"] + assert "rotateVelocityDirectionWithMesh" not in bc_default + + translated_enabled = get_solver_json(param_enabled, mesh_unit=1 * u.m) + bc_enabled = translated_enabled["boundaries"]["engine_face"] + assert bc_enabled["rotateVelocityDirectionWithMesh"] is True + + def test_liquid_simulation_translation(): with SI_unit_system: param = SimulationParams(