Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SetpointManager:ReturnTemperature:ChilledWater doesn't get the loop fluid (E+ Bugfix)

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

SetpointManager:ReturnTemperature:ChilledWater doesn't get the loop fluid (E+ Bugfix)

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)". And also this bug is repeated for the "Returnwater HOTwater setpoint manager" which in the line 7714 of the same setpointmanager.cc file.

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

SetpointManager:ReturnTemperature:ChilledWater doesn't get the loop fluid (E+ Bugfix)

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)". And also this bug is repeated for the "Returnwater HOTwater setpoint manager" which in the line 7714 of the same setpointmanager.cc file.

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

SetpointManager:ReturnTemperature:ChilledWater doesn't get the loop never reads PlantLoop fluid glycol (E+ Bugfix)

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)". And also this bug is repeated for the "Returnwater HOTwater setpoint manager" which in the line 7714 of the same setpointmanager.cc file.

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

SetpointManager:ReturnTemperature:ChilledWater SetpointManager:ReturnTemperature:Chilled/HotWater never reads PlantLoop fluid glycol (E+ Bugfix)

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, water+ethyleneglycol, 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)". And also this bug is repeated for the "Returnwater HOTwater setpoint manager" which in the line 7714 of the same setpointmanager.cc file.

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

SetpointManager:ReturnTemperature:Chilled/HotWater never reads PlantLoop fluid glycol (E+ Bugfix)

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+ethyleneglycol, 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 through 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)". And also this bug is repeated for the "Returnwater HOTwater setpoint manager" which in the line 7714 of the same setpointmanager.cc file.

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

SetpointManager:ReturnTemperature:Chilled/HotWater never reads PlantLoop fluid glycol (E+ Bugfix)

THIS POST WAS MODIFIED AS MY FIRST SOLUTION CAUSED A BUG

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+ethyleneglycol, 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 And the reason I believe is that the if condition that checks if "fluidIndex = DataPlant::PlantLoop(plantIndex).FluidIndex;" is used only once, when the plant was initialised was set wrong as is NOT initialised.

This is a mistake.

The " simplified version of the logic: Fluid=Water Ifnotinitialised->{ initialise it Fluid=Fluid of the plant}

This subroutine is executed in EVERY timestep, so it only sets the fluid correctly once, at the same time the plant initialises. After that it defaults to water. This is my fix to it:

if (this->plantLoopIndex == 0) {" means "if the plant is NOT initialised, then enter this {
...
}

 if and loop through 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)" { fluidIndex = DataPlant::PlantLoop(this->plantLoopIndex).FluidIndex; }

Now it first sets as water, then the warning that says that the return temperature setpointmanager is using pure initialises it once when necessary and once the plantLoopIndex is set, meaning it is initialised, it changes the fluidIndex to that of the plant. I believe that the problem is that the code right now doesn't reset the plantLoopIndex variable, but the code is written as if everytime the subroutine is called it should start with that index=0, as if someone thought "We don't need to check where the setpoint node is located in every timestep, we can just do that once and then keep the index" but forgot that the fluidIndex is reset to water now says that it correctly identifies water+ethyleneglycol as the fluid.at every execution of the subroutine.

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)". And and also this bug is repeated for the "Returnwater HOTwater setpoint manager" which in the line 7714 of the the same setpointmanager.cc file.

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.it.

Thank you for your time reading this post, PMP