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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | LoadCenterNum | |||
integer, | intent(in) | :: | GenNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(out) | :: | ElectricPowerOutput | |||
real(kind=r64), | intent(out) | :: | ThermalPowerOutput |
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 GeneratorPowerOutput(LoadCenterNum,GenNum,FirstHVACIteration,ElectricPowerOutput,ThermalPowerOutput)
! FUNCTION INFORMATION:
! AUTHOR B. Nigusse
! DATE WRITTEN December 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Simulates generator to get the actual electric power output based on load request
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE ICEngineElectricGenerator, ONLY: SimICEngineGenerator, GetICEGeneratorResults
USE CTElectricGenerator, ONLY: SimCTGenerator, GetCTGeneratorResults
USE MicroturbineElectricGenerator, ONLY: SimMTGenerator, GetMTGeneratorResults
USE Photovoltaics, ONLY: SimPVGenerator, GetPVGeneratorResults
USE FuelCellElectricGenerator, ONLY: SimFuelCellGenerator, GetFuelCellGeneratorResults
USE MicroCHPElectricGenerator, ONLY: SimMicroCHPGenerator, GetMicroCHPGeneratorResults
USE WindTurbine, ONLY: SimWindTurbine, GetWTGeneratorResults
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: GenNum ! Generator number counter
INTEGER, INTENT(IN) :: LoadCenterNum ! Load Center number counter
LOGICAL, INTENT(IN) :: FirstHVACIteration ! Unused 2010 JANUARY
REAL(r64), INTENT(OUT) :: ElectricPowerOutput ! Actual generator electric power output
REAL(r64), INTENT(OUT) :: ThermalPowerOutput ! Actual generator thermal power output
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: GeneratorName ! User-specified name of generator
INTEGER :: GeneratorType ! Type of generator
LOGICAL :: RunFlag ! Simulate generator when TRUE
REAL(r64) :: MyLoad ! Generator load request (W)
GeneratorType = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%CompType_Num
GeneratorName = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%Name
Runflag = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ONThisTimeStep
Myload = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%PowerRequestThisTimestep
! Select and call models and also collect results for load center power conditioning and reporting
TypeOfEquip: SELECT CASE (GeneratorType)
CASE (iGeneratorICEngine) ! 'Generator:InternalCombustionEngine'
CALL SimICEngineGenerator(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag,MyLoad,FirstHVACIteration)
CALL GetICEGeneratorResults(GeneratorType, ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE (iGeneratorCombTurbine) ! 'Generator:CombustionTurbine'
CALL SimCTGenerator(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag,MyLoad,FirstHVACIteration)
CALL GetCTGeneratorResults(GeneratorType, ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE (iGeneratorMicroturbine)! 'Generator:MicroTurbine'
CALL SimMTGenerator(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag,MyLoad,FirstHVACIteration)
CALL GetMTGeneratorResults(GeneratorType, ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE (iGeneratorPV) ! 'Generator:Photovoltaic'
CALL SimPVGenerator(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag,MyLoad)
CALL GetPVGeneratorResults(GeneratorType,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%DCElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%DCElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%DCElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE (iGeneratorFuelCell) ! 'Generator:FuelCell'
CALL SimFuelCellGenerator(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag,MyLoad,FirstHVACIteration)
CALL GetFuelCellGeneratorResults(GeneratorType, ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE(iGeneratorMicroCHP) ! 'Generator:MicroCHP'
CALL SimMicroCHPGenerator(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag, .false., MyLoad, constant_zero, FirstHVACIteration)
CALL GetMicroCHPGeneratorResults(GeneratorType, ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE (iGeneratorWindTurbine) ! 'Generator:WindTurbine'
CALL SimWindTurbine(GeneratorType,GeneratorName,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
Runflag,MyLoad)
CALL GetWTGeneratorResults(GeneratorType,ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%GeneratorIndex, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectricityProd, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate, &
ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProd)
ElectricPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ElectProdRate
ThermalPowerOutput = ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%ThermalProdRate
CASE DEFAULT
CALL ShowSevereError('ManageElectricPower: Invalid Generator Type found= '// &
TRIM(ElecLoadCenter(LoadCenterNum)%ElecGen(GenNum)%TypeOf))
CALL ShowContinueError('.. Generator Name='//TRIM(GeneratorName))
CALL ShowFatalError('.. preceding error causes termination.')
END SELECT TypeOfEquip
RETURN
END SUBROUTINE GeneratorPowerOutput