Rotation#

class Rotation[source]#

Bases: Flow360BaseModel

Rotation class for specifying rotation settings.

Example

Define a rotation model outer_rotation for the volume_mesh["outer"] volume. The rotation center and axis are defined via the rotation entity’s property:

>>> outer_rotation_volume = volume_mesh["outer"]
>>> outer_rotation_volume.center = (-1, 0, 0) * fl.u.m
>>> outer_rotation_volume.axis = (0, 1, 0)
>>> outer_rotation = fl.Rotation(
...     name="outerRotation",
...     volumes=[outer_rotation_volume],
...     spec= fl.AngleExpression("sin(t)"),
... )

Define another rotation model inner_rotation for the volume_mesh["inner"] volume. inner_rotation is nested in outer_rotation by setting volume_mesh["outer"] as the Rotation.parent_volume:

>>> inner_rotation_volume = volume_mesh["inner"]
>>> inner_rotation_volume.center = (0, 0, 0) * fl.u.m
>>> inner_rotation_volume.axis = (0, 1, 0)
>>> inner_rotation = fl.Rotation(
...     name="innerRotation",
...     volumes=inner_rotation_volume,
...     spec= fl.AngleExpression("-2*sin(t)"),
...     parent_volume=outer_rotation_volume  # inner rotation is nested in the outer rotation.
... )

Attributes

name: str, optional#

Name of the Rotation model.

Default:

'Rotation'

entities: EntityList[GenericVolume, Cylinder, CustomVolume, SeedpointVolume, AxisymmetricBody, Sphere]#

The entity list for the Rotation model. The entity should be Cylinder, AxisymmetricBody, Sphere, or GenericVolume type.

spec: AngleExpression | FromUserDefinedDynamics | AngularVelocity#

The angular velocity or rotation angle as a function of time.

parent_volume: GenericVolume | Cylinder | CustomVolume | SeedpointVolume | AxisymmetricBody | Sphere, optional#

The parent rotating entity in a nested rotation case.The entity should be Cylinder, AxisymmetricBody, Sphere, or GenericVolume type.

Default:

None

rotating_reference_frame_model: bool, optional#

Flag to specify whether the non-inertial reference frame model is to be used for the rotation model. Steady state simulation requires this flag to be True for all rotation models.

Default:

None

Additional Constructors

classmethod from_file(filename)#

Load a Flow360BaseModel from a .json file.

Parameters:

filename (str)

Return type:

Flow360BaseModel

Methods

help(methods=False)#

Print fields and methods of a Flow360BaseModel using rich.

Parameters:

methods (bool)

Return type:

None

to_file(filename, **kwargs)#

Export Flow360BaseModel instance to a .json file.

Parameters:
Return type:

None