clhuvt.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\clhuvt.f
00002 !
00083                      SUBROUTINE CLHUVT
00084 !                    *****************
00085 !
00086      &(NWEIRS,NPSING,NDGA1,NDGB1,ZDIG,X,Y,ZF,IOPTAN,UNORM,CHESTR,
00087      & NKFROT,KARMAN,T,NTRAC,H,UBOR,VBOR,TBOR,NBOR,
00088      & LIHBOR,LIUBOR,LIVBOR,LITBOR)
00089 !
00090 !***********************************************************************
00091 ! TELEMAC2D   V7P0                                   21/08/2010
00092 !***********************************************************************
00093 !
00094 !
00095 !
00096 !
00097 !
00098 !
00099 !
00100 !
00101 !
00102 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00103 !| CHESTR         |-->| FRICTION COEFFICIENT.
00104 !| H              |-->| WATER DEPTH.
00105 !| IOPTAN         |-->| OPTION FOR TANGENTIAL VELOCITIES.
00106 !| KARMAN         |-->| VON KARMAN CONSTANT.
00107 !| LIHBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON DEPTH
00108 !| LIUBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON VELOCITY
00109 !| LITBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON TRACERS
00110 !| NBOR           |-->| GLOBAL NUMBER OF BOUNDARY POINTS
00111 !| NKFROT         |-->| FRICTION LAW, PER POINT
00112 !| NPSING         |-->| NUMBER OF POINTS FOR EVERY SINGULARITY.
00113 !| NTRAC          |-->| NUMBER OF TRACERS
00114 !| NDGA1          |-->| NDGA1%ADR(I)%I(NP) : BOUNDARY NUMBER OF POINT NP
00115 !|                |   | OF WEIR I (side1)
00116 !| NDGB1          |-->| NDGB1%ADR(I)%I(NP) : BOUNDARY NUMBER OF POINT NP
00117 !|                |   | OF WEIR I (side2)
00118 !| NWEIRS         |-->| NUMBER OF SINGULARITIES
00119 !| T              |-->| BLOCK OF TRACERS.
00120 !| UBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON VELOCITY U
00121 !| VBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON VELOCITY V
00122 !| TBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON TRACER
00123 !| UNORM          |-->| NORM OF VELOCITY
00124 !| X              |-->| ABSCISSAE OF NODES
00125 !| Y              |-->| ORDINATES OF NODES
00126 !| ZDIG           |-->| ELEVATIONS OF POINTS OF WEIRS
00127 !| ZF             |-->| BOTTOM TOPOGRAPHY
00128 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00129 !
00130       USE BIEF
00131 !
00132       IMPLICIT NONE
00133       INTEGER LNG,LU
00134       COMMON/INFO/LNG,LU
00135 !
00136 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00137 !
00138       INTEGER, INTENT(IN)             :: NWEIRS,IOPTAN
00139       INTEGER, INTENT(IN)             :: NBOR(*),NKFROT(*)
00140       INTEGER, INTENT(INOUT)          :: LIUBOR(*),LIHBOR(*),LIVBOR(*)
00141       INTEGER, INTENT(IN)             :: NTRAC
00142       DOUBLE PRECISION, INTENT(IN)    :: X(*),Y(*),ZF(*),CHESTR(*),H(*)
00143       DOUBLE PRECISION, INTENT(IN)    :: UNORM(*)
00144       DOUBLE PRECISION, INTENT(INOUT) :: UBOR(*),VBOR(*)
00145       DOUBLE PRECISION, INTENT(IN)    :: KARMAN
00146       TYPE(BIEF_OBJ)  , INTENT(IN)    :: NPSING,NDGA1,NDGB1
00147       TYPE(BIEF_OBJ)  , INTENT(IN)    :: ZDIG
00148       TYPE(BIEF_OBJ)  , INTENT(INOUT) :: TBOR,LITBOR
00149       TYPE(BIEF_OBJ)  , INTENT(IN)    :: T
00150 !
00151 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00152 !
00153       INTEGER I,I0,I1,I2,K,N,N0,N1,N2,ITRAC
00154 !
00155       DOUBLE PRECISION DL,NX,NY,PENTE,CZ,HH,TX,TY,UTAN,XX
00156       DOUBLE PRECISION H0,H2,ZF0,ZF2,X0,X2,Y0,Y2,UNORM1,T1,T2
00157 !
00158       INTRINSIC ABS,SQRT,SIGN
00159 !
00160       DOUBLE PRECISION P_DMAX,P_DMIN
00161       EXTERNAL         P_DMAX,P_DMIN
00162 !
00163 !-----------------------------------------------------------------------
00164 !
00165 !     LOOPS ON THE HYDRAULIC STRUCTURES
00166 !
00167       DO N=1,NWEIRS
00168 !
00169 !       LOOPS ON THE CRESTS OF THE HYDRAULIC STRUCTURES
00170 !
00171         DO K=1,2
00172 !
00173 !         LOOPS ON THE NODES OF EACH CREST
00174 !
00175           DO I=1,NPSING%I(N)
00176 !
00177           IF(K.EQ.1) THEN
00178             I1=NDGA1%ADR(N)%P%I(I)
00179           ELSE
00180             I1=NDGB1%ADR(N)%P%I(I)
00181           ENDIF
00182 !
00183           IF(I.EQ.1) THEN
00184             I0=I1
00185             IF(K.EQ.1) THEN
00186               I2=NDGA1%ADR(N)%P%I(I+1)
00187             ELSE
00188               I2=NDGB1%ADR(N)%P%I(I+1)
00189             ENDIF
00190             XX=0.D0
00191           ELSEIF(I.LT.NPSING%I(N)) THEN
00192             IF(K.EQ.1) THEN
00193               I0=NDGA1%ADR(N)%P%I(I-1)
00194               I2=NDGA1%ADR(N)%P%I(I+1)
00195             ELSE
00196               I0=NDGB1%ADR(N)%P%I(I-1)
00197               I2=NDGB1%ADR(N)%P%I(I+1)
00198             ENDIF
00199             XX=1.D0
00200           ELSE
00201             IF(K.EQ.1) THEN
00202               I0=NDGA1%ADR(N)%P%I(I-1)
00203             ELSE
00204               I0=NDGB1%ADR(N)%P%I(I-1)
00205             ENDIF
00206             I2=I1
00207             XX=0.D0
00208           ENDIF
00209 !
00210           IF(I0.GT.0) THEN
00211             N0=NBOR(I0)
00212             X0=X(N0)
00213             Y0=Y(N0)
00214             H0=H(N0)
00215             ZF0=ZF(N0)
00216           ELSE
00217             X0=0.D0
00218             Y0=0.D0
00219             H0=0.D0
00220             ZF0=0.D0
00221           ENDIF
00222 !
00223           IF(I2.GT.0) THEN
00224             N2=NBOR(I2)
00225             X2=X(N2)
00226             Y2=Y(N2)
00227             H2=H(N2)
00228             ZF2=ZF(N2)
00229           ELSE
00230             X2=0.D0
00231             Y2=0.D0
00232             H2=0.D0
00233             ZF2=0.D0
00234           ENDIF
00235 !
00236           IF(NCSIZE.GT.1) THEN
00237             H0 =P_DMAX(H0)+P_DMIN(H0)
00238             H2 =P_DMAX(H2)+P_DMIN(H2)
00239             X0 =P_DMAX(X0)+P_DMIN(X0)
00240             X2 =P_DMAX(X2)+P_DMIN(X2)
00241             Y0 =P_DMAX(Y0)+P_DMIN(Y0)
00242             Y2 =P_DMAX(Y2)+P_DMIN(Y2)
00243             ZF0=P_DMAX(ZF0)+P_DMIN(ZF0)
00244             ZF2=P_DMAX(ZF2)+P_DMIN(ZF2)
00245           ENDIF
00246 !
00247 !         CALCULATES THE NORMAL VECTOR, OUTGOING CREST 1, ENTERING CREST 2
00248 !
00249           TX=X2-X0
00250           TY=Y2-Y0
00251           DL=SQRT(TX**2+TY**2)
00252           TX=TX/DL
00253           TY=TY/DL
00254           NX=-TY
00255           NY=TX
00256 !
00257 !         CALCULATES THE TANGENTIAL VELOCITY
00258 !
00259           IF(I1.GT.0) THEN
00260 !
00261           N1=NBOR(I1)
00262 !
00263           IF(IOPTAN.EQ.0) THEN
00264 !
00265              UTAN=0.D0
00266 !
00267           ELSEIF(IOPTAN.EQ.1) THEN
00268 !
00269 !            ONE TAKES THE HEIGHT ON THE CREST (TO BE DISCUSSED)
00270 !            HH = H(N1)
00271              HH = H(N1)+ZF(N1)-ZDIG%ADR(N)%P%R(I)
00272 !            LINE ADDED ON 23/11/2005 BY JMH (HH MAY BE NEGATIVE)
00273              HH=MAX(HH,0.D0)
00274              PENTE=(H0-H2+ZF0-ZF2)/DL
00275 !
00276              IF (NKFROT(N1).EQ.2) THEN
00277                 UTAN = CHESTR(N1)*SQRT(HH*ABS(PENTE))*SIGN(1.D0,PENTE)
00278              ELSEIF (NKFROT(N1).EQ.3) THEN
00279                 UTAN = CHESTR(N1)*HH**(2.D0/3.D0)*SQRT(ABS(PENTE))
00280      &                                           *SIGN(1.D0,PENTE)
00281              ELSEIF (NKFROT(N1).EQ.4) THEN
00282                 UTAN = HH**(2.D0/3.D0)*SQRT(ABS(PENTE))
00283      &                                *SIGN(1.D0,PENTE)/CHESTR(N1)
00284              ELSEIF (NKFROT(N1).EQ.5) THEN
00285                 HH   = MAX(HH,1.D-9)
00286               CZ = MAX(1.D-9,LOG(11.D0*HH/MAX(CHESTR(N1),1.D-9))/KARMAN)
00287                 UTAN = CZ*SQRT(HH*ABS(PENTE))*SIGN(1.D0,PENTE)
00288              ELSE
00289                 IF (LNG.EQ.1) THEN
00290                    WRITE(LU,*)'CLHUVT : OPTION INCONNUE :',NKFROT(N1)
00291                    WRITE(LU,*)'         POUR LA LOI DE FROTTEMENT'
00292                 ELSEIF(LNG.EQ.2) THEN
00293                    WRITE(LU,*)'CLHUVT : UNKNOWN OPTION:',NKFROT(N1)
00294                    WRITE(LU,*)'         FOR THE FRICTION LAW'
00295                 ENDIF
00296                 CALL PLANTE(1)
00297                 STOP
00298              ENDIF
00299 !            TO GET ZERO TANGENTIAL VELOCITIES IN THE CORNERS
00300              UTAN = XX*UTAN
00301           ELSE
00302              IF (LNG.EQ.1) THEN
00303                 WRITE(LU,*)'CLHUVT : OPTION INCONNUE :',IOPTAN
00304                 WRITE(LU,*)'         POUR LES VITESSES TANGENTIELLES'
00305              ELSEIF(LNG.EQ.2) THEN
00306                 WRITE(LU,*)'CLHUVT : UNKNOWN OPTION:',IOPTAN
00307                 WRITE(LU,*)'         FOR THE TANGENTIAL VELOCITY'
00308              ENDIF
00309              CALL PLANTE(1)
00310              STOP
00311           ENDIF
00312 !
00313 !         ONE CALCULATES VELOCITY COMPONENTS U AND V
00314 !         IN THE ORDINARY COORDINATE SYSTEM (X,Y).
00315 !
00316           UBOR(I1)=UTAN*TX+UNORM(I1)*NX
00317           VBOR(I1)=UTAN*TY+UNORM(I1)*NY
00318 !
00319           ENDIF
00320 !
00321       ENDDO ! I
00322       ENDDO ! K
00323 !
00324 !
00325 !-----------------------------------------------------------------------
00326 !
00327 !  TYPES OF CONDITIONS FOR THE DEPTH AND THE VELOCITY:
00328 !
00329       DO I=1,NPSING%I(N)
00330 !
00331         I1=NDGA1%ADR(N)%P%I(I)
00332         IF(I1.GT.0) THEN
00333           LIHBOR(I1)=4
00334           LIUBOR(I1)=6
00335           LIVBOR(I1)=6
00336           UNORM1=UNORM(I1)
00337         ELSE
00338           UNORM1=0.D0
00339         ENDIF
00340 !
00341         IF(NCSIZE.GT.1) THEN
00342           UNORM1 =P_DMAX(UNORM1)+P_DMIN(UNORM1)
00343         ENDIF
00344 !
00345         I2=NDGB1%ADR(N)%P%I(I)
00346         IF(I2.GT.0) THEN
00347           LIHBOR(I2)=4
00348           LIUBOR(I2)=6
00349           LIVBOR(I2)=6
00350         ENDIF
00351 !
00352 !       CORRECTION: SOLID WALL TYPE IF NORMAL VELOCITY IS ZERO
00353 !
00354         IF(ABS(UNORM1).LT.1.D-10) THEN
00355           IF(I1.GT.0) THEN
00356             LIHBOR(I1)=2
00357             LIUBOR(I1)=2
00358             LIVBOR(I1)=2
00359             IF(NTRAC.GT.0) THEN
00360               DO ITRAC=1,NTRAC
00361                 LITBOR%ADR(ITRAC)%P%I(I1)=2
00362               ENDDO
00363             ENDIF
00364           ENDIF
00365           IF(I2.GT.0) THEN
00366             LIHBOR(I2)=2
00367             LIUBOR(I2)=2
00368             LIVBOR(I2)=2
00369             IF(NTRAC.GT.0) THEN
00370               DO ITRAC=1,NTRAC
00371                 LITBOR%ADR(ITRAC)%P%I(I2)=2
00372               ENDDO
00373             ENDIF
00374           ENDIF
00375         ENDIF
00376 !
00377         IF(NTRAC.GT.0) THEN
00378           IF(UNORM1.LT.-1.D-8) THEN
00379 !           OUTGOING SPEED IN 1, ENTERING IN 2
00380             DO ITRAC=1,NTRAC
00381               IF(I1.GT.0) THEN
00382                 LITBOR%ADR(ITRAC)%P%I(I1)=4
00383                 T1=T%ADR(ITRAC)%P%R(NBOR(I1))
00384               ELSE
00385                 T1=0.D0
00386               ENDIF
00387               IF(NCSIZE.GT.1) THEN
00388                 T1=P_DMAX(T1)+P_DMIN(T1)
00389               ENDIF
00390               IF(I2.GT.0) THEN
00391                 LITBOR%ADR(ITRAC)%P%I(I2)=5
00392                 TBOR%ADR(ITRAC)%P%R(I2)=T1
00393               ENDIF
00394             ENDDO
00395           ELSEIF(UNORM1.GT.1.D-8) THEN
00396 !           OUTGOING SPEED IN 2, ENTERING IN 1
00397             DO ITRAC=1,NTRAC
00398               IF(I2.GT.0) THEN
00399                 LITBOR%ADR(ITRAC)%P%I(I2)=4
00400                 T2=T%ADR(ITRAC)%P%R(NBOR(I2))
00401               ELSE
00402                 T2=0.D0
00403               ENDIF
00404               IF(NCSIZE.GT.1) THEN
00405                 T2=P_DMAX(T2)+P_DMIN(T2)
00406               ENDIF
00407               IF(I1.GT.0) THEN
00408                 LITBOR%ADR(ITRAC)%P%I(I1)=5
00409                 TBOR%ADR(ITRAC)%P%R(I1)=T2
00410               ENDIF
00411             ENDDO
00412           ELSE
00413 !           ZERO VELOCITY
00414             DO ITRAC=1,NTRAC
00415               IF(I1.GT.0) LITBOR%ADR(ITRAC)%P%I(I1)=2
00416               IF(I2.GT.0) LITBOR%ADR(ITRAC)%P%I(I2)=2
00417             ENDDO
00418           ENDIF
00419         ENDIF
00420 !
00421       ENDDO ! I
00422 !
00423 !-----------------------------------------------------------------------
00424 !
00425 ! END OF THE LOOP ON THE CREST
00426 !
00427       ENDDO ! N
00428 !
00429 !-----------------------------------------------------------------------
00430 !
00431       RETURN
00432       END

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