Calibrate heat pump models

class PythonModel.calibrate.ManufacturerData(manufacturer, model, CoolingMode=False)

Bases: object

Heat pump performance data.

Parameters:
  • manufacturer – Name of the manufacturer.
  • model – Name of the heat pump model.
  • CoolingMode – Boolean, set to True if heat pump is used in cooling mode.

Note

An empty heat pump performance object is created.

add_data_point(EWT_Source, EWT_Load, flowSource, flowLoad, Capacity, HR, Power)

Add a data point to the heat pump performance data.

Parameters:
  • EWT_Source – Entering water temperature on the source side (K).
  • EWT_Load – Entering water temperature on the load side (K).
  • flowSource – Fluid mass flow rate on the source side (kg/s).
  • flowLoad – Fluid mass flow rate on the load side (kg/s).
  • Capacity – Heat pump capacity (kW).
  • HR – Heat transfer rate on the source side (kW).
  • Power – Power input to the heat pump (kW).
calibration_data_16_points()

Find the 16 min/max data points.

Returns:Performance data for calibration (object).

Note

This method returns a subsample of the performance data corresponding to the combination of minimums and maximums of the inlet water temperatures and mass flow rates on the source and load sides.

calibration_data_min_max_temp()
Find the data points that correspond to the minimum and maximum
inlet water temperature on the source and load sides.
Returns:Performance data for calibration (object).

Note

This method returns a subsample of the performance data corresponding to the combination of minimums and maximums of the inlet water temperatures on the source and load sides.

write_modelica_combiTimeTable(tableName, tableTempDir, tableFileName, CoolingMode)
Write the combiTimeTable for use by the calibration model in
Modelica.
Parameters:
  • tableName – Name of the combiTimeTable.
  • tableTempDir – Temporary directory to write the table file.
  • tableFileName – Name of the text file containing the combiTimeTable.
  • CoolingMode – Boolean, set to True if heat pump is used in cooling mode.
class PythonModel.calibrate.SimulationResults(EWT_Source, EWT_Load, flowSource, flowLoad, Capacity, HR, Power, name)

Bases: object

Results from the simulation model.

Parameters:
  • EWT_Source – Array of entering water temperature on the source side (K).
  • EWT_Load – Array of entering water temperature on the load side (K).
  • flowSource – Array of fluid mass flow rate on the source side (kg/s).
  • flowLoad – Array of fluid mass flow rate on the load side (kg/s).
  • Capacity – Array of heat pump capacity (W).
  • HR – Array of heat transfer rate on the source side (W).
  • Power – Array of power input to the heat pump (W).
  • name – Name of the heat pump.
PythonModel.calibrate.calibrate_model(heaPum, calData, data, plot=True)

Manages the calibration of heat pump models.

Parameters:
  • heaPum – Heat pump model (object).
  • calData – Subsampled data used for calibration (object).
  • data – Full data used for final comparison (object).
  • plot – Boolean, set to True to draw and save results.
Returns:

List of calibrated parameters, Results from the calibrated model, Results using the initial guess parameters.

PythonModel.calibrate.compare_data_sets(data, refData, plot=False, fname='ComparedDataSets')

Compare two sets of data.

Parameters:
  • data – Performance data (object).
  • refData – Reference performance data (object).
  • plot – Boolean, set to True to draw and save results.
  • fname – Name of the output figure file (no extension).
Returns:

Sum of normalized square errors between data sets.

PythonModel.calibrate.cost_function(scale, guess, heaPum, data)

Evaluate the cost function for optimization.

Parameters:
  • scale – Array of normalized parameters.
  • guess – Array of guess parameters.
  • heaPum – Heat pump model (object).
  • data – Reference performance data (object).
Returns:

Sum of normalized square errors between model and reference data.

Note

Parameters are evaluated by multiplying the corresponding normalized parameter with its guess value.

PythonModel.calibrate.simulate(heaPum, data)

Evaluate the heat pump performance from the model.

Parameters:
  • heaPum – Heat pump model (object).
  • data – Reference performance data (object).
Returns:

Performance data of the modeled heat pump (object).

Note

Performance data from the model is evaluated at the same operating conditions (inlet water temperatures and mass flow rates at the source and load sides) as in the reference data.

PythonModel.calibrate.simulate_in_dymola(heaPum, data, tableName, tableFileName)

Evaluate the heat pump performance from the model in Dymola.

Parameters:
  • heaPum – Heat pump model (object).
  • data – Reference performance data (object).
  • tableName – Name of the combiTimeTable.
  • tableFileName – Name of the text file containing the combiTimeTable.
Returns:

Performance data of the modeled heat pump (object).

Note

Performance data from the model is evaluated at the same operating conditions (inlet water temperatures and mass flow rates at the source and load sides) as in the reference data.