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]#

The entity list for the Rotation model. The entity should be Cylinder or AxisymmetricBody 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, optional#

The parent rotating entity in a nested rotation case.The entity should be Cylinder or AxisymmetricBody 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)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')