CR9240?
SUBROUTINE GetFuelCellGeneratorInput
! SUBROUTINE INFORMATION:
! AUTHOR: Brent Griffith
! DATE WRITTEN: April 2005
! PURPOSE OF THIS SUBROUTINE:
! This routine will get the input
! required by the FuelCell Generator models.
! METHODOLOGY EMPLOYED:
! EnergyPlus input processor
! REFERENCES: na
! USE STATEMENTS:
USE DataGenerators
USE InputProcessor, ONLY : GetNumObjectsFound, GetObjectItem, VerifyName, FindItemInList, SameString, &
FindItem
USE DataIPShortCuts ! Data for field names, blank numerics
USE CurveManager, ONLY : GetCurveIndex
USE NodeInputManager, ONLY: GetOnlySingleNode
USE BranchNodeConnections, ONLY: TestCompSet
USE DataHeatBalance, ONLY: Zone, IntGainTypeOf_GeneratorFuelCell
USE ScheduleManager, ONLY: GetScheduleIndex
USE General, ONLY: RoundSigDigits
USE DataGlobals, ONLY: DisplayAdvancedReportVariables
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(25) :: AlphArray !character string data
REAL(r64), DIMENSION(200) :: NumArray !numeric data TODO deal with allocatable for extensible
LOGICAL, SAVE :: ErrorsFound=.false. ! error flag
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
INTEGER :: NumFuelCellPMs ! number of power subsystems in input file
INTEGER :: NumFuelCellAirSups ! number of air supply subsystems in input file
! INTEGER :: NumFuelCellFuelSups ! number of fuel supply subsystems in input file
INTEGER :: NumFCWaterSups ! number of water supply subsystems in input file
INTEGER :: NumFuelCellAuxilHeaters
INTEGER :: NumFCExhaustGasHXs
INTEGER :: NumFCElecStorageUnits !number of electrical storage objects in input file
! INTEGER :: NumBatteries !number of Manwell and McGowan battery data objects
INTEGER :: NumFCPowerCondUnits ! number of power conditioning units (inverter)
INTEGER :: NumFCStackCoolers ! number of stack coolers.
INTEGER :: NumAirConstit ! number of gas constituents in air
INTEGER :: FCPMNum !loop counter over power subsystems
INTEGER :: FCAirSupNum !loop counter over air supply subsystems
! INTEGER :: FCFuelSupNum !loop counter over fuel supply subsystems
INTEGER :: ConstitNum ! loop counter for consituents
INTEGER :: FCWaterSupNum !loop counter over water supply subsystems
INTEGER :: FCHXNum !loop counter for heat exchangers
INTEGER :: FCAuxHeatNum !loop counter over auxiliar heater
INTEGER :: FCPCUNum !loop counter over inverters
INTEGER :: StorageNum !loop counter over electrical storage subsystems
INTEGER :: FCScoolNum ! loop counter over stack coolers
INTEGER :: thisFuelCell !temporary index
INTEGER :: otherFuelCell !loop counter and temporary indexer
INTEGER :: I ! loop counter
Logical, SAve :: myonetimeFlag = .true.
CHARACTER(len=MaxNameLength) :: thisname
INTEGER :: NumHardCodedConstituents
INTEGER :: thisConstituent
INTEGER :: thisGasID
INTEGER :: FuelSupNum
! execution
If (myonetimeflag) then
cCurrentModuleObject = 'Generator:FuelCell'
NumFuelCellGenerators = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFuelCellGenerators <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
!ALLOCATE ARRAYS
ALLOCATE (FuelCell(NumFuelCellGenerators)) ! inits handeled in derived type definitions
ALLOCATE(CheckEquipName(NumFuelCellGenerators))
CheckEquipName=.true.
! first load in FuelCell names
DO GeneratorNum = 1 , NumFuelCellGenerators
CALL GetObjectItem(cCurrentModuleObject,GeneratorNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%Name,GeneratorNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
FuelCell(GeneratorNum)%Name = AlphArray(1)
FuelCell(GeneratorNum)%NameFCPM = AlphArray(2)
FuelCell(GeneratorNum)%NameFCAirSup = AlphArray(3)
FuelCell(GeneratorNum)%NameFCFuelSup = AlphArray(4)
FuelCell(GeneratorNum)%NameFCWaterSup = AlphArray(5)
FuelCell(GeneratorNum)%NameFCAuxilHeat = AlphArray(6)
FuelCell(GeneratorNum)%NameExhaustHX = AlphArray(7)
FuelCell(GeneratorNum)%NameElecStorage = AlphArray(8)
FuelCell(GeneratorNum)%NameInverter = AlphArray(9)
If (numAlphas == 10) then
FuelCell(GeneratorNum)%NameStackCooler = AlphArray(10)
ENDIF
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:PowerModule'
NumFuelCellPMs = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFuelCellPMs <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
DO FCPMNum = 1 , NumFuelCellPMs
CALL GetObjectItem(cCurrentModuleObject,FCPMNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%FCPM%Name,FCPMNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameFCPM,NumFuelCellGenerators)
IF (thisFuelCell > 0) THEN !cr9323
FuelCell(thisFuelCell)%FCPM%Name = AlphArray(1)
IF (SameString(AlphArray(2), 'ANNEX42')) FuelCell(thisFuelCell)%FCPM%EffMode = DirectCurveMode
IF (SameSTring(AlphArray(2), 'NORMALIZED')) FuelCell(thisFuelCell)%FCPM%EffMode = NormalizedCurveMode
IF (FuelCell(thisFuelCell)%FCPM%EffMode == 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(AlphArray(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%FCPM%EffCurveID = GetCurveIndex(AlphArray(3))
IF (FuelCell(thisFuelCell)%FCPM%EffCurveID == 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(AlphArray(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%FCPM%NomEff = NumArray(1)
FuelCell(thisFuelCell)%FCPM%NomPel = NumArray(2)
FuelCell(thisFuelCell)%FCPM%NumCycles = NumArray(3)
FuelCell(thisFuelCell)%FCPM%CyclingDegradRat = NumArray(4)
FuelCell(thisFuelCell)%FCPM%NumRunHours = NumArray(5)
FuelCell(thisFuelCell)%FCPM%OperateDegradRat = NumArray(6)
FuelCell(thisFuelCell)%FCPM%ThreshRunHours = NumArray(7)
FuelCell(thisFuelCell)%FCPM%UpTranLimit = NumArray(8)
FuelCell(thisFuelCell)%FCPM%DownTranLimit = NumArray(9)
FuelCell(thisFuelCell)%FCPM%StartUpTime = NumArray(10)/SecInHour !convert to hours from seconds
FuelCell(thisFuelCell)%FCPM%StartUpFuel = NumArray(11)
FuelCell(thisFuelCell)%FCPM%StartUpElectConsum = NumArray(12)
FuelCell(thisFuelCell)%FCPM%StartUpElectProd = NumArray(13)
FuelCell(thisFuelCell)%FCPM%ShutDownTime = NumArray(14)/SecInHour !convert to hours from seconds
FuelCell(thisFuelCell)%FCPM%ShutDownFuel = NumArray(15)
FuelCell(thisFuelCell)%FCPM%ShutDownElectConsum = NumArray(16)
FuelCell(thisFuelCell)%FCPM%ANC0 = NumArray(17)
FuelCell(thisFuelCell)%FCPM%ANC1 = NumArray(18)
IF (SameString(AlphArray(4),'ConstantRate')) &
FuelCell(thisFuelCell)%FCPM%SkinLossMode = ConstantRateSkinLoss
IF (SameString(AlphArray(4),'UAForProcessGasTemperature')) &
FuelCell(thisFuelCell)%FCPM%SkinLossMode = UADTSkinLoss
IF (SameString(AlphArray(4),'QUADRATIC FUNCTION OF FUEL RATE')) &
FuelCell(thisFuelCell)%FCPM%SkinLossMode = QuadraticFuelNdotSkin
IF (FuelCell(thisFuelCell)%FCPM%SkinLossMode == 0) THEN
!throw error
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(AlphArray(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%FCPM%ZoneName = AlphArray(5)
FuelCell(thisFuelCell)%FCPM%ZoneID = FindItemInList(FuelCell(thisFuelCell)%FCPM%ZoneName, Zone%Name, NumOfZones)
IF (FuelCell(thisFuelCell)%FCPM%ZoneID == 0 ) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(AlphArray(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
Call ShowContinueError('Zone Name was not found ')
ErrorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%FCPM%RadiativeFract = NumArray(19)
FuelCell(thisFuelCell)%FCPM%QdotSkin = NumArray(20)
FuelCell(thisFuelCell)%FCPM%UAskin = NumArray(21)
FuelCell(thisFuelCell)%FCPM%SkinLossCurveID = GetCurveIndex(AlphArray(6))
IF (FuelCell(thisFuelCell)%FCPM%SkinLossCurveID == 0) THEN
If (FuelCell(thisFuelCell)%FCPM%SkinLossMode == QuadraticFuelNdotSkin) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(AlphArray(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDIF
FuelCell(thisFuelCell)%FCPM%NdotDilutionAir = NumArray(22)
FuelCell(thisFuelCell)%FCPM%StackHeatLossToDilution = NumArray(23)
FuelCell(thisFuelCell)%FCPM%DilutionInletNodeName = AlphArray(7)
FuelCell(thisFuelCell)%FCPM%DilutionInletNode = &
GetOnlySingleNode(AlphArray(7),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
FuelCell(thisFuelCell)%FCPM%DilutionExhaustNodeName = AlphArray(8)
FuelCell(thisFuelCell)%FCPM%DilutionExhaustNode = &
GetOnlySingleNode(AlphArray(8),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
FuelCell(thisFuelCell)%FCPM%PelMin = NumArray(24)
FuelCell(thisFuelCell)%FCPM%PelMax = NumArray(25)
!check for other FuelCell using the same power module and fill
DO otherFuelCell = thisFuelCell+1, NumFuelCellGenerators
IF (SameString(FuelCell(otherFuelCell)%FCPM%Name, FuelCell(thisFuelCell)%FCPM%Name)) THEN
FuelCell(otherFuelCell)%FCPM = FuelCell(thisFuelCell)%FCPM
ENDIF
ENDDO
ELSE ! throw warning, did not find power module input
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO ! loop over NumFuelCellPMs
Call GetGeneratorFuelSupplyInput
DO FuelSupNum = 1 , NumGeneratorFuelSups
CAll SetupFuelConstituentData(FuelSupNum, ErrorsFound)
ENDDO
!set fuel supply ID in Fuel cell structure
DO GeneratorNum = 1, NumFuelCellGenerators
FuelCell(GeneratorNum)%FuelSupNum = &
FindItemInList( FuelCell(GeneratorNum)%NameFCFuelSup , FuelSupply%name,NumGeneratorFuelSups) ! Fuel Supply ID
IF (FuelCell(GeneratorNum)%FuelSupNum == 0) THEN
CALL ShowSevereError('Fuel Supply Name: '// TRIM(FuelCell(GeneratorNum)%NameFCFuelSup) &
//' not found in ' // FuelCell(GeneratorNum)%Name )
ErrorsFound = .true.
ENDIF
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:AirSupply'
NumFuelCellAirSups = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFuelCellAirSups <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
DO FCAirSupNum = 1 , NumFuelCellAirSups
CALL GetObjectItem(cCurrentModuleObject,FCAirSupNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%AirSup%Name,FCAirSupNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameFCAirSup,NumFuelCellGenerators)
IF (thisFuelCell > 0 ) THEN
FuelCell(thisFuelCell)%AirSup%Name = AlphArray(1)
FuelCell(thisFuelCell)%AirSup%NodeName = AlphArray(2)
! check the node connections
FuelCell(thisFuelCell)%AirSup%SupNodeNum = &
GetOnlySingleNode(AlphArray(2),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
FuelCell(thisFuelCell)%AirSup%BlowerPowerCurveID = GetCurveIndex(AlphArray(3))
If (FuelCell(thisFuelCell)%AirSup%BlowerPowerCurveID == 0) Then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(AlphArray(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('Curve name was not found ')
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%AirSup%BlowerHeatLossFactor = NumArray(1)
IF (SameString(AlphArray(4), 'AirRatiobyStoics')) THEN
FuelCell(thisFuelCell)%AirSup%AirSupRateMode = ConstantStoicsAirRat
ELSEIF (SameString(AlphArray(4), 'QuadraticFunctionofElectricPower')) THEN
FuelCell(thisFuelCell)%AirSup%AirSupRateMode = QuadraticFuncofPel
ELSEIF (SameString(AlphArray(4), 'QUADRATIC FUNCTION OF FUEL RATE')) THEN
FuelCell(thisFuelCell)%AirSup%AirSupRateMode = QuadraticFuncofNdot
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(AlphArray(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%AirSup%Stoics = NumArray(2) + 1.0d0 !
FuelCell(thisFuelCell)%AirSup%AirFuncPelCurveID = GetCurveIndex(AlphArray(5))
If ((FuelCell(thisFuelCell)%AirSup%AirFuncPelCurveID == 0) .AND. &
(FuelCell(thisFuelCell)%AirSup%AirSupRateMode == QuadraticFuncofPel)) then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(AlphArray(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowSevereError('Curve name was not found')
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%AirSup%AirTempCoeff = NumArray(3)
FuelCell(thisFuelCell)%AirSup%AirFuncNdotCurveID = GetCurveIndex(AlphArray(6))
If ((FuelCell(thisFuelCell)%AirSup%AirFuncNdotCurveID ==0) .AND. &
(FuelCell(thisFuelCell)%AirSup%AirSupRateMode == QuadraticFuncofNdot)) then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(AlphArray(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowSevereError('Curve name was not found')
errorsFound = .true.
ENDIF
If(SameString('RecoverBurnerInverterStorage',AlphArray(7))) THEN
FuelCell(thisFuelCell)%AirSup%IntakeRecoveryMode = RecoverBurnInvertBatt
ELSEIF (SameString('RecoverAuxiliaryBurner',AlphArray(7))) THEN
FuelCell(thisFuelCell)%AirSup%IntakeRecoveryMode = RecoverAuxiliaryBurner
ELSEIF (SameString('RecoverInverterandStorage',AlphArray(7))) THEN
FuelCell(thisFuelCell)%AirSup%IntakeRecoveryMode = RecoverInverterBatt
ELSEIF (SameString('RecoverInverter',AlphArray(7))) THEN
FuelCell(thisFuelCell)%AirSup%IntakeRecoveryMode = RecoverInverter
ELSEIF (SameString('RecoverElectricalStorage',AlphArray(7))) THEN
FuelCell(thisFuelCell)%AirSup%IntakeRecoveryMode = RecoverBattery
ELSEIF (SameString('NoRecovery',AlphArray(7))) THEN
FuelCell(thisFuelCell)%AirSup%IntakeRecoveryMode = NoRecoveryOnAirIntake
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(7))//' = '//TRIM(AlphArray(7)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
If(SameString('AmbientAir',AlphArray(8))) THEN
FuelCell(thisFuelCell)%AirSup%ConstituentMode = RegularAir
ELSEIF (SameString('UserDefinedConstituents',AlphArray(8))) THEN
FuelCell(thisFuelCell)%AirSup%ConstituentMode = UserDefinedConstituents
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(8))//' = '//TRIM(AlphArray(8)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
If (FuelCell(thisFuelCell)%AirSup%ConstituentMode == UserDefinedConstituents) THEN
NumAirConstit = NumArray(4)
FuelCell(thisFuelCell)%AirSup%NumConstituents =NumAirConstit
IF (NumAirConstit > 5) THEN
CALL ShowSevereError('Invalid '//TRIM(cNumericFieldNames(4))//'='//TRIM(RoundSigDigits(NumArray(4),2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('Fuel Cell model not set up for more than 5 air constituents')
ErrorsFound = .true.
ENDIF
DO ConstitNum=1, NumAirConstit
FuelCell(thisFuelCell)%AirSup%ConstitName(ConstitNum) = AlphArray(ConstitNum + 8)
FuelCell(thisFuelCell)%AirSup%ConstitMolalFract(ConstitNum) = NumArray(ConstitNum + 4)
ENDDO
ELSE !regular air
NumAirConstit = 5
FuelCell(thisFuelCell)%AirSup%NumConstituents = NumAirConstit
FuelCell(thisFuelCell)%AirSup%ConstitName(1) = 'Nitrogen'
FuelCell(thisFuelCell)%AirSup%ConstitMolalFract(1) = 0.7728d0
FuelCell(thisFuelCell)%AirSup%ConstitName(2) = 'Oxygen'
FuelCell(thisFuelCell)%AirSup%ConstitMolalFract(2) = 0.2073d0
FuelCell(thisFuelCell)%AirSup%ConstitName(3) = 'Water'
FuelCell(thisFuelCell)%AirSup%ConstitMolalFract(3) = 0.0104d0
FuelCell(thisFuelCell)%AirSup%ConstitName(4) = 'Argon'
FuelCell(thisFuelCell)%AirSup%ConstitMolalFract(4) = 0.0092d0
FuelCell(thisFuelCell)%AirSup%ConstitName(5) = 'CarbonDioxide'
FuelCell(thisFuelCell)%AirSup%ConstitMolalFract(5) = 0.0003d0
ENDIF
! check for molar fractions summing to 1.0.
IF (ABS(SUM(FuelCell(thisFuelCell)%AirSup%ConstitMolalFract)-1.0d0) > .0001d0) THEN
CALL showSevereError(TRIM(cCurrentModuleObject)//' molar fractions do not sum to 1.0' )
CALL ShowContinueError('..Sum was='//TRIM(RoundSigDigits(SUM(FuelCell(thisFuelCell)%AirSup%ConstitMolalFract),1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(AlphArray(1)))
errorsfound = .true.
ENDIF
!check for other FuelCell using the same Air Supply module and fill
DO otherFuelCell = thisFuelCell+1, NumFuelCellGenerators
IF (SameString(FuelCell(otherFuelCell)%AirSup%Name, FuelCell(thisFuelCell)%AirSup%Name)) THEN
FuelCell(otherFuelCell)%AirSup = FuelCell(thisFuelCell)%AirSup
ENDIF
ENDDO
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO
DO GeneratorNum = 1, NumFuelCellGenerators
! find molal fraction of oxygen in air supply
thisConstituent = FindItem('Oxygen', FuelCell(GeneratorNum)%AirSup%ConstitName, &
FuelCell(GeneratorNum)%AirSup%NumConstituents)
IF (thisConstituent > 0) FuelCell(GeneratorNum)%AirSup%O2fraction = &
FuelCell(GeneratorNum)%AirSup%ConstitMolalFract(thisConstituent)
NumHardCodedConstituents = 14
! Loop over air constituents and do one-time setup
DO i=1, FuelCell(GeneratorNum)%AirSup%NumConstituents
thisName = FuelCell(GeneratorNum)%AirSup%ConstitName(i)
thisGasID = FindItem(thisName, GasPhaseThermoChemistryData%ConstituentName, NumHardCodedConstituents)
FuelCell(GeneratorNum)%AirSup%GasLibID(i) = thisGasID
ENDDO
!set up gas constiuents for product gases
FuelCell(GeneratorNum)%FCPM%GasLibID(1) = 1 !Carbon Dioxide
FuelCell(GeneratorNum)%FCPM%GasLibID(2) = 2 !Nitrogen
FuelCell(GeneratorNum)%FCPM%GasLibID(3) = 3 !Oxygen
FuelCell(GeneratorNum)%FCPM%GasLibID(4) = 4 !Water
FuelCell(GeneratorNum)%FCPM%GasLibID(5) = 5 !Argon
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:WaterSupply'
NumFCWaterSups = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFCWaterSups <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
DO FCWaterSupNum = 1 , NumFCWaterSups
CALL GetObjectItem(cCurrentModuleObject,FCWaterSupNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%WaterSup%Name,FCWaterSupNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameFCWaterSup,NumFuelCellGenerators)
IF (thisFuelCell > 0) THEN
! this is only the first instance of a FuelCell generator using this type of Water supply module
FuelCell(thisFuelCell)%WaterSup%Name = AlphArray(1)
FuelCell(thisFuelCell)%WaterSup%WaterSupRateCurveID = GetCurveIndex(AlphArray(2))
IF (FuelCell(thisFuelCell)%WaterSup%WaterSupRateCurveID == 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(AlphArray(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('Curve name was not found ')
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%WaterSup%PmpPowerCurveID = GetCurveIndex(AlphArray(3))
IF (FuelCell(thisFuelCell)%WaterSup%PmpPowerCurveID == 0 ) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(AlphArray(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('Curve name was not found ')
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%WaterSup%PmpPowerLossFactor = NumArray(1)
!!CR9240?
IF(SameString('TemperatureFromAirNode',AlphArray(4))) THEN
FuelCell(thisFuelCell)%WaterSup%WaterTempMode = WaterInReformAirNode
FuelCell(thisFuelCell)%WaterSup%NodeName = AlphArray(5)
FuelCell(thisFuelCell)%WaterSup%NodeNum = &
GetOnlySingleNode(AlphArray(5),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
ELSEIF(SameString('TemperatureFromWaterNode',AlphArray(4))) THEN
FuelCell(thisFuelCell)%WaterSup%WaterTempMode = WaterInReformWaterNode
FuelCell(thisFuelCell)%WaterSup%NodeName = AlphArray(5)
FuelCell(thisFuelCell)%WaterSup%NodeNum = &
GetOnlySingleNode(AlphArray(5),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Sensor,1,ObjectIsNotParent)
ELSEIF(SameString('MainsWaterTemperature' , AlphArray(4))) Then
FuelCell(thisFuelCell)%WaterSup%WaterTempMode = WaterInReformMains
ELSEIF (SameString('TemperatureFromSchedule', AlphArray(4))) THEN
FuelCell(thisFuelCell)%WaterSup%WaterTempMode = WaterInReformSchedule
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(AlphArray(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%WaterSup%SchedNum = GetScheduleIndex(AlphArray(6))
IF ((FuelCell(thisFuelCell)%WaterSup%SchedNum == 0) .AND. &
(FuelCell(thisFuelCell)%WaterSup%WaterTempMode == WaterInReformSchedule)) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(AlphArray(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CAll ShowContinueError('Schedule was not found')
errorsFound = .true.
ENDIF
!check for other FuelCell using the same Water Supply module and fill
DO otherFuelCell = thisFuelCell+1, NumFuelCellGenerators
IF (SameString(FuelCell(otherFuelCell)%WaterSup%Name, FuelCell(thisFuelCell)%WaterSup%Name)) THEN
FuelCell(otherFuelCell)%WaterSup = FuelCell(thisFuelCell)%WaterSup
ENDIF
ENDDO
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:AuxiliaryHeater'
NumFuelCellAuxilHeaters = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFuelCellAuxilHeaters <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
DO FCAuxHeatNum = 1 , NumFuelCellAuxilHeaters
CALL GetObjectItem(cCurrentModuleObject,FCAuxHeatNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%AuxilHeat%Name,FCAuxHeatNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameFCAuxilHeat,NumFuelCellGenerators)
IF (thisFuelCell > 0) THEN
FuelCell(thisFuelCell)%AuxilHeat%Name = AlphArray(1)
FuelCell(thisFuelCell)%AuxilHeat%ExcessAirRAT = NumArray(1)
FuelCell(thisFuelCell)%AuxilHeat%ANC0 = NumArray(2)
FuelCell(thisFuelCell)%AuxilHeat%ANC1 = NumArray(3)
FuelCell(thisFuelCell)%AuxilHeat%UASkin = NumArray(4)
If (SameString('SurroundingZone', AlphArray(2))) Then
FuelCell(thisFuelCell)%AuxilHeat%SkinLossDestination = SurroundingZone
ELSEIF (SameString('AirInletForFuelCell', AlphArray(2))) Then
FuelCell(thisFuelCell)%AuxilHeat%SkinLossDestination = AirInletForFC
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(AlphArray(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%AuxilHeat%ZoneName = AlphArray(3)
FuelCell(thisFuelCell)%AuxilHeat%ZoneID = FindItemInList(AlphArray(3),Zone%Name,size(Zone) )
IF ((FuelCell(thisFuelCell)%AuxilHeat%ZoneID == 0 ) &
.AND. (FuelCell(thisFuelCell)%AuxilHeat%SkinLossDestination == SurroundingZone)) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(AlphArray(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('Zone name was not found ')
errorsfound = .true.
ENDIF
FuelCell(thisFuelCell)%AuxilHeat%MaxPowerW = NumArray(5)
FuelCell(thisFuelCell)%AuxilHeat%MinPowerW = NumArray(6)
FuelCell(thisFuelCell)%AuxilHeat%MaxPowerkmolperSec = NumArray(7)
FuelCell(thisFuelCell)%AuxilHeat%MinPowerkmolperSec = NumArray(8)
! TODO finish Auxiliary heater
!check for other FuelCell using the same Auxiliary Heating module and fill
DO otherFuelCell = thisFuelCell+1, NumFuelCellGenerators
IF (SameString(FuelCell(otherFuelCell)%AuxilHeat%Name, FuelCell(thisFuelCell)%AuxilHeat%Name)) THEN
FuelCell(otherFuelCell)%AuxilHeat = FuelCell(thisFuelCell)%AuxilHeat
ENDIF
ENDDO
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO
! exhaust gas heat exchanger
cCurrentModuleObject = 'Generator:FuelCell:ExhaustGasToWaterHeatExchanger'
NumFCExhaustGasHXs = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFCExhaustGasHXs <= 0) THEN
CALL ShowWarningError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
CALL ShowContinueError('Fuel Cell model requires an '//TRIM(cCurrentModuleObject)//' object')
ErrorsFound=.true.
ENDIF
DO FCHXNum = 1 , NumFCExhaustGasHXs
CALL GetObjectItem(cCurrentModuleObject,FCHXNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%ExhaustHX%Name,FCHXNum-1,IsNotOK,IsBlank, &
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameExhaustHX,NumFuelCellGenerators)
IF (thisFuelCell > 0) THEN
FuelCell(thisFuelCell)%ExhaustHX%Name = AlphArray(1)
FuelCell(thisFuelCell)%ExhaustHX%WaterInNodeName = AlphArray(2)
FuelCell(thisFuelCell)%ExhaustHX%WaterOutNodeName= AlphArray(3)
!find node ids for water path
FuelCell(thisFuelCell)%ExhaustHX%WaterInNode = &
GetOnlySingleNode(AlphArray(2),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsNotParent )
FuelCell(thisFuelCell)%ExhaustHX%WaterOutNode = &
GetOnlySingleNode(AlphArray(3),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsNotParent )
CALL TestCompSet(TRIM(cCurrentModuleObject),AlphArray(1),AlphArray(2),AlphArray(3), &
'Heat Recovery Nodes')
!CR9240
FuelCell(thisFuelCell)%ExhaustHX%ExhaustOutNodeName = AlphArray(4)
FuelCell(thisFuelCell)%ExhaustHX%ExhaustOutNode = &
GetOnlySingleNode(AlphArray(4),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Outlet,2,ObjectIsNotParent )
IF (SameString('FixedEffectiveness', AlphArray(5))) THEN
FuelCell(thisFuelCell)%ExhaustHX%HXmodelMode = FixedEffectiveness
ELSEIF (SameString('EmpiricalUAeff', AlphArray(5))) THEN
FuelCell(thisFuelCell)%ExhaustHX%HXmodelMode = LMTDempiricalUAeff
ELSEIF (SameString('FundementalUAeff', AlphArray(5))) THEN
FuelCell(thisFuelCell)%ExhaustHX%HXmodelMode = LMTDfundementalUAeff
ELSEIF (SameString('CONDENSING', AlphArray(5))) THEN
FuelCell(thisFuelCell)%ExhaustHX%HXmodelMode = Condensing
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(AlphArray(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%ExhaustHX%WaterVolumeFlowMax= NumArray(1)
FuelCell(thisFuelCell)%ExhaustHX%HXEffect = NumArray(2)
FuelCell(thisFuelCell)%ExhaustHX%hxs0 = NumArray(3)
FuelCell(thisFuelCell)%ExhaustHX%hxs1 = NumArray(4)
FuelCell(thisFuelCell)%ExhaustHX%hxs2 = NumArray(5)
FuelCell(thisFuelCell)%ExhaustHX%hxs3 = NumArray(6)
FuelCell(thisFuelCell)%ExhaustHX%hxs4 = NumArray(7)
FuelCell(thisFuelCell)%ExhaustHX%h0gas = NumArray(8)
FuelCell(thisFuelCell)%ExhaustHX%NdotGasRef = NumArray(9)
FuelCell(thisFuelCell)%ExhaustHX%nCoeff = NumArray(10)
FuelCell(thisFuelCell)%ExhaustHX%AreaGas = NumArray(11)
FuelCell(thisFuelCell)%ExhaustHX%h0Water = NumArray(12)
FuelCell(thisFuelCell)%ExhaustHX%NdotWaterRef = NumArray(13)
FuelCell(thisFuelCell)%ExhaustHX%mCoeff = NumArray(14)
FuelCell(thisFuelCell)%ExhaustHX%AreaWater = NumArray(15)
FuelCell(thisFuelCell)%ExhaustHX%Fadjust = NumArray(16)
FuelCell(thisFuelCell)%ExhaustHX%l1Coeff = NumArray(17)
FuelCell(thisFuelCell)%ExhaustHX%l2Coeff = NumArray(18)
FuelCell(thisFuelCell)%ExhaustHX%CondensationThresholdTemp = NumArray(19)
! store cooling water volume flow rate for autosizing system
CALL RegisterPlantCompDesignFlow(FuelCell(thisFuelCell)%ExhaustHX%WaterInNode, &
FuelCell(thisFuelCell)%ExhaustHX%WaterVolumeFlowMax )
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:ElectricalStorage'
NumFCElecStorageUnits = GetNumObjectsFound(cCurrentModuleObject)
If (NumFCElecStorageUnits <= 0) THEN
Call ShowWarningError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
CALL ShowContinueError('Fuel Cell model requires an '//TRIM(cCurrentModuleObject)//' object')
errorsFound = .true.
ENDIF
DO StorageNum = 1, NumFCElecStorageUnits
CALL GetObjectItem(cCurrentModuleObject,StorageNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%ElecStorage%Name,StorageNum-1,IsNotOK,IsBlank, &
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameElecStorage,NumFuelCellGenerators)
IF (thisFuelCell > 0) THEN
FuelCell(thisFuelCell)%ElecStorage%Name = AlphArray(1)
IF (SameString(AlphArray(2), 'SimpleEfficiencyWithConstraints')) THEN
FuelCell(thisFuelCell)%ElecStorage%StorageModelMode = SimpleEffConstraints
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(AlphArray(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%ElecStorage%EnergeticEfficCharge = NumArray(1)
FuelCell(thisFuelCell)%ElecStorage%EnergeticEfficDischarge = NumArray(2)
FuelCell(thisFuelCell)%ElecStorage%NominalEnergyCapacity = NumArray(3)
FuelCell(thisFuelCell)%ElecStorage%MaxPowerDraw = NumArray(4)
FuelCell(thisFuelCell)%ElecStorage%MaxPowerStore = NumArray(5)
FuelCell(thisFuelCell)%ElecStorage%StartingEnergyStored = NumArray(6)
!check for other FuelCell using the same Electrical Storage and fill
DO otherFuelCell = thisFuelCell+1, NumFuelCellGenerators
IF (SameString(FuelCell(otherFuelCell)%ElecStorage%Name, FuelCell(thisFuelCell)%ElecStorage%Name)) THEN
FuelCell(otherFuelCell)%ElecStorage = FuelCell(thisFuelCell)%ElecStorage
ENDIF
ENDDO
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:Inverter'
NumFCPowerCondUnits = GetNumObjectsFound(cCurrentModuleObject)
IF (NumFCPowerCondUnits <= 0) THEN
CALL ShowWarningError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
CALL ShowContinueError('Fuel Cell model requires a '//TRIM(cCurrentModuleObject)//' object')
ErrorsFound=.true.
ENDIF
DO FCPCUNum = 1 , NumFCPowerCondUnits
CALL GetObjectItem(cCurrentModuleObject,FCPCUNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%Inverter%Name,FCPCUNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameInverter,NumFuelCellGenerators)
IF (thisFuelCell > 0) THEN
FuelCell(thisFuelCell)%Inverter%Name = AlphArray(1)
IF (SameString(AlphArray(2), 'QUADRATIC')) FuelCell(thisFuelCell)%Inverter%EffMode = InverterEffQuadratic
IF (SameSTring(AlphArray(2), 'Constant')) FuelCell(thisFuelCell)%Inverter%EffMode = InverterEffConstant
IF (FuelCell(thisFuelCell)%Inverter%EffMode == 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(AlphArray(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
FuelCell(thisFuelCell)%Inverter%ConstEff = NumArray(1)
FuelCell(thisFuelCell)%Inverter%EffQuadraticCurveID = GetCurveIndex(AlphArray(3))
If ((FuelCell(thisFuelCell)%Inverter%EffQuadraticCurveID == 0) &
.AND. (FuelCell(thisFuelCell)%Inverter%EffMode == InverterEffQuadratic)) Then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(AlphArray(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CALL ShowContinueError('Curve was not found ')
ErrorsFound = .true.
ENDIF
!check for other FuelCell using the same Inverter and fill
DO otherFuelCell = thisFuelCell+1, NumFuelCellGenerators
IF (SameString(FuelCell(otherFuelCell)%Inverter%Name, FuelCell(thisFuelCell)%Inverter%Name)) THEN
FuelCell(otherFuelCell)%Inverter = FuelCell(thisFuelCell)%Inverter
ENDIF
ENDDO
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .true.
ENDIF
ENDDO
cCurrentModuleObject = 'Generator:FuelCell:StackCooler'
NumFCStackCoolers = GetNumObjectsFound(cCurrentModuleObject)
If (NumFCStackCoolers > 0) then ! get stack cooler input data
Do FCScoolNum = 1, NumFCStackCoolers
CALL GetObjectItem(cCurrentModuleObject,FCScoolNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelCell%StackCooler%Name,NumFCStackCoolers-1,IsNotOK,IsBlank, &
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
thisFuelCell = FindItemInList(AlphArray(1),FuelCell%NameStackCooler,NumFuelCellGenerators)
If (thisFuelCell > 0) then
FuelCell(thisFuelCell)%StackCooler%Name = AlphArray(1)
FuelCell(thisFuelCell)%StackCooler%WaterInNodeName = AlphArray(2)
FuelCell(thisFuelCell)%StackCooler%WaterOutNodeName = AlphArray(3)
FuelCell(thisFuelCell)%StackCooler%WaterInNode = &
GetOnlySingleNode(AlphArray(2),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsNotParent )
FuelCell(thisFuelCell)%StackCooler%WaterOutNode = &
GetOnlySingleNode(AlphArray(3),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsNotParent )
CALL TestCompSet(TRIM(cCurrentModuleObject),AlphArray(1),AlphArray(2),AlphArray(3), &
'Heat Recovery Nodes')
FuelCell(thisFuelCell)%StackCooler%TstackNom = NumArray(1)
FuelCell(thisFuelCell)%StackCooler%TstackActual = NumArray(2)
FuelCell(thisFuelCell)%StackCooler%r0 = NumArray(3)
FuelCell(thisFuelCell)%StackCooler%r1 = NumArray(4)
FuelCell(thisFuelCell)%StackCooler%r2 = NumArray(5)
FuelCell(thisFuelCell)%StackCooler%r3 = NumArray(6)
FuelCell(thisFuelCell)%StackCooler%MdotStackCoolant = NumArray(7)
FuelCell(thisFuelCell)%StackCooler%UAs_cool = NumArray(8)
FuelCell(thisFuelCell)%StackCooler%Fs_cogen = NumArray(9)
FuelCell(thisFuelCell)%StackCooler%As_cogen = NumArray(10)
FuelCell(thisFuelCell)%StackCooler%MdotCogenNom = NumArray(11)
FuelCell(thisFuelCell)%StackCooler%hCogenNom = NumArray(12)
FuelCell(thisFuelCell)%StackCooler%ns = NumArray(13)
FuelCell(thisFuelCell)%StackCooler%PstackPumpEl = NumArray(14)
FuelCell(thisFuelCell)%StackCooler%PmpPowerLossFactor = NumArray(15)
FuelCell(thisFuelCell)%StackCooler%f0 = NumArray(16)
FuelCell(thisFuelCell)%StackCooler%f1 = NumArray(17)
FuelCell(thisFuelCell)%StackCooler%f1 = NumArray(18)
FuelCell(thisFuelCell)%StackCooler%StackCoolerPresent = .true.
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(1))//' = '//TRIM(AlphArray(1)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsfound=.true.
ENDIF
ENDDO
ENDIF
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting input for fuel cell model ')
ENDIF
DO GeneratorNum = 1, NumFuelCellGenerators
CALL SetupOutputVariable('Generator Produced Electric Power [W]', &
FuelCell(GeneratorNum)%Report%ACPowerGen,'System','Average',FuelCell(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Produced Electric Energy [J]', &
FuelCell(GeneratorNum)%Report%ACEnergyGen,'System','Sum',FuelCell(GeneratorNum)%Name, &
ResourceTypeKey='ElectricityProduced',EndUseKey='COGENERATION',GroupKey='Plant')
CALL SetupOutputVariable('Generator Produced Thermal Rate [W]', &
FuelCell(GeneratorNum)%Report%qHX, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Produced Thermal Energy [J]', &
FuelCell(GeneratorNum)%Report%HXenergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name , &
ResourceTypeKey='ENERGYTRANSFER' , EndUseKey='COGENERATION',GroupKey='Plant')
CALL SetupOutputVariable('Generator Fuel HHV Basis Energy [J]' , &
FuelCell(GeneratorNum)%Report%FuelEnergyHHV, 'System', 'Sum', FuelCell(GeneratorNum)%Name , &
ResourceTypeKey='Gas' , EndUseKey='COGENERATION',GroupKey='Plant')
CALL SetupOutputVariable('Generator Fuel HHV Basis Rate [W]' , &
FuelCell(GeneratorNum)%Report%FuelEnergyUseRateHHV, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Zone Sensible Heat Transfer Rate [W]' , &
FuelCell(GeneratorNum)%Report%SkinLossPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Zone Sensible Heat Transfer Energy [J]' , &
FuelCell(GeneratorNum)%Report%SkinLossEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Zone Convection Heat Transfer Rate [W]' , &
FuelCell(GeneratorNum)%Report%SkinLossConvect, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Zone Radiation Heat Transfer Rate [W]' , &
FuelCell(GeneratorNum)%Report%SkinLossRadiat, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupZoneInternalGain(FuelCell(GeneratorNum)%FCPM%zoneID, &
'Generator:FuelCell', &
FuelCell(GeneratorNum)%Name, &
IntGainTypeOf_GeneratorFuelCell, &
ConvectionGainRate = FuelCell(GeneratorNum)%Report%SkinLossConvect, &
ThermalRadiationGainRate = FuelCell(GeneratorNum)%Report%SkinLossRadiat)
IF (DisplayAdvancedReportVariables) THEN ! show extra data originally needed for detailed comparative testing
CALL SetupOutputVariable('Generator Air Inlet Temperature [C]', &
FuelCell(GeneratorNum)%Report%TairInlet, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Power Module Entering Air Temperature [C]', &
FuelCell(GeneratorNum)%Report%TairIntoFCPM, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Air Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotAir, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Power Module Entering Air Enthalpy [W]' , &
FuelCell(GeneratorNum)%Report%TotAirInEnthalphy, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Blower Electric Power [W]', &
FuelCell(GeneratorNum)%Report%BlowerPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Blower Electric Energy [J]', &
FuelCell(GeneratorNum)%Report%BlowerEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name)
CALL SetupOutputVariable('Generator Blower Skin Heat Loss Rate [W]', &
FuelCell(GeneratorNum)%Report%BlowerSkinLoss, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Inlet Temperature [C]' , &
FuelCell(GeneratorNum)%Report%TfuelInlet, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Power Module Entering Fuel Temperature [C]', &
FuelCell(GeneratorNum)%Report%TfuelIntoFCPM, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Molar Flow Rate [kmol/s]' , &
FuelCell(GeneratorNum)%Report%NdotFuel, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Consumption LHV Basis Energy [J]' , &
FuelCell(GeneratorNum)%Report%FuelEnergyLHV, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Consumption Rate LHV Basis [W]' , &
FuelCell(GeneratorNum)%Report%FuelEnergyUseRateLHV, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Power Module Entering Fuel Enthalpy [W]', &
FuelCell(GeneratorNum)%Report%TotFuelInEnthalpy, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Compressor Electric Power [W]' , &
FuelCell(GeneratorNum)%Report%FuelCompressPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Compressor Electric Energy [J]', &
FuelCell(GeneratorNum)%Report%FuelCompressEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Compressor Skin Heat Loss Rate [W]' , &
FuelCell(GeneratorNum)%Report%FuelCompressSkinLoss, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Reformer Water Inlet Temperature [C]', &
FuelCell(GeneratorNum)%Report%TwaterInlet, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Power Module Entering Reforming Water Temperature [C]', &
FuelCell(GeneratorNum)%Report%TwaterIntoFCPM, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Reformer Water Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotWater, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Reformer Water Pump Electric Power [W]' , &
FuelCell(GeneratorNum)%Report%WaterPumpPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Reformer Water Pump Electric Energy [J]' , &
FuelCell(GeneratorNum)%Report%WaterPumpEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Power Module Entering Reforming Water Enthalpy [W]', &
FuelCell(GeneratorNum)%Report%WaterIntoFCPMEnthalpy, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas Temperature [C]', &
FuelCell(GeneratorNum)%Report%TprodGas, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas Enthalpy [W]', &
FuelCell(GeneratorNum)%Report%EnthalProdGas, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotProdGas, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas Ar Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotProdAr, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas CO2 Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotProdCO2, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas H2O Vapor Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotProdH2O, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas N2 Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotProdN2, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Product Gas O2 Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%NdotProdO2, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Heat Recovery Exit Gas Temperature [C]', &
FuelCell(GeneratorNum)%Report%THXexh, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Heat Recovery Exit Gas H2O Vapor Fraction [ ]', &
FuelCell(GeneratorNum)%Report%WaterVaporFractExh, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Heat Recovery Water Condensate Molar Flow Rate [kmol/s]', &
FuelCell(GeneratorNum)%Report%CondensateRate , 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Inverter Loss Power [W]', &
FuelCell(GeneratorNum)%Report%PCUlosses, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Produced DC Electric Power [W]', &
FuelCell(GeneratorNum)%Report%DCPowerGen, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator DC Power Efficiency [ ]', &
FuelCell(GeneratorNum)%Report%DCPowerEff, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Electric Storage Charge State [J]', &
FuelCell(GeneratorNum)%Report%ElectEnergyinStorage, 'System', 'Average', FuelCell(GeneratorNum)%Name ) !? 'Sum'
CALL SetupOutputVariable('Generator DC Storage Charging Power [W]', &
FuelCell(GeneratorNum)%Report%StoredPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator DC Storage Charging Energy [J]', &
FuelCell(GeneratorNum)%Report%StoredEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator DC Storage Discharging Power [W]', &
FuelCell(GeneratorNum)%Report%DrawnPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator DC Storage Discharging Energy [J]', &
FuelCell(GeneratorNum)%Report%DrawnEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Ancillary AC Electric Power [W]', &
FuelCell(GeneratorNum)%Report%ACancillariesPower, 'System', 'Average', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Ancillary AC Electric Energy [J]', &
FuelCell(GeneratorNum)%Report%ACancillariesEnergy, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Fuel Cell Model Iteration Count [ ]' , &
FuelCell(GeneratorNum)%Report%SeqSubstIterations, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
CALL SetupOutputVariable('Generator Regula Falsi Iteration Count [ ]', &
FuelCell(GeneratorNum)%Report%RegulaFalsiIterations, 'System', 'Sum', FuelCell(GeneratorNum)%Name )
ENDIF
END DO
myonetimeflag = .false.
ENDIF
RETURN
END SUBROUTINE GetFuelCellGeneratorInput