First time here? Check out the Help page!
1 | initial version |
We ended up going with the matlab and energyplus cosimulation using this matlab toolbox on github. The toolbox is able to send Output:Variable values from energyplus to matlab, and matlab is able to send new schedule values to energyplus each timestep. How much heating or cooling the GHE did to the water circulating through it was done in energyplus by DistrictCooling and DistrictHeating objects.
Working inside the HVAC iteration loop was a little bit of a kluge though. It's not clear what the inlet and outlet temperatures of the water to the GHE should be because the GHE is attached to a water source heat pump. Reaching consistent inlet outlet water temperatures between the GHE and WSHP occurs in the HVAC iteration loop in energyplus. As far as I know, communication between matlab and energyplus only occurs once per time step and not at each iteration of the HVAC iteration loop. To get around this, the schedules give some EMS code a linear fit of the inlet outlet water temperature relationship at the current timestep. The EMS code then sets the outlet temperature of the DistrictCooling and DistrictHeating objects using the linear fit and the GHE water inlet temperature from the current iteration of the HVAC iteration loop. The HVAC iteration loop eventually converges with the final inlet and outlet water temperatures for that timestep sent to matlab.