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) | :: | GeneratorNum | |||
real(kind=r64), | intent(in) | :: | Pdemand | |||
real(kind=r64), | intent(out) | :: | PpcuLosses |
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 FigurePowerConditioningLosses(GeneratorNum, Pdemand, PpcuLosses)
! SUBROUTINE INFORMATION:
! AUTHOR B Griffith
! DATE WRITTEN Aug 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate inverter losses
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
! na
USE CurveManager, ONLY : CurveValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: GeneratorNum
REAL(r64), INTENT(IN) :: Pdemand
REAL(r64), INTENT(OUT) :: PpcuLosses
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: lastPpcuLosses !used in iterative solution
INTEGER :: iter
REAL(r64) :: Pel
IF (FuelCell(GeneratorNum)%Inverter%EffMode == InverterEffConstant) THEN
PpcuLosses = Pdemand * (1- FuelCell(GeneratorNum)%Inverter%ConstEff) &
/ FuelCell(GeneratorNum)%Inverter%ConstEff
ENDIF
IF (FuelCell(GeneratorNum)%Inverter%EffMode == InverterEffQuadratic) THEN
! first use Pdemand instead of Pel to get initial estimate
lastPpcuLosses = Pdemand * ( 1.0d0 - CurveValue(FuelCell(GeneratorNum)%Inverter%EffQuadraticCurveID, Pdemand) ) &
/CurveValue(FuelCell(GeneratorNum)%Inverter%EffQuadraticCurveID, Pdemand)
Do iter=1, 20 ! seems like need to iterate (??) Need to investigate number and convergence success here
Pel = Pdemand + lastPpcuLosses
lastPpcuLosses = (1.0d0 - CurveValue(FuelCell(GeneratorNum)%Inverter%EffQuadraticCurveID, Pel) ) * Pel
ENDDO
PpcuLosses = lastPpcuLosses
ENDIF
RETURN
END SUBROUTINE FigurePowerConditioningLosses