Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions flow360/component/simulation/models/surface_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,26 @@ class TotalPressure(Flow360BaseModel):
type_name: Literal["TotalPressure"] = pd.Field("TotalPressure", frozen=True)
# pylint: disable=no-member
value: PressureType.Positive = pd.Field(description="The total pressure value.")
<<<<<<< HEAD
=======
velocity_direction: Optional[Axis] = pd.Field(
None,
description="Direction of the incoming flow. Must be a unit vector pointing "
+ "into the volume. If unspecified, the direction will be normal to the surface.",
)

@pd.model_validator(mode="after")
@deprecation_reminder(version="25.5.6")
def check_deprecate_velocity_direction(self):
"""Check if duplicate velocity_direction set up exists."""
# pylint: disable=unsupported-membership-test
if "velocity_direction" in self.model_fields_set:
log.warning(
"Specifying `velocity_direction` in `TotalPressure` will be deprecated in the "
+ "next (25.5.2) Python client release. Please specify it directly under `Inflow`."
)
return self
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))


class Pressure(SingleAttributeModel):
Expand Down Expand Up @@ -577,6 +597,25 @@ class Inflow(BoundaryBaseWithTurbulenceQuantities):
+ "into the volume. If unspecified, the direction will be normal to the surface.",
)

<<<<<<< HEAD
=======
@pd.model_validator(mode="after")
@deprecation_reminder(version="25.5.6")
def check_duplicate_velocity_direction_setup(self):
"""Check if duplicate velocity_direction set up exists."""

if (
self.velocity_direction
and isinstance(self.spec, TotalPressure)
and self.spec.velocity_direction
):
raise ValueError(
"Duplicate `velocity_direction` setup found in `TotalPressure` and `Inflow`, "
"please set `velocity_direction` in `Inflow`."
)
return self

>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))

class SlipWall(BoundaryBase):
""":class:`SlipWall` class defines the :code:`SlipWall` boundary condition.
Expand Down
30 changes: 30 additions & 0 deletions flow360/component/simulation/web/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,36 @@ def from_cloud(cls, draft_id: IDStringType) -> Draft:
def update_simulation_params(self, params):
"""update the SimulationParams of the draft"""

<<<<<<< HEAD
=======
@deprecation_reminder(version="25.5.6")
def remove_none_inflow_velocity_direction_for_forward_compatibility(params_dict):
"""
If None `velocity_direction` is found in root level of `Inflow` then
pop the key so that forward compatibility is kept within 25.5 release.
"""
if params_dict.get("models"):
for idx, model in enumerate(params_dict["models"]):
if model.get("type") != "Inflow":
continue
if "velocity_direction" in model.keys():
params_dict["models"][idx].pop("velocity_direction")
return params_dict

params_dict = params.model_dump(exclude_none=True)
if params_dict.get("models"):
# Remove hybrid_model:None to avoid triggering front end display activated toggle.
for idx, model in enumerate(params_dict["models"]):
if (
model.get("turbulence_model_solver") is not None
and model["turbulence_model_solver"].get("hybrid_model") is None
):
params_dict["models"][idx]["turbulence_model_solver"].pop("hybrid_model", None)
break
params_dict = remove_none_inflow_velocity_direction_for_forward_compatibility(
params_dict=params_dict
)
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
self.post(
json={
"data": params.model_dump_json(exclude_none=True),
Expand Down
7 changes: 7 additions & 0 deletions flow360/component/v1/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ def _no_update(params_as_dict):
("25.2.2", "25.2.3", _no_update),
("25.2.3", "25.4.0", _no_update),
("25.4.0", "25.4.1", _no_update),
<<<<<<< HEAD
("25.4.1", "25.5.*", _no_update),
("25.5.*", "25.7.*", _no_update),
=======
("25.4.1", "25.5.2", _no_update),
("25.5.2", "25.5.3", _no_update),
("25.5.3", "25.5.4", _no_update),
("25.5.4", "25.5.6", _no_update),
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
]


Expand Down
5 changes: 5 additions & 0 deletions flow360/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
version
"""

<<<<<<< HEAD
__version__ = "25.7.1b1"
__solver_version__ = "release-25.7"
=======
__version__ = "25.5.6"
__solver_version__ = "release-25.5"
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[tool.poetry]
name = "flow360"
<<<<<<< HEAD
version = "v25.7.1b1"
description = ""
=======
version = "v25.5.6"
description = "Flow360 Python Client"
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
authors = ["Flexcompute <support@flexcompute.com>"]

[tool.poetry.dependencies]
Expand Down
4 changes: 4 additions & 0 deletions tests/ref/simulation/service_init_geometry.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
<<<<<<< HEAD
"version": "25.7.1b1",
=======
"version": "25.5.6",
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
"unit_system": {
"name": "SI"
},
Expand Down
4 changes: 4 additions & 0 deletions tests/ref/simulation/service_init_surface_mesh.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
<<<<<<< HEAD
"version": "25.7.1b1",
=======
"version": "25.5.6",
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
"unit_system": {
"name": "SI"
},
Expand Down
4 changes: 4 additions & 0 deletions tests/ref/simulation/service_init_volume_mesh.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
<<<<<<< HEAD
"version": "25.7.1b1",
=======
"version": "25.5.6",
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
"unit_system": {
"name": "SI"
},
Expand Down
4 changes: 4 additions & 0 deletions tests/simulation/converter/ref/ref_monitor.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<<<<<<< HEAD
{"version":"25.7.1b1","unit_system":{"name":"SI"},"meshing":null,"reference_geometry":null,"operating_condition":null,"models":[{"material":{"type":"air","name":"air","dynamic_viscosity":{"reference_viscosity":{"value":0.00001716,"units":"Pa*s"},"reference_temperature":{"value":273.15,"units":"K"},"effective_temperature":{"value":110.4,"units":"K"}}},"initial_condition":{"type_name":"NavierStokesInitialCondition","constants":null,"rho":"rho","u":"u","v":"v","w":"w","p":"p"},"type":"Fluid","navier_stokes_solver":{"absolute_tolerance":1e-10,"relative_tolerance":0.0,"order_of_accuracy":2,"equation_evaluation_frequency":1,"linear_solver":{"max_iterations":30,"absolute_tolerance":null,"relative_tolerance":null},"private_attribute_dict":null,"CFL_multiplier":1.0,"kappa_MUSCL":-1.0,"numerical_dissipation_factor":1.0,"limit_velocity":false,"limit_pressure_density":false,"type_name":"Compressible","low_mach_preconditioner":false,"low_mach_preconditioner_threshold":null,"update_jacobian_frequency":4,"max_force_jac_update_physical_steps":0},"turbulence_model_solver":{"absolute_tolerance":1e-8,"relative_tolerance":0.0,"order_of_accuracy":2,"equation_evaluation_frequency":4,"linear_solver":{"max_iterations":20,"absolute_tolerance":null,"relative_tolerance":null},"private_attribute_dict":null,"CFL_multiplier":2.0,"type_name":"SpalartAllmaras","reconstruction_gradient_limiter":0.5,"quadratic_constitutive_relation":false,"modeling_constants":{"type_name":"SpalartAllmarasConsts","C_DES":0.72,"C_d":8.0,"C_cb1":0.1355,"C_cb2":0.622,"C_sigma":0.6666666666666666,"C_v1":7.1,"C_vonKarman":0.41,"C_w2":0.3,"C_t3":1.2,"C_t4":0.5,"C_min_rd":10.0},"update_jacobian_frequency":4,"max_force_jac_update_physical_steps":0,"hybrid_model":null,"rotation_correction":false, "controls":null},"transition_model_solver":{"type_name":"None"}}],"time_stepping":{"type_name":"Steady","max_steps":2000,"CFL":{"type":"adaptive","min":0.1,"max":10000.0,"max_relative_change":1.0,"convergence_limiting_factor":0.25}},"user_defined_dynamics":null,"user_defined_fields":[],"outputs":[{"name":"R1","entities":{"stored_entities":[{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"b9de2bce-36c1-4bbf-af0a-2c6a2ab713a4","name":"Point-0","location":{"value":[2.694298,0.0,1.0195910000000001],"units":"m"}}]},"output_fields":{"items":["primitiveVars"]},"output_type":"ProbeOutput"},{"name":"V3","entities":{"stored_entities":[{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"a79cffc0-31d0-499d-906c-f271c2320166","name":"Point-1","location":{"value":[4.007,0.0,-0.31760000000000005],"units":"m"}},{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"8947eb10-fc59-4102-b9c7-168a91ca22b9","name":"Point-2","location":{"value":[4.007,0.0,-0.29760000000000003],"units":"m"}},{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"27ac4e03-592b-4dba-8fa1-8f6678087a96","name":"Point-3","location":{"value":[4.007,0.0,-0.2776],"units":"m"}}]},"output_fields":{"items":["mut"]},"output_type":"ProbeOutput"}],"private_attribute_asset_cache":{"project_length_unit":null,"project_entity_info":null, "use_inhouse_mesher": false, "variable_context":null, "use_geometry_AI": false}}
=======
{"version":"25.5.6","unit_system":{"name":"SI"},"meshing":null,"reference_geometry":null,"operating_condition":null,"models":[{"material":{"type":"air","name":"air","dynamic_viscosity":{"reference_viscosity":{"value":0.00001716,"units":"Pa*s"},"reference_temperature":{"value":273.15,"units":"K"},"effective_temperature":{"value":110.4,"units":"K"}}},"initial_condition":{"type_name":"NavierStokesInitialCondition","constants":null,"rho":"rho","u":"u","v":"v","w":"w","p":"p"},"type":"Fluid","navier_stokes_solver":{"absolute_tolerance":1e-10,"relative_tolerance":0.0,"order_of_accuracy":2,"equation_evaluation_frequency":1,"linear_solver":{"max_iterations":30,"absolute_tolerance":null,"relative_tolerance":null},"private_attribute_dict":null,"CFL_multiplier":1.0,"kappa_MUSCL":-1.0,"numerical_dissipation_factor":1.0,"limit_velocity":false,"limit_pressure_density":false,"type_name":"Compressible","low_mach_preconditioner":false,"low_mach_preconditioner_threshold":null,"update_jacobian_frequency":4,"max_force_jac_update_physical_steps":0},"turbulence_model_solver":{"absolute_tolerance":1e-8,"relative_tolerance":0.0,"order_of_accuracy":2,"equation_evaluation_frequency":4,"linear_solver":{"max_iterations":20,"absolute_tolerance":null,"relative_tolerance":null},"private_attribute_dict":null,"CFL_multiplier":2.0,"type_name":"SpalartAllmaras","reconstruction_gradient_limiter":0.5,"quadratic_constitutive_relation":false,"modeling_constants":{"type_name":"SpalartAllmarasConsts","C_DES":0.72,"C_d":8.0,"C_cb1":0.1355,"C_cb2":0.622,"C_sigma":0.6666666666666666,"C_v1":7.1,"C_vonKarman":0.41,"C_w2":0.3,"C_t3":1.2,"C_t4":0.5,"C_min_rd":10.0},"update_jacobian_frequency":4,"max_force_jac_update_physical_steps":0,"hybrid_model":null,"rotation_correction":false},"transition_model_solver":{"type_name":"None"}}],"time_stepping":{"type_name":"Steady","max_steps":2000,"CFL":{"type":"adaptive","min":0.1,"max":10000.0,"max_relative_change":1.0,"convergence_limiting_factor":0.25}},"user_defined_dynamics":null,"user_defined_fields":[],"outputs":[{"name":"R1","entities":{"stored_entities":[{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"b9de2bce-36c1-4bbf-af0a-2c6a2ab713a4","name":"Point-0","location":{"value":[2.694298,0.0,1.0195910000000001],"units":"m"}}]},"output_fields":{"items":["primitiveVars"]},"output_type":"ProbeOutput"},{"name":"V3","entities":{"stored_entities":[{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"a79cffc0-31d0-499d-906c-f271c2320166","name":"Point-1","location":{"value":[4.007,0.0,-0.31760000000000005],"units":"m"}},{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"8947eb10-fc59-4102-b9c7-168a91ca22b9","name":"Point-2","location":{"value":[4.007,0.0,-0.29760000000000003],"units":"m"}},{"private_attribute_registry_bucket_name":"PointEntityType","private_attribute_entity_type_name":"Point","private_attribute_id":"27ac4e03-592b-4dba-8fa1-8f6678087a96","name":"Point-3","location":{"value":[4.007,0.0,-0.2776],"units":"m"}}]},"output_fields":{"items":["mut"]},"output_type":"ProbeOutput"}],"private_attribute_asset_cache":{"project_length_unit":null,"project_entity_info":null, "use_inhouse_mesher": false, "use_geometry_AI": false}}
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))
4 changes: 4 additions & 0 deletions tests/test_current_flow360_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@


def test_version():
<<<<<<< HEAD
assert __version__ == "25.7.1b1"
=======
assert __version__ == "25.5.6"
>>>>>>> a2099add (Bump to 25.5.6 for release (#1326))