pogona.SensorFlowRate

class pogona.SensorFlowRate[source]

Bases: pogona.component.Component

At the beginning of the simulation, the position of N sample points will be randomly set inside this sensor’s Geometry. In each time step, the flow speed inside attached_object will be sampled and logged for each of these points.

This class is intentionally not a subclass of the Sensor class, since child classes of Sensor have so far been reserved for sensors monitoring the positions of particles. (In its current implementation, the SensorManager considers all Sensor instances for sensor subscriptions, which we don’t need for sampling the flow rate.)

Attributes

attached_object

Component name of the object in which to sample the flow rate.

column_prefix

Column header prefix for each sample point.

component_name

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

custom_sample_points_global

Points to sample the flow rate at in every time step.

log_folder

The file sensor[<component name>].csv will be created in here.

log_mesh_index

If True, log the attached object's unique mesh index in each time step.

num_sample_points

The number of sample points N that will be added in addition to any sample points already defined in sample_points.

rotation

scale

seed

Seed for the pseudo-random number generator.

shape

Shape of this sensor.

translation

__init__()[source]

Methods

__init__()

finalize(simulation_kernel)

initialize(simulation_kernel, init_stage)

Use InitStages to initialize this Component instance.

initialize_sample_points()

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: pogona.simulation_kernel.SimulationKernel)[source]
initialize(simulation_kernel: pogona.simulation_kernel.SimulationKernel, init_stage: pogona.component.InitStages)[source]

Use InitStages to initialize this Component instance.

initialize_sample_points()[source]
process_new_time_step(simulation_kernel: pogona.simulation_kernel.SimulationKernel, notification_stage: pogona.component.NotificationStages)[source]
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().

attached_object = ''

Component name of the object in which to sample the flow rate.

column_prefix = 'flow_mps_'

Column header prefix for each sample point.

By default, if num_sample_points is 2, for example, the output CSV may have the following columns: [sim_time, flow_mps_[0 0 0]_x, flow_mps_[0 0 0]_y, flow_mps_[0 0 0]_z, flow_mps_[1 0 0]_x, flow_mps_[1 0 0]_y, flow_mps_[1 0 0]_z]

component_name = 'Generic component'

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

custom_sample_points_global = []

Points to sample the flow rate at in every time step. Coordinates are in global coordinates. If num_sample_points is not 0, this list will be extended with randomly positioned points.

id

Unique integer component ID

log_folder = 'sensor_data'

The file sensor[<component name>].csv will be created in here.

log_mesh_index = False

If True, log the attached object’s unique mesh index in each time step.

num_sample_points = 1

The number of sample points N that will be added in addition to any sample points already defined in sample_points.

rotation = [0, 0, 0]
scale = [1, 1, 1]
seed = ''

Seed for the pseudo-random number generator. If ‘’, the random number generator of the simulation kernel will be used. If ‘random’, a random seed will be used for initialization.

shape = 'NONE'

Shape of this sensor. Valid shapes are defined in the pg.Shapes enum.

translation = [0, 0, 0]