Skip to content

Commit

Permalink
First round of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 7, 2024
1 parent 6a339a8 commit d0b7ff9
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 469 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ namespace AirflowNetwork {
case VentControlType::CEN15251:
case VentControlType::NoVent:
case VentControlType::ZoneLevel: {
MultizoneSurfaceData(i).ventSched = nullptr;
MultizoneSurfaceData(i).ventSched = Sched::GetScheduleAlwaysOff(m_state);
MultizoneSurfaceData(i).VentSchName = "";
} break;
default:
Expand Down
13 changes: 7 additions & 6 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,11 @@ void EnergyPlusData::init_constant_state(EnergyPlusData &state)

this->init_constant_state_called = true;

this->dataSimulationManager->init_constant_state(state); // GetProjectData
this->dataFluidProps->init_constant_state(state); // GetFluidPropertiesData
this->dataPsychrometrics->init_constant_state(state); // InitializePsychRoutines
// The order of these should not matter, but we are mirroring init_state() order which does matter.
this->dataSimulationManager->init_constant_state(state);
this->dataEMSMgr->init_constant_state(state);
this->dataFluidProps->init_constant_state(state);
this->dataPsychrometrics->init_constant_state(state);
this->dataSched->init_constant_state(state);

this->dataAirLoop->init_constant_state(state);
Expand Down Expand Up @@ -629,7 +631,6 @@ void EnergyPlusData::init_constant_state(EnergyPlusData &state)
this->dataDualDuct->init_constant_state(state);
this->dataEIRFuelFiredHeatPump->init_constant_state(state);
this->dataEIRPlantLoopHeatPump->init_constant_state(state);
this->dataEMSMgr->init_constant_state(state);
this->dataEarthTube->init_constant_state(state);
this->dataEcoRoofMgr->init_constant_state(state);
this->dataEconLifeCycleCost->init_constant_state(state);
Expand Down Expand Up @@ -842,9 +843,10 @@ void EnergyPlusData::init_state(EnergyPlusData &state)
// objects that do not reference any other objects, like fluids,
// schedules, curves, etc.
this->dataSimulationManager->init_state(state); // GetProjectData
this->dataEMSMgr->init_state(state); // CheckIfAnyEMS
this->dataFluidProps->init_state(state); // GetFluidPropertiesData
this->dataPsychrometrics->init_state(state); // InitializePsychRoutines
this->dataSched->init_state(state);
this->dataSched->init_state(state); // GetScheduleData

this->dataAirLoop->init_state(state);
this->dataAirLoopHVACDOAS->init_state(state);
Expand Down Expand Up @@ -892,7 +894,6 @@ void EnergyPlusData::init_state(EnergyPlusData &state)
this->dataDualDuct->init_state(state);
this->dataEIRFuelFiredHeatPump->init_state(state);
this->dataEIRPlantLoopHeatPump->init_state(state);
this->dataEMSMgr->init_state(state);
this->dataEarthTube->init_state(state);
this->dataEcoRoofMgr->init_state(state);
this->dataEconLifeCycleCost->init_state(state);
Expand Down
7 changes: 3 additions & 4 deletions src/EnergyPlus/DataRuntimeLanguage.hh
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,7 @@ struct RuntimeLanguageData : BaseGlobalStruct
DataRuntimeLanguage::ErlValueType True = DataRuntimeLanguage::ErlValueType(
DataRuntimeLanguage::Value::Null, 0.0, "", 0, 0, false, 0, "", true); // special "True" Erl variable value instance, gets reset

// EMS Actuator fast duplicate check lookup support
std::unordered_set<std::tuple<std::string, std::string, std::string>, DataRuntimeLanguage::EMSActuatorKey_hash>
EMSActuator_lookup; // Fast duplicate lookup structure
std::map<std::tuple<std::string_view, std::string_view, std::string_view>, int> EMSActuatorAvailableMap;

void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
{
Expand Down Expand Up @@ -865,10 +863,11 @@ struct RuntimeLanguageData : BaseGlobalStruct
this->EMSInternalVarsAvailable.deallocate();
this->EMSInternalVarsUsed.deallocate();
this->EMSProgramCallManager.deallocate();
this->EMSActuator_lookup.clear();
this->Null = DataRuntimeLanguage::ErlValueType(DataRuntimeLanguage::Value::Null, 0.0, "", 0, 0, false, 0, "", true);
this->False = DataRuntimeLanguage::ErlValueType(DataRuntimeLanguage::Value::Null, 0.0, "", 0, 0, false, 0, "", true);
this->True = DataRuntimeLanguage::ErlValueType(DataRuntimeLanguage::Value::Null, 0.0, "", 0, 0, false, 0, "", true);

this->EMSActuatorAvailableMap.clear();
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/DaylightingDevices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,8 @@ namespace Dayltg {
state.dataDaylightingDevices->GetShelfInputErrorsFound = true;
}

if (state.dataSurface->Surface(SurfNum).shadowSurfSched != nullptr) {
if (state.dataSurface->Surface(SurfNum).shadowSurfSched != nullptr &&
state.dataSurface->Surface(SurfNum).shadowSurfSched != Sched::GetScheduleAlwaysOff(state)) {
ShowSevereError(state,
format("{} = {}: Outside shelf {} must not have a transmittance schedule.",
cCurrentModuleObject,
Expand Down
Loading

3 comments on commit d0b7ff9

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2: OK (2788 of 2918 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Subprocess aborted: 2

EnergyPlusFixture Test Summary

  • Passed: 1586
  • Failed: 16
  • Subprocess aborted: 3

integration Test Summary

  • Passed: 696
  • Failed: 105

performance Test Summary

  • Passed: 16
  • Failed: 1

ZoneIdealLoadsTest Test Summary

  • Passed: 5
  • Failed: 3

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-UnitTestsCoverage-RelWithDebInfo: OK (2076 of 2100 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Subprocess aborted: 2

EnergyPlusFixture Test Summary

  • Passed: 1586
  • Failed: 16
  • Subprocess aborted: 3

ZoneIdealLoadsTest Test Summary

  • Passed: 5
  • Failed: 3

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-IntegrationCoverage-RelWithDebInfo: Tests Failed (705 of 801 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 705
  • Failed: 96

Build Badge Test Badge Coverage Badge

Please sign in to comment.