cdl_waf.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\cdl_waf.f
00002 !
00048                         SUBROUTINE CDL_WAF
00049 !                       ******************
00050 !
00051      &(NS,NPTFR,NBOR,LIMPRO,XNEBOR,YNEBOR,KDIR,KNEU,KDDL,
00052      & W,CE,FLUENT,FLUSORT,FLBOR,DTHAUT,DT,EPS,WINF)
00053 !
00054 !***********************************************************************
00055 !  TELEMAC 2D VERSION 6.3                                         R. ATA
00056 !-----------------------------------------------------------------------
00057 !                 WAF SCHEME (OPTVF =6)
00058 !
00059 !     COMPUTATION OF THE CONVECTIVE FLUXES AT BOUNDARIES
00060 !
00061 !
00062 !     W(1,IS) = H,  W(2,IS)=QU  ,W(3,IS)=QV
00063 !
00064 !
00065 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00066 !|  NS            |-->|  TOTAL NUMNER OF NODES
00067 !|  NPTFR         |-->|  TOTAL NUMBER OF BOUNDARY NODES
00068 !|  NBOR          |-->|  GLOBAL NUMBERS OF BOUNDARY POINTS
00069 !|  LIMPRO        |-->|  TYPES OF BOUNDARY CONDITION
00070 !|  XNEBOR,YNEBOR |-->|  UNIT OUTWARD NORMAL COMPONENTS AT BOUNDARY POINTS
00071 !|  KDIR          |-->|  CONVENTION FOR DIRICHLET POINTS
00072 !|  KNEU          |-->|  CONVENTION FOR NEUMANN POINTS
00073 !|  W             |-->|  UA(1,IS) = H,  UA(2,IS)=U  ,UA(3,IS)=V
00074 !|  CE            |<->|  FLUX
00075 !|  FLUENT,FLUSORT|<--|  IN AND OUT MASS FLUX
00076 !|  FLBOR         |<--|  IN AND OUT WATER MASS FLUX
00077 !|  DTHAUT        |-->|  CHARACTERISTIC LENGTH (DX) FOR CFL
00078 !|  DT            |<->|  TIME STEP
00079 !|  EPS           |-->|  TOLERANCE FOR WATER DEPTH DIVISION
00080 !|  WINF          |-->|  PRESCRIBED BOUNDARY CONDITIONS
00081 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00082 !
00083 !-----------------------------------------------------------------------
00084 !
00085 !
00086 !***********************************************************************
00087 !
00088       USE BIEF
00089 !
00090       IMPLICIT NONE
00091       INTEGER LNG,LU
00092       COMMON/INFO/LNG,LU
00093 !
00094 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00095 !
00096       INTEGER, INTENT(IN)             :: NS,NPTFR,KDIR,KNEU,KDDL
00097       INTEGER, INTENT(IN)             :: NBOR(NPTFR),LIMPRO(NPTFR,6)
00098       DOUBLE PRECISION, INTENT(IN)    :: XNEBOR(2*NPTFR),YNEBOR(2*NPTFR)
00099       DOUBLE PRECISION, INTENT(IN)    :: W(3,NS),DTHAUT(NS),EPS
00100       DOUBLE PRECISION, INTENT(INOUT) :: DT,WINF(3,NPTFR)
00101       DOUBLE PRECISION, INTENT(INOUT) :: CE(NS,3),FLUENT,FLUSORT
00102       TYPE(BIEF_OBJ) , INTENT(INOUT)  :: FLBOR
00103 !
00104 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00105 !
00106       INTEGER IS,K,IDRY
00107 !
00108       DOUBLE PRECISION VNX,VNY,XNN,YNN,VNL
00109       DOUBLE PRECISION :: FLX(4),H1,U10,U1,V1
00110       DOUBLE PRECISION :: H2,U2,V2,DX
00111       DOUBLE PRECISION :: INFLOW,OUTFLOW
00112 !     DOUBLE PRECISION :: HL_UP,HR_UP,VL_UP,VR_UP,PSIL_UP,PSIR_UP
00113 !     HL_UP AND HR_UP NOT USED BUT COULD BE USED IF WE CHANGE ALGORITHM
00114 !     FOR LIMITER
00115       DOUBLE PRECISION,PARAMETER ::XI=0.D0
00116 !     TO CORRECT WHEN CONSIDERING TRACER
00117       DOUBLE PRECISION,PARAMETER ::PSI1=0.D0,PSI2=0.D0
00118 !
00119 !-----------------------------------------------------------------------
00120 !
00121 !     LOOP OVER BOUNDARY NODES
00122 !
00123       DO K=1,NPTFR
00124 !
00125         IS=NBOR(K)
00126 !
00127 !       INITIALIZATION
00128 !
00129         FLUENT  = 0.D0
00130         FLUSORT = 0.0D0
00131         INFLOW  = 0.0D0
00132         OUTFLOW = 0.0D0
00133         FLX(1)  = 0.0D0
00134         FLX(2)  = 0.0D0
00135         FLX(3)  = 0.0D0
00136         FLX(4)  = 0.0D0
00137 ! INDICATOR FOR DRY CELLS
00138         IDRY=0
00139 ! NORMALIZED NORMAL
00140         XNN=XNEBOR(K)
00141         YNN=YNEBOR(K)
00142 ! NON NORMALIZED NORMAL
00143         VNX=XNEBOR(K+NPTFR)
00144         VNY=YNEBOR(K+NPTFR)
00145         VNL=SQRT(VNX**2+VNY**2)
00146 !
00147         H1 = W(1,IS)
00148         IF(H1.GT.EPS)THEN
00149           U1   = W(2,IS)/H1
00150           V1   = W(3,IS)/H1
00151         ELSE
00152           U1   = 0.0D0
00153           V1   = 0.0D0
00154           IDRY=IDRY+1
00155         ENDIF
00156 ! MEAN DISTANCE (FOR CFL)
00157         DX    = DTHAUT(IS)
00158 !**************************************************
00159 !         SOLID WALL
00160 !**************************************************
00161 !===============================
00162 !    SLIPPING CONDITION
00163 !===============================
00164 !
00165         IF(LIMPRO(K,1).EQ.KNEU) THEN
00166 ! FIRST METHOD: STRONG IMPOSITION
00167 !********************************
00168 ! DEFINITION OF THE GHOST STATE Ue
00169           H2=H1
00170 !         ROTATION
00171           U10 = U1
00172           U1  = XNN*U10+YNN*V1
00173           V1  =-YNN*U10+XNN*V1
00174 ! PUT NORMAL COMPONENT = 0
00175           U1 =  0.D0
00176           U2 =  U1
00177           V2 =  V1
00178 ! INVERSE ROTATION
00179           U10 = U1
00180           U1  = -YNN*V1
00181           V1  =  XNN*V1
00182 !
00183           U2  = -YNN*V2
00184           V2  =  XNN*V2
00185 ! SECOND METHOD: WEAK IMPOSITION
00186 !********************************
00187 ! !DEFINITION OF THE GHOST STATE Ue
00188 !             H2 = H1
00189 ! ! INNER PRODUCT 2V.n
00190 !            U10 = 2.D0*(U1*XNN + V1*YNN)
00191 ! ! WEAK IMPOSITION: PUT Ve = V1-2(V1.n)n
00192 !            U2 = U1 - U10*XNN
00193 !            V2 = V1 - U10*YNN
00194 !
00195 ! ! HERE WE MAKE THE DECISION TO USE HL_UP=HL, HR_UP=HR ..
00196 ! ! WHICH HAS A CONSEQUENCE THAT LIMITER =0 (A=1)
00197 !          CALL FLUX_WAF(XI,H1,H2,U1,U2,V1,V2,PSI1,PSI2,
00198 !      &                 H1,H2,V1,V2,PSI1,PSI2,
00199 !      &                 XNN,YNN,DT,DX,FLX)
00200 !
00201 !**************************************************
00202 !         LIQUID BOUDARIES
00203 !**************************************************
00204         ELSEIF(LIMPRO(K,1).EQ.KDIR.OR.LIMPRO(K,1).EQ.KDDL)THEN
00205 !===============================
00206 !    SI H EST IMPOSEE
00207 !===============================
00208 !
00209           IF(LIMPRO(K,1).EQ.KDIR) THEN
00210 !
00211             H2 = WINF(1,K)
00212 !
00213             IF(H2 .GT.EPS)THEN
00214               U2 = WINF(2,K) / H2
00215               V2 = WINF(3,K) / H2
00216             ELSE
00217               U2 = 0.0D0
00218               V2 = 0.0D0
00219               IDRY = IDRY + 1
00220             ENDIF
00221 !
00222             IF(IDRY.LT.2)THEN
00223 !           AT LEAST ONE WET CELL
00224               CALL FLUX_WAF(XI,H1,H2,U1,U2,V1,V2,PSI1,PSI2,
00225      &                      H1,H2,V1,V2,PSI1,PSI2,
00226      &                      XNN,YNN,DT,DX,FLX)
00227             ENDIF
00228             OUTFLOW    = FLX(1)*VNL
00229             FLUSORT    = FLUSORT + OUTFLOW
00230             FLBOR%R(K) = OUTFLOW
00231 !
00232 !         LIMPRO(K,1).NE.KDIR
00233           ELSE
00234             H2 = H1
00235             U2 = U1
00236             V2 = V1
00237 !
00238             H1 = WINF(1,K)
00239             IF(H1.GT.EPS)THEN
00240               U1 = WINF(2,K) / H1
00241               V1 = WINF(3,K) / H1
00242             ELSE
00243               U1 = 0.0D0
00244               V1 = 0.0D0
00245               IDRY = IDRY + 1
00246             ENDIF
00247 !
00248             IF(IDRY.LT.2)THEN
00249 !           AT LEAST ONE WET CELL
00250               CALL FLUX_WAF(XI,H2,H1,U2,U1,V2,V1,PSI2,PSI1,
00251      &                      H1,H2,V1,V2,PSI1,PSI2,
00252      &                      XNN,YNN,DT,DX,FLX)
00253             ENDIF
00254             INFLOW     = FLX(1)*VNL
00255             FLUENT     = FLUENT + INFLOW
00256             FLBOR%R(K) = INFLOW
00257 !
00258           ENDIF
00259         ENDIF
00260 !
00261         CE(IS,1)  = CE(IS,1) - VNL*FLX(1)
00262         CE(IS,2)  = CE(IS,2) - VNL*FLX(2)
00263         CE(IS,3)  = CE(IS,3) - VNL*FLX(3)
00264 !
00265       ENDDO
00266 !
00267 !-----------------------------------------------------------------------
00268 !
00269       RETURN
00270       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0