Skip to content

Commit

Permalink
add control over sizing factor to use
Browse files Browse the repository at this point in the history
add input switch for control which sizing factor is applied to the
measured flow when setting the size for coincident plant sizing. improve
reporting to predefined sizing summary table.
  • Loading branch information
EnergyArchmage committed Jan 21, 2015
1 parent 72bdc98 commit 382814a
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 19 deletions.
8 changes: 7 additions & 1 deletion idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -31045,10 +31045,16 @@ Sizing:Plant,
\key Coincident
\key NonCoincident
\default NonCoincident
N3; \field Zone Timesteps in Averaging Window
N3, \field Zone Timesteps in Averaging Window
\type integer
\minimum 0
\default 1
A4; \field Coincident Sizing Factor Mode
\type choice
\key None
\key GlobalHeatingSizingFactor
\key GlobalCoolingSizingFactor
\key LoopComponentSizingFactor

OutputControl:Sizing:Style,
\memo Default style for the Sizing output files is comma -- this works well for
Expand Down
6 changes: 6 additions & 0 deletions src/EnergyPlus/DataSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ namespace DataSizing {
int const FractionOfAutosizedCoolingCapacity( 11 );
int const FractionOfAutosizedHeatingCapacity( 12 );

int const NoSizingFactorMode( 101 );
int const GlobalHeatingSizingFactorMode( 102 );
int const GlobalCoolingSizingFactorMode( 103 );
int const LoopComponentSizingFactorMode( 104 );


// DERIVED TYPE DEFINITIONS:

// INTERFACE BLOCK SPECIFICATIONS
Expand Down
10 changes: 10 additions & 0 deletions src/EnergyPlus/DataSizing.hh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ namespace DataSizing {
extern int const FractionOfAutosizedCoolingCapacity;
extern int const FractionOfAutosizedHeatingCapacity;

// Plant Coincident sizing factor options
extern int const NoSizingFactorMode;
extern int const GlobalHeatingSizingFactorMode;
extern int const GlobalCoolingSizingFactorMode;
extern int const LoopComponentSizingFactorMode;

// DERIVED TYPE DEFINITIONS:

// INTERFACE BLOCK SPECIFICATIONS
Expand Down Expand Up @@ -1689,6 +1695,7 @@ namespace DataSizing {
Real64 DeltaT; // loop design temperature drop (or rise) [DelK]
int ConcurrenceOption; // sizing option for coincident or noncoincident
int NumTimeStepsInAvg; // number of zone timesteps in the averaging window for coincident plant flow
int SizingFactorOption; // option for what sizing factor to apply
// Calculated
Real64 DesVolFlowRate; // loop design flow rate in m3/s
bool VolFlowSizingDone; // flag to indicate when this loop has finished sizing flow rate
Expand All @@ -1700,6 +1707,7 @@ namespace DataSizing {
DeltaT( 0.0 ),
ConcurrenceOption( 0 ),
NumTimeStepsInAvg( 0 ),
SizingFactorOption( 101 ),
DesVolFlowRate( 0.0 ),
VolFlowSizingDone( false )
{}
Expand All @@ -1712,6 +1720,7 @@ namespace DataSizing {
Real64 const DeltaT, // loop design temperature drop (or rise) [DelK]
int const ConcurrenceOption,
int const NumTimeStepsInAvg,
int const SizingFactorOption,
Real64 const DesVolFlowRate, // loop design flow rate in m3/s
bool const VolFlowSizingDone // flag to indicate when this loop has finished sizing flow rate
) :
Expand All @@ -1721,6 +1730,7 @@ namespace DataSizing {
DeltaT( DeltaT ),
ConcurrenceOption( ConcurrenceOption ),
NumTimeStepsInAvg( NumTimeStepsInAvg ),
SizingFactorOption( SizingFactorOption ),
DesVolFlowRate( DesVolFlowRate ),
VolFlowSizingDone( VolFlowSizingDone )
{}
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/OutputReportPredefined.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ namespace OutputReportPredefined {
int pdchSysSizUserHtAir;
int pdstPlantSize;
int pdchPlantSizCalcVdot;
int pdchPlantSizMeasVdot;
int pdchPlantSizPrevVdot;
int pdchPlantSizPass;
int pdchPlantSizCoincYesNo;
Expand Down Expand Up @@ -972,6 +973,7 @@ namespace OutputReportPredefined {
pdstPlantSize = newPreDefSubTable( pdrSizing, "Plant Loop Coincident Design Fluid Flow Rate Adjustments");
pdchPlantSizPass = newPreDefColumn( pdstPlantSize, "Sizing Pass" );
pdchPlantSizPrevVdot = newPreDefColumn( pdstPlantSize, "Previous Design Volume Flow Rate [m3/s]" );
pdchPlantSizMeasVdot = newPreDefColumn( pdstPlantSize, "Measured Volume Flow Rate [m3/s]" );
pdchPlantSizCalcVdot = newPreDefColumn( pdstPlantSize, "Coincident Design Volume Flow Rate [m3/s]" );
pdchPlantSizCoincYesNo = newPreDefColumn( pdstPlantSize, "Coincident Size Adjusted" );
pdchPlantSizDesDay = newPreDefColumn( pdstPlantSize, "Peak Sizing Period Name" );
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/OutputReportPredefined.hh
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ namespace OutputReportPredefined {
extern int pdchSysSizUserHtAir;
extern int pdstPlantSize;
extern int pdchPlantSizCalcVdot;
extern int pdchPlantSizMeasVdot;
extern int pdchPlantSizPrevVdot;
extern int pdchPlantSizPass;
extern int pdchPlantSizCoincYesNo;
Expand Down
49 changes: 34 additions & 15 deletions src/EnergyPlus/SizingAnalysisObjects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace EnergyPlus {
}

int const SizingLoggerFramework::SetupVariableSizingLog(
int const & SupplySideInletNodeNum // change to pointer setup
int const SupplySideInletNodeNum // change to pointer setup
){
using DataGlobals::NumOfTimeStepInHour;
using DataGlobals::ksDesignDay;
Expand Down Expand Up @@ -193,33 +193,53 @@ namespace EnergyPlus {
using DataGlobals::TimeStepZone;
using DataGlobals::SecInHour;
using DataSizing::PlantSizData;
using DataSizing::NoSizingFactorMode;
using DataSizing::GlobalHeatingSizingFactorMode;
using DataSizing::GlobalCoolingSizingFactorMode;
using DataSizing::LoopComponentSizingFactorMode;
using DataSizing::GlobalHeatSizingFactor;
using DataSizing::GlobalCoolSizingFactor;
using namespace DataPlant;
using namespace OutputReportPredefined;
using WeatherManager::Environment;
using DataHVACGlobals::SmallWaterVolFlow;
bool SetNewSizes;
Real64 SizingFac;
Real64 NormalizedChange;
Real64 newFoundVolFlowRate;


//this is for a loop level sizing factor which is assumed to not need to change for resizing
PlantSizingFraction = PlantLoop( PlantLoopIndex ).LoopSide( SupplySide ).Branch( 1 ).PumpSizFac;

previousVolDesignFlowRate = PlantSizData( PlantLoopIndex ).DesVolFlowRate;

if (newFoundMassFlowRateTimeStamp.LogDataValue > 0.0 ) {
newFoundMassFlowRate = newFoundMassFlowRateTimeStamp.LogDataValue;
newFoundMassFlowRate = newFoundMassFlowRateTimeStamp.LogDataValue;
} else {
newFoundMassFlowRate = 0.0;
}

newAdjustedMassFlowRate = newFoundMassFlowRate * PlantSizingFraction; //indlude sizing fraction multiplier, often 1.0
newVolDesignFlowRate = newAdjustedMassFlowRate / DensityForSizing;

newFoundVolFlowRate = newFoundMassFlowRate / DensityForSizing;

// now apply the correct sizing factor depending on input option
if ( PlantSizData( PlantLoopIndex ).SizingFactorOption == NoSizingFactorMode ) {
SizingFac = 1.0;
} else if ( PlantSizData( PlantLoopIndex ).SizingFactorOption == GlobalHeatingSizingFactorMode ) {
SizingFac = GlobalHeatSizingFactor;
} else if ( PlantSizData( PlantLoopIndex ).SizingFactorOption == GlobalCoolingSizingFactorMode ) {
SizingFac = GlobalCoolSizingFactor;
} else if ( PlantSizData( PlantLoopIndex ).SizingFactorOption == LoopComponentSizingFactorMode ) {
//multiplier used for pumps, often 1.0, from component level sizing fractions
SizingFac = PlantLoop( PlantLoopIndex ).LoopSide( SupplySide ).Branch( 1 ).PumpSizFac;
}

newAdjustedMassFlowRate = newFoundMassFlowRate * SizingFac; // apply overall heating or cooling sizing factor

newVolDesignFlowRate = newAdjustedMassFlowRate / DensityForSizing;

//compare threshold, store TODO
//compare threshold,
SetNewSizes = false;
if (newVolDesignFlowRate > SmallWaterVolFlow && newVolDesignFlowRate < previousVolDesignFlowRate ) {
if ( ( newVolDesignFlowRate > SmallWaterVolFlow ) // do not use zero size
// && ( newVolDesignFlowRate < previousVolDesignFlowRate )// assume only shrink size from noncoincident? nah
) {
SetNewSizes = true;
NormalizedChange = std::abs((newVolDesignFlowRate - previousVolDesignFlowRate)
/ previousVolDesignFlowRate);
Expand All @@ -228,8 +248,6 @@ namespace EnergyPlus {
} else {
AnotherIterationDesired = false;
}


}

if ( SetNewSizes ) {
Expand All @@ -249,8 +267,9 @@ namespace EnergyPlus {
}
//report to sizing summary table called Plant Loop Coincident Design Fluid Flow Rates
PreDefTableEntry( pdchPlantSizPass, PlantLoop( PlantLoopIndex ).Name, HVACSizingIterCount );
PreDefTableEntry( pdchPlantSizPrevVdot, PlantLoop( PlantLoopIndex ).Name, previousVolDesignFlowRate , 4 );
PreDefTableEntry( pdchPlantSizCalcVdot, PlantLoop( PlantLoopIndex ).Name, newVolDesignFlowRate , 4 );
PreDefTableEntry( pdchPlantSizPrevVdot, PlantLoop( PlantLoopIndex ).Name, previousVolDesignFlowRate , 6 );
PreDefTableEntry( pdchPlantSizMeasVdot, PlantLoop( PlantLoopIndex ).Name, newFoundVolFlowRate , 6 );
PreDefTableEntry( pdchPlantSizCalcVdot, PlantLoop( PlantLoopIndex ).Name, newVolDesignFlowRate , 6 );

if (SetNewSizes) {
PreDefTableEntry( pdchPlantSizCoincYesNo, PlantLoop( PlantLoopIndex ).Name, "Yes" );
Expand All @@ -261,7 +280,7 @@ namespace EnergyPlus {
PreDefTableEntry( pdchPlantSizDesDay, PlantLoop( PlantLoopIndex ).Name, Environment(newFoundMassFlowRateTimeStamp.EnvrnNum).Title );
PreDefTableEntry( pdchPlantSizPkTimeDayOfSim, PlantLoop( PlantLoopIndex ).Name, newFoundMassFlowRateTimeStamp.DayOfSim );
PreDefTableEntry( pdchPlantSizPkTimeHour, PlantLoop( PlantLoopIndex ).Name, newFoundMassFlowRateTimeStamp.HourOfDay );
PreDefTableEntry( pdchPlantSizPkTimeMin, PlantLoop( PlantLoopIndex ).Name, newFoundMassFlowRateTimeStamp.stepStartMinute );
PreDefTableEntry( pdchPlantSizPkTimeMin, PlantLoop( PlantLoopIndex ).Name, newFoundMassFlowRateTimeStamp.stepStartMinute, 0 );

}
}
2 changes: 1 addition & 1 deletion src/EnergyPlus/SizingAnalysisObjects.hh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public:


int const SetupVariableSizingLog(
int const & SupplySideInletNodeNum //change to pointers for generality later
int const SupplySideInletNodeNum //change to pointers for generality later
);

void UpdateSizingLogValuesZoneStep();
Expand Down
19 changes: 17 additions & 2 deletions src/EnergyPlus/SizingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2342,9 +2342,9 @@ namespace SizingManager {

if ( NumAlphas > 2 ) {
{auto const concurrenceOption (cAlphaArgs(3) );
if (concurrenceOption == "NONCOINCIDENT"){
if ( concurrenceOption == "NONCOINCIDENT" ){
PlantSizData( PltSizIndex ).ConcurrenceOption = NonCoincident;
} else if (concurrenceOption == "COINCIDENT" ){
} else if ( concurrenceOption == "COINCIDENT" ){
PlantSizData( PltSizIndex ).ConcurrenceOption = Coincident;
} else {
ShowSevereError( cCurrentModuleObject + "=\"" + cAlphaArgs( 1 ) + "\", invalid data." );
Expand All @@ -2354,6 +2354,21 @@ namespace SizingManager {

}}
}
if (NumAlphas > 3){
{auto const sizingFactorOption ( cAlphaArgs(4) );
if ( sizingFactorOption == "NONE" ) {
PlantSizData( PltSizIndex ).SizingFactorOption = NoSizingFactorMode;
} else if ( sizingFactorOption == "GLOBALHEATINGSIZINGFACTOR" ) {
PlantSizData( PltSizIndex ).SizingFactorOption = GlobalHeatingSizingFactorMode;
} else if ( sizingFactorOption == "GLOBALCOOLINGSIZINGFACTOR" ) {
PlantSizData( PltSizIndex ).SizingFactorOption = GlobalCoolingSizingFactorMode;
} else if ( sizingFactorOption == "LOOPCOMPONENTSIZINGFACTOR" ) {
PlantSizData( PltSizIndex ).SizingFactorOption = LoopComponentSizingFactorMode;
}

}

}
SetupEMSInternalVariable( "Plant Design Volume Flow Rate", PlantSizData( PltSizIndex ).PlantLoopName, "[m3/s]", PlantSizData( PltSizIndex ).DesVolFlowRate );
}

Expand Down

7 comments on commit 382814a

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: Coverage Too Low

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: Coverage Too Low

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - i386-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - Win64-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

HVACSizingSim_CoincidentPlant (EnergyArchmage) - x86_64-MacOS-10.9-clang: Tests Failed

Build Badge Test Badge

Please sign in to comment.