Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
outer_radius=1.0,
height=2.5,
)
sliding_interface = fl.RotationCylinder(
sliding_interface = fl.RotationVolume(
spacing_axial=0.04,
spacing_radial=0.04,
spacing_circumferential=0.04,
Expand Down
26 changes: 20 additions & 6 deletions examples/advanced_simulations/rotorcraft/isolated_propeller.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@

with fl.SI_unit_system:
rotating_cylinder = fl.Cylinder(
name="Rotating zone", center=[0, 0, 0], axis=[1, 0, 0], outer_radius=2, height=0.8
name="Rotating zone",
center=[0, 0, 0],
axis=[1, 0, 0],
outer_radius=2,
height=0.8,
)
refinement_cylinder = fl.Cylinder(
name="Refinement zone", center=[1.9, 0, 0], axis=[1, 0, 0], outer_radius=2, height=4
name="Refinement zone",
center=[1.9, 0, 0],
axis=[1, 0, 0],
outer_radius=2,
height=4,
)
slice = fl.Slice(name="Slice", normal=[1, 0, 0], origin=[0.6, 0, 0])
volume_zone_rotating_cylinder = fl.RotationCylinder(
volume_zone_rotating_cylinder = fl.RotationVolume(
name="Rotation cylinder",
spacing_axial=0.05,
spacing_radial=0.05,
Expand All @@ -30,11 +38,14 @@
params = fl.SimulationParams(
meshing=fl.MeshingParams(
defaults=fl.MeshingDefaults(
surface_max_edge_length=1, boundary_layer_first_layer_thickness=0.1 * fl.u.mm
surface_max_edge_length=1,
boundary_layer_first_layer_thickness=0.1 * fl.u.mm,
),
refinements=[
fl.UniformRefinement(
name="Uniform refinement", spacing=0.025, entities=[refinement_cylinder]
name="Uniform refinement",
spacing=0.025,
entities=[refinement_cylinder],
)
],
volume_zones=[farfield, volume_zone_rotating_cylinder],
Expand Down Expand Up @@ -63,7 +74,10 @@
step_size=0.0025,
max_pseudo_steps=35,
CFL=fl.AdaptiveCFL(
min=0.1, max=10000, max_relative_change=1, convergence_limiting_factor=0.5
min=0.1,
max=10000,
max_relative_change=1,
convergence_limiting_factor=0.5,
),
),
outputs=[
Expand Down
26 changes: 20 additions & 6 deletions examples/post_processing/field_data/time_averaged_isosurfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@

with fl.SI_unit_system:
rotating_cylinder = fl.Cylinder(
name="Rotating zone", center=[0, 0, 0], axis=[1, 0, 0], outer_radius=2, height=0.8
name="Rotating zone",
center=[0, 0, 0],
axis=[1, 0, 0],
outer_radius=2,
height=0.8,
)
refinement_cylinder = fl.Cylinder(
name="Refinement zone", center=[1.9, 0, 0], axis=[1, 0, 0], outer_radius=2, height=4
name="Refinement zone",
center=[1.9, 0, 0],
axis=[1, 0, 0],
outer_radius=2,
height=4,
)
slice = fl.Slice(name="Slice", normal=[1, 0, 0], origin=[0.6, 0, 0])
volume_zone_rotating_cylinder = fl.RotationCylinder(
volume_zone_rotating_cylinder = fl.RotationVolume(
name="Rotation cylinder",
spacing_axial=0.05,
spacing_radial=0.05,
Expand All @@ -31,11 +39,14 @@
params = fl.SimulationParams(
meshing=fl.MeshingParams(
defaults=fl.MeshingDefaults(
surface_max_edge_length=1, boundary_layer_first_layer_thickness=0.1 * fl.u.mm
surface_max_edge_length=1,
boundary_layer_first_layer_thickness=0.1 * fl.u.mm,
),
refinements=[
fl.UniformRefinement(
name="Uniform refinement", spacing=0.025, entities=[refinement_cylinder]
name="Uniform refinement",
spacing=0.025,
entities=[refinement_cylinder],
)
],
volume_zones=[farfield, volume_zone_rotating_cylinder],
Expand Down Expand Up @@ -64,7 +75,10 @@
step_size=0.0025,
max_pseudo_steps=35,
CFL=fl.AdaptiveCFL(
min=0.1, max=10000, max_relative_change=1, convergence_limiting_factor=0.5
min=0.1,
max=10000,
max_relative_change=1,
convergence_limiting_factor=0.5,
),
),
outputs=[
Expand Down
2 changes: 2 additions & 0 deletions flow360/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
AutomatedFarfield,
AxisymmetricRefinement,
RotationCylinder,
RotationVolume,
UniformRefinement,
UserDefinedFarfield,
)
Expand Down Expand Up @@ -198,6 +199,7 @@
"AutomatedFarfield",
"AxisymmetricRefinement",
"RotationCylinder",
"RotationVolume",
"UniformRefinement",
"SurfaceEdgeRefinement",
"HeightBasedRefinement",
Expand Down
5 changes: 4 additions & 1 deletion flow360/component/simulation/framework/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,10 @@ def preprocess(
required_by = []

solver_values = self._nondimensionalization(
params=params, exclude=exclude, required_by=required_by, registry_lookup=registry_lookup
params=params,
exclude=exclude,
required_by=required_by,
registry_lookup=registry_lookup,
)
for property_name, value in self.__dict__.items():
if property_name in exclude:
Expand Down
18 changes: 13 additions & 5 deletions flow360/component/simulation/meshing_param/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
AutomatedFarfield,
AxisymmetricRefinement,
RotationCylinder,
RotationVolume,
UniformRefinement,
UserDefinedFarfield,
)
Expand Down Expand Up @@ -47,7 +48,13 @@
]

VolumeZonesTypes = Annotated[
Union[RotationCylinder, AutomatedFarfield, UserDefinedFarfield, CustomVolume],
Union[
RotationVolume,
RotationCylinder,
AutomatedFarfield,
UserDefinedFarfield,
CustomVolume,
],
pd.Field(discriminator="type"),
]

Expand Down Expand Up @@ -332,7 +339,7 @@ def _check_no_reused_volume_entities(self) -> Self:
usage = EntityUsageMap()

for volume_zone in self.volume_zones if self.volume_zones is not None else []:
if isinstance(volume_zone, RotationCylinder):
if isinstance(volume_zone, (RotationVolume, RotationCylinder)):
# pylint: disable=protected-access
_ = [
usage.add_entity_usage(item, volume_zone.type)
Expand All @@ -350,9 +357,10 @@ def _check_no_reused_volume_entities(self) -> Self:
error_msg = ""
for entity_type, entity_model_map in usage.dict_entity.items():
for entity_info in entity_model_map.values():
if len(entity_info["model_list"]) == 1 or sorted(
entity_info["model_list"]
) == sorted(["RotationCylinder", "UniformRefinement"]):
if len(entity_info["model_list"]) == 1 or sorted(entity_info["model_list"]) in [
sorted(["RotationCylinder", "UniformRefinement"]),
sorted(["RotationVolume", "UniformRefinement"]),
]:
# RotationCylinder and UniformRefinement are allowed to be used together
continue

Expand Down
Loading
Loading