SUEWS API Site
Documentation of SUEWS source code
Functions/Subroutines
heatflux Module Reference

Functions/Subroutines

subroutine heatcond1d (T, Qs, dx, dt, k, rhocp, bc, bctype)
 

Function/Subroutine Documentation

◆ heatcond1d()

subroutine heatflux::heatcond1d ( real(kind(1d0)), dimension(:), intent(inout)  T,
real(kind(1d0)), intent(out)  Qs,
real(kind(1d0)), dimension(:), intent(in)  dx,
real(kind(1d0)), intent(in)  dt,
real(kind(1d0)), dimension(:), intent(in)  k,
real(kind(1d0)), dimension(:), intent(in)  rhocp,
real(kind(1d0)), dimension(2), intent(in)  bc,
logical, dimension(2), intent(in)  bctype 
)

Definition at line 481 of file suews_phys_estm.f95.

Referenced by estm_module::estm().

481  REAL(KIND(1d0)), INTENT(inout)::t(:)
482  REAL(KIND(1d0)), INTENT(in)::dx(:), dt, k(:), rhocp(:), bc(2)
483  REAL(KIND(1d0)), INTENT(out)::qs
484  LOGICAL, INTENT(in)::bctype(2)
485  INTEGER ::i, n!,j !!!!!FO!!!!!
486  REAL(KIND(1d0)), ALLOCATABLE::w(:), a(:), t1(:)
487  n = SIZE(t)
488  ALLOCATE (w(0:n), a(n), t1(n))
489  !w = interface tempea
490  w(1:n) = t
491  w(0) = bc(1); w(n) = bc(2)
492  !convert from flux to equivalent temperature, not exact
493  ! F = k dT/dX => dx*F/k + Ti = Ti
494  IF (bctype(1)) w(0) = bc(1)*0.5*dx(1)/k(1) + w(1)
495  IF (bctype(2)) w(n) = bc(2)*0.5*dx(n)/k(n) + w(n)
496 
497  a = k/dx
498  DO i = 1, n - 1
499  w(i) = (t(i + 1)*a(i + 1) + t(i)*a(i))/(a(i) + a(i + 1))
500  ENDDO
501  !!FO!! print*, 'w: ', w
502  DO i = 1, n
503  t1(i) = (dt/rhocp(i))*(w(i - 1) - 2*t(i) + w(i))*2*a(i)/dx(i) + t(i)
504  ENDDO
505  !!FO!! print*, 'T1: ', T1
506  !for storage the internal distribution of heat should not be important
507  qs = (w(0) - t(1))*2*a(1) + (w(n) - t(n))*2*a(n) !!FO!! k*d(dT/dx)/dx = rhoCp*(dT/dt) -- rhoCp*(dT/dt)*dx = dQs -- dQs = k*d(dT/dx)
508  ! Qs=sum((T1-T)*rhocp*dx)/dt!
509  t = t1
real(kind(1d0)) k
logical, dimension(2) bctype
Here is the caller graph for this function: