Skip to content
Merged
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
10 changes: 7 additions & 3 deletions flow360/component/simulation/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from flow360.component.simulation.user_code.core.types import ValueOrExpression
from flow360.component.simulation.utils import model_attribute_unlock
from flow360.component.types import Axis
from flow360.exceptions import Flow360BoundaryMissingError


def _get_boundary_full_name(surface_name: str, volume_mesh_meta: dict[str, dict]) -> str:
Expand All @@ -43,11 +44,14 @@ def _get_boundary_full_name(surface_name: str, volume_mesh_meta: dict[str, dict]
return existing_boundary_name
if surface_name == "symmetric":
# Provides more info when the symmetric boundary is not auto generated.
raise ValueError(
raise Flow360BoundaryMissingError(
f"Parent zone not found for boundary: {surface_name}. "
+ "It is likely that it was never auto generated because the condition is not met."
"It is likely that it was never auto generated because the condition is not met."
)
raise ValueError(f"Parent zone not found for surface {surface_name}.")
raise Flow360BoundaryMissingError(
f"Parent zone not found for surface {surface_name}. "
"It may have been deleted due to overlapping with generated symmetry plane."
)


def _check_axis_is_orthogonal(axis_pair: Tuple[Axis, Axis]) -> Tuple[Axis, Axis]:
Expand Down
4 changes: 4 additions & 0 deletions flow360/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class Flow360ValidationError(Flow360Error):
"""Error when constructing FLow360 components."""


class Flow360BoundaryMissingError(Flow360Error):
"""Error when a boundary in simulation.json is not found in mesh metadata"""


class Flow360ErrorWithLocation(Exception):
"""
Error with metadata on where the error is in the SimulationParams.
Expand Down
Loading