fluidlab.objects.pumps

Pumps (fluidlab.objects.pumps)

Provides:

class fluidlab.objects.pumps.MasterFlexPumps(nb_pumps=2, verbose=False)[source]

Represent some Masterflex pumps.

We use Masterflex L/S (model number 7551.00).

Parameters:
nb_pumps{2, int}, optional

Number of pumps

verbose{False, bool}, optional

If True, more verbose.

Notes

The pumps and this class are often used with the class fluidlab.objects.tanks.StratifiedTank.

Attributes:
flow_rates_max: `numpy.ndarray`

Maximum flow rates of the pumps.

pumps: list

List of the pump indexes.

serial: serial.Serial

Object representing the serial port connected to the pumps.

_command(command, pumps=None, verbose=False)[source]

Send a command to some pumps.

Parameters:
commandstr

The command that has to be send to the pumps.

pumpsint or array_like

The index of one pump or an array_like containing the indexes of pumps.

verbosebool

More verbose If equal to True.

Returns:
resultslist

The results of the commands.

Notes

The command can be for example ‘’, ‘G0’, ‘I’, ‘z’…

go(pumps=None)[source]

Start some pumps.

Send the command ‘G0’ to the pumps.

Parameters:
pumps{None, int, array_like}, optional

The index of one pump or an array_like containing the indexes of pumps. If None, the function uses self.pumps.

set_rot_per_min(rots_per_min=0, pumps=None)[source]

Set the number of rotations per min for some pumps.

Parameters:
rots_per_minnumber or array_like

The rotation rate(s) in rotations per mimute.

pumps{None, int, array_like}, optional

The index of one pump or an array_like containing the indexes of pumps. If None, the function uses self.pumps.

stop(pumps=None)[source]

Stop some pumps.

Parameters:
pumps{None, int, array_like}, optional

The index of one pump or an array_like containing the indexes of pumps. If None, the function uses self.pumps.

_give_list_pumps(pumps=None)[source]

Return a list of pump indexes.

Parameters:
pumps{None, int, array_like}, optional

The index of one pump or an array_like containing the indexes of pumps. If None, the function uses self.pumps.

calibrate(pumps=None, nb_mins=4)[source]

Calibrate the pumps.

Parameters:
pumps{None, int, array_like}, optional

The index of one pump or an array_like containing the indexes of pumps. If None, the function uses self.pumps.

nb_mins{4, number}

Number of minutes for calibrating one pumps.

set_flow_rate(flow_rates=0, pumps=None)[source]

Set the flow rates.

Parameters:
flow_rates{number, array_like}

flow rates in ml/min.

pumps{None, int, array_like}, optional

The index of one pump or an array_like containing the indexes of pumps. If None, the function uses self.pumps.

test_one_pump(pump=1, vol_to_pump=2000.0, flow_rate_test=None)[source]

Test one pump and print actual maximum flowrate.

Pump with the pump with the index pump an approximate volume vol_to_pump. Ask for a measure of the volume actually pumped. Print the “actual” maximum flowrate for the tested pump (which can be written in the function __init__).

The “actual” maximum flowrate is the one that which has give a more accurate result, computed from the volume actually pumped.

Parameters:
pump{1, int}, optional

A pump index.

vol_to_pump{2000., number}

The volume to pump.

flow_rate_test{None, number}, optional

The flow rate used for testing. If None, use 2/3 of the maximum flow rate for the tested pump.

Functions

modif_calib_file(pump, flow_rate)

Classes

MasterFlexPumps([nb_pumps, verbose])

Represent some Masterflex pumps.