Skip to content

Latest commit

 

History

118 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load-based-testing method for heat pumps

This repository contains a simple one-mass building model for load-based testing of heat pumps. The model is used to define the inertial behavior of the heat sink.

Installation

LoadBasedTesting can be installed as a package. In order to use this package, you can either install it via pip install (see below) or simply download the Python files and use them in your own script. Installation steps are:

  1. Download or clone the repository via git: git clone https://github.com/BAMresearch/bam-load-based-testing/
  2. Install the package via pip. Use conda prompt console or the terminal within pycharm: pip install -e <local path to git repo>
  3. If you do not need the package anymore you can deinstall it via pip: pip uninstall bamLoadBasedTesting

One-mass model

The one-mass model consists of mass H, representing the heat transfer system. The mass is characterized by a heat capacity MCp and an initial temperature $\vartheta_\mathrm{start}$.

The heat output provided by the heat pump $\dot{Q}_\mathrm{HP}$ is delivered to mass H. $\dot{Q}_\mathrm{HP}$ is calculated based on the supply temperature $\vartheta_\mathrm{S}$ provided by the heat pump, the measured return temperature of the heat pump $\vartheta_\mathrm{ret,mea}$ and the mass flow rate through the heat transfer system $\dot{m}_\mathrm{w}$. Based on $\vartheta_\mathrm{S}$ and $\vartheta_\mathrm{ret,mea}$ the enthalpies $h_\mathrm{S}$ and $h_\mathrm{ret,mea}$ are determined using CoolProp [1, 2] and assuming an absolute pressure of 3e5 Pa at the heat pump supply and return.

$$ \begin{equation} \dot{Q}_\mathrm{HP} = \dot{m}_\mathrm{w} \cdot (h_\mathrm{S} - h_\mathrm{ret,mea}) \qquad(\text{equation 1}) \tag{1} \end{equation} $$

Furthermore, mass H (heat transfer system) is connected to a building with a constant temperature of $\vartheta_\mathrm{B}=20 \mathrm{°C}$ for heating or $\vartheta_\mathrm{B}=27 \mathrm{°C}$ for cooling. For the heat flow rate between the heat transfer system and the building ($\dot{Q}_\mathrm{HB}$), there are two approaches.

Dynamic load approach: Depending on the temperature of the mass H and the supply temperature $\vartheta_\mathrm{S}$ provided by the heat pump, the heat flow rate $\dot{Q}_\mathrm{HB}$ is determined by the thermal conductivity $UA_\mathrm{HB}$ between the heat transfer system and the building, and a logarithmic temperature difference.

$$ \begin{equation} \dot{Q}_\mathrm{HB} = UA_\mathrm{HB} \frac{\vartheta_\mathrm{S} - \vartheta_\mathrm{H}}{\ln(\frac{\vartheta_\mathrm{B} - \vartheta_\mathrm{S}}{\vartheta_\mathrm{B} - \vartheta_\mathrm{H}})} \qquad(\text{equation 2.1a}) \tag{2.1a} \end{equation} $$

If the logarithmic temperature difference cannot be calculated (due to mathematical reasons), an arithmetic temperature difference will be used with following equation. In this case a comment will be logged, too.

$$ \begin{equation} \dot{Q}_\mathrm{HB} = UA_\mathrm{HB} \cdot (\frac{\vartheta_\mathrm{S} - \vartheta_\mathrm{H}}{2} - \vartheta_\mathrm{B}) \qquad(\text{equation 2.1b}) \tag{2.1b} \end{equation} $$

Fixed load approach: The heat flow rate $\dot{Q}_\mathrm{HB}$ is fixed and corresponds to the design heat flow rate of the part load condition specified for the building model ($P_\mathrm{designh} \cdot pl(T)$, see EN 14825). There is an option to add a defrost correction $\dot{Q}_\mathrm{def,corr}$. During a defrost it is $\dot{Q}_\mathrm{HB}=0$.

$$ \begin{equation} \dot{Q}_\mathrm{HB} = P_\mathrm{designh} \cdot pl(T) + \dot{Q}_\mathrm{def,corr} \qquad(\text{equation 2.2}) \tag{2.2} \end{equation} $$

The associated energy balances of the subsystems determine the temperature changes of the mass H. $C_\mathrm{H}$ is the thermal capacity of the heat transfer system.

$$ \begin{equation} \frac{\mathrm{d}\vartheta_\mathrm{H}}{\mathrm{d}t} = \frac{\dot{Q}_\mathrm{HP} - \dot{Q}_\mathrm{HB}}{C_\mathrm{H}} \qquad(\text{equation 3}) \tag{3} \end{equation} $$

With this equation the temperature of the heating system $\vartheta_\mathrm{H}$ can be recalculated. This temperature is then used as the new return temperature $\vartheta_\mathrm{ret,calc}$ for the heat pump.

$$ \begin{equation} \vartheta_\mathrm{ret,calc} = \vartheta_\mathrm{H} \qquad(\text{equation 4}) \tag{4} \end{equation} $$

This model can be used for heat pumps with fixed and variable water mass flow rate in the heat transfer system.

Implementation in python

The script oneMassModel.py

This script contains the main classes for the calculation of the above mentioned equations. Please find a short description below. For further information please look at the documentation in the script.

The class OneMassBuilding

The building model is defined in the class "OneMassBuilding" in "oneMassModel.py" and consists of one object of the class "ThermalMass" (mass with capacity and temperature) that represents the heat transfer system. The "OneMassBuilding" has two functions:

  1. "calcHeatFlows()": This function is used to calculate the above mentioned heat flow rates $\dot{Q}_\mathrm{HP}$ (equation 1) and $\dot{Q}_\mathrm{HB}$ (equation 2.1a/2.1b or 2.2). The water enthalpies at supply and return conditions for $\dot{Q}_\mathrm{HP}$ (equation 1) are determined using the fluid "Water" from CoolProp [1,2] via the wrapper pyfluids 4.0.0 [3]. According to [4] the fluid "Water" refers to the thermodynamic properties of the Helmholtz formulation (IAPWS-95 [5]).
  2. "doStep()": This function is used to first apply "calcHeatFlows()" and then to calculate the above mentioned energy balance (equation 3) to calculate the new return temperature of the heat pump.

The class CalcParameters

To configure a new building model, the class "CalcParameters" can be used (also defined in "oneMassModel.py"). A building model can be configured for a heat pump with constant mass flow or a constant temperature difference (variable flow). In both cases, the nominal heating power and the nominal flow temperature of the heat pump must be specified. Additionally, the thermal design capacity of the mass as well as the ambient temperature are required. Also conditions for the specific part load (e.g. PLC-A) have to be specified. The calculations in this class mainly happen in two functions:

  1. In the "init()" function, the temperature difference of the water in the condenser and the mean temperatures for the one mass model are parameterized. Furthermore, the thermal conductivity between heat transfer system and building, the initial return temperature and the thermal capacity of the heat transfer system are calculated.
  2. The function "createBuilding()" then determines all necessary parameters and instantiates the building model ("OneMassBuilding").

Scripts to apply the one mass model

To use the one mass model, the following scripts should be used in the following order. More information on how to use the scripts is documented directly in the scripts.

  1. First, the building models need to be parameterized. This can be done as shown in "BuildingModels/OneMassModelConfig.py". The script has several examples for different applications (heating/cooling, medium/low temperature). You can adjust this script for your use case or simply add new scripts in the directory BuildingModels. In the last case, please make sure to adjust the import statements of the building models for the following two scripts.
  2. Parameterized models can be tested by using the script "testModelSim.py" in the "Example" folder.
  3. Finally, building models can be used for experimental testing on the test bench with the script "Example/modelOnTestBench.py". Further instructions are documented within the script.

References

[1] Bell, I. H. & CoolProp Team (no year given). Welcome to CoolProp. https://coolprop.org/
[2] Bell, I. H., Wronski, J., Quoilin, S. & Lemort, V. (2014). Pure and Pseudo-pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp. Industrial & Engineering Chemistry Research 53(6), 2498-2508. https://doi.org/10.1021/ie4033999
[3] Portyanikhin, V. (2026). pyfluids 4.0.0 CoolProp wrapper for Python, https://pypi.org/project/pyfluids/
[4] Bell, I. H. & CoolProp Team (no year given). IF97 Steam/Water Properties. https://coolprop.org/fluid_properties/IF97.html
[5] International Association for the Properties of Water and Steam, IAPWS R6-95 (2018), Revised Release on the IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use (2018), https://iapws.org/technical-guidance/release/IAPWS-95

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages