-
Notifications
You must be signed in to change notification settings - Fork 389
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
Fix VRF_FluidTCtrl cooling supply fan power calculation when cycling #10341
Changes from 52 commits
89671cc
5a00a65
9a0cc0b
a033890
8901906
7c1a008
aef23cb
5fcc817
026be04
b9c6bff
7d79eac
aee8c4a
ce65545
9734922
e00e86a
740bd92
902baea
c4c3067
49b10f0
154343d
21afabe
cf886aa
aef9b67
d2183c3
26414a6
9de83a1
5bb21f0
50e57b7
d21a85c
1a07c51
f7942a0
733ec7e
6319656
8ec965f
79a0810
289d5cc
6e79143
f0a18f4
b5fa9ea
4c834c7
49e82a0
6e5166a
cf3b3c5
7dd6720
19c4aae
ba1f3cf
a19c990
dc5c342
d1c3cd7
3c6c581
698ddbf
4417664
261699a
de9baf3
e03dea0
37471e1
bcf4118
fabbc97
49fd825
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 ! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
@@ -485,6 +570,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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field in Fan:SystemModel is "Electric Power Minimum Flow Rate Fraction", so if the old fan is Fraction, then this field = old fan There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make sense. I will change it to this calculation logic |
||
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 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the VAV fan comments be removed from the idd and maybe the docs? Also, should the old fan be deleted during the transition?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes and Yes. |
||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
! Changes for report variables, meters, tables -- update names ! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall why this passes RTF now when it should pass PLF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that the runtime fraction can be passed into fan simulation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, you're passing the mass flow rate and RTF for speed 1 and then 0's for massflowrate2 and RTF2 to trick the fan model. But then the fan model also uses state.dataHVACGlobal->OnOffFanPartLoadFraction to calculate a local RTF. So don't change line 16883, leave it as PLF. Then in the call to the fan, pass the correct RTF. Actually, I don't think this is correct because
thisDXCoil.CoolingCoilRuntimeFraction
will not be the same as_locRuntimeFrac
(that may not be a bad thing). I think you should pass PLF to the fan (using state.dataHVACGlobal->OnOffFanPartLoadFraction) and then let the fan calculate the _locRuntimeFrac to use for energy calculations, but I'm not actually sure since the coil PLF applies to the load and the fan PLF applies to the air flow. When the coil load and air flow are disconnected like they are in this VRF model, all bets are off as to what is happening.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case where the fan is Continuous (the one corresponding to VAV fan in the VRF FluidTCtrl model), this is is how the _locRuntimeFrac is currently computed
and the
_localRuntimeFrac
is calculated like thisShould I change these to using the calculation like in the Discrete fan case like this?
@rraustad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not change the fan model. I am just pointing out what I see that looks odd. PLF and RTF are an energy adjustment and I am trying to understand how coil PLR/PLF = RTF affect the fan energy. In other cycling coil/system models the fan air flow and coil load are dependent/proportional. In this model they are independent. I think just pass PLF over to the fan and leave it there for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this VRF coil doesn't have a "Part Load Fraction Correlation Curve Name" field.
PLF is computed like this
So PLF will constantly be 1. But the coil do cycle. So I feel fan should not have
PLF = 1
be passed into the system fan calculation all the time. Is this right? @rraustadThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yujiex @rraustad just pinging here to see if there is still work to do here and try to get this wrapped.