Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnergyPlus returns for OutputVariable the schedule value before rather than after time advanced #1679

Closed
mwetter opened this issue Dec 13, 2019 · 4 comments
Assignees
Labels
spawn Development for Spawn of EnergyPlus

Comments

@mwetter
Copy link
Member

mwetter commented Dec 13, 2019

Simulating Buildings.ThermalZones.EnergyPlus.Validation.OneZoneOneOutputVariable gives the following output:

************** Debug for output OneZoneOneOutputVariable.equEle, time = 83700.00, y = 483.09
************** Debug for output OneZoneOneOutputVariable.equEle, time = 84600.00, y = 483.09
************** Debug for output OneZoneOneOutputVariable.equEle, time = 85500.00, y = 483.09
************** Debug for output OneZoneOneOutputVariable.equEle, time = 86400.00, y = 483.09
Continuing Simulation at 01/01/2017 for ANNUAL
************** Debug for output OneZoneOneOutputVariable.equEle, time = 87300.00, y = 644.13
************** Debug for output OneZoneOneOutputVariable.equEle, time = 88200.00, y = 644.13
************** Debug for output OneZoneOneOutputVariable.equEle, time = 89100.00, y = 644.13

The expected value is

time = 86400.00, y = 644.13

These are values from the EnergyPlus schedule

  Schedule:Compact,
    BLDG_EQUIP_SCH,          !- Name
    Fraction,                !- Schedule Type Limits Name
    Through: 12/31,          !- Field 1
    For: Weekdays,           !- Field 2
    Until: 08:00,0.40,       !- Field 3
    Until: 12:00,0.90,       !- Field 5
    Until: 13:00,0.80,       !- Field 7
    Until: 17:00,0.90,       !- Field 9
    Until: 18:00,0.50,       !- Field 11
    Until: 24:00,0.40,       !- Field 13
    For: Saturday,           !- Field 15
    Until: 06:00,0.30,       !- Field 16
    Until: 08:00,0.4,        !- Field 18
    Until: 12:00,0.5,        !- Field 20
    Until: 17:00,0.35,       !- Field 22
    Until: 24:00,0.30,       !- Field 24
    For: SummerDesignDay,    !- Field 26
    Until: 24:00,1.0,        !- Field 27
    For: WinterDesignDay,    !- Field 29
    Until: 24:00,0.0,        !- Field 30
    For: AllOtherDays,       !- Field 32
    Until: 24:00,0.30;       !- Field 33

EnergyPlus needs to be changed so it outputs the value of the schedule that is active at the time step that starts at time because Modelica already requested an event update in the code

  /* Get next event time, unless FMU is in initialization mode */
  if (bui->mode == initializationMode){
    if (FMU_EP_VERBOSITY >= MEDIUM)
      ModelicaFormatMessage(
        "Returning current time %.0f as tNext due to initializationMode for zone = %s\n",
        bui->time,
        outVar->modelicaNameOutputVariable);
    *tNext = bui->time; /* Return start time for next event time */
  }
  else{
    if (FMU_EP_VERBOSITY >= TIMESTEP)
      ModelicaFormatMessage("Calling do_event_iteration for output = %s\n", outVar->modelicaNameOutputVariable);
    *tNext = do_event_iteration(bui, outVar->modelicaNameOutputVariable);
  }
  /* Get output */
  getVariables(bui, outVar->modelicaNameOutputVariable, outVar->outputs);
@mwetter mwetter added the spawn Development for Spawn of EnergyPlus label Dec 13, 2019
@mwetter
Copy link
Member Author

mwetter commented Dec 13, 2019

The branch to reproduce it is issue1679_spawnDelayedScheduleValue.

@kbenne
Copy link
Contributor

kbenne commented Mar 5, 2020

Partially or fully address here NREL/Spawn@a61f2b3 but need testing.

@kbenne
Copy link
Contributor

kbenne commented Mar 13, 2020

Addressed further here NREL/Spawn@e443d63 but please read the commit log.

@mwetter
Copy link
Member Author

mwetter commented May 19, 2020

This is now corrected for the internal loads.

@mwetter mwetter closed this as completed May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spawn Development for Spawn of EnergyPlus
Projects
None yet
Development

No branches or pull requests

2 participants