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) | :: | ColleNum | |||
real(kind=r64), | intent(in) | :: | SecInTimeStep | |||
real(kind=r64), | intent(in) | :: | a1 | |||
real(kind=r64), | intent(in) | :: | a2 | |||
real(kind=r64), | intent(in) | :: | a3 | |||
real(kind=r64), | intent(in) | :: | b1 | |||
real(kind=r64), | intent(in) | :: | b2 | |||
real(kind=r64), | intent(in) | :: | b3 | |||
real(kind=r64), | intent(in) | :: | TempAbsPlateOld | |||
real(kind=r64), | intent(in) | :: | TempWaterOld | |||
real(kind=r64), | intent(out) | :: | TempAbsPlate | |||
real(kind=r64), | intent(out) | :: | TempWater | |||
logical, | intent(in) | :: | AbsorberPlateHasMass |
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 ICSCollectorAnalyticalSoluton(ColleNum,SecInTimeStep,a1,a2,a3,b1,b2,b3,TempAbsPlateOld, &
TempWaterOld,TempAbsPlate,TempWater,AbsorberPlateHasMass)
! SUBROUTINE INFORMATION:
! AUTHOR Bereket Nigusse, FSEC/UCF
! DATE WRITTEN February 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates the absorber plate and collector water temperatures.
!
!
! METHODOLOGY EMPLOYED:
! Analytical method: Solves the coupled absorber plate and collector water energy balance
! equations. The two non-homogeneous ordinary differential equations of the form.
! Tp' = a1*Tp + a2*Tw + a3.
! Tw' = b1*Tp + b2*Tw + b3.
!
! The general solution of these coupled equation with real routes has the following form:
! Tp = ConstantC1*exp(lamda1*t) + ConstantC2*exp(lamda2*t) + ConstOfTpSln
! Tw = r1*ConstantC2*exp(lamda1*t) + r2*ConstantC2*exp(lamda2*t) + ConstOfTwSln
!
! REFERENCES:
!
! NOTES:
!
! USE STATEMENTS:
USE DataGlobals, ONLY: DegToRadians, TimeStepZone, TimeStep, SecInHour, WarmupFlag, HourOfDay
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ColleNum ! solar collector index
REAL(r64), INTENT(IN) :: SecInTimeStep ! seconds in a time step
REAL(r64), INTENT(IN) :: a1 ! coefficient of ODE for Tp
REAL(r64), INTENT(IN) :: a2 ! coefficient of ODE for Tp
REAL(r64), INTENT(IN) :: a3 ! coefficient of ODE for Tp
REAL(r64), INTENT(IN) :: b1 ! coefficient of ODE for TW
REAL(r64), INTENT(IN) :: b2 ! coefficient of ODE for TW
REAL(r64), INTENT(IN) :: b3 ! coefficient of ODE for TW
REAL(r64), INTENT(IN) :: TempWaterOld ! collector water temperature at previous time step [C]
REAL(r64), INTENT(IN) :: TempAbsPlateOld ! absorber plate temperature at previous time step [C]
REAL(r64), INTENT(OUT) :: TempWater ! collector water temperature at current time step [C]
REAL(r64), INTENT(OUT) :: TempAbsPlate ! absorber plate temperature at current time step [C]
LOGICAL, INTENT(IN) :: AbsorberPlateHasMass ! flag for absober thermal mass
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: BSquareM4TimesATimesC ! intermediate variable
REAL(r64) :: r1 ! ratio of the ODE solution constant coefficients
REAL(r64) :: r2 ! ratio of the ODE solution constant coefficients
REAL(r64) :: ConstantC1 ! coefficient of the ODE solution
REAL(r64) :: ConstantC2 ! coefficient of the ODE solution
REAL(r64) :: DetOfMatrix ! intermediate variable
REAL(r64) :: ConstOfTpSln ! the particular solution for the ODE
REAL(r64) :: ConstOfTwSln ! the particular solution for the ODE
REAL(r64) :: lamda1 ! the real roots of the quadratic equation
REAL(r64) :: lamda2 ! the real roots of the quadratic equation
REAL(r64) :: a ! coefficients of quadratic equation a*m2+b*m+c=0
REAL(r64) :: b ! coefficients of quadratic equation a*m2+b*m+c=0
REAL(r64) :: c ! coefficients of quadratic equation a*m2+b*m+c=0
! FLOW:
IF ( AbsorberPlateHasMass ) Then
a = 1.0d0
b =-(a1+b2)
c = a1*b2 - a2*b1
BSquareM4TimesATimesC = b**2 - 4.0d0*a*c
IF (BSquareM4TimesATimesC .GT. 0.0d0 )THEN
lamda1 = (-b + SQRT(BSquareM4TimesATimesC) ) / (2.d0*a)
lamda2 = (-b - SQRT(BSquareM4TimesATimesC) ) / (2.d0*a)
DetOfMatrix = c
ConstOfTpSln = (-a3*b2+b3*a2)/ DetOfMatrix
ConstOfTwSln = (-a1*b3+b1*a3)/ DetOfMatrix
r1 = (lamda1 - a1) / a2
r2 = (lamda2 - a1) / a2
ConstantC2 = (TempWaterOld + r1*ConstOfTpSln - r1*TempAbsPlateOld - ConstOfTwSln) / (r2-r1)
ConstantC1 = (TempAbsPlateOld - ConstOfTpSln - ConstantC2)
TempAbsPlate = ConstantC1*exp(lamda1*SecInTimeStep) + ConstantC2*exp(lamda2*SecInTimeStep) + ConstOfTpSln
TempWater = r1*ConstantC1*exp(lamda1*SecInTimeStep) + r2*ConstantC2*exp(lamda2*SecInTimeStep) + ConstOfTwSln
ELSE ! this should never occur
CALL ShowSevereError('ICSCollectorAnalyticalSoluton: Unanticipated differential equation coefficient - '// &
'report to EnergyPlus Development Team')
CALL ShowFatalError('Program terminates due to above conditions.')
ENDIF
ELSE
! In the absence of absorber plate thermal mass, only the collector water heat balance has a
! differential equation of the form: Tw' = b1*Tp + b2*Tw + b3. The absorber plate energy balance
! equation in the absence of thermal mass is a steady state form: b1*Tp + b2*Tw + b3 = 0
b = b2 - b1 * (a2/a1)
c = b3 - b1 * (a3/a1)
TempWater = (TempWaterOld + c/b)*exp(b*SecInTimeStep) - c/b
TempAbsPlate = -(a2*TempWater + a3)/a1
ENDIF
RETURN
END SUBROUTINE ICSCollectorAnalyticalSoluton