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
6 changes: 6 additions & 0 deletions flow360/component/simulation/meshing_param/face_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pydantic as pd

import flow360.component.simulation.units as u
from flow360.component.simulation.framework.base_model import Flow360BaseModel
from flow360.component.simulation.framework.entity_base import EntityList
from flow360.component.simulation.primitives import Surface
Expand Down Expand Up @@ -77,6 +78,11 @@ class GeometryRefinement(Flow360BaseModel):
+ "to geometry_accuracy should be resolved accurately during the surface meshing process.",
)

sealing_size: Optional[LengthType.NonNegative] = pd.Field(
0.0 * u.m,
description="Threshold size below which all geometry gaps are automatically closed. Zero is deactivated.",
)

# Note: No checking on deleted surfaces since geometry accuracy on deleted surface does impact the volume mesh.

@pd.model_validator(mode="after")
Expand Down
7 changes: 7 additions & 0 deletions flow360/component/simulation/meshing_param/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ class MeshingDefaults(Flow360BaseModel):
+ "This can be overridden with class: ~flow360.GeometryRefinement",
)

sealing_size: Optional[LengthType.NonNegative] = pd.Field(
0.0 * u.m,
description="Threshold size below which all geometry gaps are automatically closed. "
+ "Zero is deactivated. This can be overridden with class: ~flow360.GeometryRefinement",
)

@pd.field_validator("number_of_boundary_layers", mode="after")
@classmethod
def invalid_number_of_boundary_layers(cls, value):
Expand Down Expand Up @@ -201,6 +207,7 @@ def invalid_geometry_accuracy(cls, value):
"surface_max_aspect_ratio",
"surface_max_adaptation_iterations",
"preserve_thin_geometry",
"sealing_size",
mode="after",
)
@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def _get_volume_zones(volume_zones_list: list[dict]):
"preserve_thin_geometry": None,
"surface_max_aspect_ratio": None,
"surface_max_adaptation_iterations": None,
"sealing_size": None,
},
"refinements": _get_surface_refinements,
"volume_zones": _get_volume_zones,
Expand Down
6 changes: 5 additions & 1 deletion tests/ref/simulation/service_init_geometry.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
"value": 12.0,
"units": "degree"
},
"preserve_thin_geometry": false
"preserve_thin_geometry": false,
"sealing_size": {
"value": 0.0,
"units": "m"
}
},
"refinements": [],
"volume_zones": [
Expand Down
6 changes: 5 additions & 1 deletion tests/ref/simulation/service_init_surface_mesh.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
"value": 12.0,
"units": "degree"
},
"preserve_thin_geometry": false
"preserve_thin_geometry": false,
"sealing_size": {
"value": 0.0,
"units": "m"
}
},
"refinements": [],
"volume_zones": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
},
"preserve_thin_geometry": false,
"surface_max_aspect_ratio": 0.01,
"surface_max_adaptation_iterations": 19
"surface_max_adaptation_iterations": 19,
"sealing_size": {
"value": 0.0,
"units": "flow360_length_unit"
}
},
"refinements": [
{
Expand Down Expand Up @@ -178,10 +182,14 @@
}
]
},
"preserve_thin_geometry": false,
"geometry_accuracy": {
"value": 0.05,
"units": "flow360_length_unit"
},
"preserve_thin_geometry": false,
"sealing_size": {
"value": 0.0,
"units": "flow360_length_unit"
}
}
],
Expand Down
Loading