datalogd.plugins.coolingpower_datafilter module

class datalogd.plugins.coolingpower_datafilter.CoolingPowerDataFilter(sinks=[], temperature_id_in='A_0', temperature_id_out='A_1', flow_rate_id='A_0', heatcapacity=4184, density=1.0, coolingpower_id='A_0')[source]

Bases: datalogd.DataFilter

Calculate power absorbed by cooling liquid through a system given flow rate and input and output temperatures.

The calculation requires each receipt of data to contain two temperature entries and one flow rate entry. For example:

[
    {"type": "temperature", "id": "A_0", "value": 12.34, "units": "C"},
    {"type": "temperature", "id": "A_1", "value": 23.45, "units": "C"},
    {"type": "flow_rate", "id": "A_0", "value": 0.456, "units": "L/min"}
]

The IDs used to select the appropriate temperatures and flow rate may be given in the initialisation parameters. Temperatures should be in celsius (or kelvin), and flow rate should be in litres per minute. By default, the heat capacity and density of water will be used for calculations, but alternate values may supplied as a parameters. Heat capacity should be in J/kg/K, and density in g/mL.

If all required data entries are present, a new entry with a coolingpower type will be added, and the data will then look like:

[
    {"type": "temperature", "id": "A_0", "value": 12.34, "units": "C"},
    {"type": "temperature", "id": "A_1", "value": 23.45, "units": "C"},
    {"type": "flow_rate", "id": "A_0", "value": 0.456, "units": "L/min"},
    {"type": "coolingpower", "id": "A_0", "value": 353.28, "units": "W"}
]

The ID used for the coolingpower entry may also be specified as an initialisation parameter. If the flow rate entry includes a "timestamp" field, its value will be copied to the cooling power entry.

Parameters:
  • temperature_id_in – ID of temperature data for inlet liquid.
  • temperature_id_out – ID of temperature data for outlet liquid.
  • flow_rate_id – ID of liquid flow rate data.
  • heatcapacity – Heat capacity of cooling liquid, in J/kg/K.
  • density – Density of cooling liquid, in g/mL.
  • coolingpower_id – ID to use for the calculated cooling power data.
receive(data)[source]

Accept the provided data and add a coolingpower entry calculated from flow rate and input and output temperatures.

Parameters:data – Data to calculate cooling power from.