Skip to content

Commit a0f096e

Browse files
committed
Modified inputs for heatpump, added swithc for fan on/off.
1 parent 7297be0 commit a0f096e

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

src/heatpump.f90

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ module modheatpump
1010
logical, allocatable :: lhpptsrank(:) ! Logical array indicating if heat pump points are on this rank
1111

1212
real :: thl_dot_hp ! Rate of change of temperature due to heat loss from the heat pump in [Km^3/s]
13+
real :: w_hp_exhaust ! Exhaust velocity at heat pump points in [m/s]
1314

1415
contains
1516

1617
subroutine init_heatpump
17-
use modglobal, only : lheatpump, nhppoints, Q_dot_hp, rhoa, cp, ifinput, cexpnr, ltempeq
18+
use modglobal, only : lheatpump, nhppoints, Q_dot_hp, QH_dot_hp, rhoa, cp, ifinput, cexpnr, ltempeq, dxi, dyi
1819
use modmpi, only : myid, comm3d, mpierr
1920
use decomp_2d, only : zstart, zend
2021
implicit none
@@ -50,12 +51,14 @@ subroutine init_heatpump
5051
end if
5152
end do
5253

53-
thl_dot_hp = Q_dot_hp / (nhppoints*rhoa*cp) ! Calculate temperature change rate from heat loss [Km^3/s]
54+
thl_dot_hp = QH_dot_hp / (nhppoints*rhoa*cp) ! Calculate temperature change rate from heat loss [Km^3/s]
5455

56+
w_hp_exhaust = Q_dot_hp / (nhppoints*dxi*dyi) ! Calculate exhaust velocity at heat pump points [m/s]
57+
5558
end subroutine init_heatpump
5659

5760
subroutine heatpump
58-
use modglobal, only : lheatpump, nhppoints, w_hp_exhaust, dxi, dyi, dzfi, ltempeq
61+
use modglobal, only : lheatpump, lfan_hp, nhppoints, dxi, dyi, dzfi, ltempeq
5962
use modfields, only : wm, w0, wp, thlp
6063
use modmpi, only : myidx, myidy
6164
use decomp_2d, only : zsize
@@ -71,9 +74,12 @@ subroutine heatpump
7174
j = idhppts_global(n,2) - myidy*zsize(2)
7275
k = idhppts_global(n,3)
7376

74-
wm(i,j,k+1) = w_hp_exhaust ! Set exhaust velocity at heat pump point [m/s], at input 'w' cell face k+1
75-
w0(i,j,k+1) = w_hp_exhaust
76-
!wp(i,j,k+1) = 0.
77+
if (lfan_hp) then ! Heat pump fan is on
78+
wm(i,j,k+1) = w_hp_exhaust ! Set exhaust velocity at heat pump point [m/s], at input 'w' cell face k+1
79+
w0(i,j,k+1) = w_hp_exhaust
80+
!wp(i,j,k+1) = 0.
81+
end if
82+
7783
thlp(i,j,k) = thlp(i,j,k) - thl_dot_hp * dxi * dyi * dzfi(k) ! [K/s], at cell center k
7884
end if
7985
end do

src/modglobal.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,10 @@ module modglobal
363363

364364
! Heat pump
365365
logical :: lheatpump = .false. !< switch for heat pump
366+
logical :: lfan_hp = .true. !< switch for heat pump fan on/off
366367
integer :: nhppoints = 0 !< number of heat pump grid points
367-
real :: Q_dot_hp = 0. !< rate of heat extracted from the ambient air by the heat pump (W)
368-
real :: w_hp_exhaust = 0. !< exhaust vertical velocity of the heat pump (m/s)
368+
real :: QH_dot_hp = 0. !< Total rate of heat extracted from the ambient air by the heat pump (W)
369+
real :: Q_dot_hp = 0. !< Total volume flux going out from the heat pump in vertical direction(m^3/s)
369370

370371
! Poisson solver
371372
integer, parameter :: POISS_FFT2D = 0, &

src/modstartup.f90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ subroutine readnamelists
7777
lrandomize, prandtlturb, fkar, lwritefac, dtfac, tfac, tnextfac, &
7878
ltrees,ntrees,Qstar,dQdt,lad,lsize,r_s,cd,dec,ud,ltreedump, &
7979
lpurif,npurif,Qpu,epu, &
80-
lheatpump, nhppoints, Q_dot_hp, w_hp_exhaust
80+
lheatpump,lfan_hp,nhppoints,Q_dot_hp,QH_dot_hp
8181
use modsurfdata, only : z0, z0h, wtsurf, wttop, wqtop, wqsurf, wsvsurf, wsvtop, wsvsurfdum, wsvtopdum, ps, thvs, thls, thl_top, qt_top, qts
8282
use modfields, only : initfields, dpdx, ncname
8383
use modpois, only : initpois
@@ -170,7 +170,7 @@ subroutine readnamelists
170170
namelist/PURIFS/ &
171171
lpurif, npurif, Qpu, epu
172172
namelist/HEATPUMP/ &
173-
lheatpump, nhppoints, Q_dot_hp, w_hp_exhaust
173+
lheatpump, lfan_hp, nhppoints, Q_dot_hp, QH_dot_hp
174174

175175
if (myid == 0) then
176176
if (command_argument_count() >= 1) then
@@ -603,9 +603,10 @@ subroutine readnamelists
603603
call MPI_BCAST(Qpu, 1, MY_REAL, 0, comm3d, mpierr)
604604
call MPI_BCAST(epu, 1, MY_REAL, 0, comm3d, mpierr)
605605
call MPI_BCAST(lheatpump, 1, MPI_LOGICAL, 0, comm3d, mpierr)
606+
call MPI_BCAST(lfan_hp, 1, MPI_LOGICAL, 0, comm3d, mpierr)
606607
call MPI_BCAST(nhppoints, 1, MPI_INTEGER, 0, comm3d, mpierr)
607608
call MPI_BCAST(Q_dot_hp, 1, MY_REAL, 0, comm3d, mpierr)
608-
call MPI_BCAST(w_hp_exhaust, 1, MY_REAL, 0, comm3d, mpierr)
609+
call MPI_BCAST(QH_dot_hp, 1, MY_REAL, 0, comm3d, mpierr)
609610

610611
! ! Allocate and initialize core modules
611612
! call initglobal

0 commit comments

Comments
 (0)