pogona.objects.ObjectYPiece

class pogona.objects.ObjectYPiece[source]

Bases: Object

Attributes

angle

Angle between outlet and particle inlet in degrees.

background_inlet_length

Length of the background flow inlet in meters.

component_name

Unique name of this component, unless it is "Generic component".

dummy_boundary_points

Whether to insert dummy points at the boundary of the mesh, and where exactly.

fallback_background_rate_mlpmin

Fallback background flow rate for making sensor subscriptions possible in the case that this Object starts with an overall flow rate of 0 (i.e., is_active == False).

fallback_injection_rate_mlpmin

Fallback injection flow rate for making sensor subscriptions possible in the case that this Object starts with an overall flow rate of 0 (i.e., is_active == False).

flow_rate_background

Background flow rate in ml/min.

flow_rate_injection

Flow rate in the injection tube in ml/min.

injection_inlet_length

Length of the particle injection inlet tube in meters.

is_active

name

The name of this object.

object_id

Object index, set by the scene manager.

openfoam_cases_path

Path to all OpenFOAM simulation cases.

outlet_length

Length of the outlet tube in meters.

outlet_zone

For teleporting: If a molecule enters this zone at the end of the outlet tube, it will be teleported to a connected object.

radius

Radius of the outlet tube in meters.

rotation

scale

translation

use_sensor_subscriptions

Notify subscribed sensors based on object mesh cells.

variant

Additional variant information.

walls_patch_names

__init__()[source]

Methods

__init__()

finalize(simulation_kernel)

find_latest_time_step(path)

return

The highest-valued subdirectory of path that is named

get_closest_cell_centre_id(position_global)

returns

Array of closest cell centers to position.

get_current_mesh_global()

get_current_mesh_local()

get_fallback_mesh_index()

If an Object supports sensor subscriptions, some OpenFOAM case with a non-zero flow rate should exist (i.e., a vector field for which this Object has self.is_active == True).

get_flow(simulation_kernel, position_global, ...)

get_mesh_index()

returns

A unique string for the current configuration of this object.

get_outlet_area(outlet_name)

get_path([use_latest_time_step, fallback])

param use_latest_time_step

Find the latest time step in path.

get_transformation()

get_vector_field_manager()

get_ypiece_mesh_index(injection_rate_mlpmin, ...)

initialize(simulation_kernel, init_stage)

Use InitStages to initialize this Component instance.

load_current_vector_field(simulation_kernel)

process_changed_inlet_flow_rate(...)

Update the flow rate inside this Object based on the changed flow rate of the inlet with name inlet_name, then propagate this change to any Object connected to this Object's outlets.

process_new_time_step(simulation_kernel, ...)

set_arguments(**kwargs)

Read arguments as key value pairs and set this component's member variables accordingly.

__init__()[source]
finalize(simulation_kernel: SimulationKernel)
static find_latest_time_step(path: str) str
Returns

The highest-valued subdirectory of path that is named only after a floating point value. E.g., if there are ‘{path}/0/’ and ‘{path}/0.1/’, this will return ‘0.1’.

get_closest_cell_centre_id(position_global: ndarray) Optional[ndarray]
Returns

Array of closest cell centers to position. If there’s only one position, output is squeezed. None if this Object is inactive. See documentation of cKDTree.query().

get_current_mesh_global() Optional[ndarray]
get_current_mesh_local() Optional[ndarray]
get_fallback_mesh_index() Optional[str][source]

If an Object supports sensor subscriptions, some OpenFOAM case with a non-zero flow rate should exist (i.e., a vector field for which this Object has self.is_active == True). If this object is initially inactive, however, we still need to know where to find this mesh for the initialization of the SensorManager.

Returns

A valid mesh index independent of this Object’s is_active status. None if this Object does not support sensor subscriptions.

get_flow(simulation_kernel: SimulationKernel, position_global: ndarray, sim_time: float)
get_mesh_index()[source]
Returns

A unique string for the current configuration of this object. Used for caching.

get_outlet_area(outlet_name: str)[source]
get_path(use_latest_time_step=False, fallback=False) str
Parameters
  • use_latest_time_step – Find the latest time step in path. If False, use this Object’s _default_time_str, which may still be set to ‘latest’, which has the same effect.

  • fallback – Use get_fallback_mesh_index instead of get_mesh_index.

Returns

Path to the OpenFOAM files for this object.

get_transformation() Transformation
get_vector_field_manager() Optional[VectorFieldManager]
get_ypiece_mesh_index(injection_rate_mlpmin: float, background_rate_mlpmin: float) str[source]
initialize(simulation_kernel: SimulationKernel, init_stage: InitStages)[source]

Use InitStages to initialize this Component instance.

load_current_vector_field(simulation_kernel: SimulationKernel)
process_changed_inlet_flow_rate(simulation_kernel: SimulationKernel, inlet_name: str, flow_rate: float)[source]

Update the flow rate inside this Object based on the changed flow rate of the inlet with name inlet_name, then propagate this change to any Object connected to this Object’s outlets.

Should also update is_active accordingly.

process_new_time_step(simulation_kernel: SimulationKernel, notification_stage: NotificationStages)
set_arguments(**kwargs)

Read arguments as key value pairs and set this component’s member variables accordingly. Validity of the argument values will be checked in initialize().

angle = 30.0

Angle between outlet and particle inlet in degrees.

background_inlet_length = 0.01

Length of the background flow inlet in meters.

component_name = 'Generic component'

Unique name of this component, unless it is “Generic component”.

dummy_boundary_points = 'NONE'

Whether to insert dummy points at the boundary of the mesh, and where exactly. This may help with interpolation.

fallback_background_rate_mlpmin = 5.0

Fallback background flow rate for making sensor subscriptions possible in the case that this Object starts with an overall flow rate of 0 (i.e., is_active == False).

fallback_injection_rate_mlpmin = 0.0

Fallback injection flow rate for making sensor subscriptions possible in the case that this Object starts with an overall flow rate of 0 (i.e., is_active == False).

flow_rate_background = 5.0

Background flow rate in ml/min.

flow_rate_injection = 0.0

Flow rate in the injection tube in ml/min.

id

Unique integer component ID

injection_inlet_length = 0.04

Length of the particle injection inlet tube in meters.

inlets: List[str]

Names of the inlets in the OpenFOAM mesh.

property is_active
name: str = 'Y-Piece'

The name of this object.

object_id = -1

Object index, set by the scene manager.

openfoam_cases_path = ''

Path to all OpenFOAM simulation cases. Subclasses may use this as the base path to find their respective meshes via get_path().

outlet_length = 0.04

Length of the outlet tube in meters.

outlet_zone = 0.005

For teleporting: If a molecule enters this zone at the end of the outlet tube, it will be teleported to a connected object.

outlets: List[str]

Names of the outlets in the OpenFOAM mesh.

radius = 0.00075

Radius of the outlet tube in meters.

rotation = [0, 0, 0]
scale = [1, 1, 1]
translation = [0, 0, 0]
use_sensor_subscriptions = 'USE_DEFAULT'

Notify subscribed sensors based on object mesh cells. This speeds up simulation. Only disable this if you are constrained by memory or if the object does not have a mesh in the first place. If None, use the SensorManager’s default_use_sensor_subscriptions.

variant = ''

Additional variant information.

If given, look for an OpenFOAM case with ‘_<variant>’ appended to its path name.

property walls_patch_names