Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | Delt | |||
integer, | intent(in) | :: | I | |||
integer, | intent(in) | :: | Lay | |||
integer, | intent(in) | :: | Surf | |||
real(kind=r64), | intent(in), | DIMENSION(:) | :: | T | ||
real(kind=r64), | intent(inout), | DIMENSION(:) | :: | TT | ||
real(kind=r64), | intent(in), | DIMENSION(:) | :: | Rhov | ||
real(kind=r64), | intent(inout), | DIMENSION(:) | :: | RhoT | ||
real(kind=r64), | intent(inout), | DIMENSION(:) | :: | RH | ||
real(kind=r64), | intent(in), | DIMENSION(:) | :: | TD | ||
real(kind=r64), | intent(inout), | DIMENSION(:) | :: | TDT | ||
real(kind=r64), | intent(inout), | DIMENSION(:) | :: | EnthOld | ||
real(kind=r64), | intent(inout), | DIMENSION(:) | :: | EnthNew |
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 InteriorNodeEqns(Delt,I,Lay,Surf,T,TT,Rhov,RhoT,RH,TD,TDT,EnthOld,EnthNew)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Liesen
! DATE WRITTEN November, 2003
! MODIFIED May 2011, B. Griffith and P. Tabares
! RE-ENGINEERED C. O. Pedersen, 2006
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: Delt ! Time Increment
INTEGER, INTENT(IN) :: I ! Node Index
INTEGER, INTENT(IN) :: Lay ! Layer Number for Construction
INTEGER, INTENT(IN) :: Surf ! Surface number
REAL(r64),DIMENSION(:), INTENT(In) :: T !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(InOut) :: TT !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(In) :: Rhov !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(InOut) :: RhoT !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(In) :: TD !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(InOut) :: TDT !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(InOut) :: RH !INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF.
REAL(r64),DIMENSION(:), INTENT(InOut) :: EnthOld ! Old Nodal enthalpy
REAL(r64),DIMENSION(:), INTENT(InOut) :: EnthNew ! New Nodal enthalpy
! SUBROUTINE PARAMETER DEFINITIONS:
! REAL(r64), PARAMETER :: NinetyNine=99.0d0
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! na
REAL(r64) :: Delx
INTEGER :: ConstrNum
INTEGER :: MatLay
INTEGER :: DepVarCol
INTEGER :: IndVarCol
REAL(r64) :: kt ! Thermal conductivity in temperature equation
REAL(r64) :: ktA1 ! Variable Outer Thermal conductivity in temperature equation
REAL(r64) :: ktA2 ! Thermal Inner conductivity in temperature equation
REAL(r64) :: kto ! base 20 C thermal conductivity
REAL(r64) :: kt1 ! temperature coefficient for simple temp dep k.
REAL(r64) :: Cp ! Cp used
REAL(r64) :: Cpo ! Const Cp from input
REAL(r64) :: RhoS
ConstrNum=Surface(surf)%Construction
MatLay = Construct(ConstrNum)%LayerPoint(Lay)
! Set Thermal Conductivity. Can be constant, simple linear temp dep or multiple linear segment temp function dep.
kto = Material(MatLay)%Conductivity ! 20C base conductivity
kt1 = MaterialFD(MatLay)%tk1 ! linear coefficient (normally zero)
kt = kto + kt1*((TDT(I)+TDT(I-1))/2.d0 - 20.0d0)
ktA1 = kto + kt1*((TDT(I)+TDT(I+1))/2.d0 - 20.0d0) ! Will be overridden if variable k
ktA2 = kto + kt1*((TDT(I)+TDT(I-1))/2.d0 - 20.0d0) ! Will be overridden if variable k
IF( SUM(MaterialFD(MatLay)%TempCond(1:3,2)) >= 0.0d0) THEN ! Multiple Linear Segment Function
DepVarCol = 2 ! thermal conductivity
IndVarCol = 1 !temperature
ktA1 = terpld(MaterialFD(MatLay)%numTempCond,MaterialFD(MatLay)%TempCond,(TDT(I)+TDT(I+1))/2.0d0 ,IndVarCol,DepVarCol)
ktA2 = terpld(MaterialFD(MatLay)%numTempCond,MaterialFD(MatLay)%TempCond,(TDT(I)+TDT(I-1))/2.0d0 ,IndVarCol,DepVarCol)
ENDIF
RhoS = Material(MatLay)%Density
Cpo = Material(MatLay)%SpecHeat
Cp = Cpo ! Will be changed if PCM
Delx = ConstructFD(ConstrNum)%Delx(Lay)
IF( SUM(MaterialFD(MatLay)%TempEnth(1:3,2)) >= 0.0d0) THEN ! phase change material, Use TempEnth Data
DepVarCol = 2 ! enthalpy
IndVarCol = 1 !temperature
EnthOld(I) =terpld(MaterialFD(MatLay)%numTempEnth,MaterialFD(MatLay)%TempEnth,TD(I),IndVarCol,DepVarCol)
EnthNew(I) =terpld(MaterialFD(MatLay)%numTempEnth,MaterialFD(MatLay)%TempEnth,TDT(I),IndVarCol,DepVarCol)
IF (EnthNew(I)==EnthOld(I)) THEN
Cp = Cpo
ELSE
Cp = MAX(Cpo,(EnthNew(I) -EnthOld(I))/(TDT(I)-TD(I)))
END IF
ELSE ! No phase change
Cp = Cpo
END IF ! Phase Change case
SELECT CASE (CondFDSchemeType)
CASE (CrankNicholsonSecondOrder)
! Adams-Moulton second order
TDT(I)= ((Cp*Delx*RhoS*TD(I))/Delt + &
0.5d0*((ktA2*(-1.0d0*TD(I) + TD(I-1)))/Delx + (ktA1*(-1.d0*TD(I) + TD(I+1)))/Delx) + &
(0.5d0*ktA2*TDT(I-1))/Delx + (0.5d0*ktA1*TDT(I+1))/Delx)/ &
((0.5d0*(ktA1+ktA2))/Delx + (Cp*Delx*RhoS)/Delt)
CASE (FullyImplicitFirstOrder)
! Adams-Moulton First order
TDT(I)= ((Cp*Delx*RhoS*TD(I))/Delt + &
(1.d0*ktA2*TDT(I-1))/Delx + (1.d0*ktA1*TDT(I+1))/Delx)/ &
((2.d0*(ktA1+ktA2)/2.d0)/Delx + (Cp*Delx*RhoS)/Delt)
END SELECT
IF ((TDT(I) > MaxSurfaceTempLimit) .OR. &
(TDT(I) < MinSurfaceTempLimit) ) THEN
TDT(I) = Max(MinSurfaceTempLimit,Min(MaxSurfaceTempLimit,TDT(I))) ! +++++ Limit Check
! CALL CheckFDSurfaceTempLimits(I,TDT(I))
ENDIF
RETURN
END SUBROUTINE InteriorNodeEqns