fluxzz.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\fluxzz.f
00002 !
00059                         SUBROUTINE FLUXZZ
00060 !                      *******************
00061 
00062      &(X,Y,NS,NSEG,NELEM,NUBO,G,W,ZF,VNOCL,
00063      & ELTSEG,CE,IFABOR)
00064 !
00065 !***********************************************************************
00066 ! TELEMAC-2D VERSION 6.3                                     01/07/2013
00067 !***********************************************************************
00068 !
00069 !       REF.:"MODELING OF WETTING-DRYING TRANSITIONS IN FREE SURFACE FLOWS
00070 !             OVER COMPLEX TOPOGRAPHIES" CMAME 199(2010) PP 2281-2304
00071 !
00072 !
00073 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00074 ! |  CE            |<-->|  FLUX  INCREMENTS AT INTERNAL FACES          |                          |
00075 ! |  ELTSEG        | -->|  SEGMENT NUMBERS PER ELEMENT                 |
00076 ! |  G             | -->|  GRAVITY                                     |
00077 ! |  NELEM         | -->|  NUMBER OF TOTAL ELEMENTS                    |
00078 ! |  NS            | -->|  NUMBER OF TOTAL MESH NODES                  |
00079 ! |  NSEG          | -->|  NUMBER OF TOTAL MESH EDGES                  |
00080 ! |  NUBO          ! -->!  GLOBAL NUMBER OF EDGE EXTREMITIES           |
00081 ! !  VNOCL         | -->|  OUTWARD UNIT NORMALS                        |
00082 ! !                |    |   (2 FIRST COMPONENTS) AND                   |
00083 ! !                |    |   SEGMENT LENGTH  (THIRD COMPONENT)          |
00084 ! |  W             | -->|  W(1,IS) = H,  W(2,IS)=U  ,W(3,IS)=V         |
00085 ! |  X,Y           | -->|  X AND Y COORDINATES                         |
00086 ! |  ZF            | -->|  BATHYMETRIES                                |
00087 ! !________________|____|______________________________________________|
00088 !
00089       USE BIEF
00090       USE INTERFACE_TELEMAC2D, EX_FLUXZZ => FLUXZZ
00091       USE BIEF_DEF, ONLY:NCSIZE
00092 !
00093       IMPLICIT NONE
00094       INTEGER LNG,LU
00095       COMMON/INFO/LNG,LU
00096 !
00097 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00098 !
00099       INTEGER, INTENT(IN)             :: NS,NSEG,NELEM
00100       INTEGER, INTENT(IN)             :: NUBO(2,NSEG)
00101       INTEGER, INTENT(IN)             :: ELTSEG(NELEM,3)
00102       DOUBLE PRECISION, INTENT(IN)    :: ZF(NS),VNOCL(3,NSEG)
00103       DOUBLE PRECISION, INTENT(IN)    :: G,W(3,NS)
00104       DOUBLE PRECISION, INTENT(IN)    :: X(NS),Y(NS)
00105       DOUBLE PRECISION, INTENT(INOUT) :: CE(NS,3)
00106       INTEGER, INTENT(IN)             :: IFABOR(NELEM,3)
00107 !
00108 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00109 !
00110       INTEGER NSG,NUBO1,NUBO2,IVAR,I,IDRY
00111       INTEGER IELEM,IER
00112 !
00113       DOUBLE PRECISION ZF1,ZF2,XNN,YNN,RNN
00114       DOUBLE PRECISION V21,V22,V31,V32,PROD_SCAL
00115       DOUBLE PRECISION H1,H2,EPS,FLXI(3),FLXJ(3)
00116       DOUBLE PRECISION ETA1,ETA2
00117       DOUBLE PRECISION DEMI
00118       LOGICAL, ALLOCATABLE :: YESNO(:)
00119 !-----------------------------------------------------------------------
00120 !**************************************************************
00121       EPS=1.E-3
00122       DEMI = 0.5D0
00123       ALLOCATE(YESNO(NSEG),STAT=IER)
00124       IF(IER.NE.0)THEN
00125         IF(LNG.EQ.1)WRITE(LU,*)'FLUXZZ: ERREUR D''ALLOCATION'
00126         IF(LNG.EQ.2)WRITE(LU,*)'FLUXZZ: ALLOCATION ERROR '
00127         CALL PLANTE(1)
00128         STOP
00129       ENDIF
00130 !**************************************************************
00131 ! INITIALIZATION OF CE
00132       DO I=1,3
00133         DO IVAR=1,NS
00134           CE(IVAR,I) = 0.D0
00135         ENDDO
00136       ENDDO
00137 ! INITIALIZATION OF YESNO
00138       DO I=1,NSEG
00139         YESNO(I)=.FALSE.
00140       ENDDO
00141 !
00142 !
00143 !-----------------------------------------------------------------------
00144 !     LOOP OVER GLOBAL LIST OF EDGES
00145 !    ********************************
00146 !
00147       DO IELEM=1, NELEM
00148         DO I = 1,3
00149           IF(.NOT.YESNO(ELTSEG(IELEM,I)))THEN
00150             NSG = ELTSEG(IELEM,I)
00151 ! INDICATOR FOR DRY CELLS
00152             IDRY= 0
00153 ! INITIALIZATION
00154             FLXI(1)= 0.0D0
00155             FLXI(2)= 0.0D0
00156             FLXI(3)= 0.0D0
00157             FLXJ(1)= 0.0D0
00158             FLXJ(2)= 0.0D0
00159             FLXJ(3)= 0.0D0
00160 ! RECUPERATE NODES OF THE EDGE WITH RESPECT TO THE NORMAL
00161             NUBO1 = NUBO(1,NSG)
00162             NUBO2 = NUBO(2,NSG)
00163             PROD_SCAL= ((X(NUBO2)-X(NUBO1))*VNOCL(1,NSG)+
00164      &                  (Y(NUBO2)-Y(NUBO1))*VNOCL(2,NSG))
00165             IF(PROD_SCAL.LT.0.D0)THEN
00166               NUBO1 = NUBO(2,NSG)
00167               NUBO2 = NUBO(1,NSG)
00168             ENDIF
00169 !
00170 ! THEIR BATHYMETRIES
00171 !
00172             ZF1   =  ZF(NUBO1)
00173             ZF2   =  ZF(NUBO2)
00174 !
00175 ! NORMAL COORDINATES NX, NY AND SEGMENT LENGTH
00176 !
00177             XNN   = VNOCL(1,NSG)
00178             YNN   = VNOCL(2,NSG)
00179             RNN   = VNOCL(3,NSG)
00180 !
00181 ! WATER DEPTH
00182 !
00183             H1    = W(1,NUBO1)
00184             H2    = W(1,NUBO2)
00185 !
00186 ! UNKNOWN SET (V1,V2,V3)=(eta,U,V) FOR EACH NODE
00187 !
00188             ETA1  = W(1,NUBO1)+ZF1
00189             ETA2  = W(1,NUBO2)+ZF2
00190 
00191             IF(H1.GT.EPS)THEN
00192               V21 = W(2,NUBO1)/H1
00193               V31 = W(3,NUBO1)/H1
00194             ELSE
00195               V21 = 0.0D0
00196               V31 = 0.0D0
00197               IDRY= IDRY+1
00198             ENDIF
00199 
00200             IF(H2.GT.EPS)THEN
00201               V22 = W(2,NUBO2)/H2
00202               V32 = W(3,NUBO2)/H2
00203             ELSE
00204               V22 = 0.0D0
00205               V32 = 0.0D0
00206               IDRY= IDRY+1
00207             ENDIF
00208 !
00209 ! LOCAL FLUX COMPUTATION
00210 !
00211 !        AT LEAST ONE WET CELL
00212             IF(IDRY.LT.2)THEN
00213               CALL FLU_ZOKAGOA(H1,H2,ZF1,ZF2,ETA1,ETA2,V21,V22,
00214      &                         V31,V32,XNN,YNN,FLXI,FLXJ,G)
00215 !
00216 !FOR PARALLELISM
00217 !
00218               IF(NCSIZE.GT.1)THEN
00219                 IF(IFABOR(IELEM,I).EQ.-2)THEN !THIS IS INTERFACE EDGE
00220                   FLXI(1)= DEMI*FLXI(1)
00221                   FLXI(2)= DEMI*FLXI(2)
00222                   FLXI(3)= DEMI*FLXI(3)
00223                   FLXJ(1)= DEMI*FLXJ(1)
00224                   FLXJ(2)= DEMI*FLXJ(2)
00225                   FLXJ(3)= DEMI*FLXJ(3)
00226                 ENDIF
00227               ENDIF
00228 !
00229 ! FLUX INCREMENT
00230 !
00231               CE(NUBO1,1) = CE(NUBO1,1) - RNN*FLXI(1)
00232               CE(NUBO1,2) = CE(NUBO1,2) - RNN*FLXI(2)
00233               CE(NUBO1,3) = CE(NUBO1,3) - RNN*FLXI(3)
00234 !
00235               CE(NUBO2,1) = CE(NUBO2,1) + RNN*FLXJ(1)
00236               CE(NUBO2,2) = CE(NUBO2,2) + RNN*FLXJ(2)
00237               CE(NUBO2,3) = CE(NUBO2,3) + RNN*FLXJ(3)
00238             ENDIF
00239             YESNO(NSG)=.TRUE.
00240           ENDIF
00241         ENDDO
00242 !
00243       ENDDO
00244 !
00245       DEALLOCATE(YESNO)
00246 !
00247 !-----------------------------------------------------------------------
00248 !
00249       RETURN
00250       END

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