Case#

class Case[source]#

Bases: CaseBase, Flow360Resource

Case component

Properties

params: Flow360Params | SimulationParams#

returns case params

params_as_dict: dict#

returns case params as dictionary

parent: Case#

parent case

Returns:

parent case object

Return type:

Case

Raises:

RuntimeError – When case does not have parent

info: CaseMetaV2#

returns metadata info for case

info_v2: CaseMetaV2#

returns metadata v2 info for case

project_id: str | None#

Returns the project id of the case if case was run with V2 interface.

tags: List[str]#

get case tags

volume_mesh: VolumeMeshV2#

returns volume mesh

volume_mesh_id#

returns volume mesh id

results: CaseResultsModel#

returns results object to managing case results

usage: ResourceUsage#

Usage recorded for the case, fetched from the cloud on every access.

usage.compute stays None until the case finishes, so call wait() first. Read it once (usage = case.usage) rather than once per field.

Additional Constructors

classmethod from_cloud(case_id)[source]#

get case from cloud

Parameters:

case_id (str)

classmethod from_local_storage(local_storage_path, meta_data)[source]#

Create a Case instance from local storage.

Parameters:
  • local_storage_path (str) – The path to the local storage directory.

  • meta_data (CaseMeta) –

    Case metadata containing:

    • id (str): The unique identifier for the case.

    • name (str): The name of the case.

    • user_id (str): The user ID associated with the case, can be “local”.

Returns:

An instance of Case with data loaded from local storage.

Return type:

Case

Methods

get_simulation_params()[source]#

returns simulation params

has_parent()[source]#

Check if case has parent case

Returns:

True when case has parent, False otherwise

Return type:

bool

is_steady()[source]#

returns True when case is steady state

has_actuator_disks()[source]#

returns True when case has actuator disk

has_bet_disks()[source]#

returns True when case has BET disk

has_isosurfaces()[source]#

returns True when case has isosurfaces

has_monitors()[source]#

returns True when case has monitors

has_volume_output()[source]#

returns True when case has volume output

has_aeroacoustics()[source]#

returns True when case has aeroacoustics

has_user_defined_dynamics()[source]#

returns True when case has user defined dynamics

has_custom_forces()[source]#

returns True when case has custom forces

has_force_distributions()[source]#

returns True when case has force distributions

has_renders()[source]#

returns True when case has render outputs

move_to_folder(folder)[source]#

Move the current case to the specified folder.

Parameters:

folder (Folder) – The destination folder where the item will be moved.

Returns:

Returns the modified item after it has been moved to the new folder.

Return type:

self

Notes

This method sends a REST API request to move the current item to the specified folder. The folder parameter should be an instance of the Folder class with a valid ID.

rename(new_name)[source]#

Rename the current case.

Parameters:

new_name (str) – The new name for the case.

delete()[source]#

Delete the current case.

Goes through the v2 endpoint. The v1 one runs the S3 cleanup inline before it stops the pipeline job, so a failed cleanup leaves a deleted case still running.

stop()[source]#

Stop the running case, the same way Stop does in the web UI.

The solver stops at an upcoming step, its results are uploaded as usual, and the case finishes as completed. This returns once the request is sent; call wait() to block until the case finishes. As in the web UI, stopping a case re-creates its draft in the project.

Raises:

Flow360RuntimeError – If the case is not running: it has not started yet, or it has already finished.

classmethod create(name, params, volume_mesh_id=None, tags=None, parent_id=None, other_case=None, parent_case=None, solver_version=None)[source]#

Create new case :param name: :param params: :param volume_mesh_id: :param other_case: :param tags: :param parent_id: :param parent_case: :return:

Parameters:
  • name (str)

  • params (Flow360Params)

  • volume_mesh_id (str)

  • tags (List[str])

  • parent_id (str)

  • other_case (Case)

  • parent_case (Case)

  • solver_version (str)

Return type:

CaseDraft

retry(name=None, params=None, solver_version=None, tags=None)#

Retry case :param name: :param params: :param tags: :return:

Parameters:
  • name (str)

  • params (Flow360Params)

  • solver_version (str)

  • tags (List[str])

Return type:

CaseDraft

continuation(name=None, params=None, tags=None)#

Alias for fork a case to continue simulation :param name: :param params: :param tags: :return:

Parameters:
  • name (str)

  • params (Flow360Params)

  • tags (List[str])

Return type:

CaseDraft

fork(name=None, params=None, tags=None)#

Fork a case to continue simulation :param name: :param params: :param tags: :return:

Parameters:
  • name (str)

  • params (Flow360Params)

  • tags (List[str])

Return type:

CaseDraft