pogona.SensorFlowRate
- class pogona.SensorFlowRate[source]
Bases:
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
Component name of the object in which to sample the flow rate.
Column header prefix for each sample point.
Unique name of this component, unless it is "Generic component".
Points to sample the flow rate at in every time step.
The file sensor[<component name>].csv will be created in here.
If True, log the attached object's unique mesh index in each time step.
The number of sample points N that will be added in addition to any sample points already defined in sample_points.
Seed for the pseudo-random number generator.
Shape of this sensor.
Methods
__init__
()finalize
(simulation_kernel)initialize
(simulation_kernel, init_stage)Use
InitStages
to initialize this Component instance.process_new_time_step
(simulation_kernel, ...)set_arguments
(**kwargs)Read arguments as key value pairs and set this component's member variables accordingly.
- finalize(simulation_kernel: SimulationKernel)[source]
- initialize(simulation_kernel: SimulationKernel, init_stage: InitStages)[source]
Use
InitStages
to initialize this Component instance.
- process_new_time_step(simulation_kernel: SimulationKernel, notification_stage: 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]