General effects
Reduction of usable heat during startup of each component
To account for transient effects, the reduction of the usable heat output during startup of a component can be described using either linear oder exponential startup and cooldown ramps. Both are described in the following.
Linear startup
The following figure illustrate a linear startup and cooldown behavior characterized by the startup time (SUT) and cooldown time (CDT) the component needs to reach full thermal energy output or to cool down completely.
The current thermal power output can be expressed with the following sectionally defined function. The simulation engine tracks the time a component is running or not running. The ontime represents the time since the last startup of the component while is the time since the last shutdown. To handle the case when the component has not cooled down completely since the last shutdown, the linear startup curve can be shifted using to represent a warm start:
The required timeshift of the warmingup curve can be calculated within the timestep where the component is turned on again using the coolingdown curve and the time since the last shutdown:
that leads with to
With this information, the average thermal power output in the current timestep between and can be calculated using the integral of the sectionally defined function above:
This timeaveraged integral results in the following yellow curve that represents the normalized average thermal power output, calculated in each timestep with the lower time bound of :
Note that has to be set to zero at the first timestep of the simulation and and have to start counting again at every change of operation (on/off, not partload).
Exponential startup
While the method above describes a linear thermal power output during the heatup of a component that requires the integration of sectionally defined functions, the calculation of the timestep averaged thermal power can be also performed using continuous exponential functions. Therefore, the general timerelated function of a PT1 element can be used to model the delay of the thermal energy output. This is used for example in the TRNSYS Type 401^{1} for modulating heat pumps. The time span for each component to heat up is defined by the constant heatuptime and the cooldown time . This is not the same time span as defined above (SUT and CDT) for the linear warmup! The following figure shows an exemplary operation curve, analogous to the one for linear transient effects above. A component is started from a cool basis, heated up to nominal thermal power output, then shut down and restarted before the component has cooled down completely.
The calculation of the reduced heat output due to transient effects at current time since the last start of the component and with the constant heatuptime of each component can be calculated with the following expression:
If the component has not been cooled town completely since the last shutdown, the heatup losses can be calculated using the following equation with representing the time shift for the exponential function (compare to figure above).
The cooldown curve is calculated analogously in order to get the current state of the component in the case of restart in the next time step.
To get the average thermal energy output within the current timestep between and , an integration of the exponential function is needed. According to the TRNSYS Type 401^{1}, this leads to
For the zeroth timestep of the simulation, is set to zero. does not have to be calculated in every time step, but only when the state of the component changes from "off" to "on". For this purpose, the energy output of the last time step with the state "on" must be documented, since this is required for the further calculation.
Below, an exemplary logic is given of a function handling the transient heatup effects.
def heat_up_losses( Q_out(last_ontime),
last_state,
this_state,
t_simulation,
t_on,
t_off,
tau_on,
tau_off,
t_on_upper,
t_on_lower,
t_shift_on)
if t_simulation == 0:
Q_out_last = 0
else:
Q_out_last = Q_out(last_ontime)
end
if last_state == on and this_state == off:
t_off = 0
end
if last_state == off and this_state == on:
t_on = 0
end
if this_state == on and t_on == 0:
t_shif_off = f(Q_out_last)
Q_off = f(t_shift_off, t_off)
t_shift_on = f(Q_off)
Q_out_new = f(t_shift_on)
t_on += 1
elif this_state == on:
Q_out_new = f(t_shift_on)
t_on += 1
elif this_state == off:
t_off += 1
end
return Q_out_new, t_shift_on, t_on, t_off
Nonlinear partload efficiency
Most components can be operated not only at full load, but also in part load operation. Due to several effects like the efficiency of electrical motors, inverters or thermal capacity effects, the efficiency of a component in part load usually differs from its efficiency at its full load operation point. How exactly the efficiency changes in part load depends on the specific component. Here, the general approach implemented in the simulation model is explained to consider partload dependent efficiencies. This method needs to be extended for heat pumps which is described in the corresponding section.
The partload ratio (PLR) in general is defined as:
The change of the efficiency with respect to the PLR can be given as curve, for example as shown in the following figure for the efficiency of a motor in partload operation (Source: Eppinger2021^{2}):
Considering nonlinear partload efficiencies leads to several problems. First, the partload efficiency curve is not necessarily a monotonic function, as shown in the figure above exemplarily. This implies that the function is also noninvertible. However, the inversion is needed to determine the partload state at which power a component has to be operated at the current time step when external limits are present, e.g. if only a limited energy supply and/or a limited energy demand is given.
Another problem is the fact, that efficiencies are always defined as ratios. When changing the efficiency due to partload operation, it is not clear, how the two elements of the efficiencyratio have to be adjusted as only their ratio is given. Here, in this simulation model, one input or one output has to be defined as basis for the efficiency that will be considered to have a linear behavior in partload operation. The other in or output energy will be adjusted to represent the nonlinearities in the change of the efficiency at different PLR.
A third difficulty is the inconsistent definition of the partload ratio in the literature when considering nonlinearities in partload operation. In theory, every input and output has its own partload ratio at a certain operation point of a component with multiple in or outputs. Each of the PLR do not necessarily represent the same operational state of the component, so this would lead to an inconsistent base if several operational restrictions are given. This can be solved by defining a reference partload ratio, e.g. with respect to the main output or by defining the efficiency curves relative to each other with the same base.
In the figure below, a partload curve (orange curve) based on an exponential function of a fictitious component that has electricity as input (yellow curve) and heat as output (grey curve) is shown. The heat output (= useful energy) is assumed to be linear (straight line) with a rated power of 1 kW, resulting in a nonlinear demand of electricity (= expended energy).
The basis for the consideration of nonlinear partload efficiencies is the userdefined efficiency curve of a component
as shown exemplarily as orange curve in the figure above. can be a linear, an exponential or a partially defined function. The efficiency curve can also be a nonmonotonic function as long as the function of the expended energy (yellow curve for electrical input in the figure above)
is monotonic in the range of and depicts the rated power of the component. This is the case for all common partload functions as the change in efficiency is not as big as the impact of the PLR on the energy curve . During preprocessing, the function is calculated from and inverted to get .
The partload function of the useful energy, that is assumed to be linear,
needs to be inverted as well. As is assumed to be linear, the inverse is trivial and meets the original definition of the PLR:
.
During each timestep, both functions, and , are evaluated according to the operational strategy to determine the part load ratio that is needed to meet the demand while not exceeding the maximum available power.
PLR calculation for Gas Boiler
The following section provides a more detailed explanation of the calculations for maximal consumable gas and maximal produced heat for the GB under different operating strategies. At full load, no additional calculations are required, as the maximal consumable gas is equal to the maximal produced heat. Before diving deeper into the computation steps, it should be noted that for the thermal efficiency curve of the gas boiler a polynomial fit is used. The data points for the fit are obtained from the graph via the visual metric and fitted with the NumPy polyfit function. The fit closely resembles the orange curve, with the only difference being that the implemented curve is monotonically increasing across the entire partialload ratio interval. LeeSeo2019^{3} uses a similar curve for the thermal efficiency of a gas boiler but with slightly different parameter values. The reason for the disparity in values is that we were unable to replicate the values for the thermal efficiency with their coefficient values.
For a supplydriven strategy, the intake amount of gas is provided at the current time step. To determine PLR, the following procedure is followed: First, the output energy curve is divided by the thermal efficiency curve. Second, a lookup table is created. The entries in this table consist of tuples comprising the PLR value and the corresponding expended energy value, obtained in the first step. Finally, when estimating the partload ratio corresponding to a provided energy input value, the upper and lower values around the provided value are identified using the lookup table. Once this is accomplished, the PLR value is calculated through linear interpolation.
The computed PLR value is then used to compute the thermal efficiency (gray function). Last but not least, the energy balance equation is solved to determine the maximum producible heat based on the obtained thermal efficiency of the gas boiler. This is achieved by simply multiplying the thermal efficiency by the maximum consumable gas.
When a gas boiler (GB) is operated using a demanddriven strategy, the maximal produced heat and maximal consumable gas are determined as follows. First, the maximal produced heat is set to be equal to the rated power, instead of the demanded power. This prevents the case where the demanded power is infinite, which, in turn, would lead to a nonphysical state. Second, the demand heat is checked to see if it exceeds the maximum producible heat. If this is the case, then the demand heat is limited to the maximum producible heat ^{4}. Afterwards, the part load ratio is calculated as . Thermal efficiency is calculated by evaluating the preimplemented function (orange curve) with the obtained PLR as input. Lastly, the maximal consumable gas is computed by solving the energy balance equation. In this case, the maximal produced heat is divided by the computed thermal efficiency.
If several outputs on a component exist, like with an combined heat and power plant, each output can have its own independent efficiency curve, so several efficiency curves are needed as input. In this case, it is necessary to ensure that the partload factor is based on the same definition for all partload depended efficiency curves to ensure comparability and a consistent basis.
ToDo
 Bezugsgröße für Berechnung der PLR definieren je Komponente? Oder pauschal auf thermischen Ausgang? Oder wählbar?
 Aufteilung der Wirkungsgradänderung auf Input/Output (aktuell: eines linear, das andere alles; aber aber 50/50 denkbar)
Minimum operation time
To force the simulation engine to turn on a component for a defined minimum operation time, the partial load ratio is limited to allow the component to run for the defined turnon time. The limit is determined by the maximum potential of the energy sink (e.g. free storage capacity) divided by the minimum operating time with a consideration of the maximum deliverable power of the component. This method does not take into account an unexpected decrease of the available energy input into the component, since no prediction is possible in this model. Therefore, the minimum operating time cannot be guaranteed.
ToDo: elaborate further

Wetter M., Afjei T.: TRNSYS Type 401  Kompressionswärmepumpe inklusive Frost und Taktverluste. Modellbeschreibung und Implementation in TRNSYS (1996). Zentralschweizerisches Technikum Luzern, Ingenieurschule HTL. URL: https://trnsys.de/static/05dea6f31c3fc32b8db8db01927509ce/ts_type_401_de.pdf ↩↩

Eppinger, B. et al.(2021): Simulation of the Part Load Behavior of Combined Heat PumpOrganic Rankine Cycle Systems. In: Energies 14 (13), S. 3870. doi: 10.3390/en14133870. ↩

Lee, D.Y., Seo, B.M., Yoon, Y.B. et al. Heating energy performance and part load ratio characteristics of boiler staging in an office building. Front. Energy 13, 339–353 (2019). doi: https://doi.org/10.1007/s1170801805965. ↩

Assuming the demand heat would not be set to the maximal produced heat, then the usage fraction would be greater than 1. This theoretically would not produce any issues as the usage fraction is set to 1 if there is no smaller value. ↩