Skip to content

Commit

Permalink
Merge branch 'develop' into SpaceSizingHVACPart4
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Aug 19, 2024
2 parents 498a892 + ad64c7a commit 254ccce
Show file tree
Hide file tree
Showing 11 changed files with 1,314 additions and 601 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4060,7 +4060,7 @@ \subsubsection{Inputs}\label{inputs-14-018}

\paragraph{Field: Supply Air Fan Object Type}\label{field-supply-air-fan-object-type-8}

This choice field contains the identifying type of supply air fan specified for the furnace. Fan type must be \textit{\hyperref[fanonoff]{Fan:OnOff}}, \textit{\hyperref[fanconstantvolume]{Fan:ConstantVolume}}, \textit{\hyperref[fansystemmodel]{Fan:SystemModel}} or \textit{\hyperref[fanvariablevolume]{Fan:VariableVolume}}. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel}, \hyperref[fanonoff]{Fan:OnOff}, or \hyperref[fanconstantvolume]{Fan:ConstantVolume} if \hyperref[airconditionervariablerefrigerantflow]{AirConditioner:VariableRefrigerantFlow} is used to model the VRF outdoor unit. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel} or \hyperref[fanvariablevolume]{Fan:VariableVolume} if AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl or AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl:HR is used to model the VRF outdoor unit.
This choice field contains the identifying type of supply air fan specified for the furnace. Fan type must be \textit{\hyperref[fanonoff]{Fan:OnOff}}, \textit{\hyperref[fanconstantvolume]{Fan:ConstantVolume}}, \textit{\hyperref[fansystemmodel]{Fan:SystemModel}}. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel}, \hyperref[fanonoff]{Fan:OnOff}, or \hyperref[fanconstantvolume]{Fan:ConstantVolume} if \hyperref[airconditionervariablerefrigerantflow]{AirConditioner:VariableRefrigerantFlow} is used to model the VRF outdoor unit. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel} if AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl or AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl:HR is used to model the VRF outdoor unit.

\hyperref[fanconstantvolume]{Fan:ConstantVolume} is used when the Supply Air Fan Operating Mode Schedule values are never 0 and the fan operates continuously. \hyperref[fanonoff]{Fan:OnOff} is used when the fan cycles on and off with the cooling or heating coil (i.e.~Supply Air Fan Operating Mode Schedule values are at times 0). The \hyperref[fansystemmodel]{Fan:SystemModel} may be used to model either of these fan operating characteristics.

Expand Down
3 changes: 1 addition & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -42498,11 +42498,10 @@ ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,
\key Fan:SystemModel
\key Fan:OnOff
\key Fan:ConstantVolume
\key Fan:VariableVolume
\default Fan:ConstantVolume
\note Supply Air Fan Object Type must be Fan:SystemModel, Fan:OnOff, or Fan:ConstantVolume
\note if AirConditioner:VariableRefrigerantFlow is used to model VRF outdoor unit
\note Supply Air Fan Object Type must be Fan:SystemModel or Fan:VariableVolume if
\note Supply Air Fan Object Type must be Fan:SystemModel if
\note AirConditioner:VariableRefrigerantFlow:FluidTemperatureControl or
\note AirConditioner:VariableRefrigerantFlow:FluidTemperatureControl:HR
\note is used to model VRF outdoor unit
Expand Down
8 changes: 6 additions & 2 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5494,7 +5494,7 @@ void CheckVRFTUNodeConnections(EnergyPlusData &state, int const VRFTUNum, bool &
if (fanOutletNode != VRFTUOutletNodeNum) {
ShowSevereError(state, fmt::format("{}=\"{}\",", cTerminalUnitType, cTUName));
ShowContinueError(state,
"... For blow through fan and no supplemental heating coil the fan outlet node name must "
"... For draw through fan and no supplemental heating coil the fan outlet node name must "
"match the terminal unit outlet node name.");
if (fanOutletNode > 0 && VRFTUOutletNodeNum > 0) {
ShowContinueError(state, format("... Fan outlet node name = {}.", nodeID(fanOutletNode)));
Expand Down Expand Up @@ -12841,12 +12841,16 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state,
state.dataHVACVarRefFlow->LoopDXHeatCoilRTF = 0.0;
}

Real64 OnOffFanPartLoadFraction = 1.0;
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanOp == HVAC::FanOp::Cycling) {
OnOffFanPartLoadFraction = state.dataHVACGlobal->OnOffFanPartLoadFraction;
}
// if draw through, simulate coils then fan
if (this->fanPlace == HVAC::FanPlace::DrawThru) {
auto *fan = state.dataFans->fans(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex);
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::SystemModel) {
if (OnOffAirFlowRatio > 0.0) {
fan->simulate(state, FirstHVACIteration, _, _);
fan->simulate(state, FirstHVACIteration, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _);
} else {
fan->simulate(state, FirstHVACIteration, _, _, PartLoadRatio);
}
Expand Down
183 changes: 183 additions & 0 deletions src/Transition/CreateNewIDFUsingRulesV24_2_0.f90
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,42 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
! I N S E R T L O C A L V A R I A B L E S H E R E !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! used in transition code for changing fan in ZoneHVAC:TerminalUnit:VariableRefrigerantFlow from VariableVolume to SystemModel
LOGICAL :: isVariableVolume
REAL :: fanTotalEff
REAL :: pressureRise
REAL :: maxAirFlow
REAL :: minAirFlowFrac
REAL :: fanPowerMinAirFlow
INTEGER :: NumFanVariableVolume
INTEGER :: NumOldFanVO = 1
INTEGER :: NumVRFTU = 1
INTEGER :: Num3 = 1
INTEGER :: VRFTU_i = 1
CHARACTER(len=MaxNameLength) :: sysFanName
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: vavFanNameToDelete

TYPE FanVOTransitionInfo
CHARACTER(len=MaxNameLength) :: oldFanName
CHARACTER(len=MaxNameLength) :: availSchedule
CHARACTER(len=MaxNameLength) :: fanTotalEff_str
CHARACTER(len=MaxNameLength) :: pressureRise_str
CHARACTER(len=MaxNameLength) :: maxAirFlow_str
CHARACTER(len=MaxNameLength) :: minFlowInputMethod
CHARACTER(len=MaxNameLength) :: minAirFlowFrac_str
CHARACTER(len=MaxNameLength) :: fanPowerMinAirFlow_str
CHARACTER(len=MaxNameLength) :: motorEfficiency
CHARACTER(len=MaxNameLength) :: motorInAirStreamFrac
CHARACTER(len=MaxNameLength) :: coeff1 !- Coefficient1 Constant
CHARACTER(len=MaxNameLength) :: coeff2 !- Coefficient2 x
CHARACTER(len=MaxNameLength) :: coeff3 !- Coefficient3 x**2
CHARACTER(len=MaxNameLength) :: coeff4 !- Coefficient4 x**3
CHARACTER(len=MaxNameLength) :: coeff5 !- Coefficient5 x**4
CHARACTER(len=MaxNameLength) :: inletAirNodeName
CHARACTER(len=MaxNameLength) :: outletAirNodeName
CHARACTER(len=MaxNameLength) :: endUseSubCat
END TYPE FanVOTransitionInfo
TYPE(FanVOTransitionInfo), ALLOCATABLE, DIMENSION(:) :: OldFanVO

INTEGER :: TotSPMs = 0
INTEGER :: spmNum = 0
Expand Down Expand Up @@ -317,6 +353,55 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
ENDDO
ENDDO

! collect old VAV fans to be deleted
NumVRFTU = GetNumObjectsFound('ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW')
IF(ALLOCATED(vavFanNameToDelete)) DEALLOCATE(vavFanNameToDelete)
ALLOCATE(vavFanNameToDelete(NumVRFTU))
DO Num = 1, NumIDFRecords
SELECT CASE (MakeUPPERCase(IDFRecords(Num)%Name))
CASE('ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW')
IF (SameString(TRIM(IDFRecords(Num)%Alphas(7)), 'FAN:VARIABLEVOLUME')) THEN
vavFanNameToDelete(VRFTU_i) =TRIM(IDFRecords(Num)%Alphas(8))
ELSE
vavFanNameToDelete(VRFTU_i) = ''
ENDIF
VRFTU_i = VRFTU_i + 1
END SELECT
END DO

! accumulate info on VAV fans
NumFanVariableVolume = GetNumObjectsFound('FAN:VARIABLEVOLUME')
IF (ALLOCATED(OldFanVO)) DEALLOCATE(OldFanVO)
ALLOCATE(OldFanVO(NumFanVariableVolume))
NumOldFanVO = 1
DO Num = 1, NumIDFRecords
SELECT CASE (MakeUPPERCase(IDFRecords(Num)%Name))
CASE ('FAN:VARIABLEVOLUME')
OldFanVO(NumOldFanVO)%oldFanName = TRIM(IDFRecords(Num)%Alphas(1))
OldFanVO(NumOldFanVO)%availSchedule = TRIM(IDFRecords(Num)%Alphas(2))
OldFanVO(NumOldFanVO)%fanTotalEff_str = TRIM(IDFRecords(Num)%Numbers(1))
OldFanVO(NumOldFanVO)%pressureRise_str = TRIM(IDFRecords(Num)%Numbers(2))
OldFanVO(NumOldFanVO)%maxAirFlow_str = TRIM(IDFRecords(Num)%Numbers(3))
OldFanVO(NumOldFanVO)%minFlowInputMethod = TRIM(IDFRecords(Num)%Alphas(3))
OldFanVO(NumOldFanVO)%minAirFlowFrac_str = TRIM(IDFRecords(Num)%Numbers(4))
OldFanVO(NumOldFanVO)%fanPowerMinAirFlow_str = TRIM(IDFRecords(Num)%Numbers(5))
OldFanVO(NumOldFanVO)%motorEfficiency = TRIM(IDFRecords(Num)%Numbers(6))
OldFanVO(NumOldFanVO)%motorInAirStreamFrac = TRIM(IDFRecords(Num)%Numbers(7))
OldFanVO(NumOldFanVO)%coeff1 = TRIM(IDFRecords(Num)%Numbers(8)) !- Coefficient1 Constant
OldFanVO(NumOldFanVO)%coeff2 = TRIM(IDFRecords(Num)%Numbers(9)) !- Coefficient2 x
OldFanVO(NumOldFanVO)%coeff3 = TRIM(IDFRecords(Num)%Numbers(10)) !- Coefficient3 x**2
OldFanVO(NumOldFanVO)%coeff4 = TRIM(IDFRecords(Num)%Numbers(11)) !- Coefficient4 x**3
OldFanVO(NumOldFanVO)%coeff5 = TRIM(IDFRecords(Num)%Numbers(12)) !- Coefficient5 x**4
OldFanVO(NumOldFanVO)%inletAirNodeName = TRIM(IDFRecords(Num)%Alphas(4))
OldFanVO(NumOldFanVO)%outletAirNodeName = TRIM(IDFRecords(Num)%Alphas(5))
OldFanVO(NumOldFanVO)%endUseSubCat = TRIM(IDFRecords(Num)%Alphas(6))
IF (FindItemInList(TRIM(IDFRecords(Num)%Alphas(1)), vavFanNameToDelete, NumVRFTU) /= 0) THEN
DeleteThisRecord(Num) = .TRUE.
ENDIF
NumOldFanVO = NumOldFanVO + 1
END SELECT
END DO

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! P R O C E S S I N G !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down Expand Up @@ -492,6 +577,104 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile

! If your original object starts with Z, insert the rules here

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CASE('ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW')
isVariableVolume = .FALSE.
CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits)
nodiff = .false.
OutArgs(1:13) = InArgs(1:13)
IF (SameString(InArgs(14), 'FAN:VARIABLEVOLUME')) THEN
isVariableVolume = .TRUE.
OutArgs(14) = 'Fan:SystemModel'
OutArgs(15) = TRIM(InArgs(15))
sysFanName = TRIM(InArgs(15))
ELSE
OutArgs(14:15) = InArgs(14:15)
ENDIF
OutArgs(16:CurArgs) = InArgs(16:CurArgs)
CALL WriteOutIDFLines(DifLfn, 'ZoneHVAC:TerminalUnit:VariableRefrigerantFlow', CurArgs, OutArgs, NwFldNames, NwFldUnits)

IF (isVariableVolume) THEN
! create fan system model object
ObjectName = 'Fan:SystemModel'
DO Num3 = 1, NumFanVariableVolume
IF (SameString(OldFanVO(Num3)%oldFanName, sysFanName)) THEN
CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits)
OutArgs(1) = TRIM(sysFanName)
OutArgs(2) = OldFanVO(Num3)%availSchedule
OutArgs(3) = OldFanVO(Num3)%inletAirNodeName
OutArgs(4) = OldFanVO(Num3)%outletAirNodeName
OutArgs(5) = OldFanVO(Num3)%maxAirFlow_str
OutArgs(6) = 'Continuous' !- Speed Control Method
IF (SameString(OldFanVO(Num3)%minFlowInputMethod, "FixedFlowRate")) THEN
IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN
fanPowerMinAirFlow = ProcessNumber(OldFanVO(Num3)%fanPowerMinAirFlow_str, ErrFlag)
IF (ErrFlag) THEN
CALL ShowSevereError('Invalid Number, FAN:VARIABLEVOLUME field 8, Fan Power Minimum Air Flow Rate, Name=' // TRIM(OutArgs(1)), Auditf)
END IF
maxAirFlow = ProcessNumber(OldFanVO(Num3)%maxAirFlow_str, ErrFlag)
IF (ErrFlag) THEN
CALL ShowSevereError('Invalid Number, FAN:VARIABLEVOLUME field 5, Maximum Flow Rate, Name=' // TRIM(OutArgs(1)), Auditf)
END IF
WRITE(OutArgs(7), '(F15.5)') (fanPowerMinAirFlow / maxAirFlow)
ELSE ! maxAirFlow_stris autosize
fanPowerMinAirFlow = ProcessNumber(OldFanVO(Num3)%fanPowerMinAirFlow_str, ErrFlag)
IF (ErrFlag) THEN
CALL ShowSevereError('Invalid Number, FAN:VARIABLEVOLUME field 8, Fan Power Minimum Air Flow Rate, Name=' // TRIM(OutArgs(1)), Auditf)
END IF
IF (.NOT. fanPowerMinAirFlow == 0) THEN ! don't know how to do division with autosize
CALL writePreprocessorObject(DifLfn, PrognameConversion, 'Warning', &
'Cannot calculate Electric Power Minimum Flow Rate Fraction for Fan:SystemModel=' // sysFanName // &
' when old Fan:VariableVolume Maximum Flow Rate is autosize and Fan Power Minimum Air Flow Rate is non-zero. ' // &
'Electric Power Minimum Flow Rate Fraction is set to zero. ' // &
'Manually size the Maximum Flow Rate if Electric Power Minimum Flow Rate Fraction should not be zero.')
CALL ShowWarningError('Cannot calculate Electric Power Minimum Flow Rate Fraction for Fan:SystemModel=' // sysFanName // &
' when old Fan:VariableVolume Maximum Flow Rate is autosize and Fan Power Minimum Air Flow Rate is non-zero. ' // &
'Electric Power Minimum Flow Rate Fraction is set to zero. ' // &
'Manually size the Maximum Flow Rate if Electric Power Minimum Flow Rate Fraction should not be zero.', Auditf)
END IF
OutArgs(7) = '0.0'
ENDIF
ELSE ! input method is "Fraction"
OutArgs(7) = OldFanVO(Num3)%minAirFlowFrac_str
ENDIF
OutArgs(8) = OldFanVO(Num3)%pressureRise_str !- Design Pressure Rise {Pa}
OutArgs(9) = OldFanVO(Num3)%motorEfficiency !- Motor Efficiency
OutArgs(10) = OldFanVO(Num3)%motorInAirStreamFrac !- Motor In Air Stream Fraction
OutArgs(11) = 'autosize'
OutArgs(12) = 'TotalEfficiencyAndPressure' ! chose this becuase power per flow or per pressure are unknown
OutArgs(13) = '' !- Electric Power Per Unit Flow Rate {W/(m3/s)}
OutArgs(14) = '' !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}
OutArgs(15) = OldFanVO(Num3)%fanTotalEff_str !- Fan Total Efficiency
OutArgs(16) = TRIM(sysFanName) // '_curve' !- Electric Power Function of Flow Fraction Curve Name
OutArgs(17) = ''
OutArgs(18) = ''
OutArgs(19) = ''
OutArgs(20) = ''
OutArgs(21) = OldFanVO(Num3)%endUseSubCat !- End-Use Subcategory
CurArgs = 21 !- Design Electric Power Consumption {W}
CALL WriteOutIDFLines(DifLfn, ObjectName, CurArgs, OutArgs, NwFldNames, NwFldUnits)

! create curve object
ObjectName = 'Curve:Quartic'
CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits)
OutArgs(1) = TRIM(sysFanName) // '_curve'
OutArgs(2) = OldFanVO(Num3)%coeff1 !- Coefficient1 Constant
OutArgs(3) = OldFanVO(Num3)%coeff2 !- Coefficient2 x
OutArgs(4) = OldFanVO(Num3)%coeff3 !- Coefficient3 x**2
OutArgs(5) = OldFanVO(Num3)%coeff4 !- Coefficient4 x**3
OutArgs(6) = OldFanVO(Num3)%coeff5 !- Coefficient5 x**4
OutArgs(7) = '0.0' !- Minimum Value of x
OutArgs(8) = '1.0' !- Maximum Value of x
OutArgs(9) = '0.0' !- Minimum Curve Output
OutArgs(10) = '5.0' !- Maximum Curve Output
OutArgs(11) = 'Dimensionless' !- Input Unit Type for X
OutArgs(12) = 'Dimensionless' !- Output Unit Type
CurArgs = 12
ENDIF
ENDDO
ENDIF

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Changes for report variables, meters, tables -- update names !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
9 changes: 9 additions & 0 deletions src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,12 @@ thru
`zone_20_name` --> `zone_or_space_name_20`
`relative_ratios_of_air_flow_rates_passing_through_zone_20` --> `relative_ratios_of_air_flow_rates_passing_through_inlet_20`

## "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow"

If field "Supply Air Fan Object Type" (A7, the 14th field) in
"ZoneHVAC:TerminalUnit:VariableRefrigerantFlow" is "Fan:VariableVolume", it
needs to be changed to "Fan:SystemModel". A "Fan:SystemModel" object need to be
created based on the former "Fan:VariableVolume" object. A fan power curve will
be created as well that holds the "Fan Power Coefficient i" in Fan:VariableVolume.

See PR https://github.com/NREL/EnergyPlus/pull/10341
Loading

0 comments on commit 254ccce

Please sign in to comment.