|
[Sponsors] |
July 12, 2005, 14:28 |
High Priority!!! Please Help
|
#1 |
Guest
Posts: n/a
|
I have a three-dimensional room which has five sides to be adiabatic and one of the sides has a constant heat source. I have both the inlet and outlet for the air stream on the roof. I have a thermostat on the wall that kicks on when the temperature reaches above 297 K and goes down when the temperature reaches below 292 K. I tried to simulate the thermostat by changing the conditions at the inlet i.e by providing a BCDEFI subroutine. I have the following questions and the subroutine is as follows:
and the temperature input for this subroutine is the temperature of a cell which is the output from the subroutine POSDAT.f. C************************************************* ************************ SUBROUTINE BCDEFI(SCALAR,U,V,W,TE,ED,T,DEN,TURINT) C Boundary conditions at inlets C************************************************* ************************ C--------------------------------------------------------------------------* C STAR RELEASE 3.150 * C--------------------------------------------------------------------------* INCLUDE 'comdb.inc' COMMON/USR001/INTFLG(100) DIMENSION SCALAR(50) C REAL TEMPR=287.0 LOGICAL TURINT INCLUDE 'usrdat.inc' DIMENSION SCALC(50) EQUIVALENCE( UDAT12(001), ICTID ) EQUIVALENCE( UDAT04(002), DENC ) EQUIVALENCE( UDAT04(003), EDC ) EQUIVALENCE( UDAT02(005), PR ) EQUIVALENCE( UDAT04(005), PRC ) EQUIVALENCE( UDAT04(009), SCALC(01) ) EQUIVALENCE( UDAT04(007), TC ) EQUIVALENCE( UDAT04(008), TEC ) EQUIVALENCE( UDAT04(059), UC ) EQUIVALENCE( UDAT04(060), VC ) EQUIVALENCE( UDAT04(061), WC ) EQUIVALENCE( UDAT04(064), UCL ) EQUIVALENCE( UDAT04(065), VCL ) EQUIVALENCE( UDAT04(066), WCL ) EQUIVALENCE( UDAT02(070), X ) EQUIVALENCE( UDAT02(071), Y ) EQUIVALENCE( UDAT02(072), Z ) C----------------------------------------------------------------------- C C This subroutine enables the user to specify INLET boundary C conditions for U,V,W,TE,ED,T and SCALAR. C C Set TURINT=.TRUE. if turbulence intensity and length scale are C specified as TE and ED respectively C Set TURINT=.FALSE. if k and epsilon are specified as TE and C ED respectively C C ** Parameters to be returned to STAR: U,V,W,TE,ED,T, C SCALAR, DEN, TURINT C C NB U,V and W are in the local coordinate-system of the C inlet boundary. C C----------------------------------------------------------------------- C C Sample coding: To specify inlet values for region 1 C IF( IREG.EQ.1 ) THEN C TURINT=.FALSE. OPEN(87,FILE='MoniT',STATUS='UNKNOWN') TEMPR=287.0 READ(87,*) TEMPR IF( TEMPR.GE.297.6 ) THEN U=-21.7 V=0.0 W=0.0 C TE= C ED= T=287.0 C SCALAR(1)= C DEN= ENDIF IF( TEMPR.LT.297.6 ) THEN U=0.0 V=0.0 W=0.0 T=287.0 ENDIF ENDIF C------------------------------------------------------------------------- RETURN END C POSTDAT.f C************************************************* ************************ SUBROUTINE POSDAT(KEY,VOL,U,TE,ED,T,P,VIST,DEN,CP,VISM,CON, * F,ICLMAP,ICTID,RESOR,VF,FORCB,IRN,PREFM,LEVEL) C Post-process data C************************************************* ************************ C--------------------------------------------------------------------------* C STAR RELEASE 3.150 * C--------------------------------------------------------------------------* INCLUDE 'comdb.inc' COMMON/USR001/INTFLG(100) DIMENSION KEY(-NBMAXU:NCTMXU),VOL(NCTMXU),U(3,-NBMAXU:NCMAXU), * TE(-NBMAXU:NCMAXU),ED(-NBMAXU:NCMAXU),T(-NBMAXU:NCTMXU,1+NSCU), * P(-NBMAXU:NCMAXU),VIST(-NBMAXU:NCMAXU),DEN(-NBMAXU:NCTMXU), * CP(-NBMAXU:NCTMXU),VISM(-NBMXVU:NCMXVU),CON(-NBMXCU:NCMXCU), * F(3,-NBMAXU:NCMAXU),ICLMAP(NCTMXU),ICTID(NCTMXU), * RESOR(63,-100:100),VF(NCDMXU), * FORCB(3,NWLMX),IRN(NWLMX) DOUBLE PRECISION P DIMENSION PREFM(4) INCLUDE 'usrdat.inc' C------------------------------------------------------------------------- C C This subroutine enables the user TO OUTPUT DATA and is called C at the beginning AND at the end of each iteration/time step. C e.g. C IF(LEVEL.EQ.1) THEN C called at the beginning of iteration/time step C "user code" C ELSE IF(LEVEL.EQ.2) THEN C called at the end of iteration/time step C "user code" C ENDIF C Any user code which is not enclosed in the IF condition will C be outputed for both calls C C Note: 1. File numbers available to the users are from 84 to 89. C 2. All variables passed to this routine uses STAR cell C numbering which is different from PROSTAR cell numbers. C PROSTAR cell number can be obtained from a STAR cell C number ICSTAR by ICPROSTAR=ICLMAP(ICSTAR) C------------------------------------------------------------------------- C C Sample coding: (a) To write values of U-velocity component, C pressure and temperature at 5 specified points C to a file at each time step (for plotting). C C (b) To calculate and print mass averaged concentra- C tion of SC2 at the end of the run and to write C it on file60. C------------------------------------------------------------------------- REAL MONI=22553 C DIMENSION MONI(5) C DATA MONI/1,105,1230,12010,14500/ CC CC---- (A) --------------- IF(LEVEL.EQ.2) THEN IF(INTFLG(1).EQ.0) THEN CC FIRST ITERATION, SO OPEN FILES C OPEN(85,FILE='MonitU',FORM='FORMATTED', STATUS='UNKNOWN') C OPEN(86,FILE='MonitP',FORM='FORMATTED', STATUS='UNKNOWN') OPEN(87,FILE='MonitT', STATUS='UNKNOWN') C INTFLG(1)=1 CC ELSE FILES ALREADY OPEN C ENDIF C WRITE(85,800) ITER,(U(1,MONI(I)),I=1,5) C WRITE(86,800) ITER,(P(MONI(I)),I=1,5) WRITE(87,*) T(MONI,1) C 800 FORMAT(5E10.3) ENDIF ENDIF CC CC---- (B) --------------- C IF(ITER.EQ.ITERS+ITSTEP) THEN C TOTMAS=0. C AVRCON=0. C DO 200 IP=1,NCELL C TOTMAS=TOTMAS+DEN(IP)*VOL(IP) C AVRCON=AVRCON+T(IP,3)*DEN(IP)*VOL(IP) C 200 CONTINUE C AVRCON=AVRCON/TOTMAS C WRITE(60,600) AVRCON C 600 FORMAT(///,5X,'MASS AVERAGED CONCENTRATION OF SCALAR 2 =', C * 1PE10.3) C ENDIF CC C-------------------------------------------------------------------------C RETURN END C 1. How do I link the sub routine to starlink? 2. Is the subroutine written correct? 3. The boundary conditions after simulating were as mentioned in STAR GUIde but not as in subroutines, i.e velocity=0 through out.The temperature after simulation is all over the place ( reaches as much as 530 K .Most of the temperature is at the inlet temperature condition i.e 287 K). I would appreciate if someone can give me an immediate response as I have to present the results soon. Thanks in advance, Sandeep |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CD too high | Matthew | FLUENT | 1 | February 21, 2009 05:42 |
Boundary conditions priority | floooo | OpenFOAM Running, Solving & CFD | 1 | November 21, 2008 04:51 |
High Value of HTC | Daniel | CFX | 4 | October 20, 2008 19:01 |
CFX Runtime Priority | Karsten | CFX | 0 | April 26, 2006 05:33 |
about high Y+ | Hannah liang | CFX | 0 | August 27, 2002 17:34 |