Skip to content

Commit

Permalink
Merge pull request #4764 from NREL/HVACSizingSim_CoincidentPlant
Browse files Browse the repository at this point in the history
@EnergyArchmage CI is showing lots of regressions, but again, they are expected, and running locally showed no diffs.  🍀
  • Loading branch information
Myoldmopar committed Mar 18, 2015
2 parents 649933a + b7db966 commit b587b3d
Show file tree
Hide file tree
Showing 81 changed files with 6,431 additions and 5,642 deletions.
41 changes: 39 additions & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ SimulationControl,
\memo fields set to No, the corresponding Sizing object is ignored.
\memo Note also, if you want to do system sizing, you must also do zone sizing in the same
\memo run or an error will result.
\min-fields 5
A1, \field Do Zone Sizing Calculation
\note If Yes, Zone sizing is accomplished from corresponding Sizing:Zone objects
\note and autosize fields.
Expand Down Expand Up @@ -410,12 +411,26 @@ SimulationControl,
\key Yes
\key No
\default Yes
A5; \field Run Simulation for Weather File Run Periods
A5, \field Run Simulation for Weather File Run Periods
\note If Yes, RunPeriod:* objects are executed and results from those may be displayed..
\type choice
\key Yes
\key No
\default Yes
A6, \field Do HVAC Sizing Simulation for Sizing Periods
\note If Yes, SizingPeriod:* objects are exectuted additional times for advanced sizing.
\note Currently limited to use with coincident plant sizing, see Sizing:Plant object
\type choice
\key Yes
\key No
\default No
N1; \field Maximum Number of HVAC Sizing Simulation Passes
\note the entire set of SizingPeriod:* objects may be repeated to fine tune size results
\note this input sets a limit on the number of passes that the sizing algorithms can repeate the set
\type integer
\minimum 1
\default 1


Building,
\memo Describes parameters that are used during the simulation
Expand Down Expand Up @@ -31102,11 +31117,31 @@ Sizing:Plant,
\required-field
\type real
\units C
N2; \field Loop Design Temperature Difference
N2, \field Loop Design Temperature Difference
\required-field
\type real
\units deltaC
\minimum> 0.0
A3, \field Sizing Option
\note if Coincident is chosen, then sizing is based on HVAC Sizing Simulations and
\note the input field called Do HVAC Sizing Simulation for Sizing Periods in SimulationControl must be set to Yes
\type choice
\key Coincident
\key NonCoincident
\default NonCoincident
N3, \field Zone Timesteps in Averaging Window
\note this is used in the coincident sizing algorithm to apply a running average to peak flow rates
\note that occur during HVAC Sizing Simulations
\type integer
\minimum 1
\default 1
A4; \field Coincident Sizing Factor Mode
\note this is used to adjust the result for coincident sizing by applying a sizing factor
\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 Expand Up @@ -92463,6 +92498,7 @@ Output:Diagnostics,
\key DisplayWeatherMissingDataWarnings
\key ReportDuringWarmup
\key ReportDetailedWarmupConvergence
\key ReportDuringHVACSizingSimulation
A2 ; \field Key 2
\type choice
\key DisplayAllWarnings
Expand All @@ -92475,6 +92511,7 @@ Output:Diagnostics,
\key DisplayWeatherMissingDataWarnings
\key ReportDuringWarmup
\key ReportDetailedWarmupConvergence
\key ReportDuringHVACSizingSimulation

Output:DebuggingData,
\memo switch eplusout.dbg file on or off
Expand Down
62 changes: 32 additions & 30 deletions src/EnergyPlus/BoilerSteam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ namespace BoilerSteam {

// Initialize Loop Equipment
if ( InitLoopEquip ) {
Boiler( BoilerNum ).IsThisSized = false;
InitBoiler( BoilerNum );
Boiler( BoilerNum ).IsThisSized = true;
SizeBoiler( BoilerNum );
MinCap = Boiler( BoilerNum ).NomCap * Boiler( BoilerNum ).MinPartLoadRat;
MaxCap = Boiler( BoilerNum ).NomCap * Boiler( BoilerNum ).MaxPartLoadRat;
Expand Down Expand Up @@ -216,6 +214,7 @@ namespace BoilerSteam {
using FluidProperties::FindRefrigerant;
using GlobalNames::VerifyUniqueBoilerName;
using General::RoundSigDigits;
using DataSizing::AutoSize;

// Locals
// PARAMETERS
Expand Down Expand Up @@ -325,6 +324,9 @@ namespace BoilerSteam {
Boiler( BoilerNum ).Effic = rNumericArgs( 2 );
Boiler( BoilerNum ).TempUpLimitBoilerOut = rNumericArgs( 3 );
Boiler( BoilerNum ).NomCap = rNumericArgs( 4 );
if ( Boiler( BoilerNum ).NomCap == AutoSize ) {
Boiler( BoilerNum ).NomCapWasAutoSized = true;
}
Boiler( BoilerNum ).MinPartLoadRat = rNumericArgs( 5 );
Boiler( BoilerNum ).MaxPartLoadRat = rNumericArgs( 6 );
Boiler( BoilerNum ).OptPartLoadRat = rNumericArgs( 7 );
Expand Down Expand Up @@ -418,8 +420,8 @@ namespace BoilerSteam {
using DataPlant::TypeOf_Boiler_Steam;
using DataPlant::ScanPlantLoopsForObject;
using DataPlant::PlantLoop;
using DataPlant::PlantSizesOkayToFinalize;
using DataPlant::PlantSizeNotComplete;
using DataPlant::PlantFirstSizesOkayToFinalize;
using DataPlant::PlantFirstSizeCompleted;
using DataPlant::SingleSetPoint;
using DataPlant::DualSetPointDeadBand;
using PlantUtilities::InitComponentNodes;
Expand Down Expand Up @@ -477,8 +479,7 @@ namespace BoilerSteam {
BoilerInletNode = Boiler( BoilerNum ).BoilerInletNodeNum;
BoilerOutletNode = Boiler( BoilerNum ).BoilerOutletNodeNum;

if ( BeginEnvrnFlag && MyEnvrnFlag( BoilerNum ) && ( PlantSizesOkayToFinalize ) ) {
if ( PlantSizeNotComplete ) SizeBoiler( BoilerNum );
if ( BeginEnvrnFlag && MyEnvrnFlag( BoilerNum ) && ( PlantFirstSizesOkayToFinalize ) ) {

//BoilerOutletTemp = Node(BoilerOutletNode)%TempSetPoint
//TempUpLimitBoilerOut =Boiler(BoilerNum)%TempUpLimitBoilerOut
Expand Down Expand Up @@ -576,7 +577,9 @@ namespace BoilerSteam {
// Using/Aliasing
using namespace DataSizing;
using DataPlant::PlantLoop;
using DataPlant::PlantSizesOkayToFinalize;
using DataPlant::PlantFirstSizesOkayToFinalize;
using DataPlant::PlantFirstSizesOkayToReport;
using DataPlant::PlantFinalSizesOkayToReport;
using FluidProperties::GetSatDensityRefrig;
using FluidProperties::GetSatEnthalpyRefrig;
using FluidProperties::GetSatSpecificHeatRefrig;
Expand Down Expand Up @@ -606,21 +609,16 @@ namespace BoilerSteam {
Real64 CpWater; // Heat capacity of condensed steam
std::string equipName;
Real64 tmpNomCap; // local nominal capacity cooling power
bool IsAutoSize; // Indicator to autosize for reporting
Real64 NomCapUser; // Hardsized nominal capacity for reporting

PltSizNum = 0;
ErrorsFound = false;
IsAutoSize = false;
tmpNomCap = Boiler( BoilerNum ).NomCap;
NomCapUser = 0.0;

// Find the appropriate Plant Sizing object
PltSizNum = PlantLoop( Boiler( BoilerNum ).LoopNum ).PlantSizNum;

if ( Boiler( BoilerNum ).NomCap == AutoSize ) {
IsAutoSize = true;
}
if ( PltSizNum > 0 ) {
if ( PlantSizData( PltSizNum ).DesVolFlowRate >= SmallWaterVolFlow ) {
SizingTemp = Boiler( BoilerNum ).TempUpLimitBoilerOut;
Expand All @@ -630,23 +628,28 @@ namespace BoilerSteam {
LatentEnthSteam = EnthSteamOutDry - EnthSteamOutWet;
CpWater = GetSatSpecificHeatRefrig( FluidNameSteam, SizingTemp, 0.0, Boiler( BoilerNum ).FluidIndex, RoutineName );
tmpNomCap = ( CpWater * SteamDensity * Boiler( BoilerNum ).SizFac * PlantSizData( PltSizNum ).DeltaT * PlantSizData( PltSizNum ).DesVolFlowRate + PlantSizData( PltSizNum ).DesVolFlowRate * SteamDensity * LatentEnthSteam );
if ( ! IsAutoSize ) tmpNomCap = Boiler( BoilerNum ).NomCap;
//IF (PlantSizesOkayToFinalize) Boiler(BoilerNum)%NomCap =tmpNomCap
if ( ! Boiler( BoilerNum ).NomCapWasAutoSized ) tmpNomCap = Boiler( BoilerNum ).NomCap;
} else {
if ( IsAutoSize ) tmpNomCap = 0.0;
//IF (PlantSizesOkayToFinalize) Boiler(BoilerNum)%NomCap = tmpNomCap
if ( Boiler( BoilerNum ).NomCapWasAutoSized ) tmpNomCap = 0.0;
}
if ( PlantSizesOkayToFinalize ) {
if ( IsAutoSize ) {
if ( PlantFirstSizesOkayToFinalize ) {
if ( Boiler( BoilerNum ).NomCapWasAutoSized ) {
Boiler( BoilerNum ).NomCap = tmpNomCap;
if ( ! Boiler( BoilerNum ).IsThisSized ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name, "Design Size Nominal Capacity [W]", tmpNomCap );
if ( PlantFinalSizesOkayToReport ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name,
"Design Size Nominal Capacity [W]", tmpNomCap );
}
if ( PlantFirstSizesOkayToReport ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name,
"Initial Design Size Nominal Capacity [W]", tmpNomCap );
}
} else { // Hard-sized with sizing data
if ( Boiler( BoilerNum ).NomCap > 0.0 && tmpNomCap > 0.0 ) {
NomCapUser = Boiler( BoilerNum ).NomCap;
if ( ! Boiler( BoilerNum ).IsThisSized ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name, "Design Size Nominal Capacity [W]", tmpNomCap, "User-Specified Nominal Capacity [W]", NomCapUser );
if ( PlantFinalSizesOkayToReport ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name,
"Design Size Nominal Capacity [W]", tmpNomCap,
"User-Specified Nominal Capacity [W]", NomCapUser );
if ( DisplayExtraWarnings ) {
if ( ( std::abs( tmpNomCap - NomCapUser ) / NomCapUser ) > AutoVsHardSizingThreshold ) {
ShowMessage( "SizePump: Potential issue with equipment sizing for " + Boiler( BoilerNum ).Name );
Expand All @@ -662,23 +665,22 @@ namespace BoilerSteam {
}
}
} else {
if ( IsAutoSize ) {
if ( Boiler( BoilerNum ).NomCapWasAutoSized && PlantFirstSizesOkayToFinalize ) {
ShowSevereError( "Autosizing of Boiler nominal capacity requires a loop Sizing:Plant object" );
ShowContinueError( "Occurs in Boiler:Steam object=" + Boiler( BoilerNum ).Name );
ErrorsFound = true;
} else {
if ( ! Boiler( BoilerNum ).IsThisSized ) {
if ( Boiler( BoilerNum ).NomCap > 0.0 ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name, "User-Specified Nominal Capacity [W]", Boiler( BoilerNum ).NomCap );
}
}
}
if ( ! Boiler( BoilerNum ).NomCapWasAutoSized && Boiler( BoilerNum ).NomCap > 0.0
&& PlantFinalSizesOkayToReport ) {
ReportSizingOutput( "Boiler:Steam", Boiler( BoilerNum ).Name,
"User-Specified Nominal Capacity [W]", Boiler( BoilerNum ).NomCap );
}
}

// model has no volume flow rate, may need something else for steam loop sizing DSU??
//DSU? CALL RegisterPlantCompDesignFlow(Boiler(BoilerNum)%BoilerInletNodeNum,Boiler(BoilerNum)%VolFlowRate)

if ( PlantSizesOkayToFinalize ) {
if ( PlantFinalSizesOkayToReport ) {
//create predefined report
equipName = Boiler( BoilerNum ).Name;
PreDefTableEntry( pdchMechType, equipName, "Boiler:Steam" );
Expand Down
91 changes: 3 additions & 88 deletions src/EnergyPlus/BoilerSteam.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace BoilerSteam {
Real64 DesMassFlowRate; // kg/s - Boiler water design mass flow rate
Real64 MassFlowRate; // kg/s - Boiler water mass flow rate
Real64 NomCap; // W - design nominal capacity of Boiler
bool NomCapWasAutoSized; //true if Nominal capacity was autosize on input
Real64 Effic; // boiler efficiency at design conditions
// REAL(r64) :: TempDesBoilerOut =0.0d0 ! C - Boiler design outlet temperature
Real64 MinPartLoadRat; // Minimum allowed operating part load ratio
Expand All @@ -68,7 +69,6 @@ namespace BoilerSteam {
int CompNum; // Plant loop component index number
int PressErrIndex; // index pointer for recurring errors
int FluidIndex; // Steam index
bool IsThisSized; // TRUE if sizing is done

// Default Constructor
BoilerSpecs() :
Expand All @@ -80,6 +80,7 @@ namespace BoilerSteam {
DesMassFlowRate( 0.0 ),
MassFlowRate( 0.0 ),
NomCap( 0.0 ),
NomCapWasAutoSized( false ),
Effic( 0.0 ),
MinPartLoadRat( 0.0 ),
MaxPartLoadRat( 0.0 ),
Expand All @@ -98,73 +99,8 @@ namespace BoilerSteam {
BranchNum( 0 ),
CompNum( 0 ),
PressErrIndex( 0 ),
FluidIndex( 0 ),
IsThisSized( false )
FluidIndex( 0 )
{}

// Member Constructor
BoilerSpecs(
std::string const & Name, // user identifier
int const FuelType, // resource type
bool const Available, // TRUE if machine available in current time step
bool const ON, // TRUE: simulate the machine at it's operating part load ratio
bool const MissingSetPointErrDone, // Missing outlet node setpoint message flag
bool const UseLoopSetPoint, // Flag to use setpoint from loop
Real64 const DesMassFlowRate, // kg/s - Boiler water design mass flow rate
Real64 const MassFlowRate, // kg/s - Boiler water mass flow rate
Real64 const NomCap, // W - design nominal capacity of Boiler
Real64 const Effic, // boiler efficiency at design conditions
Real64 const MinPartLoadRat, // Minimum allowed operating part load ratio
Real64 const MaxPartLoadRat, // Maximum allowed operating part load ratio
Real64 const OptPartLoadRat, // Optimal operating part load ratio
Real64 const OperPartLoadRat, // Actual operating part load ratio
Real64 const TempUpLimitBoilerOut, // C - Boiler outlet maximum temperature limit
Real64 const BoilerMaxOperPress, // Max Boiler Pressure
Real64 const BoilerPressCheck, // Boiler Operating Pressure at Saturation Temperature
Real64 const SizFac, // sizing factor
int const BoilerInletNodeNum, // Node number at the boiler inlet
int const BoilerOutletNodeNum, // Node number at the boiler outlet
FArray1< Real64 > const & FullLoadCoef, // Coefficients of the fuel consumption/part load ratio curve
int const TypeNum, // Plant loop type identifier
int const LoopNum, // Plant loop index number
int const LoopSideNum, // Loop side index number
int const BranchNum, // Branch index number
int const CompNum, // Plant loop component index number
int const PressErrIndex, // index pointer for recurring errors
int const FluidIndex, // Steam index
bool const IsThisSized // TRUE if sizing is done
) :
Name( Name ),
FuelType( FuelType ),
Available( Available ),
ON( ON ),
MissingSetPointErrDone( MissingSetPointErrDone ),
UseLoopSetPoint( UseLoopSetPoint ),
DesMassFlowRate( DesMassFlowRate ),
MassFlowRate( MassFlowRate ),
NomCap( NomCap ),
Effic( Effic ),
MinPartLoadRat( MinPartLoadRat ),
MaxPartLoadRat( MaxPartLoadRat ),
OptPartLoadRat( OptPartLoadRat ),
OperPartLoadRat( OperPartLoadRat ),
TempUpLimitBoilerOut( TempUpLimitBoilerOut ),
BoilerMaxOperPress( BoilerMaxOperPress ),
BoilerPressCheck( BoilerPressCheck ),
SizFac( SizFac ),
BoilerInletNodeNum( BoilerInletNodeNum ),
BoilerOutletNodeNum( BoilerOutletNodeNum ),
FullLoadCoef( 3, FullLoadCoef ),
TypeNum( TypeNum ),
LoopNum( LoopNum ),
LoopSideNum( LoopSideNum ),
BranchNum( BranchNum ),
CompNum( CompNum ),
PressErrIndex( PressErrIndex ),
FluidIndex( FluidIndex ),
IsThisSized( IsThisSized )
{}

};

struct ReportVars
Expand All @@ -191,27 +127,6 @@ namespace BoilerSteam {
BoilerMaxOperPress( 0.0 )
{}

// Member Constructor
ReportVars(
Real64 const BoilerLoad, // W - Boiler operating load
Real64 const BoilerEnergy, // J - Boiler energy integrated over time
Real64 const FuelUsed, // W - Boiler fuel used
Real64 const FuelConsumed, // J - Boiler Fuel consumed integrated over time
Real64 const BoilerInletTemp, // C - Boiler inlet temperature
Real64 const BoilerOutletTemp, // C - Boiler outlet temperature
Real64 const Mdot, // kg/s - Boiler mass flow rate
Real64 const BoilerMaxOperPress
) :
BoilerLoad( BoilerLoad ),
BoilerEnergy( BoilerEnergy ),
FuelUsed( FuelUsed ),
FuelConsumed( FuelConsumed ),
BoilerInletTemp( BoilerInletTemp ),
BoilerOutletTemp( BoilerOutletTemp ),
Mdot( Mdot ),
BoilerMaxOperPress( BoilerMaxOperPress )
{}

};

// Object Data
Expand Down
Loading

0 comments on commit b587b3d

Please sign in to comment.