Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nlayer | |||
real(kind=r64), | intent(in) | :: | W | |||
real(kind=r64), | intent(in) | :: | H | |||
real(kind=r64), | intent(in) | :: | Pa | |||
real(kind=r64), | intent(in) | :: | Pini | |||
real(kind=r64), | intent(in) | :: | Tini | |||
real(kind=r64), | intent(in), | dimension(MaxGap) | :: | NonDeflectedGapWidth | ||
real(kind=r64), | intent(out), | dimension(MaxGap) | :: | DeflectedGapWidthMax | ||
real(kind=r64), | intent(out), | dimension(MaxGap) | :: | DeflectedGapWidthMean | ||
real(kind=r64), | intent(in), | dimension(maxlay2) | :: | PanelTemps | ||
real(kind=r64), | dimension(maxlay) | :: | DCoeff | |||
real(kind=r64), | intent(inout), | dimension(maxlay) | :: | LayerDeflection | ||
integer, | intent(inout) | :: | nperr | |||
character(len=*), | intent(inout) | :: | ErrorMessage |
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 DeflectionTemperatures(nlayer, W, H, Pa, Pini, Tini, NonDeflectedGapWidth, DeflectedGapWidthMax, &
DeflectedGapWidthMean, PanelTemps, DCoeff, LayerDeflection, nperr, ErrorMessage)
!***********************************************************************************************************
! DeflectionTemperatures - calculates deflection of panes and recalculate gap
! widths at maximal point of deflection based on gap pressures and temperatures
!***********************************************************************************************************
!INPUT
integer, intent(in) :: nlayer
real(r64), intent(in) :: W, H
real(r64), dimension(maxlay2), intent(in) :: PanelTemps
real(r64), dimension(MaxGap), intent(in) :: NonDeflectedGapWidth
real(r64), dimension(maxlay) :: DCoeff
real(r64), intent(in) :: Pa, Pini, Tini
!OUTPUT
real(r64), dimension(maxlay), intent(inout) :: LayerDeflection !Objexx:ArgIN Changed IN to INOUT: Arg used and modified
real(r64), dimension(MaxGap), intent(out) :: DeflectedGapWidthMax
real(r64), dimension(MaxGap), intent(out) :: DeflectedGapWidthMean
integer, intent(inout) :: nperr
character (len=*), intent(inout) :: ErrorMessage
!localy used
real(r64), dimension(maxlay) :: DPressure !delta pressure at each glazing layer
real(r64), dimension(MaxGap) :: Vini
real(r64), dimension(MaxGap) :: Vgap
real(r64), dimension(MaxGap) :: Pgap
real(r64), dimension(MaxGap) :: Tgap
real(r64) :: MaxLDSum, MeanLDSum, Ratio
integer :: i, j
i = 0
j = 0
Ratio = 0.0d0
MeanLDSum = 0.0d0
MaxLDSum = 0.0d0
!calculate Vini for each gap
do i = 1, nlayer - 1
Vini(i) = NonDeflectedGapWidth(i) * W * H
end do !do i = 1, nlayer
MaxLDSum = LDSumMax(W, H)
MeanLDSum = LDSumMean(W, H)
Ratio = MeanLDSum / MaxLDSum
!calculate Vgap for each gap
do i = 1, nlayer - 1
Vgap(i) = Vini(i) + W * H * Ratio * (LayerDeflection(i) - LayerDeflection(i+1))
end do !do i = 1, nlayer
!calculate Tgap for each gap
do i = 1, nlayer - 1
j = 2 * i
Tgap(i) = (PanelTemps(j) + PanelTemps(j + 1)) / 2
end do !do i = 1, nlayer
do i = 1, nlayer - 1
Pgap(i) = Pini*Vini(i)*Tgap(i)/(Tini*Vgap(i))
end do !do i = 1, nlayer
DPressure(1) = Pgap(1) - Pa
if (nlayer.gt.1) then
DPressure(nlayer) = Pa - Pgap(nlayer - 1)
end if
do i = 2, nlayer - 1
DPressure(i) = Pgap(i) - Pgap(i - 1)
end do !do i = 1, nlayer
do i = 1, nlayer
LayerDeflection(i) = LayerDeflection(i) + DeflectionRelaxation * MaxLDSum * 16 * DPressure(i) / (Pi**6 * DCoeff(i))
end do
do i = 1, nlayer - 1
DeflectedGapWidthMax(i) = NonDeflectedGapWidth(i) + LayerDeflection(i) - LayerDeflection(i+1)
if (DeflectedGapWidthMax(i) < 0.0d0) then
nperr = 2001 !glazing panes collapsed
ErrorMessage = 'Glazing panes collapsed'
end if
end do
do i = 1, nlayer - 1
DeflectedGapWidthMean(i) = NonDeflectedGapWidth(i) + Ratio * (DeflectedGapWidthMax(i) - NonDeflectedGapWidth(i))
end do
return
end subroutine DeflectionTemperatures