RWTH-EBC / AixLib

A Modelica model library for building performance simulations
https://ebc-tools.eonerc.rwth-aachen.de/aixlib
173 stars 80 forks source link

Issues on heat pump condenser/evaporator heat flow calculation #1507

Open wehuang16 opened 2 months ago

wehuang16 commented 2 months ago

Describe the bug For the Aixlib heat pump model during "cooling" operation, there is a possibility that the calculation for the condenser/evaporator heat flow is not quite correct.

To Reproduce

  1. Use a modelica tool, such as Dymola or OpenModelica, to simulate this heat pump example in the "main" branch (https://github.com/RWTH-EBC/AixLib/blob/main/AixLib/Fluid/HeatPumps/Examples/HeatPump.mo)

  2. we will first see that the simulation runs for 3600 seconds. The first half (1800s) is heating mode, and the second half is cooling mode.Screenshot 2024-06-30 at 11 14 28 AM

  3. View the parameter QCon, QEva, and Pel, we notice that during the second half of simulation when the heat pump is in cooling mode, QCon is about -9.1kW, QEva is about 8.7kW, Pel is about 0.4kW. Screenshot 2024-07-01 at 9 42 52 PM

  4. QEva is positive, meaning that heat flows from the heat pump refrigerant at the evaporator to the flowing fluid (water or air), so the evaporator in the model actually acts as an actual "condenser". QCon is negative, meaning that heat flows from the flowing fluid (water or air) to the heat pump refrigerant at the condenser, so the condenser in the model actually acts as an actual "evaporator".

  5. The correct calculation should be that the absolute value of the actual "evaporator" heat flow (currently represented by QCon for cooling) plus the electric power equal to the absolute value of the actual "condenser" heat flow (currently represented by QEva for cooling). Thus, the absolute value of the actual "evaporator" heat flow (9.1kW) should be less than the absolute value of the actual "condenser" heat flow (8.7kW), which might not be correct.

Expected behavior I expect that for cooling, when the QCon is acting as an actual "evaporator", and QEva is acting as an actual "condenser", absolute value of QCon should be less than the absolute value of QEva.

Desktop (please complete the following information): I used Dymola 2023x on an ubuntu 20.04 environment

Additional context This issue on heat pump condenser/evaporator heat flow calculation has actually been fixed on the IBPSA heat pump libraries about 2 months ago. Specifically, we can look at these examples at the IBPSA github "main" branch (https://github.com/ibpsa/modelica-ibpsa/tree/master/IBPSA/Fluid/HeatPumps/ModularReversible/Examples)

FWuellhorst commented 1 month ago

Thanks for raising this well documented issue! You are correct. I just merged the latest IBPSA version, were I fixed this issue, into AixLib. The "old" models will be moved to the Obsolete package, as the changes are not manageable using a conversion script. I would highly recommend using the new models. If you have questions on how to switch, please ask. I will try to give a short tutorial on how to switch from old to new HP models.

wehuang16 commented 1 month ago

Thanks for raising this well documented issue! You are correct. I just merged the latest IBPSA version, were I fixed this issue, into AixLib. The "old" models will be moved to the Obsolete package, as the changes are not manageable using a conversion script. I would highly recommend using the new models. If you have questions on how to switch, please ask. I will try to give a short tutorial on how to switch from old to new HP models.

Thank you!