** Plane channel with distorted grid.
DISPLAY
The Q1 presents a test case for viscous flow through
a highly distorted mesh, with or without a body force
representing a porous medium.
It allows the behaviour of the GCV, CCM and standard
staggered solvers to be compared.
In all cases, the vector field should show completely
uniform flow.
If the body force is not included, the pressure should
be uniform and zero, as there are no wall boundaries.
If they are included, there should be a uniform pressure
gradient in the X direction.
ENDDIS
MESG(Select equation formulation:
MESG( G - GCV (default)
MESG( S - Standard staggered formulation
MESG( M - CCM Colocated formulation
MESG( V - CCV Colocated formulation
MESG(
MESG(Enter letter for choice
READVDU(ANS,CHAR,G)
REAL(DTF)
CASE :ANS: OF
WHEN S,1
SYMBFC=T; ANS='Staggered'
DTF=0.0001
WHEN M,1
CCM=T ; ANS=CCM; DTF=0.0001
WHEN V,1
CCV=T ; ANS=CCV; DTF=0.0001
MESG(To get the correct vectors in PHOTON, issue the
MESG(command:
MESG(SET VEC COMP UC1 VC1 -
MESG(before drawing the vectors.
ORELSE
GCV=T;LSG9=T; ANS=GCV; DTF=1E4
ENDCASE
PHOTON USE
p ; ; ; ; ;
msg Computational Domain:
gr k 1
pause
cl
msg Velocity Vectors:
vec k 1 sh
msg Press Any Key to Continue...
pause
cl
msg Contours of p1
con p1 k 1 fi;0.0001
msg Press E to exit PHOTON ...
ENDUSE
REAL(ANGL,DELX,DNX)
REAL(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18)
REAL(Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12,Y13,Y14,Y15,Y16,Y17,Y18)
REAL(XLEN1,XLEN2,XLEN3,YLEN1,YLEN2)
INTEGER(NX1,NX2,NX3,NY1,NY2)
MESG(Enter skew angle in range 0 - 70 (70)
READVDU(ANGL,REAL,70)
IF(:ANS:.EQ.CCM.AND.ANGL.GT.50) THEN
MESG(WARNING: CCM wil not converge for angles much above 50
ENDIF
TEXT(XY Duct, :ANS: Solver, Skew angle :ANGL:
TITLE
ANGL = ANGL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X1+2,1,1)
GSET(F,F7,P14,-,P7 ,-,P10,-,P16,-); GSET(M,F7,+I+J,NX1+NX3,1,1)
GSET(F,F8,P3 ,-,P15,-,P17,-,P5 ,-); GSET(M,F8,+I+J,NX1+1,NY1+1,1)
GSET(F,F9,P15,-,P16,-,P18,-,P17,-); GSET(M,F9,+I+J,NX1+2,NY1+1,1)
GSET(F,F10,P16,-,P10,-,P12,-,P18,-);GSET(M,F10,+I+J,NX1+NX3,NY1+1,1)
GSET(C,K:NZ+1:,F,K1,1,NX,1,NY,+,0.0,0.0,1.0)
REAL(SCA); SCA = 1.
INTEGER(IYIN1); IYIN1=2
DIFCUT=0.0; ENUL=1.0; RHO1=1.
SOLVE(P1,U1,V1)
FIINIT(U1) =0.0; FIINIT(V1) = 0.0; FIINIT(P1) =0.0
PATCH(INL1,WEST,1,1, 1,IYIN1,1,1,1,1)
PATCH(INL2,WEST,1,1,IYIN1+1,NY ,1,1,1,1)
COVAL(INL1,P1,FIXFLU,1.0 )
COVAL(INL2,P1,FIXFLU,1.0*SCA)
PATCH(OULET,EAST,NX,NX,1,NY,1,1,1,1)
COVAL(OULET,P1, 1.0E8 ,0.0)
NONORT=T
COVAL(INL1,U1,ONLYMS,1.0 )
COVAL(INL2,U1,ONLYMS,1.0*SCA)
MESG(Introduce Porous Medium? (N/y)
READVDU(ANS,CHAR,N)
IF(:ANS:.EQ.Y) THEN
Porous Medium Test
+ PATCH(RES,PHASEM,1,NX,1,NY,1,1,1,1)
+ COVAL(RES,U1,1.E4,0.0)
+ COVAL(RES,V1,1.E4,0.0)
+ IF(GCV) THEN
+ LSG9=F
+ ENDIF
ENDIF
SELREF = T; RESFAC =1.0E-8
ECHO=T;IXMON=NX-1;IYMON=NY/2
NXPRIN=1; NYPRIN=1
TSTSWP=-1; LSWEEP=1000
NXPRIN= 1; NYPRIN=1
IF(.NOT.GCV) THEN
RELAX(P1,LINRLX,0.1)
ENDIF
RELAX(U1,FALSDT,DTF);RELAX(V1,FALSDT,DTF)
MESG(Show the grid? (N/y)
READVDU(ANS,CHAR,N)
IF(:ANS:.EQ.Y) THEN
GCLEAR;GVIEW(Z);GGRID(Z,1,1,NX+1,1,NY+1,3,0); GDRAW
ENDIF