-
Notifications
You must be signed in to change notification settings - Fork 393
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
Fix #6435 - WaterUse:Storage Design Inflow Rate not respected #8399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a Walkthrough. The unit test is commented and should be self explanatory so I didn't add walkthrough comments.
@@ -121,6 +121,7 @@ namespace DataWater { | |||
int OverflowTankSupplyARRID; | |||
Real64 ValveOnCapacity; // tank capacity at lower control range [m3] | |||
Real64 ValveOffCapacity; // tank capacity at upper control range [m3] | |||
bool LastTimeStepFilling; // Indicates that tank was filling up at last timestep, to determine whether to continue until ValveOffCapacity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New attribute
: MaxCapacity(0.0), OverflowMode(Overflow::Unassigned), OverflowTankID(0), OverflowTankSupplyARRID(0), ValveOnCapacity(0.0), ValveOffCapacity(0.0), ControlSupply(ControlSupplyType::Unassigned), GroundWellID(0), SupplyTankID(0), SupplyTankDemandARRID(0), BackupMainsCapacity(0.0), InitialVolume(0.0), | ||
MaxInFlowRate(0.0), MaxOutFlowRate(0.0), ThermalMode(TankThermalMode::Unassigned), InitialTankTemp(20.0), TempSchedID(0), AmbientTempIndicator(AmbientTempType::Unassigned), | ||
: MaxCapacity(0.0), OverflowMode(Overflow::Unassigned), OverflowTankID(0), OverflowTankSupplyARRID(0), ValveOnCapacity(0.0), | ||
ValveOffCapacity(0.0), LastTimeStepFilling(false), ControlSupply(ControlSupplyType::Unassigned), GroundWellID(0), SupplyTankID(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Init to false in Ctor
|
||
if ( ((VolumePredict) < state.dataWaterData->WaterStorage(TankNum).ValveOnCapacity) || | ||
state.dataWaterData->WaterStorage(TankNum).LastTimeStepFilling ) | ||
{ // turn on supply to fill tank | ||
FillVolRequest = state.dataWaterData->WaterStorage(TankNum).ValveOffCapacity - VolumePredict; | ||
|
||
state.dataWaterData->WaterStorage(TankNum).LastTimeStepFilling = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you go below ValveOnCapacity
, you start filling, and you set the LastTimeStepFilling
to true.
Or if LastTimeStepFilling
is already true
, you keep filling.
if (state.dataWaterData->WaterStorage(TankNum).ThisTimeStepVolume >= state.dataWaterData->WaterStorage(TankNum).ValveOffCapacity) { | ||
state.dataWaterData->WaterStorage(TankNum).LastTimeStepFilling = false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the end of the iteration, you check whether you are above or equal to ValveOffCapacity
, in which case you switch LastTimeStepFilling
to false.
|
I've confirmed the fix here. Everything looks good. Merging. |
Pull request overview
The problem is actually slightly different than originally stated, it's a problem of float valve control. When it goes below the
ValveOnCapacity
, it fills up. But at the next timestep, regardless of whether it's went above theValveOffCapacity
or not, it checks again if it's belowValveOnCapacity
and determines that it doesn't need to keep filling up.Defect file on EnergyPlusDevSupport: https://github.com/NREL/EnergyPlusDevSupport/blob/d37b70ea2df0e180cc527b222f827913c81ecf5d/DefectFiles/6000s/6435/in.idf#L9647-L9681
Running the defect file before and after. As you can see, in the before case, the last graph "Storage Tank Volume [m3]", you have the tank filling up only during one timestep, while the
ValveOffCapacity
which is 3m3 isn't achieved. The Timestep in the file is 6, so it fills up between 14:40 and 14:50. In the after case, the tank fills up during one more timestep until it'sValveOffCapacity
is achieved.Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.