Skip to content

Commit

Permalink
Merge pull request #4463 from NREL/ScalableSizing_FSEC_Edwin
Browse files Browse the repository at this point in the history
Scalable sizing fsec edwin
  • Loading branch information
rraustad committed Sep 9, 2014
2 parents b9698e5 + 7b8dde7 commit 334dd71
Show file tree
Hide file tree
Showing 233 changed files with 11,427 additions and 2,631 deletions.
2,405 changes: 1,526 additions & 879 deletions idd/Energy+.idd

Large diffs are not rendered by default.

186 changes: 140 additions & 46 deletions src/EnergyPlus/BaseboardElectric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// EnergyPlus Headers
#include <BaseboardElectric.hh>
#include <DataHeatBalance.hh>
#include <DataHVACGlobals.hh>
#include <DataIPShortCuts.hh>
#include <DataLoopNode.hh>
Expand Down Expand Up @@ -66,6 +67,7 @@ namespace BaseboardElectric {

// Object Data
FArray1D< BaseboardParams > Baseboard;
FArray1D< BaseboardNumericFieldData > BaseboardNumericFields;

// Functions

Expand Down Expand Up @@ -183,13 +185,25 @@ namespace BaseboardElectric {
using InputProcessor::SameString;
using GlobalNames::VerifyUniqueBaseboardName;
using namespace DataIPShortCuts;
using General::TrimSigDigits;
using DataSizing::HeatingDesignCapacity;
using DataSizing::CapacityPerFloorArea;
using DataSizing::FractionOfAutosizedHeatingCapacity;
using DataSizing::AutoSize;
using DataGlobals::NumOfZones;
using DataZoneEquipment::ZoneEquipList;
using DataZoneEquipment::BBElectricConvective_Num;

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
// na

// SUBROUTINE PARAMETER DEFINITIONS:
static std::string const RoutineName( "GetBaseboardInput: " ); // include trailing blank space
int const iHeatCAPMAlphaNum( 3 ); // get input index to baseboard heating capacity sizing method
int const iHeatDesignCapacityNumericNum( 1 ); // get input index to baseboard heating capacity
int const iHeatCapacityPerFloorAreaNumericNum( 2 ); // get input index to baseboard heating capacity per floor area sizing
int const iHeatFracOfAutosizedCapacityNumericNum( 3 ); // get input index to baseboard heating capacity sizing as fraction of autozized heating capacity

// INTERFACE BLOCK SPECIFICATIONS
// na
Expand All @@ -209,19 +223,8 @@ namespace BaseboardElectric {
bool IsBlank; // Flag for blank name
bool errFlag;

//BASEBOARD HEATER:ELECTRIC:Convective,
// A1 , \field Baseboard Name
// \required-field
// A2 , \field Available Schedule
// \required-field
// \type object-list
// \object-list ScheduleNames
// N1 , \field Efficiency of the Coil
// \maximum 1.0
// \minimum 0.0
// \default 1.0
// N2 ; \field Nominal Capacity of the Coil
// \units W
int CtrlZone; // index to constrolled zone number
int ZoneEquipTypeNum; // index to zone equipment in a zone equipment list

cCurrentModuleObject = cCMO_BBRadiator_Electric;

Expand All @@ -232,13 +235,18 @@ namespace BaseboardElectric {

Baseboard.allocate( NumBaseboards );
CheckEquipName.allocate( NumBaseboards );
BaseboardNumericFields.allocate( NumBaseboards );
CheckEquipName = true;

if ( NumConvElecBaseboards > 0 ) { //Get the data for cooling schemes
BaseboardNum = 0;
for ( ConvElecBBNum = 1; ConvElecBBNum <= NumConvElecBaseboards; ++ConvElecBBNum ) {

GetObjectItem( cCurrentModuleObject, ConvElecBBNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );

BaseboardNumericFields( ConvElecBBNum ).FieldNames.allocate( NumNums);
BaseboardNumericFields( ConvElecBBNum ).FieldNames = "";
BaseboardNumericFields( ConvElecBBNum ).FieldNames = cNumericFieldNames;

IsNotOK = false;
IsBlank = false;
Expand All @@ -265,8 +273,73 @@ namespace BaseboardElectric {
}
}
// get inlet node number
Baseboard( BaseboardNum ).NominalCapacity = rNumericArgs( 1 );
Baseboard( BaseboardNum ).BaseboardEfficiency = rNumericArgs( 2 );
Baseboard( BaseboardNum ).BaseboardEfficiency = rNumericArgs( 4 );

// Determine baseboard electric heating design capacity sizing method
if ( SameString( cAlphaArgs( iHeatCAPMAlphaNum ), "HeatingDesignCapacity" ) ) {
Baseboard( BaseboardNum ).HeatingCapMethod = HeatingDesignCapacity;
if ( !lNumericFieldBlanks( iHeatDesignCapacityNumericNum ) ) {
Baseboard( BaseboardNum ).ScaledHeatingCapacity = rNumericArgs( iHeatDesignCapacityNumericNum );
if ( Baseboard( BaseboardNum ).ScaledHeatingCapacity < 0.0 && Baseboard( BaseboardNum ).ScaledHeatingCapacity != AutoSize ) {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Illegal " + cNumericFieldNames( iHeatDesignCapacityNumericNum ) + " = " + TrimSigDigits( rNumericArgs( iHeatDesignCapacityNumericNum ), 7 ) );
ErrorsFound = true;
}
} else {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Input for " + cAlphaFieldNames( iHeatCAPMAlphaNum ) + " = " + cAlphaArgs( iHeatCAPMAlphaNum ) );
ShowContinueError( "Blank field not allowed for " + cNumericFieldNames( iHeatDesignCapacityNumericNum ) );
ErrorsFound = true;
}
} else if ( SameString( cAlphaArgs( iHeatCAPMAlphaNum ), "CapacityPerFloorArea" ) ) {
Baseboard( BaseboardNum ).HeatingCapMethod = CapacityPerFloorArea;
if ( !lNumericFieldBlanks( iHeatCapacityPerFloorAreaNumericNum ) ) {
Baseboard( BaseboardNum ).ScaledHeatingCapacity = rNumericArgs( iHeatCapacityPerFloorAreaNumericNum );
if ( Baseboard( BaseboardNum ).ScaledHeatingCapacity <= 0.0 ) {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Input for " + cAlphaFieldNames( iHeatCAPMAlphaNum ) + " = " + cAlphaArgs( iHeatCAPMAlphaNum ) );
ShowContinueError( "Illegal " + cNumericFieldNames( iHeatCapacityPerFloorAreaNumericNum ) + " = " + TrimSigDigits( rNumericArgs( iHeatCapacityPerFloorAreaNumericNum ), 7 ) );
ErrorsFound = true;
} else if ( Baseboard( BaseboardNum ).ScaledHeatingCapacity == AutoSize ) {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Input for " + cAlphaFieldNames( iHeatCAPMAlphaNum ) + " = " + cAlphaArgs( iHeatCAPMAlphaNum ) );
ShowContinueError( "Illegal " + cNumericFieldNames( iHeatCapacityPerFloorAreaNumericNum ) + " = Autosize" );
ErrorsFound = true;
}
} else {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Input for " + cAlphaFieldNames( iHeatCAPMAlphaNum ) + " = " + cAlphaArgs( iHeatCAPMAlphaNum ) );
ShowContinueError( "Blank field not allowed for " + cNumericFieldNames( iHeatCapacityPerFloorAreaNumericNum ) );
ErrorsFound = true;
}
} else if ( SameString( cAlphaArgs( iHeatCAPMAlphaNum ), "FractionOfAutosizedHeatingCapacity" ) ){
Baseboard( BaseboardNum ).HeatingCapMethod = FractionOfAutosizedHeatingCapacity;
if ( !lNumericFieldBlanks( iHeatFracOfAutosizedCapacityNumericNum ) ) {
Baseboard( BaseboardNum ).ScaledHeatingCapacity = rNumericArgs( iHeatFracOfAutosizedCapacityNumericNum );
if ( Baseboard( BaseboardNum ).ScaledHeatingCapacity < 0.0 ) {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Illegal " + cNumericFieldNames( iHeatFracOfAutosizedCapacityNumericNum ) + " = " + TrimSigDigits( rNumericArgs( iHeatFracOfAutosizedCapacityNumericNum ), 7 ) );
ErrorsFound = true;
}
} else {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Input for " + cAlphaFieldNames( iHeatCAPMAlphaNum ) + " = " + cAlphaArgs( iHeatCAPMAlphaNum ) );
ShowContinueError( "Blank field not allowed for " + cNumericFieldNames( iHeatFracOfAutosizedCapacityNumericNum ) );
ErrorsFound = true;
}
} else {
ShowSevereError( cCurrentModuleObject + " = " + Baseboard( BaseboardNum ).EquipName );
ShowContinueError( "Illegal " + cAlphaFieldNames( iHeatCAPMAlphaNum ) + " = " + cAlphaArgs( iHeatCAPMAlphaNum ) );
ErrorsFound = true;
}

for ( CtrlZone = 1; CtrlZone <= NumOfZones; ++CtrlZone ) {
for ( ZoneEquipTypeNum = 1; ZoneEquipTypeNum <= ZoneEquipList( CtrlZone ).NumOfEquipTypes; ++ZoneEquipTypeNum ) {
if ( ZoneEquipList( CtrlZone ).EquipType_Num( ZoneEquipTypeNum ) == BBElectricConvective_Num && ZoneEquipList( CtrlZone ).EquipName( ZoneEquipTypeNum ) == Baseboard( BaseboardNum ).EquipName ) {
Baseboard( BaseboardNum ).ZonePtr = CtrlZone;
}
}
}
}

if ( ErrorsFound ) {
Expand Down Expand Up @@ -386,6 +459,7 @@ namespace BaseboardElectric {
// AUTHOR Fred Buhl
// DATE WRITTEN February 2002
// MODIFIED August 2013 Daeho Kang, add component sizing table entries
// July 2014, B. Nigusse, added scalable sizing
// RE-ENGINEERED na

// PURPOSE OF THIS SUBROUTINE:
Expand All @@ -401,14 +475,17 @@ namespace BaseboardElectric {

// Using/Aliasing
using namespace DataSizing;
using ReportSizingManager::RequestSizing;
using ReportSizingManager::ReportSizingOutput;
using General::RoundSigDigits;
using DataHVACGlobals::HeatingCapacitySizing;
using DataHeatBalance::Zone;

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:

// SUBROUTINE PARAMETER DEFINITIONS:
// na
static std::string const RoutineName("SizeElectricBaseboard");

// INTERFACE BLOCK SPECIFICATIONS
// na
Expand All @@ -421,43 +498,60 @@ namespace BaseboardElectric {
Real64 NominalCapacityDes; // Design nominal capacity for reporting
Real64 NominalCapacityUser; // User hard-sized nominal capacity for reporting

std::string CompName; // component name
std::string CompType; // component type
std::string SizingString; // input field sizing description (e.g., Nominal Capacity)
Real64 TempSize; // autosized value of coil input field
int FieldNum = 1; // IDD numeric field number where input field description is found
int SizingMethod; // Integer representation of sizing method name (e.g., CoolingAirflowSizing, HeatingAirflowSizing, CoolingCapacitySizing, HeatingCapacitySizing, etc.)
bool PrintFlag; // TRUE when sizing information is reported in the eio file
int CapSizingMethod( 0 ); // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and FractionOfAutosizedHeatingCapacity )

IsAutoSize = false;
NominalCapacityDes = 0.0;
NominalCapacityUser = 0.0;
DataScalableCapSizingON = false;

if ( CurZoneEqNum > 0 ) {
if ( Baseboard( BaseboardNum ).NominalCapacity == AutoSize ) {
IsAutoSize = true;
}
if ( ! IsAutoSize && ! ZoneSizingRunDone ) { // Simulation continue
if ( Baseboard( BaseboardNum ).NominalCapacity > 0.0 ) {
ReportSizingOutput( cCMO_BBRadiator_Electric, Baseboard( BaseboardNum ).EquipName, "User-Specified Nominal Capacity [W]", Baseboard( BaseboardNum ).NominalCapacity );
}
} else { // AutoSize or hard-size with design run
CheckZoneSizing( Baseboard( BaseboardNum ).EquipType, Baseboard( BaseboardNum ).EquipName );
NominalCapacityDes = CalcFinalZoneSizing( CurZoneEqNum ).DesHeatLoad * CalcFinalZoneSizing( CurZoneEqNum ).HeatSizingFactor;

if ( IsAutoSize ) {
Baseboard( BaseboardNum ).NominalCapacity = NominalCapacityDes;
ReportSizingOutput( cCMO_BBRadiator_Electric, Baseboard( BaseboardNum ).EquipName, "Design Size Nominal Capacity [W]", NominalCapacityDes );
} else { // hard-sized with sizing data
if ( Baseboard( BaseboardNum ).NominalCapacity > 0.0 && NominalCapacityDes > 0.0 ) {
NominalCapacityUser = Baseboard( BaseboardNum ).NominalCapacity;
ReportSizingOutput( cCMO_BBRadiator_Electric, Baseboard( BaseboardNum ).EquipName, "Design Size Nominal Capacity [W]", NominalCapacityDes, "User-Specified Nominal Capacity [W]", NominalCapacityUser );
if ( DisplayExtraWarnings ) {
if ( ( std::abs( NominalCapacityDes - NominalCapacityUser ) / NominalCapacityUser ) > AutoVsHardSizingThreshold ) {
ShowMessage( "SizeBaseboard: Potential issue with equipment sizing for ZoneHVAC:Baseboard:Convective:Electric=\"" + Baseboard( BaseboardNum ).EquipName + "\"." );
ShowContinueError( "User-Specified Nominal Capacity of " + RoundSigDigits( NominalCapacityUser, 2 ) + " [W]" );
ShowContinueError( "differs from Design Size Nominal Capacity of " + RoundSigDigits( NominalCapacityDes, 2 ) + " [W]" );
ShowContinueError( "This may, or may not, indicate mismatched component sizes." );
ShowContinueError( "Verify that the value entered is intended and is consistent with other components." );
}
}
}

CompType = Baseboard( BaseboardNum ).EquipType;
CompName = Baseboard( BaseboardNum ).EquipName;
DataFracOfAutosizedHeatingCapacity = 1.0;
DataZoneNumber = Baseboard( BaseboardNum ).ZonePtr;
SizingMethod = HeatingCapacitySizing;
FieldNum = 1;
PrintFlag = true;
SizingString = BaseboardNumericFields(BaseboardNum).FieldNames(FieldNum) + " [W]";
CapSizingMethod = Baseboard( BaseboardNum ).HeatingCapMethod;
ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod;
if ( CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedHeatingCapacity ) {
if ( CapSizingMethod == HeatingDesignCapacity ){
if ( Baseboard( BaseboardNum ).ScaledHeatingCapacity == AutoSize ) {
CheckZoneSizing(CompType, CompName);
ZoneEqSizing( CurZoneEqNum ).HeatingCapacity = true;
ZoneEqSizing( CurZoneEqNum ).DesHeatingLoad = CalcFinalZoneSizing( CurZoneEqNum ).DesHeatLoad * CalcFinalZoneSizing( CurZoneEqNum ).HeatSizingFactor;
}
TempSize = Baseboard( BaseboardNum ).ScaledHeatingCapacity;
} else if ( CapSizingMethod == CapacityPerFloorArea ){
ZoneEqSizing( CurZoneEqNum ).HeatingCapacity = true;
ZoneEqSizing( CurZoneEqNum ).DesHeatingLoad = Baseboard( BaseboardNum ).ScaledHeatingCapacity * Zone( DataZoneNumber ).FloorArea;
TempSize = ZoneEqSizing( CurZoneEqNum ).DesHeatingLoad;
DataScalableCapSizingON = true;
} else if ( CapSizingMethod == FractionOfAutosizedHeatingCapacity ){
CheckZoneSizing( CompType, CompName );
ZoneEqSizing( CurZoneEqNum ).HeatingCapacity = true;
DataFracOfAutosizedHeatingCapacity = Baseboard( BaseboardNum ).ScaledHeatingCapacity;
ZoneEqSizing( CurZoneEqNum ).DesHeatingLoad = CalcFinalZoneSizing( CurZoneEqNum ).DesHeatLoad * CalcFinalZoneSizing(CurZoneEqNum).HeatSizingFactor;
TempSize = AutoSize;
DataScalableCapSizingON = true;
} else {
TempSize = Baseboard( BaseboardNum ).ScaledHeatingCapacity;
}
}
RequestSizing( CompType, CompName, SizingMethod, SizingString, TempSize, PrintFlag, RoutineName );
Baseboard( BaseboardNum ).NominalCapacity = TempSize;
DataScalableCapSizingON = false;
}
}

}

void
Expand Down
36 changes: 33 additions & 3 deletions src/EnergyPlus/BaseboardElectric.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace BaseboardElectric {
Real64 Energy;
Real64 ElecUseLoad;
Real64 ElecUseRate;
int ZonePtr; // point to teh zone where the basebaord is located
int HeatingCapMethod; // - Method for heating capacity scaledsizing calculation- (HeatingDesignCapacity, CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
Real64 ScaledHeatingCapacity; // - scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment, {-}, or {W/m2}

// Default Constructor
BaseboardParams() :
Expand All @@ -58,7 +61,10 @@ namespace BaseboardElectric {
Power( 0.0 ),
Energy( 0.0 ),
ElecUseLoad( 0.0 ),
ElecUseRate( 0.0 )
ElecUseRate( 0.0 ),
ZonePtr( 0 ),
HeatingCapMethod( 0.0 ),
ScaledHeatingCapacity( 0.0 )
{}

// Member Constructor
Expand All @@ -75,7 +81,10 @@ namespace BaseboardElectric {
Real64 const Power,
Real64 const Energy,
Real64 const ElecUseLoad,
Real64 const ElecUseRate
Real64 const ElecUseRate,
int const ZonePtr, // point to teh zone where the electric baseboard is located
int const HeatingCapMethod, // - Method for electric baseboard heating capacity scalable sizing calculation
Real64 const ScaledHeatingCapacity // - electric baseboard scaled maximum heating capacity {W} or scalable variable for sizing in {-}, or {W/m2}
) :
EquipName( EquipName ),
EquipType( EquipType ),
Expand All @@ -89,13 +98,34 @@ namespace BaseboardElectric {
Power( Power ),
Energy( Energy ),
ElecUseLoad( ElecUseLoad ),
ElecUseRate( ElecUseRate )
ElecUseRate( ElecUseRate ),
ZonePtr( ZonePtr ),
HeatingCapMethod( HeatingCapMethod ),
ScaledHeatingCapacity( ScaledHeatingCapacity )
{}

};

struct BaseboardNumericFieldData
{
// Members
FArray1D_string FieldNames;

// Default Constructor
BaseboardNumericFieldData()
{}

// Member Constructor
BaseboardNumericFieldData(
FArray1_string const & FieldNames // Name of the HeatingCoil numeric field descriptions
) :
FieldNames(FieldNames)
{}
};

// Object Data
extern FArray1D< BaseboardParams > Baseboard;
extern FArray1D< BaseboardNumericFieldData > BaseboardNumericFields;

// Functions

Expand Down
Loading

8 comments on commit 334dd71

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: Build 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.

develop (rraustad) - 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.

develop (rraustad) - x86_64-MacOS-10.9-clang: Tests Failed

Build Badge Test Badge

@rraustad
Copy link
Contributor Author

@rraustad rraustad commented on 334dd71 Sep 9, 2014 via email

Choose a reason for hiding this comment

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

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (rraustad) - x86_64-MacOS-10.9-clang-Debug: Tests Failed

Build Badge Test Badge

@Myoldmopar
Copy link
Member

Choose a reason for hiding this comment

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

I'll issue a quick branch and pull request to address the broken build in develop.

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (rraustad) - 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.

develop (rraustad) - Win64-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

Please sign in to comment.