Skip to content
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

Add Fan:SystemModel to OpenStudio #3856

Merged
merged 61 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
aefd7de
add E+ Idd for FanSystemModel, and align other fan type idd (comments…
jmarrec Jan 17, 2020
2c926b0
Port IDD object to OS. Make all fields with default required, will se…
jmarrec Jan 17, 2020
4b0109f
Move File Header (copyright) in its own class
jmarrec Oct 17, 2018
463117c
Fix problem in GenerateClass: all setters should return bool, whether…
jmarrec Oct 17, 2018
ded87b3
Handle `\type node`
jmarrec Oct 17, 2018
a4b4123
Ok here's the main dish: automatically generate ReverseTranslator for…
jmarrec Oct 17, 2018
76e8624
Add an optional parameters for returnType: useful for my ReverseTrans…
jmarrec Oct 17, 2018
cd1941f
Expose the reverseTranslate in GenerateClass.rb
jmarrec Oct 17, 2018
82cf13d
Start on automatic FT too
jmarrec Oct 26, 2018
fd56779
Update FileHeader
jmarrec Jan 17, 2020
5f54c45
Merge branch 'AutomateFTandRT' into 3044_FanSystemModel
jmarrec Jan 17, 2020
fa70209
Commit GenerateClass files
jmarrec Jan 17, 2020
52c5be4
Forgot a reqired-field
jmarrec Jan 17, 2020
359954d
Make the `Electric Power Per Unit Flow Rate Per Unit Pressure`require…
jmarrec Jan 17, 2020
46f6e8c
required 'Motor Loss Radiative Fraction': if blank = same as 0.0, so …
jmarrec Jan 17, 2020
2ee60f5
Add minimums in IDD where negative numbers don't make sense
jmarrec Jan 17, 2020
cd5a6fc
Restub the headers to have the API i'd like
jmarrec Jan 17, 2020
ae68c93
Add to Schedule type registry
jmarrec Jan 17, 2020
909a430
Implement cpp
jmarrec Jan 17, 2020
26d0161
Add to CMakeLists
jmarrec Jan 17, 2020
5685bd2
Registry Ctor
jmarrec Jan 17, 2020
0040a76
Add FanSystemModel where fans are explicitly used in the code and whe…
jmarrec Jan 17, 2020
0d86f0b
Override children to add curve
jmarrec Jan 17, 2020
cf1d7f8
Add gtests: all getter and setters, add to AirLoopHVAC, ZoneHVAC (Som…
jmarrec Jan 17, 2020
8ead9b5
Geez, UnivariateFunctions doesn't exist in OS idd... back to reebuild…
jmarrec Jan 17, 2020
8f8a215
Modified test a bit
jmarrec Jan 17, 2020
1261e9c
Misses this one: have to explicitly allow FanSystemModel in ZOneHVACH…
jmarrec Jan 17, 2020
a0a65a3
FanSystemModel: have to override containingHVACComponent & containing…
jmarrec Jan 17, 2020
8e8b2f3
FT FanSystemModel
jmarrec Jan 17, 2020
a5aae32
Stub a RT
jmarrec Jan 17, 2020
f304968
CAUGHT EXISTING ERROR IN FANONOFF: trnaslating inlet node instead of …
jmarrec Jan 17, 2020
5757245
Missed a few cases where we explicitly check for fan types
jmarrec Jan 17, 2020
79d582f
Wrong casing in Uni*V*ariateCurves, also add UniVariateTables whil…
jmarrec Jan 17, 2020
63c3b3b
Can't do assert_any_throw passing a wrong fan, because during remove …
jmarrec Jan 17, 2020
287f897
Typo in gtest
jmarrec Jan 20, 2020
ad0c6a8
FanSystemModel has to be a reference ConnectionObject or I can't conn…
jmarrec Jan 20, 2020
a2a88f8
Adjust addToNode test that had mistakes
jmarrec Jan 20, 2020
9dbbcb8
Merge remote-tracking branch 'upstream/develop' into 3044_FanSystemModel
jmarrec Jan 20, 2020
2018467
Revert "Merge branch 'AutomateFTandRT' into 3044_FanSystemModel"
jmarrec Jan 17, 2020
e5d6a4c
Try to capture all types in containing(Zone)HVACComponent
jmarrec Jan 20, 2020
4add888
Speed a wrapper class & API to deal with speeds
jmarrec Jan 20, 2020
51e0bd2
Implement the wrapper class
jmarrec Jan 20, 2020
b30ccc9
Add a test for the speed API
jmarrec Jan 20, 2020
0d00418
Use the speed API in FT
jmarrec Jan 20, 2020
1c54a69
Add FT tests
jmarrec Jan 21, 2020
6383a19
Fix last kinks in FT/FT test
jmarrec Jan 21, 2020
6e75522
Adjust RT
jmarrec Jan 21, 2020
a191a81
Register RT
jmarrec Jan 21, 2020
711739a
setElectricPowerPerUnitFlowRate: multiplied 1.6667 (from IDD per flow…
jmarrec Jan 21, 2020
9769de5
FanSystemModel: RT test
jmarrec Jan 21, 2020
be7eaf8
Minor fixes to RT test
jmarrec Jan 21, 2020
89aa9a4
Add RT test for logic to handle bad input data for speeds in particular.
jmarrec Jan 21, 2020
b894b00
Add AirflowNetworkFan support
jmarrec Jan 21, 2020
b5f7a48
Ignore getAirflowNetworkFan in swig like the rest (should probably be…
jmarrec Jan 21, 2020
a6d1021
Handle FanSystemModel in ForwardTranslators of containing HVAC/ZoneHV…
jmarrec Jan 21, 2020
ed60c9e
Forgot the public forwarding methods airflowNetworkFan
jmarrec Jan 21, 2020
b59047c
Leave TODOs
jmarrec Jan 21, 2020
f2cda38
SWIG the helper class FanSystemModelSpeed
jmarrec Jan 21, 2020
e68957c
Merge branch '3851-bundle-test-failure' into 3044_FanSystemModel
jmarrec Jan 21, 2020
5156b8f
Remove "Number of SPeeds" from OS:Fan:SystemModel IDD: inferred from …
jmarrec Jan 21, 2020
903d4e7
Merge remote-tracking branch 'upstream/develop' into 3044_FanSystemModel
jmarrec Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -20093,7 +20093,155 @@ OS:EvaporativeFluidCooler:TwoSpeed,
\type object-list
\object-list WaterStorageTankNames

OS:Fan:SystemModel,
\memo Versatile simple fan that can be used in variable air volume, constant volume, on-off cycling, two-speed or multi-speed applications.
\memo Performance at different flow rates, or speed levels, is determined using separate performance curve or table
\memo or prescribed power fractions at discrete speed levels for two-speed or multi-speed fans.
\min-fields 15
\extensible:2
A1, \field Handle
\type handle
\required-field
A2 , \field Name
\required-field
\reference Fans
\reference FansCV
\reference FansCVandOnOff
\reference FansVAV
\reference FansCVandVAV
\reference FansCVandOnOffandVAV
\reference ConnectionObject
A3 , \field Availability Schedule Name
\note Availability schedule name for this fan. Schedule value > 0 means the fan is available.
\note If this field is blank, the fan is always available.
\type object-list
\required-field
\object-list ScheduleNames
A4 , \field Air Inlet Node Name
\type object-list
\object-list ConnectionNames
A5 , \field Air Outlet Node Name
\type object-list
\object-list ConnectionNames
N1 , \field Design Maximum Air Flow Rate
\required-field
\type real
\units m3/s
\minimum> 0.0
\autosizable
A6 , \field Speed Control Method
\type choice
\key Continuous
\key Discrete
\required-field
N2 , \field Electric Power Minimum Flow Rate Fraction
\type real
\required-field
\minimum 0.0
\maximum 1.0
N3 , \field Design Pressure Rise
\type real
\minimum> 0.0
\units Pa
\ip-units inH2O
\required-field
N4 , \field Motor Efficiency
\type real
\required-field
\minimum> 0.0
\maximum 1.0
N5 , \field Motor In Air Stream Fraction
\note 0.0 means fan motor outside of air stream, 1.0 means motor inside of air stream
\type real
\required-field
\minimum 0.0
\maximum 1.0
N6 , \field Design Electric Power Consumption
\type real
\units W
\autosizable
\required-field
\minimum> 0.0
\note Fan power consumption at maximum air flow rate.
\note If autosized the method used to scale power is chosen in the following field
A7 , \field Design Power Sizing Method
\type choice
\key PowerPerFlow
\key PowerPerFlowPerPressure
\key TotalEfficiencyAndPressure
\required-field
N7 , \field Electric Power Per Unit Flow Rate
\type real
\units W/(m3/s)
\ip-units W/(ft3/min)
\required-field
\minimum> 0.0
N8 , \field Electric Power Per Unit Flow Rate Per Unit Pressure
\type real
\units W/((m3/s)-Pa)
\ip-units W/((ft3/min)-inH2O)
\required-field
\minimum> 0.0
N9, \field Fan Total Efficiency
\type real
\required-field
\minimum> 0.0
\maximum 1.0
A8 , \field Electric Power Function of Flow Fraction Curve Name
\note independent variable is normalized flow rate, current flow divided by Design Maximum Air Flow Rate.
\note dependent variable is modification factor multiplied by Design Power Consumption.
\note This field is required if Speed Control Method is set to Continuous or if the Number of Speeds is greater than 1 and Speed Electric Power Fraction fields are not used.
\type object-list
\object-list UniVariateCurves
\object-list UniVariateTables
N10, \field Night Ventilation Mode Pressure Rise
\note Total system fan pressure rise at the fan when in night mode using AvailabilityManager:NightVentilation
\type real
\units Pa
\ip-units inH2O
\minimum> 0.0
N11, \field Night Ventilation Mode Flow Fraction
\note Fraction of Design Maximum Air Flow Rate to use when in night mode using AvailabilityManager:NightVentilation
\type real
\minimum 0.0
\maximum 1.0
A9 , \field Motor Loss Zone Name
\note optional, if used fan motor heat losses that not added to air stream are transferred to zone as internal gains
\type object-list
\object-list ThermalZoneNames
N12, \field Motor Loss Radiative Fraction
\note optional. If zone identified in previous field then this determines
\note the split between convection and radiation for the fan motor's skin losses
\type real
\minimum 0.0
\maximum 1.0
\required-field
A10, \field End-Use Subcategory
\note Any text may be used here to categorize the end-uses in the ABUPS End Uses by Subcategory table.
\type alpha
\retaincase
\default General
N13, \field Speed 1 Flow Fraction
\note number of different speed levels is inferred from the number of extensible groups you provide
\note This is meant to be used when Speed Control Method is set to Discrete
\note Speed need to be arranged in increasing order in remaining field sets.
\note If no extensible groups (speeds) are specified, and Speed Control Method is Discrete,
\note then constant fan speed is the design maximum.
\begin-extensible
\type real
\minimum 0.0
\maximum 1.0
\required-field
N14; \field Speed 1 Electric Power Fraction
\note if left blank then use Electric Power Function of Flow Fraction Curve
\type real
\minimum 0.0
\maximum 1.0

OS:Fan:ConstantVolume,
\memo Constant volume fan that is intended to operate continuously based on a time schedule.
\memo This fan will not cycle on and off based on cooling/heating load or other control
\memo signals.
\min-fields 10
A1, \field Handle
\type handle
Expand All @@ -20108,6 +20256,8 @@ OS:Fan:ConstantVolume,
\reference FansCVandOnOffandVAV
\reference ConnectionObject
A3, \field Availability Schedule Name
\note Availability schedule name for this system. Schedule value > 0 means the system is available.
\note If this field is blank, the system is always available.
\type object-list
\required-field
\object-list ScheduleNames
Expand Down Expand Up @@ -20146,11 +20296,14 @@ OS:Fan:ConstantVolume,
\required-field
\object-list ConnectionNames
A6; \field End-Use Subcategory
\note Any text may be used here to categorize the end-uses in the ABUPS End Uses by Subcategory table.
\type alpha
\retaincase
\default General

OS:Fan:VariableVolume,
\memo Variable air volume fan where the electric power input varies according to a
\memo performance curve as a function of flow fraction.
\min-fields 18
A1, \field Handle
\type handle
Expand All @@ -20165,6 +20318,8 @@ OS:Fan:VariableVolume,
\reference FansCVandOnOffandVAV
\reference ConnectionObject
A3, \field Availability Schedule Name
\note Availability schedule name for this system. Schedule value > 0 means the system is available.
\note If this field is blank, the system is always available.
\type object-list
\required-field
\object-list ScheduleNames
Expand Down Expand Up @@ -20230,11 +20385,15 @@ OS:Fan:VariableVolume,
\required-field
\object-list ConnectionNames
A6; \field End-Use Subcategory
\note Any text may be used here to categorize the end-uses in the ABUPS End Uses by Subcategory table.
\type alpha
\retaincase
\default General

OS:Fan:OnOff,
\memo Constant volume fan that is intended to cycle on and off based on cooling/heating load
\memo or other control signals. This fan can also operate continuously like
\memo Fan:ConstantVolume.
\min-fields 13
A1, \field Handle
\type handle
Expand All @@ -20250,6 +20409,8 @@ OS:Fan:OnOff,
\reference FansCVandOnOffandVAV
\reference ConnectionObject
A3, \field Availability Schedule Name
\note Availability schedule name for this system. Schedule value > 0 means the system is available.
\note If this field is blank, the system is always available.
\type object-list
\required-field
\object-list ScheduleNames
Expand Down Expand Up @@ -20295,6 +20456,7 @@ OS:Fan:OnOff,
\type object-list
\object-list QuadraticCubicCurves
A8; \field End-Use Subcategory
\note Any text may be used here to categorize the end-uses in the ABUPS End Uses by Subcategory table.
\type alpha
\retaincase
\default General
Expand Down
5 changes: 4 additions & 1 deletion src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateExternalInterfaceVariable.cpp
ForwardTranslator/ForwardTranslateFanConstantVolume.cpp
ForwardTranslator/ForwardTranslateFanOnOff.cpp
ForwardTranslator/ForwardTranslateFanSystemModel.cpp
ForwardTranslator/ForwardTranslateFanVariableVolume.cpp
ForwardTranslator/ForwardTranslateFanZoneExhaust.cpp
ForwardTranslator/ForwardTranslateFFactorGroundFloorConstruction.cpp
Expand Down Expand Up @@ -455,6 +456,7 @@ set(${target_name}_src
ReverseTranslator/ReverseTranslateExteriorFuelEquipment.cpp
ReverseTranslator/ReverseTranslateExteriorWaterEquipment.cpp
ReverseTranslator/ReverseTranslateFanConstantVolume.cpp
ReverseTranslator/ReverseTranslateFanSystemModel.cpp
ReverseTranslator/ReverseTranslateFenestrationSurfaceDetailed.cpp
ReverseTranslator/ReverseTranslateFoundationKiva.cpp
ReverseTranslator/ReverseTranslateFoundationKivaSettings.cpp
Expand Down Expand Up @@ -587,6 +589,7 @@ set(${target_name}_test_src
Test/ExternalInterfaceFT_GTest.cpp
Test/FanConstantVolume_GTest.cpp
Test/FanVariableVolume_GTest.cpp
Test/FanSystemModel_GTest.cpp
Test/FuelCell_GTest.cpp
Test/GasEquipment_GTest.cpp
Test/GeneratorMicroTurbine_GTest.cpp
Expand Down Expand Up @@ -690,7 +693,7 @@ CREATE_SRC_GROUPS("${${target_name}_src}")
if(BUILD_TESTING)

CREATE_TEST_TARGETS(${target_name} "${${target_name}_test_src}" "${${target_name}_depends}")

add_dependencies(${target_name}_tests
ResultsViewer_resources
openstudio_energyplus_resources
Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,12 @@ boost::optional<IdfObject> ForwardTranslator::translateAndMapModelObject(ModelOb
retVal = translateFanOnOff(fan);
break;
}
case openstudio::IddObjectType::OS_Fan_SystemModel :
{
model::FanSystemModel fan = modelObject.cast<FanSystemModel>();
retVal = translateFanSystemModel(fan);
break;
}
case openstudio::IddObjectType::OS_Fan_VariableVolume :
{
model::FanVariableVolume fan = modelObject.cast<FanVariableVolume>();
Expand Down
3 changes: 3 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class ExternalInterfaceSchedule;
class ExternalInterfaceVariable;
class FanConstantVolume;
class FanOnOff;
class FanSystemModel;
class FanVariableVolume;
class FanZoneExhaust;
class FFactorGroundFloorConstruction;
Expand Down Expand Up @@ -893,6 +894,8 @@ class ENERGYPLUS_API ForwardTranslator {

boost::optional<IdfObject> translateFanOnOff( model::FanOnOff & modelObject );

boost::optional<IdfObject> translateFanSystemModel( model::FanSystemModel & modelObject );

boost::optional<IdfObject> translateFanVariableVolume( model::FanVariableVolume & modelObject );

boost::optional<IdfObject> translateFanZoneExhaust( model::FanZoneExhaust & modelObject );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx>
#include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
#include <utilities/idd/Fan_VariableVolume_FieldEnums.hxx>
#include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
#include <utilities/idd/OutdoorAir_Mixer_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
#include <utilities/idd/IddEnums.hxx>
Expand Down Expand Up @@ -298,6 +299,11 @@ boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitaryHeatCoo
_fan->setString(Fan_OnOffFields::AirInletNodeName,fanInletNodeName);
_fan->setString(Fan_OnOffFields::AirOutletNodeName,fanOutletNodeName);
}
else if( _fan->iddObject().type() == IddObjectType::Fan_SystemModel )
{
_fan->setString(Fan_SystemModelFields::AirInletNodeName,fanInletNodeName);
_fan->setString(Fan_SystemModelFields::AirOutletNodeName,fanOutletNodeName);
}

fixSPMsForUnitarySystem(modelObject,fanInletNodeName,fanOutletNodeName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <utilities/idd/AirLoopHVAC_UnitaryHeatPump_AirToAir_FieldEnums.hxx>
#include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx>
#include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
#include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
#include <utilities/idd/Coil_Heating_DX_SingleSpeed_FieldEnums.hxx>
#include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx>
#include <utilities/idd/Coil_Heating_Electric_FieldEnums.hxx>
Expand Down Expand Up @@ -284,6 +285,10 @@ boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitaryHeatPum
{
_fan->setString(Fan_OnOffFields::AirInletNodeName,airInletNodeName.get());
}
else if( _fan->iddObject().type() == IddObjectType::Fan_SystemModel )
{
_fan->setString(Fan_SystemModelFields::AirInletNodeName,airInletNodeName.get());
}
}

//if( airOutletNodeName && _heatingCoil )
Expand All @@ -306,6 +311,10 @@ boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitaryHeatPum
{
_fan->setString(Fan_OnOffFields::AirOutletNodeName,nodeName);
}
else if( _fan->iddObject().type() == IddObjectType::Fan_SystemModel )
{
_fan->setString(Fan_SystemModelFields::AirOutletNodeName,nodeName);
}

_coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirInletNodeName,nodeName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <utilities/idd/AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed_FieldEnums.hxx>
#include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx>
#include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
#include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
#include <utilities/idd/Coil_Heating_DX_SingleSpeed_FieldEnums.hxx>
#include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx>
#include <utilities/idd/Coil_Heating_Gas_MultiStage_FieldEnums.hxx>
Expand Down Expand Up @@ -338,6 +339,9 @@ boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitaryHeatPum
} else if( _fan->iddObject().type() == IddObjectType::Fan_OnOff ) {
_fan->setString(Fan_OnOffFields::AirInletNodeName,fanInletNodeName);
_fan->setString(Fan_OnOffFields::AirOutletNodeName,fanOutletNodeName);
} else if( _fan->iddObject().type() == IddObjectType::Fan_SystemModel ) {
_fan->setString(Fan_SystemModelFields::AirInletNodeName,fanInletNodeName);
_fan->setString(Fan_SystemModelFields::AirOutletNodeName,fanOutletNodeName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx>
#include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
#include <utilities/idd/Fan_VariableVolume_FieldEnums.hxx>
#include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
#include <utilities/idd/SetpointManager_MixedAir_FieldEnums.hxx>
#include <utilities/idd/UnitarySystemPerformance_Multispeed_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
Expand Down Expand Up @@ -679,6 +680,11 @@ boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitarySystem(
_fan->setString(Fan_OnOffFields::AirInletNodeName,inletNodeName);
_fan->setString(Fan_OnOffFields::AirOutletNodeName,outletNodeName);
}
else if( _fan->iddObject().type() == IddObjectType::Fan_SystemModel )
{
_fan->setString(Fan_SystemModelFields::AirInletNodeName,inletNodeName);
_fan->setString(Fan_SystemModelFields::AirOutletNodeName,outletNodeName);
}

fixSPMsForUnitarySystem(modelObject,inletNodeName,outletNodeName);
}
Expand Down
Loading