PHOTON USE p phi msg grid gr x 1;gr x m gr y 1;gr y m msg Pressto continue pause cl vi x up z scale cl msg 1st-phase (light phase) velocity vectors on plane ix=3 set vec ref;0.1 vec x 3 sh gr ou x 3 msg Press to continue pause cl msg 2nd-phase (dense phase) velocity vectors on plane ix=3 set vec ref;0.1 set vec comp - v2 w2 vec x 3 sh gr ou x 3 msg Press to continue pause cl msg contour of pressure on plane ix=3 con p1 x 3 fi;0.002 gr ou x 3 msg Press to continue pause cl msg contour of 1st-phase (vapour) volume fraction on plane ix=3 con gas x 3 fi;0.002 gr ou x 3 msg Press to continue pause cl msg contour of shell-side vapour enthalpy on plane ix=3 con 1sth x 3 fi;0.002 gr ou x 3 msg Press to continue pause cl msg contour of shell-side liquid enthalpy on plane ix=3 con 2ndh x 3 fi;0.002 gr ou x 3 msg Press to continue pause cl msg contour of tube-side fluid enthalpy on plane ix=3 con tubh x 3 fi;0.002 gr ou x 3 msg Press e to END enduse CASE 799. Similar to case 7, but with condensation in the shell GROUP 1. Run title TEXT(3D SHELL-AND-TUBE CONDENSER : W799 TITLE User-defined variables;- T1IN = inlet temperarure of shell fluid T2IN = inlet temperature of tube fluid FLO1 = mass-flow rate of shell fluid FLO2 = mass-flow rate of tube fluid COEF1 = heat-transfer coefficient on shell-fluid side COEF2 = heat-transfer coefficient on tube-fluid side COEF12 = overall heat-transfer coefficient from fluid 1 to fluid 2 RESCO = flow-resistance coefficient of the tube bank VELIN = velocity of fluid injection REAL(T1IN,T2IN,FLO1,FLO2,COEF1,COEF2,COEF12) T1IN=1.0;T2IN=0.0;FLO1=0.05;FLO2=0.05;COEF1=0.1;COEF2=0.8 COEF12=1.0/(1.0/COEF1+1.0/COEF2) REAL(RESCO,VELIN);RESCO=2.E2;VELIN=0.6 GROUP 3. X-direction grid specification The condenser is a rectangular box, 1m high, 1m wide and 4m long. A uniform 5*3*8 grid is used, as was done by Patankar and Spalding. Only one half of the exchanger is included in the calculation domain, because of the symmetry of the geometry. GRDPWR(X,5,1.0,1.0) GROUP 4. Y-direction grid specification GRDPWR(Y,3,0.5,1.0) GROUP 5. Z-direction grid specification GRDPWR(Z,8,4.0,1.0) GROUP 7. Variables stored, solved & named The shell-side fluid is a two-phase one, for which eleven variables must be solved; only the enthalpy needs be computed for the tube-side fluid. ONEPHS=F SOLVE(P1,U1,U2,V1,V2,W1,W2,R1,R2,H1,H2,C1) The whole-field method is selected for the pressure, so as to promote convergence in this highly-coupled strongly elliptic problem SOLUTN(P1,Y,Y,Y,P,P,P) In contrast to the practice of cases 7 to 9, H1 is allocated to the shell-side vapour, H2 to the shell-side and C1 (the next variable) to the tube-side fluid. The name TUBH is adopted for the enthalpy of the tube-side fluid. NAME(H1)=1STH;NAME(H2)=2NDH;NAME(C1)=TUBH STORE(MDOT);NAME(R1)=GAS;NAME(R2)=LIQ STORE(EPOR,NPOR,HPOR) GROUP 8. Terms (in differential equations) & devices The "diffusion" terms are cut out for all variables, and also the built-in sources for the enthalpies. TERMS(U1,Y,Y,N,Y,Y,Y);TERMS(V1,Y,Y,N,Y,Y,Y) TERMS(W1,Y,Y,N,Y,Y,Y);TERMS(1STH,N,Y,N,Y,Y,Y) TERMS(TUBH,N,N,N,Y,N,N) TERMS(U2,Y,Y,N,P,P,P);TERMS(V2,Y,Y,N,P,P,P) TERMS(W2,Y,Y,N,P,P,P);TERMS(2NDH,N,Y,N,P,P,P) TERMS(GAS,Y,Y,N,P,P,P);TERMS(LIQ,Y,Y,N,P,P,P) GROUP 9. Properties of the medium (or media) RHO2=100.0 GROUP 10. Inter-phase-transfer processes and properties Linear inter-phase friction and heat-transfer relations are activated through the following statements; and the vaporisation rate is indicated as to be computed from a heat balance applied to the interface between liquid vapour. CFIPS=-1.E4;CMDOT=HEATBL;CINT(1STH)=1.E-5;CINT(2NDH)=1.E-4 RLOLIM=1.E-3 The saturation enthalpies of the shell-side vapour and liquid are set at 0.9 and 0.4 respectively. Arbitrary units are allowed, because the built-in source terms (which represent mechanical work) have been deactivated in TERMS. PHINT(1STH)=0.9;PHINT(2NDH)=0.4 GROUP 11. Initialization of variable or porosity fields FIINIT(W1)=FLO1;FIINIT(U1)=0.0;FIINIT(V1)=0.0 FIINIT(1STH)=PHINT(1STH);FIINIT(2NDH)=PHINT(2NDH);FIINIT(TUBH)=T2IN FIINIT(EPOR)=0.5;FIINIT(NPOR)=0.5;FIINIT(HPOR)=0.5 FIINIT(GAS)=0.9;FIINIT(LIQ)=0.1;FIINIT(MDOT)=0.0 GROUP 13. Boundary conditions and special sources West boundary; shell fluid inlet ; 2 cells in west wall INLET(INLET1,CELL,1,1,2,3,2,2,1,1000) VALUE(INLET1,P1,FLO1/2.0);VALUE(INLET1,1STH,T1IN) VALUE(INLET1,TUBH,SAME) VALUE(INLET1,U1,VELIN) East boundary; shell fluid outlet; 2 cells in east wall PATCH(OUTLET1,EAST,NX,NX,2,3,NZ-1,NZ-1,1,1000) COVAL(OUTLET1,P1,FIXP,0.0);COVAL(OUTLET1,P2,FIXP,0.0) COVAL(OUTLET1,1STH,ONLYMS,SAME);COVAL(OUTLET1,2NDH,ONLYMS,SAME) COVAL(OUTLET1,TUBH,ONLYMS,SAME) High boundary, tube fluid inlet; 5 cells in high wall PATCH(INLET2,CELL,1,1,1,NY,NZ,NZ,1,1000) COVAL(INLET2,TUBH,FLO2/3.0,T2IN) Flow of tube fluid in first pass PATCH(NEH1,CELL,1,1,1,NY,1,NZ-1,1,1000) COVAL(NEH1,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in first bend PATCH(NEW1,CELL,2,2,1,NY,1,1,1,1000) COVAL(NEW1,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in second pass PATCH(NEL1,CELL,2,2,1,NY,2,NZ,1,1000) COVAL(NEL1,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in second bend PATCH(NEW2,CELL,3,3,1,NY,NZ,NZ,1,1000) COVAL(NEW2,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in third pass PATCH(NEH2,CELL,3,3,1,NY,1,NZ-1,1,1000) COVAL(NEH2,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in third bend PATCH(NEW3,CELL,4,4,1,NY,1,1,1,1000) COVAL(NEW3,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in fourth pass PATCH(NEL2,CELL,4,4,1,NY,2,NZ,1,1000) COVAL(NEL2,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in fourth bend PATCH(NEW4,CELL,NX,NX,1,NY,NZ,NZ,1,1000) COVAL(NEW4,TUBH,FLO2/3.0,LOCNE) Flow of tube fluid in fifth pass PATCH(NEH3,CELL,NX,NX,1,NY,1,NZ-1,1,1000) COVAL(NEH3,TUBH,FLO2/3.0,LOCNE) Heat-exchange from liquid to tube fluid, throughout the exchanger PATCH(NEP1,VOLUME,1,NX,1,NY,1,NZ,1,1000) COVAL(NEP1,2NDH,COEF12,LOCNE) Heat-exchange from tube fluid to liquid, throughout the exchanger PATCH(NEM1,VOLUME,1,NX,1,NY,1,NZ,1,1000) COVAL(NEM1,TUBH,COEF12,LOCNE) Baffle 1 at NZ=3 PATCH(BAFFLE1,HIGH,1,NX-1,1,NY,3,3,1,1000) COVAL(BAFFLE1,W1,1.E4,0.0);COVAL(BAFFLE1,W2,1.E4,0.0) Baffle 2 at NZ=5 PATCH(BAFFLE2,HIGH,2,NX,1,NY,5,5,1,1000) COVAL(BAFFLE2,W1,1.E4,0.0);COVAL(BAFFLE2,W2,1.E4,0.0) Resistance to flow exerted by tubes, throughout the shell. PATCH(RESIST,PHASEM,1,NX,1,NY,1,NZ,1,1000) COVAL(RESIST,U1,RESCO,0.0);COVAL(RESIST,V1,RESCO,0.0) COVAL(RESIST,W1,0.5*RESCO,0.0) COVAL(RESIST,U2,RHO2*RESCO,0.0);COVAL(RESIST,V2,RHO2*RESCO,0.0) COVAL(RESIST,W2,0.5*RHO2*RESCO,0.0) Gravity in positive-z direction. PATCH(GRAVITY,PHASEM,1,NX,1,NY,1,NZ,1,1000) COVAL(GRAVITY,W1,FIXFLU,9.81) COVAL(GRAVITY,W2,FIXFLU,9.81) Local under-relaxation of velcity components PATCH(UNRELAX,PHASEM,1,4,1,3,1,3,1,1000) COVAL(UNRELAX,U1,0.01,SAME);COVAL(UNRELAX,U2,0.01,SAME) COVAL(UNRELAX,W1,0.1,SAME);COVAL(UNRELAX,W2,0.1,SAME) COVAL(UNRELAX,V1,0.1,SAME);COVAL(UNRELAX,V2,0.1,SAME) GROUP 15. Termination of sweeps LSWEEP=200 GROUP 16. Termination of iterations LITER(P1)=20 GROUP 17. Under-relaxation devices The under-relaxation applied in this group is probably far heavier than is needed. RELAX(U1,FALSDT,0.01);RELAX(V1,FALSDT,0.01) RELAX(W1,FALSDT,0.01) RELAX(U2,FALSDT,0.01);RELAX(V2,FALSDT,0.01) RELAX(W2,FALSDT,0.01) RELAX(1STH,FALSDT,1.0);RELAX(2NDH,FALSDT,1.0) RELAX(TUBH,FALSDT,1.0) RELAX(GAS,LINRLX,0.4);RELAX(LIQ,LINRLX,0.4) RELAX(MDOT,LINRLX,0.4) GROUP 18. Limits on variables or increments to them VARMIN(GAS)=1.E-4;VARMIN(LIQ)=1.E-4 GROUP 21. Print-out of variables There is no need to print both GAS and LIQ concentrations. OUTPUT(LIQ,N,N,N,N,N,N) Print-out of porosities is suppressed. OUTPUT(EPOR,N,N,N,N,N,N);OUTPUT(NPOR,N,N,N,N,N,N) OUTPUT(HPOR,N,N,N,N,N,N);OUTPUT(1STH,N,N,Y,Y,Y,Y) OUTPUT(2NDH,N,N,Y,Y,Y,Y);OUTPUT(TUBH,N,N,Y,Y,Y,Y) GROUP 22. Spot-value print-out IXMON=3;IYMON=2;IZMON=4;TSTSWP=-1 GROUP 23. Field print-out and plot control IPLTL=LSWEEP;IPROF=1;ORSIZ=0.4;XZPR=T;NPLT=1 PATCH(PASS1,PROFIL,1,1,2,2,1,NZ,1,1000) PLOT(PASS1,1STH,T2IN,T1IN);PLOT(PASS1,TUBH,T2IN,T1IN) PLOT(PASS1,2NDH,T2IN,T1IN) PATCH(PASS2,PROFIL,2,2,2,2,1,NZ,1,1000) PLOT(PASS2,1STH,T2IN,T1IN);PLOT(PASS2,TUBH,T2IN,T1IN) PLOT(PASS2,2NDH,T2IN,T1IN) PATCH(PASS3,PROFIL,3,3,2,2,1,NZ,1,1000) PLOT(PASS3,1STH,T2IN,T1IN);PLOT(PASS3,TUBH,T2IN,T1IN) PLOT(PASS3,2NDH,T2IN,T1IN) PATCH(PASS4,PROFIL,4,4,2,2,1,NZ,1,1000) PLOT(PASS4,1STH,T2IN,T1IN);PLOT(PASS4,TUBH,T2IN,T1IN) PLOT(PASS4,2NDH,T2IN,T1IN) PATCH(PASS5,PROFIL,5,5,2,2,1,NZ,1,1000) PLOT(PASS5,1STH,T2IN,T1IN);PLOT(PASS5,TUBH,T2IN,T1IN) PLOT(PASS5,2NDH,T2IN,T1IN) PATCH(TABMAP,CONTUR,1,NX,1,NY,4,4,1,1000) PLOT(TABMAP,1STH,0.0,10.0);PLOT(TABMAP,TUBH,0.0,10.0) PLOT(TABMAP,2NDH,0.0,10.0) PATCH(TABYEQ3,CONTUR,1,NX,3,3,1,NZ,1,1000) PLOT(TABYEQ3,P1,0.0,10.0);PLOT(TABYEQ3,1STH,0.0,10.0) PLOT(TABYEQ3,TUBH,0.0,10.0);PLOT(TABYEQ3,2NDH,0.0,10.0) PLOT(TABYEQ3,GAS,0.0,10.0) PLOT(TABYEQ3,MDOT,0.0,10.0) GROUP 24. Dumps for restarts