Hello to anyone interested in this post,
First, I work in E+ 9.4 but I have checked that this error is still in the most recent version of EP, that is why I made it as a bugfix proposal.
While working in Design Builder and E+ modelling a thermal energy storage system with heatpumps and cold water storage I found the object "SetpointManager:ReturnTemperature:ChilledWater".
I found it really useful because it lets the heat pump impulsion temperature float between a minimum and a maximum, and this is a "common" practice that makes the COP of the heat pump higher.
However, after changing the fluid of the plant loop to water+ethylenglycol, I found in the .err file the following warning:
** Warning ** GetSpecificHeatGlycol: Temperature is out of range (too low) for fluid **[WATER]** specific heat supplied values **
** ~~~ ** ..Called From:ReturnWaterChWSetPointManager::calculate,Temperature=[-0.34], supplied data range=[0.00,125.00]
** ~~~ ** Environment=SITIO (01-01:31-12), at Simulation time=01/01 10:05 - 10:10
This error says that the returnWaterSetpoint manager thinks the fluid is water and therefore the problem is that the return water setpoint is using pure water for specific heat calculations, and because the fluid isn't pure water, the heat balance is never properly solved.
So I delved into the Source code as I have a modified version (for E+ 9.4) and found this on the Setpointmanager.cc, subroutine "DefineReturnWaterChWSetPointManager" lines 7606 to 7624:
// we need to know the plant to get the fluid ID in case it is glycol
// but we have to wait in case plant isn't initialized yet
// if plant isn't initialized, assume index=1 (water)
int fluidIndex = 1;
if (this->plantLoopIndex == 0) {
for (int plantIndex = 1; plantIndex <= DataPlant::TotNumLoops; plantIndex++) {
if (this->supplyNodeIndex == DataPlant::PlantLoop(plantIndex).LoopSide(2).NodeNumOut) {
this->plantLoopIndex = plantIndex;
this->plantSetpointNodeIndex = DataPlant::PlantLoop(plantIndex).TempSetPointNodeNum;
fluidIndex = DataPlant::PlantLoop(plantIndex).FluidIndex;
// now that we've found the plant populated, let's verify that the nodes match
if (!PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(this->supplyNodeIndex, this->returnNodeIndex)) {
ShowSevereError("Node problem for SetpointManager:ReturnTemperature:ChilledWater.");
ShowContinueError("Return and Supply nodes were not found on the same plant loop. Verify node names.");
ShowFatalError("Simulation aborts due to setpoint node problem");
}
}
}
}
Some lines later it uses the variable "fluidIndex" to calculate the specific heat of the fluid:
// we don't need fluid names since we have a real index, so just pass in the temperature and get properties
Real64 avgTemp = (returnNode.Temp + supplyNode.Temp) / 2;
Real64 cp = FluidProperties::GetSpecificHeatGlycol("", avgTemp, fluidIndex, "ReturnWaterChWSetPointManager::calculate");
This block of code NEVER uses fluidIndex as called from the plantloop, it ALWAYS uses 1 (Water). My believe is that the if condition that checks if the plant was initialised was set wrong as a mistake.
The " if (this->plantLoopIndex == 0) {" means "if the plant is NOT initialised, then enter this if and loop trough the plants" and that does nothing during simulations, as only during warmup is the plant not initialised. I believe the intention was to use this as "if (this->plantLoopIndex != 0) ".
By changing that condition to "if (this->plantLoopIndex != 0)" then the warning that says that the return temperature setpointmanager is using pure water now says that it correctly identifies water+ethyleneglycol as the fluid.
The current version of E+ has this exact same bug as the if condition checks if "it is NOT initialised then enter" and therefore my proposal is changing it from "if (this->plantLoopIndex == 0) " to "if (this->plantLoopIndex != 0)".
For anyone working in their own version of E+ with this return temperature setpoint manager you can also easily implement it by changing that one character.
Thank you for your time reading this post, PMP