Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE GetCTGeneratorInput
! SUBROUTINE INFORMATION:
! AUTHOR: Dan Fisher
! DATE WRITTEN: April 2000
! PURPOSE OF THIS SUBROUTINE:
! This routine will get the input
! required by the CT Generator models.
! METHODOLOGY EMPLOYED:
! EnergyPlus input processor
! REFERENCES: na
! USE STATEMENTS:
USE InputProcessor, ONLY : GetNumObjectsFound, GetObjectItem, VerifyName
USE DataIPShortCuts ! Data for field names, blank numerics
USE CurveManager, ONLY : GetCurveIndex
USE NodeInputManager, ONLY: GetOnlySingleNode
USE BranchNodeConnections, ONLY: TestCompSet
USE OutAirNodeManager, ONLY: CheckOutAirNodeNumber
USE General, ONLY: RoundSigDigits
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
IMPLICIT NONE !
! PARAMETERS
!LOCAL VARIABLES
INTEGER :: GeneratorNum !Generator counter
INTEGER :: NumAlphas ! Number of elements in the alpha array
INTEGER :: NumNums ! Number of elements in the numeric array
INTEGER :: IOStat ! IO Status when calling get input subroutine
CHARACTER(len=MaxNameLength),DIMENSION(12) :: AlphArray !character string data
REAL(r64), DIMENSION(12) :: NumArray !numeric data
LOGICAL, SAVE :: ErrorsFound=.false. ! error flag
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
!FLOW
cCurrentModuleObject = 'Generator:CombustionTurbine'
NumCTGenerators = GetNumObjectsFound(cCurrentModuleObject)
IF (NumCTGenerators <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
!ALLOCATE ARRAYS
ALLOCATE (CTGenerator(NumCTGenerators))
ALLOCATE(CheckEquipName(NumCTGenerators))
CheckEquipName=.true.
ALLOCATE (CTGeneratorReport(NumCTGenerators))
!LOAD ARRAYS WITH CT CURVE FIT Generator DATA
DO GeneratorNum = 1 , NumCTGenerators
CALL GetObjectItem(cCurrentModuleObject,GeneratorNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),CTGenerator%Name,GeneratorNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
CTGenerator(GeneratorNum)%Name = AlphArray(1)
CTGenerator(GeneratorNum)%RatedPowerOutput = NumArray(1)
IF (NumArray(1) == 0.0d0) THEN
CALL ShowSevereError('Invalid '//TRIM(cNumericFieldNames(1))//'='//TRIM(RoundSigDigits(NumArray(1),2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound=.true.
ENDIF
! Not sure what to do with electric nodes, so do not use optional arguments
CTGenerator(GeneratorNum)%ElectricCircuitNode = &
GetOnlySingleNode(AlphArray(2),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Electric,NodeConnectionType_Electric,1,ObjectIsNotParent)
CTGenerator(GeneratorNum)%MinPartLoadRat = NumArray(2)
CTGenerator(GeneratorNum)%MaxPartLoadRat = NumArray(3)
CTGenerator(GeneratorNum)%OptPartLoadRat = NumArray(4)
!Load Special CT Generator Input
CTGenerator(GeneratorNum)%PLBasedFuelInputCurve = GetCurveIndex(AlphArray(3)) ! convert curve name to number
IF (CTGenerator(GeneratorNum)%PLBasedFuelInputCurve .EQ. 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//'='//TRIM(AlphArray(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
END IF
CTGenerator(GeneratorNum)%TempBasedFuelInputCurve = GetCurveIndex(AlphArray(4)) ! convert curve name to number
IF (CTGenerator(GeneratorNum)%TempBasedFuelInputCurve .EQ. 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(4))//'='//TRIM(AlphArray(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
END IF
CTGenerator(GeneratorNum)%ExhaustFlowCurve = GetCurveIndex(AlphArray(5)) ! convert curve name to number
IF (CTGenerator(GeneratorNum)%ExhaustFlowCurve .EQ. 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(5))//'='//TRIM(AlphArray(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
END IF
CTGenerator(GeneratorNum)%PLBasedExhaustTempCurve = GetCurveIndex(AlphArray(6)) ! convert curve name to number
IF (CTGenerator(GeneratorNum)%PLBasedExhaustTempCurve .EQ. 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(6))//'='//TRIM(AlphArray(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
END IF
CTGenerator(GeneratorNum)%TempBasedExhaustTempCurve = GetCurveIndex(AlphArray(7)) ! convert curve name to number
IF (CTGenerator(GeneratorNum)%TempBasedExhaustTempCurve .EQ. 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(7))//'='//TRIM(AlphArray(7)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
END IF
CTGenerator(GeneratorNum)%QLubeOilRecoveredCurve = GetCurveIndex(AlphArray(8)) ! convert curve name to number
IF (CTGenerator(GeneratorNum)%QLubeOilRecoveredCurve .EQ. 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(8))//'='//TRIM(AlphArray(8)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
END IF
CTGenerator(GeneratorNum)%UACoef(1) = NumArray(5)
CTGenerator(GeneratorNum)%UACoef(2) = NumArray(6)
CTGenerator(GeneratorNum)%MaxExhaustperCTPower = NumArray(7)
CTGenerator(GeneratorNum)%DesignMinExitGasTemp = NumArray(8)
CTGenerator(GeneratorNum)%DesignAirInletTemp = NumArray(9)
CTGenerator(GeneratorNum)%FuelHeatingValue = NumArray(10)
CTGenerator(GeneratorNum)%DesignHeatRecVolFlowRate = NumArray(11)
IF (CTGenerator(GeneratorNum)%DesignHeatRecVolFlowRate > 0.0d0) THEN
CTGenerator(GeneratorNum)%HeatRecActive=.true.
CTGenerator(GeneratorNum)%HeatRecInletNodeNum = &
GetOnlySingleNode(AlphArray(9),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsNotParent)
IF (CTGenerator(GeneratorNum)%HeatRecInletNodeNum == 0) THEN
CALL ShowSevereError('Missing Node Name, Heat Recovery Inlet, for '// &
TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound=.true.
ENDIF
CTGenerator(GeneratorNum)%HeatRecOutletNodeNum = &
GetOnlySingleNode(AlphArray(10),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsNotParent)
IF (CTGenerator(GeneratorNum)%HeatRecOutletNodeNum == 0) THEN
CALL ShowSevereError('Missing Node Name, Heat Recovery Outlet, for '// &
TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound=.true.
ENDIF
CALL TestCompSet(TRIM(cCurrentModuleObject),AlphArray(1),AlphArray(9),AlphArray(10),'Heat Recovery Nodes')
Call RegisterPlantCompDesignFlow(CTGenerator(GeneratorNum)%HeatRecInletNodeNum, &
CTGenerator(GeneratorNum)%DesignHeatRecVolFlowRate )
ELSE
CTGenerator(GeneratorNum)%HeatRecActive=.false.
CTGenerator(GeneratorNum)%HeatRecInletNodeNum = 0
CTGenerator(GeneratorNum)%HeatRecOutletNodeNum = 0
IF (.NOT. lAlphaFieldBlanks(9) .OR. .NOT. lAlphaFieldBlanks(10) ) THEN
CALL ShowWarningError('Since Design Heat Flow Rate = 0.0, Heat Recovery inactive for '// &
TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('However, Node names were specified for Heat Recovery inlet or outlet nodes')
ENDIF
ENDIF
!Fuel Type Case Statement
SELECT CASE (AlphArray(11))
CASE (' ') !If blank then the default is Natural Gas
CTGenerator(GeneratorNum)%FuelType = 'Gas'
CASE ('GAS','NATURALGAS','NATURAL GAS')
CTGenerator(GeneratorNum)%FuelType = 'Gas'
CASE ('DIESEL')
CTGenerator(GeneratorNum)%FuelType = 'Diesel'
CASE ('GASOLINE')
CTGenerator(GeneratorNum)%FuelType = 'Gasoline'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
CTGenerator(GeneratorNum)%FuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
CTGenerator(GeneratorNum)%FuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
CTGenerator(GeneratorNum)%FuelType = 'Propane'
CASE ('OTHERFUEL1')
CTGenerator(GeneratorNum)%FuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
CTGenerator(GeneratorNum)%FuelType = 'OtherFuel2'
CASE DEFAULT
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(11))//'='//TRIM(AlphArray(11)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound=.true.
END SELECT
CTGenerator(GeneratorNum)%HeatRecMaxTemp = NumArray(12)
!begin CR7021
IF (lAlphaFieldBlanks(12) ) THEN
CTGenerator(GeneratorNum)%OAInletNode = 0
ELSE
CTGenerator(GeneratorNum)%OAInletNode = &
GetOnlySingleNode(AlphArray(12),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_OutsideAirReference,1,ObjectIsNotParent)
IF ( .not. CheckOutAirNodeNumber(CTGenerator(GeneratorNum)%OAInletNode)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(CTGenerator(GeneratorNum)%Name)//&
'" Outdoor Air Inlet Node Name not valid Outdoor Air Node= '//TRIM(AlphArray(12)))
CALL ShowContinueError('...does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node.')
ErrorsFound=.true.
ENDIF
ENDIF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in processing input for '//TRIM(cCurrentModuleObject))
ENDIF
DO GeneratorNum = 1, NumCTGenerators
CALL SetupOutputVariable('Generator Produced Electric Power [W]', &
CTGeneratorReport(GeneratorNum)%PowerGen,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Produced Electric Energy [J]', &
CTGeneratorReport(GeneratorNum)%EnergyGen,'System','Sum',CTGenerator(GeneratorNum)%Name, &
ResourceTypeKey='ElectricityProduced',EndUseKey='COGENERATION',GroupKey='Plant')
CALL SetupOutputVariable('Generator '// TRIM(CTGenerator(GeneratorNum)%FuelType)//' Rate [W]', &
CTGeneratorReport(GeneratorNum)%FuelEnergyUseRate,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator '// TRIM(CTGenerator(GeneratorNum)%FuelType)//' Energy [J]', &
CTGeneratorReport(GeneratorNum)%FuelEnergy,'System','Sum',CTGenerator(GeneratorNum)%Name, &
ResourceTypeKey=CTGenerator(GeneratorNum)%FuelType,EndUseKey='COGENERATION',GroupKey='Plant')
! general fuel use report (to match other generators)
CALL SetupOutputVariable('Generator Fuel HHV Basis Rate [W]', &
CTGeneratorReport(GeneratorNum)%FuelEnergyUseRate,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Fuel HHV Basis Energy [J]', &
CTGeneratorReport(GeneratorNum)%FuelEnergy,'System','Sum',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator '// TRIM(CTGenerator(GeneratorNum)%FuelType)//' Mass Flow Rate [kg/s]', &
CTGeneratorReport(GeneratorNum)%FuelMdot,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Exhaust Air Temperature [C]', &
CTGeneratorReport(GeneratorNum)%ExhaustStackTemp,'System','Average',CTGenerator(GeneratorNum)%Name)
IF (CTGenerator(GeneratorNum)%HeatRecActive) THEN
CALL SetupOutputVariable('Generator Exhaust Heat Recovery Rate [W]', &
CTGeneratorReport(GeneratorNum)%QExhaustRecovered,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Exhaust Heat Recovery Energy [J]', &
CTGeneratorReport(GeneratorNum)%ExhaustEnergyRec,'System','Sum',CTGenerator(GeneratorNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATRECOVERY',GroupKey='Plant')
CALL SetupOutputVariable('Generator Lube Heat Recovery Rate [W]', &
CTGeneratorReport(GeneratorNum)%QLubeOilRecovered,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Lube Heat Recovery Energy [J]', &
CTGeneratorReport(GeneratorNum)%LubeOilEnergyRec,'System','Sum',CTGenerator(GeneratorNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATRECOVERY',GroupKey='Plant')
CALL SetupOutputVariable('Generator Produced Thermal Rate [W]', &
CTGeneratorReport(GeneratorNum)%QTotalHeatRecovered,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Produced Thermal Energy [J]', &
CTGeneratorReport(GeneratorNum)%TotalHeatEnergyRec,'System','Sum',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Heat Recovery Inlet Temperature [C]', &
CTGeneratorReport(GeneratorNum)%HeatRecInletTemp,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Heat Recovery Outlet Temperature [C]', &
CTGeneratorReport(GeneratorNum)%HeatRecOutletTemp,'System','Average',CTGenerator(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Heat Recovery Mass Flow Rate [kg/s]', &
CTGeneratorReport(GeneratorNum)%HeatRecMdot,'System','Average',CTGenerator(GeneratorNum)%Name)
ENDIF
END DO
RETURN
END SUBROUTINE GetCTGeneratorInput