Closed AntoineGautier closed 3 years ago
@amyeallen1 @khinkelman @nllong @YanfeiNREL You can checkout this branch to see whole DHC system example models. As discussed this is still under development.
EDIT (2/16/21): TODO
tau=5*60
for junctions, solver tolerance (check that 1e-6 with DASSL does not yield nonrecoverable error).
Comparison of annual electricity use (in e+12 Wh) between
Buildings.Examples.DistrictReservoirNetworks.Reservoir1Constant
from branch issue1613_rnbnComparison
(after de-normalizing with totEneRN3 = 2.72961e+12
)Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesConstantFlow
from current development branch issue1769_examples5GDHC
e370360Branch | Etot |
EHeaPum |
EPum |
CPU-time (CVode 1e-6) |
---|---|---|---|---|
issue1613_rnbnComparison |
4.0 | 2.5 | 1.5 | 21 |
issue1769_examples5GDHC |
3.5 | 2.2 | 1.3 | 182 |
As mentioned in https://github.com/lbl-srg/modelica-buildings/issues/1769#issuecomment-780937436 the increase in simulation time is mostly due to the building mechanical system model. An alternative approach for coupling time series will be developed in #2302.
Comparison of annual electricity use (in e+12 Wh) between
Buildings.Examples.DistrictReservoirNetworks.Reservoir3Variable
from branch issue1613_rnbnComparison
(after de-normalizing with totEneRN3 = 2.72961e+12
)Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow
from current development branch issue1769_examples5GDHC
e370360
issue1613_rnbnComparison
use a time constant tau=3*60
for the control volume of each fluid junction (before and after each agent connection) whereas the refactored model uses a default tau=10
.Branch | Etot |
EHeaPum |
EPum |
CPU-time (CVode 1e-6) |
---|---|---|---|---|
issue1613_rnbnComparison |
2.7 | 2.5 | 0.2 | 54 |
issue1769_examples5GDHC |
2.5 | 2.3 | 0.3 | 248 |
See https://github.com/lbl-srg/modelica-buildings/pull/2373#discussion_r607348601
On Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesConstantFlow
commit 97561a13c87fe3e862c61ee372783835bca631b4
Branch | Etot |
EHeaPum |
EPum |
CPU-time (CVode 1e-6) |
---|---|---|---|---|
issue1613_rnbnComparison |
4.0 | 2.5 | 1.5 | 21 |
issue1769_examples5GDHC |
3.5 | 2.2 | 1.3 | 220 |
On Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow
commit 97561a13c87fe3e862c61ee372783835bca631b4
Branch | Etot |
EHeaPum |
EPum |
CPU-time (CVode 1e-6) |
---|---|---|---|---|
issue1613_rnbnComparison |
2.7 | 2.5 | 0.2 | 54 |
issue1769_examples5GDHC |
2.5 | 2.3 | 0.3 | 307 |
The refactoring of the original models from issue1613_rnbnComparison
includes the following modifications that may impact the simulation time.
This is related to the fan component in
Buildings.Experimental.DHC.Loads.Validation.BaseClasses.FanCoil2PipeCooling
Buildings.Experimental.DHC.Loads.Validation.BaseClasses.FanCoil2PipeHeating
The model simulated has 3 buildings * 2 FCU / building = 6 instances.
simulateModel("Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesConstantFlow",
method="cvode",
tolerance=1e-6,
startTime=0,
stopTime=6048000);
With energy and mass dynamics (fixed initial)
Integration terminated successfully at T = 6.048e+06
CPU-time for integration : 19.895 seconds
CPU-time for initialization : 0.731633 seconds
Number of result points : 4317
Number of grid points : 501
Number of accepted steps : 91400
Number of rejected steps : 5262
Number of f-evaluations (dynamics) : 143274
Number of non-linear iteration : 135901
Number of non-linear convergence failures : 245
Number of Jacobian-evaluations : 3702
Number of crossing function evaluations : 93369
Number of model time events : 1759
Number of state events : 159
Number of step events : 0
In steady-state
Integration terminated successfully at T = 6.048e+06
CPU-time for integration : 16.8291 seconds
CPU-time for initialization : 0.724413 seconds
Number of result points : 4317
Number of grid points : 501
Number of accepted steps : 71511
Number of rejected steps : 3664
Number of f-evaluations (dynamics) : 105427
Number of non-linear iteration : 97862
Number of non-linear convergence failures : 32
Number of Jacobian-evaluations : 2647
Number of crossing function evaluations : 73463
Number of model time events : 1759
Number of state events : 159
Number of step events : 0
So a gain of nearly 30% in the number of non-linear iterations, and about 15% in CPU-time for integration. However, the steady-state model yields this warning in Dymola.
Some variables are iteration variables of the initialization problem:
but they are not given any explicit start values. Zero will be used.
Iteration variables:
bui[1].bui.terUniCoo.fan.heaDis.WHyd
...
And heaDis
is a protected component that prevents modifying the start attribute of WHyd
. So currently the fan is modeled with a state.
Simulating the model with DASSL shows that most of the states that dominate the error correspond to the terminal unit model. The feature enhancement in #2302 should address this.
This is related to the control volume in the fluid junction components, especially before and after each connection to an agent (ETS, plant or storage). The effect is highly tangible with closed loop control of the distribution system (as opposed to constant flow rate).
simulateModel("Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow",
method="cvode",
tolerance=1e-6,
startTime=0,
stopTime=6048000);
tau=5*60
(setting from original models in issue1613_rnbnComparison
)
Integration terminated successfully at T = 6.048e+06
CPU-time for integration : 26.3316 seconds
CPU-time for initialization : 0.807683 seconds
Number of result points : 4319
Number of grid points : 501
Number of accepted steps : 118454
Number of rejected steps : 6985
Number of f-evaluations (dynamics) : 186083
Number of non-linear iteration : 178706
Number of non-linear convergence failures : 299
Number of Jacobian-evaluations : 4409
Number of crossing function evaluations : 120433
Number of model time events : 1759
Number of state events : 160
Number of step events : 0
tau=10
(default setting for the base classes in Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Networks
)
Integration terminated successfully at T = 6.048e+06
CPU-time for integration : 47.0535 seconds
CPU-time for initialization : 0.75922 seconds
Number of result points : 4319
Number of grid points : 501
Number of accepted steps : 252732
Number of rejected steps : 18448
Number of f-evaluations (dynamics) : 368372
Number of non-linear iteration : 360288
Number of non-linear convergence failures : 291
Number of Jacobian-evaluations : 7193
Number of crossing function evaluations : 254736
Number of model time events : 1759
Number of state events : 160
Number of step events : 0
CPU-time for integration is nearly doubled. The whole-year simulation will eventually stall. However, 5' transport delay at each junction seems also unrealistic. A plug flow pipe model will probably be better suited to include temperature dynamics.
simulateModel("Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow",
method="cvode",
tolerance=1e-6, // Default setting.
startTime=0,
stopTime=6048000);
Integration terminated successfully at T = 6.048e+06
CPU-time for integration : 26.3316 seconds
CPU-time for initialization : 0.807683 seconds
Number of result points : 4319
Number of grid points : 501
Number of accepted steps : 118454
Number of rejected steps : 6985
Number of f-evaluations (dynamics) : 186083
Number of non-linear iteration : 178706
Number of non-linear convergence failures : 299
Number of Jacobian-evaluations : 4409
Number of crossing function evaluations : 120433
Number of model time events : 1759
Number of state events : 160
Number of step events : 0
simulateModel("Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow",
method="cvode",
tolerance=1e-4, // Change in tolerance.
startTime=0,
stopTime=6048000);
Integration terminated successfully at T = 6.048e+06
CPU-time for integration : 20.6832 seconds
CPU-time for initialization : 0.771738 seconds
Number of result points : 4339
Number of grid points : 501
Number of accepted steps : 79861
Number of rejected steps : 1004
Number of f-evaluations (dynamics) : 119938
Number of non-linear iteration : 112354
Number of non-linear convergence failures : 1319
Number of Jacobian-evaluations : 5526
Number of crossing function evaluations : 82065
Number of model time events : 1759
Number of state events : 170
Number of step events : 0
So a gain of nearly 20% in CPU-time for integration. However, this comes with a high number of
cvode: CVODE CVode At t = 165552, mxstep steps taken before reaching tout.
The conclusion differs with DASSL solver, with a gain closer to 50%. The log also shows that the integration order may effectively be reduced from 5 to 4 with the relaxed tolerance.
simulateModel("Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow",
method="dassl",
tolerance=1e-6, // Default setting.
startTime=0,
stopTime=6048000);
Integration terminated successfully at T = 6048000
CPU-time for integration : 41.2 seconds
CPU-time for one grid interval : 82.4 milliseconds
CPU-time for initialization : 0.81 seconds
Number of result points : 4317
Number of grid points : 501
Number of accepted steps : 83111
Number of f-evaluations (dynamics) : 175368
Number of crossing function evaluations : 86702
Number of Jacobian-evaluations : 26127
Number of model time events : 1759
Number of input time events : 0
Number of state events : 159
Number of step events : 0
Minimum integration stepsize : 1.48e-10
Maximum integration stepsize : 796
Maximum integration order : 5
simulateModel("Buildings.Experimental.DHC.Examples.Combined.Generation5.Unidirectional.Examples.SeriesVariableFlow",
method="dassl",
tolerance=1e-4, // Default setting.
startTime=0,
stopTime=6048000);
Integration terminated successfully at T = 6048000
CPU-time for integration : 22.7 seconds
CPU-time for one grid interval : 45.4 milliseconds
CPU-time for initialization : 0.776 seconds
Number of result points : 4317
Number of grid points : 501
Number of accepted steps : 37070
Number of f-evaluations (dynamics) : 77966
Number of crossing function evaluations : 40845
Number of Jacobian-evaluations : 16863
Number of model time events : 1759
Number of input time events : 0
Number of state events : 159
Number of step events : 0
Minimum integration stepsize : 1.48e-08
Maximum integration stepsize : 1.77e+03
Maximum integration order : 4
This issue is related to:
Example models of 5th generation DHC systems are generated in
Buildings.Experimental.DHC.Examples
to illustrate:The development branch is issue1769_examples5GDHC.
The examples are still under development. TO DO:
[x] For models in
DHC.Networks.BaseClasses
:[x] Check that replaceable types cannot be propagated and document the redeclare logic.
[x] Package the computation of
Q_flow
from temperature measurements in a reusable blockBuildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate
[x] Add
Dialog(tab="Assumptions")
toallowFlowReversalBui
andallowFlowReversalDis
.[x] Validate temperature sensor with no state with PI controller cf. direct feed through due to P term and algebraic loop.
[x] Devise how different building model types can be used within a single array instance.
[x] Remove
Buildings.Controls.OBC.UnitConversions.From_degC
in favor of attributedisplayUnit
Sizing building models: the examples currently use the sizing parameters of the case
SeriesConstantFlowTimeSeriesB3
.[x] Investigate the reason why flow reversal occurs.
DHC.Examples.Combined.Generation5.Unidirectional.EnergyTransferStations.Validation.SwitchBox
[x] Select the best model for the switching box.
[x] Validate on/off control of heat pump.
[x] Add domestic hot water production to be consistent with the RN analysis already published.
[x] Add simulation scripts and validate yearly simulation results against the RN analysis already published.
[x] Develop a partial ETS/dedicated plant model to connect with the partial building model.
[x] Document the example models.
[x] Relocate models of generic use in
DHC
package.Include an example model with
DHC.EnergyTransferStations.Combined.Generation5.ChillerBorefield
: this will allow testing the scalability of the "advanced" ETS model, benchmarking the computational performance with the simple ETS model, and compare the energy use between a free-cooling & direct connection system, and a heat recovery chiller & indirect connection system.[x] Refactor
PartialBuilding
withhave_heaWat
instead ofhave_watHea
andhave_chiWat
instead ofhave_watCoo
: addressed through https://github.com/lbl-srg/modelica-buildings/pull/2310.[x] Scale the loads.