# Heat pump parameterization

## 1. Introduction🔗

This tutorial aims to explain the basic implementation of the compressor models that are part of Thermal Power Library (TPL), and how to parametrize a TPL compressor model with SAE characteristic map. You will:

• get background information about the compressor model,
• learn how to format your OEM data using Excel,
• understand to set up a compressor test bench based on an existing testbench example,
• plot and verify the compressor parametrization, and
• learn about compressor behavior extrapolation,

Important modeling and usability concepts of the compressor models provided by Modelon are explained step by step. If they are not sufficient for you and you get stuck, please don't hesitate to contact us at support@modelon.com.

## 2. Thermal Power Library Turbocompressor Model🔗

While the compressor model relies on static balance equations for energy and mass, underlying effects like power consumption and hydraulics are map-baesed. These performance maps are typically provided by compressor OEMs either through tables or graphs.

### SAE Map🔗

Characteristic map for dynamic compressors based on look-up tables for isentropic efficiency and pressure ratio from corrected mass flow rate at different corrected speeds. For the sake of numerical robustness and performance, mass flow rate is introduced as a dynamic state variable.

Example of an SAE Map

### Model description🔗

This model is based on two 1D look-up tables of isentropic efficiency and pressure ratio versus corrected mass flow rate. For both properties multiple tables should be provided, describing different lines of constant corrected speed in the compressor performance map. The implementation performs table look-up from mass flow rate in all tables at simulation and then interpolates linearly between the resulting points depending on the actual corrected speed. For a definition of the isentropic efficiency, see the information of PartialCompressor. The isentropic efficiency is then used to provide the output flow specific torque.

### Corrected properties🔗

The characteristic map model can handle tables with two possible definitions of the corrected or reduced properties. This is chosen by setting the normalizedCorrection parameter. The definitions used are described below (default choice is false, p and T refer to the upstream fluid state, the units required in the table data are given in brackets after the expression):

For normalizedCorrection = false:

• $\omega_{\text {corrected }}=\frac{\omega}{\sqrt{T}}$

For normalizedCorrection = true:

• $m_{\text {flowcorrected }}=\frac{m_{\text {flow }} \cdot \sqrt{\frac{T}{T_{\text {ref }}}}}{\frac{p}{p_{\text {ref }}}}$

• $\omega_{\text {corrected }}=\frac{\omega}{\sqrt{\frac{T}{T_{\text {ref }}}}}$

## 2. Prepare OEM Data Using Excel🔗

Before calibrating the compressor model in Modelon Impact, data provided by the OEM must be put into the correct syntax. The initial format of the data might be different and some additional calculations may be required. Currently, only maps PR-massflow are supported.

### Available parameters🔗

• normalizedCorrection: Defines how table data is interpreted, as described in section 2.
• p_ref: Reference pressure for map, only used if normalizedCorrection = true.
• T_ref: Reference temperature for map, only used if normalizedCorrection = true.
• N: Number of lines of constant speed included in map. Two 1D tables (one for flow and one for efficiency) must be given for each.
• speeds: Vector with N elements, defines the different fixed corrected speeds that have been mapped. Must be strictly increasing values.
• prMap: 3D-array with size [N, :, 2]. The array prMap[i, :, :] should hold the mapped pressure ratio from corrected flow at the compressor speed in speed[i]. The values in prMap[i, :, 1] should be corrected flows and the values in prMap[i, :, 2] should be pressure ratios.
• effMap: 3D-array with size [N, :, 2]. The array effMap[i, :, :] should hold the mapped isentropic efficiencies from corrected flow at the compressor speed in speed[i]. The values in effMap[i, :, 1] should be corrected flows and the values in effMap[i, :, 2] should be isentropic efficiencies.
• Tc_flow: Time constant for flow dynamics, that parameter by default should be kept small, however if numerical problems occur, its value should be increased
• mflow_start: Initial value of mass flow rate

To make the parameterization easier Modelon provides an Excel sheet [placeholder for excel] that after specifying Pressure ratios, mass flow rates, isentropic efficiencies and compressors speeds provides maps that can be directly copied to the map compressor model.

Compressor PR-massflowrate map in Excel

Created compressor maps with correct syntax

## 3. Setup a Compressor Testbench Based on an Existing Example Testbench🔗

In that section, an example of how to correctly parameterize the Turbocompressor model in TPL is presented. It was divided into three steps to make it easier to follow and understand. The goal of that example is to recreate the compressor map PR-mflow in Modelon Impact.

Demo Model of the turbocompressor located in ThermalPower.TwoPhase.TurboMachinery.Compressors.Demos.TurboCompressorTest

### Step 1: Duplicate Compressor Testbench:🔗

A fully parameterized demo model is available [placeholder for reshareable workspace]. Before going to the next step, duplicate the ThermalPower.TwoPhase.TurboMachinery.Compressors.Demos.TurboCompressorTest into your workspace by right clicking on it and selecting duplicate to option and selecting your project.

Duplicating demo model to the workspace

### Step 2. Modifying OEMs data sets to fit into correct syntax for SAE standard:🔗

Marked cells from 2. Prepare OEM Data Using Excel should be copied to corresponding parameter dialogs in the characteristic map.

Parameter dialog for turbocompressor model

Correct syntax of the data:

• speeds = {100,5000,10000,15000}
• prMap = {[0.8,3.3;0.9,3.27;1,3.24;1.1,3.21;1.2,3.03],[2.1,5.7;2.3,5.4;2.5,4.8;2.7,3.9;2.8,3.3],[3.4,8.1;3.6,7.8;3.8,7.2;4,6;4.2,4.5],[4.3,10.2;4.9,9.6;5.2,9;5.5,7.8;5.7,6]}
• effMap = {[0.8,0.25;0.9,0.25;1,0.25;1.1,0.25;1.2,0.25],[2.1,0.74;2.3,0.76;2.5,0.78;2.7,0.76;2.8,0.74],[3.4,0.77;3.6,0.79;3.8,0.81;4,0.79;4.2,0.77],[4.3,0.76;4.9,0.78;5.2,0.8;5.5,0.78;5.7,0.76]}

### Step 3. Setting up the testbench🔗

To reproduce PR-mflow plot in Modelon Impact, the multi-execution experiment is going to be used. The goal of the simulation is to recreate the PR-mflow compressor plot. To achieve this, the compressor must traverse all mapped speeds and discharge pressures. To map discharge pressures, the component 'pressure_outlet' needs to be parameterized accordingly. This involves simply editing the initial and end pressures. Throughout the simulation, the discharge pressure will change linearly from the initial to the end pressure.

Setting up the discharge pressure

Discharge pressure throughout the simulation

To change the compressor's speed, a multi-execution experiment is employed. To set it up correctly, conversion from RPMs to radians per second is necessary. Afterward, navigate to the experiment tab, select the speed_rad_per_s component, and use the following syntax to input the compressor speeds: choices(speed1, speed2, ..., speedn). Then execute the simulation, which will run all n cases of the model.

Setting up compressor speeds for multi-execution experiment

### Step 4. Inspect predefined plot of PR-m_flow🔗

In the demo example, a predefined view is available. After completing the simulation, the plot should resemble Figure X. This plot not only demonstrates the compressor's operation within mapped regions but also illustrates how values are interpolated outside of the compressor map, such as negative mass flows for low RPMs.

Preprepared custom view for the demo experiment

Desirable outcome of the characteristic map of the compressor

The created plot presents what happens not only in the mapped region but also shows how the data is extrapolated outside the mapped region. Some results in the figure above can show nonphysical results such as negative flow.

### Step 5. An additional step to demonstrate the mapped region🔗

To distinguish between mapped and extrapolated regions, an additional simulation can be performed to achieve the plot in below. Anything above the green line is extrapolated and may result in a non-physical result.

Desirable outcome of the characteristic map of the compressor with a line that illustrates the boundary of a mapped region

To achieve a similar plot, the simulation must be run with boundary conditions that encompass the upper side of the mapped region. This involves varying the compressor speed from its minimum to maximum values and adjusting the discharge pressure from the highest pressure at the lowest compressor speed to the highest pressure at the maximum compressor speed. By running this simulation and plotting the results from both simulations, a similar plot to that shown in figure above can be obtained.