lbl-srg / modelica-buildings

Modelica Buildings library
244 stars 153 forks source link

Support negative start time in EnergyPlus #1938

Closed mwetter closed 1 day ago

mwetter commented 4 years ago

The following command

simulateModel("Buildings.ThermalZones.EnergyPlus.Validation.OneZone", startTime=-864000, stopTime=864000, method="Cvode", tolerance=1e-06, resultFile="OneZone");

produces image

kbenne commented 4 years ago

What are the outside conditions when a simulation is started in a scenario like this with a negative start time? I need to correlate with a time in the weather file.

mwetter commented 4 years ago

If the E+ weather file is from t=0 to t=365 days, then you can look up the outside conditions at t-365 days.

kbenne commented 4 years ago

Yikes!

mwetter commented 4 years ago

In FY21 AOP for NREL.

mwetter commented 4 years ago

Todo for the release:

mwetter commented 2 years ago

@kbenne : This issue is not yet fixed in the latest build that is merged through https://github.com/lbl-srg/modelica-buildings/pull/2984

Commit 06cc58dc25 on branch issue1938_spawn_negative_startTime adds the validation case Buildings/Resources/Scripts/Dymola/ThermalZones/EnergyPlus_9_6_0/Validation/RunPeriod/NegativeStartTime.mos which produces the following output: image

kbenne commented 2 years ago

Hmm. That's interesting. I can't perceive why it is doing this, although the testing I'm doing at my level doesn't attempt actual simulation. Take a look at the unit test in this commit.

I'll have to dig a bit deeper.

mwetter commented 2 years ago

You may need to check if E+ does internally the right thing, for example by verifying that it picks the same weather data for t=-1 days as it does for t=364 days; or whether the simulations for these two day specifications produce the same indoor temperatures.

kbenne commented 2 years ago

Yeah I certainly have some investigation to do. But the whole point of the strategy was that EnergyPlus would never actually see a negative time. I probably need to rig up a test that actually does simulation for day 364 and day -1, which will be a bit more involved.

Note how this so closely relates to https://github.com/lbl-srg/modelica-buildings/issues/2453 because simulating day 364 actually requires EnergyPlus to simulate through the first 363 days to arrive at the start time.

mwetter commented 2 years ago

Delay for later, not part of release 9.0.

Problem is that if simulation starts at -1 day, then week-day of Jan 1 must be the same as if it were to start on Jan 1.