[Fortran] 纯文本查看 复制代码
SUBROUTINE TYPE304 (TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*)
USE TrnsysFunctions
USE TrnsysConstants
IMPLICIT NONE
DOUBLE PRECISION XIN,OUT,TIME,PAR,T,DTDT,STORED
INTEGER*4 INFO(15),NI,NP,NO,ND,NS,IUNIT,ITYPE,ICNTRL
CHARACTER*3 OCHECK,YCHECK
PARAMETER (NP=0,NI=7,NO=6,ND=0,NS=0)
DIMENSION XIN(NI),OUT(NO),PAR(NP),YCHECK(NI),OCHECK(NO),
& STORED(NS)
DOUBLE PRECISION FL_Steam,
& T_Steam,
& X_Steam,
& FL_fw,
& T_fw,
& P_out,
& Tset,
& P_in,
& PROP(7),
& H_steam,
& Hset,
& H_fw,
& FL_mix,
& Fl_d_fw,
& Fl_d_s,
& Hmix,
& Tmix,
& X_mix,
& IERR,
& TIME0,
& DELT,
& Relax
PARAMETER ( Relax = 0.05)
DATA YCHECK/'MF1','TE1','DM1','MF1','TE1','PR1','TE1'/
DATA OCHECK/'MF1','MF1','MF1','TE1','DM1','PR1'/
TIME0 = getSimulationStartTime()
DELT = getSimulationTimeStep()
IF(INFO(7).EQ.-2) THEN
INFO(12)=16
RETURN 1
ENDIF
IF (INFO(8).EQ.-1) THEN
RETURN 1
ENDIF
IF(INFO(13).GT.0) THEN
RETURN 1
ENDIF
IF (INFO(7).EQ.-1) THEN
IUNIT=INFO(1)
ITYPE=INFO(2)
INFO(6) = NO
INFO(9) = 1
INFO(10) = 0
CALL setStorageSize(NS,INFO)
CALL TYPECK(1,INFO,NI,NP,ND)
CALL RCHECK(INFO,YCHECK,OCHECK)
RETURN 1
ENDIF
IF (TIME.LT.(TIME0+DELT/2.d0)) THEN
IUNIT=INFO(1)
ITYPE=INFO(2)
OUT(1) = 0.d0
OUT(2) = XIN(1)
OUT(3) = XIN(2)
RETURN 1
ENDIF
100 CONTINUE
FL_Steam = XIN(1)
T_Steam = XIN(2)
X_steam = XIN(3)
FL_fw = XIN(4)
T_fw = XIN(5)
P_out = XIN(6)
Tset = XIN(7)
P_in = P_out
IF (x_steam.ge.1 .or. x_steam.le.0) THEN
PROP(1) = T_Steam
PROP(2) = 0.1*P_in
CALL steam3('SI',PROP,12,ierr,*108)
CALL LINKCK('TYPE 304','Steam ',1,99)
108 H_steam = PROP(3)
ELSE
PROP(2) = 0.1*P_in
PROP(5) = x_Steam
CALL steam3('SI',PROP,25,ierr,*109)
CALL LINKCK('TYPE 304','Steam ',1,99)
109 H_steam = PROP(3)
ENDIF
PROP(1) = Tset
PROP(2) = 0.1*P_out
CALL steam3('SI',PROP,12,ierr,*110)
CALL LINKCK('TYPE 304','Steam ',1,99)
110 Hset = PROP(3)
PROP(1) = T_fw
PROP(5) = 0.d0
CALL steam3('SI',PROP,15,ierr,*112)
CALL LINKCK('TYPE 304','Steam ',1,99)
112 H_fw = PROP(3)
FL_mix = FL_steam+Fl_fw
IF ( (Hset-H_fw.LE.0.0).OR.(H_steam-Hset.eq.0.0) ) THEN
Fl_d_fw = 0.d0
Fl_d_s = 0.d0
ELSE
Fl_d_fw=
# DMIN1(DMAX1(0.,FL_steam * (H_steam-Hset)/(Hset-H_fw)),FL_steam)
Fl_d_s=DMIN1(DMAX1(0.,Fl_fw * (Hset - H_fw) /
# (H_steam-Hset)),Fl_fw)
ENDIF
IF (Fl_mix.le.1e-6) THEN
Hmix = H_fw
ELSE
Hmix = (Fl_steam*H_steam + fl_fw*H_fw)/Fl_mix
ENDIF
PROP(3) = Hmix
PROP(2) = 0.1*P_out
CALL steam_C('SI',PROP,23,ierr,*111)
CALL LINKCK('TYPE 304','Steam ',1,99)
111 Tmix = PROP(1)
x_mix = DMIN1(2.0,Prop(5))
200 CONTINUE
IF (info(7).le.20) THEN
OUT(1) = FL_d_FW
OUT(2) = FL_d_S
OUT(3) = FL_mix
OUT(4) = Tmix
OUT(5) = X_mix
OUT(6) = P_in
ELSE
OUT(1) = OUT(1) + relax*(FL_d_FW-out(1))
OUT(2) = OUT(2) + relax*(FL_d_S-out(2))
OUT(3) = OUT(3) + relax * (FL_mix -out(3))
OUT(4) = OUT(4) + relax * (Tmix - out(4))
OUT(5) = OUT(5) + relax*(X_mix -out(5))
OUT(6) = P_in
ENDIF
RETURN 1
END