hyd_hllc.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\hyd_hllc.f
00002 !
00058                         SUBROUTINE HYD_HLLC
00059 !                       *******************
00060 
00061      &(NS,NELEM,NSEG,NUBO,G,W,ZF,VNOCL,
00062      & X,Y,ELTSEG,CE,IFABOR)
00063 !
00064 !***********************************************************************
00065 ! TELEMAC 2D VERSION 6.3                                      01/07/2013
00066 !
00067 !***********************************************************************
00068 !
00069 !
00070 !
00071 !
00072 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00073 ! |  CE            |<-->|  FLUX  INCREMENTS AT INTERNAL FACES          |                          |
00074 ! |  ELTSEG        | -->|  SEGMENT NUMBERS PER ELEMENT                 |
00075 ! |  G             | -->|  GRAVITY                                     |
00076 ! |  NELEM         | -->|  NUMBER OF TOTAL ELEMENTS                    |
00077 ! |  NS            | -->|  NUMBER OF TOTAL MESH NODES                  |
00078 ! |  NSEG          | -->|  NUMBER OF TOTAL MESH EDGES                  |
00079 ! |  NUBO          ! -->!  GLOBAL NUMBER OF EDGE EXTREMITIES           |
00080 ! !  VNOCL         | -->|  OUTWARD UNIT NORMALS                        |
00081 ! !                |    |   (2 FIRST COMPONENTS) AND                   |
00082 ! !                |    |   SEGMENT LENGTH  (THIRD COMPONENT)          |
00083 ! |  W             | -->|  W(1,IS) = H,  W(2,IS)=U  ,W(3,IS)=V         |
00084 ! |  X,Y           | -->|  X AND Y COORDINATES                         |
00085 ! |  ZF            | -->|  BATHYMETRIES                                |
00086 ! !________________|____|______________________________________________|
00087 !
00088 !  MODE: -->( UNCHANGEABLE INPUT ),<--(OUTPUT),<-->(CHANGEABLE INPUT)
00089 !-----------------------------------------------------------------------
00090 !     - CALLING SUBROUTINE(S) : RESOLU
00091 !
00092 !***********************************************************************
00093 !
00094       USE BIEF_DEF
00095       IMPLICIT NONE
00096       INTEGER LNG,LU
00097       COMMON/INFO/LNG,LU
00098 !
00099 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00100 !
00101       INTEGER, INTENT(IN)             :: NS,NSEG,NELEM
00102       INTEGER, INTENT(IN)             :: NUBO(2,NSEG)
00103       INTEGER, INTENT(IN)             :: ELTSEG(NELEM,3)
00104       DOUBLE PRECISION, INTENT(IN)    :: ZF(NS),VNOCL(3,NSEG)
00105       DOUBLE PRECISION, INTENT(IN)    :: X(NS),Y(NS)
00106       DOUBLE PRECISION, INTENT(IN)    :: G,W(3,NS)
00107       DOUBLE PRECISION, INTENT(INOUT) :: CE(NS,3)
00108       INTEGER, INTENT(IN)             :: IFABOR(NELEM,3)
00109 !
00110 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00111 !
00112       INTEGER NSG,NUBO1,NUBO2,IVAR,IS,IDRY,I,IEL
00113 !
00114       DOUBLE PRECISION ZF1,ZF2,XNN,YNN,RNN
00115       DOUBLE PRECISION V21,V22,V31,V32
00116       DOUBLE PRECISION HIJ,PROD_SCAL
00117       DOUBLE PRECISION HJI,DZIJ,DZJI
00118       DOUBLE PRECISION HGZI,HGZJ,HDXZ1,HDYZ1,HDXZ2,HDYZ2
00119 !
00120       DOUBLE PRECISION H1,H2,EPS,FLX(4),DEMI
00121       LOGICAL          ROT
00122 !     XI = X/T, AT THE (X,T) DIAGRAM, WE COMPUTE THE FLUX AT XI = 0
00123       DOUBLE PRECISION,PARAMETER :: XI=0.D0
00124 !     PSI1 AND PSI2 ARE TRACER DENSITIES, MAKE ADAPTATION FOR TELEMAC
00125 !     NOT ADAPTED YET
00126       DOUBLE PRECISION           :: PSI1,PSI2
00127       LOGICAL   YESNO(NSEG)
00128 !
00129 !-----------------------------------------------------------------------
00130 !
00131       EPS=1.E-6
00132       DEMI=0.5D0
00133       ROT =.TRUE.
00134 !     NO TRACER UNTIL NOW ...
00135       PSI1 = 0.D0
00136       PSI2 = 0.D0
00137 !
00138 !-----------------------------------------------------------------------
00139 !
00140 ! INITIALIZATION OF CE
00141 !
00142       DO IS=1,3
00143         DO IVAR=1,NS
00144           CE(IVAR,IS) = 0.D0
00145         ENDDO
00146       ENDDO
00147 ! INITIALIZATION OF YESNO
00148       DO I=1,NSEG
00149         YESNO(I)=.FALSE.
00150       ENDDO
00151 !
00152 !-----------------------------------------------------------------------
00153 !
00154 !     LOOP OVER GLOBAL LIST OF EDGES
00155 !
00156       DO IEL=1,NELEM
00157         DO I = 1,3
00158           IF(.NOT.YESNO(ELTSEG(IEL,I)))THEN
00159             NSG = ELTSEG(IEL,I)
00160 !    INDICATOR FOR DRY CELLS
00161             IDRY=0
00162 !    INITIALIZATION
00163             FLX(1) = 0.D0
00164             FLX(2) = 0.D0
00165             FLX(3) = 0.D0
00166             FLX(4) = 0.D0
00167 !    RECUPERATE NODES OF THE EDGE WITH THE GOOD ORIENTATION
00168 !     WITH RESPECT TO THE NORMAL
00169             NUBO1 = NUBO(1,NSG)
00170             NUBO2 = NUBO(2,NSG)
00171             PROD_SCAL= ((X(NUBO2)-X(NUBO1))*VNOCL(1,NSG)+
00172      &                  (Y(NUBO2)-Y(NUBO1))*VNOCL(2,NSG))
00173             IF(PROD_SCAL.LT.0.D0)THEN
00174               NUBO1 = NUBO(2,NSG)
00175               NUBO2 = NUBO(1,NSG)
00176             ENDIF
00177 !           THEIR BATHYMETRIES
00178             ZF1 = ZF(NUBO1)
00179             ZF2 = ZF(NUBO2)
00180 !    NORMAL COORDINATES NX, NY AND SEGMENT LENGTH
00181             XNN = VNOCL(1,NSG)
00182             YNN = VNOCL(2,NSG)
00183             RNN = VNOCL(3,NSG)
00184 !    WATER DEPTH
00185             H1=W(1,NUBO1)
00186             H2=W(1,NUBO2)
00187 !
00188 !*****************************************************
00189 !    HYDROSTATIC RECONSTRUCTION
00190 !
00191             DZIJ = MAX(0.D0,ZF2-ZF1)
00192             HIJ  = MAX(0.D0,H1- DZIJ)
00193 !*****************************************************
00194 !    HYDROSTATIC RECONSTRUCTION
00195 !
00196             DZJI = MAX(0.D0,ZF1-ZF2)
00197             HJI  = MAX(0.D0,H2- DZJI)
00198 !*****************************************************
00199 !
00200 !    VELOCITY COMPONENTS
00201 !
00202             IF(H1.GT.EPS)THEN
00203               V21 = W(2,NUBO1)/H1
00204               V31 = W(3,NUBO1)/H1
00205             ELSE
00206               V21=0.D0
00207               V31=0.D0
00208               IDRY=IDRY+1
00209             ENDIF
00210 !
00211             IF(H2.GT.EPS)THEN
00212               V22 = W(2,NUBO2)/H2
00213               V32 = W(3,NUBO2)/H2
00214             ELSE
00215               V22=0.0D0
00216               V32=0.0D0
00217               IDRY=IDRY+1
00218             ENDIF
00219 !
00220 !       LOCAL FLUX COMPUTATION
00221 !       AT LEAST ONE WET CELL
00222 !
00223             IF(IDRY.LT.2)THEN
00224               CALL FLUX_HLLC(XI,HIJ,HJI,V21,V22,V31,V32,
00225      &                       PSI1,PSI2,XNN,YNN,ROT,FLX)
00226 !
00227 !*********************************************************
00228 !       GEOMETRIC SOURCE TERMS:HYDROSTATIC RECONSTRUCTION
00229 !*********************************************************
00230 !
00231               HGZI = 0.5D0*RNN*(HIJ+H1)*(HIJ-H1)
00232               HGZJ = 0.5D0*RNN*(HJI+H2)*(HJI-H2)
00233 !
00234               HDXZ1 = G*XNN*HGZI
00235               HDYZ1 = G*YNN*HGZI
00236 !
00237               HDXZ2 = G*XNN*HGZJ
00238               HDYZ2 = G*YNN*HGZJ
00239 !
00240 !FOR PARALLELISM
00241 !
00242               IF(NCSIZE.GT.1)THEN
00243                 IF(IFABOR(IEL,I).EQ.-2)THEN !THIS IS INTERFACE EDGE
00244                   ! DEMI=DEMI*SIGN(1.0D0,PROD_SCAL)
00245                   FLX(1)= DEMI*FLX(1)
00246                   FLX(2)= DEMI*FLX(2)
00247                   FLX(3)= DEMI*FLX(3)
00248 !                 FLX(4)= DEMI*FLX(4)
00249                   HDXZ1 = DEMI*HDXZ1
00250                   HDYZ1 = DEMI*HDYZ1
00251                   HDXZ2 = DEMI*HDXZ2
00252                   HDYZ2 = DEMI*HDYZ2
00253                 ENDIF
00254               ENDIF
00255 !
00256 !***********************************************************
00257 !
00258 !       FLUX INCREMENT
00259 !
00260               CE(NUBO1,1) = CE(NUBO1,1) - RNN*FLX(1)
00261               CE(NUBO1,2) = CE(NUBO1,2) - RNN*FLX(2) + HDXZ1
00262               CE(NUBO1,3) = CE(NUBO1,3) - RNN*FLX(3) + HDYZ1
00263 !
00264               CE(NUBO2,1) = CE(NUBO2,1) + RNN*FLX(1)
00265               CE(NUBO2,2) = CE(NUBO2,2) + RNN*FLX(2) - HDXZ2
00266               CE(NUBO2,3) = CE(NUBO2,3) + RNN*FLX(3) - HDYZ2
00267             ENDIF
00268 !
00269             YESNO(NSG)=.TRUE.
00270           ENDIF
00271         ENDDO
00272 !
00273       ENDDO
00274 !
00275 !-----------------------------------------------------------------------
00276 !
00277       RETURN
00278       END

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