dragfo.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\dragfo.f
00002 !
00083                      SUBROUTINE DRAGFO
00084 !                    *****************
00085 !
00086      &(FUDRAG,FVDRAG)
00087 !
00088 !***********************************************************************
00089 ! TELEMAC2D   V6P2                                   21/08/2010
00090 !***********************************************************************
00091 !
00092 !
00093 !
00094 !
00095 !
00096 !
00097 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00098 !| FUDRAG         |<--| DRAG FORCE ALONG X
00099 !| FVDRAG         |<--| DRAG FORCE ALONG Y
00100 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00101 !
00102       USE BIEF
00103       USE DECLARATIONS_TELEMAC2D
00104 !
00105       IMPLICIT NONE
00106       INTEGER LNG,LU
00107       COMMON/INFO/LNG,LU
00108 !
00109 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00110 !
00111       TYPE(BIEF_OBJ), INTENT(INOUT) :: FUDRAG,FVDRAG
00112 !
00113 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00114 !
00115       INTEGER IELEM,I,I4,NSOM,DISCLIN
00116       DOUBLE PRECISION UNORM,AIRE,SOM,XSOM(4),YSOM(4),X4,Y4
00117 !     DOUBLE PRECISION, PARAMETER :: CD=1.56D0,DIAM=2.D0
00118       DOUBLE PRECISION, PARAMETER :: CD=1.34D0,DIAM=2.D0
00119       INTEGER, PARAMETER :: N=1
00120 !
00121       DOUBLE PRECISION P_DSUM
00122       EXTERNAL         P_DSUM
00123 !
00124 !-----------------------------------------------------------------------
00125 !
00126 !     COMPUTES THE MASSE INTEGRALS
00127 !
00128       CALL VECTOR (T1,'=','MASBAS          ',UN%ELM,1.D0,
00129      &             S,S,S,S,S,S,MESH,.FALSE.,S)
00130 !
00131       CALL CPSTVC(UN,FUDRAG)
00132       CALL CPSTVC(VN,FVDRAG)
00133       CALL OS('X=C     ',FUDRAG,FUDRAG,FUDRAG,0.D0)
00134       CALL OS('X=C     ',FVDRAG,FVDRAG,FVDRAG,0.D0)
00135 !
00136 !-----------------------------------------------------------------------
00137 !
00138 !     EXAMPLE : DRAGFORCE IS SET IN A QUADRILATERAL DEFINED BY
00139 !               4 NODES
00140 !     SURFACE OF 20 X 40 CENTERED ON (0,0)
00141 !
00142       NSOM = 4
00143       XSOM(1) = -10.D0
00144       XSOM(2) =  10.D0
00145       XSOM(3) =  10.D0
00146       XSOM(4) = -10.D0
00147       YSOM(1) = -21.D0
00148       YSOM(2) = -21.D0
00149       YSOM(3) =  21.D0
00150       YSOM(4) =  21.D0
00151 !
00152 !--------------------------------------------------------------
00153 !
00154 !     P1 POINTS
00155 !
00156       AIRE=0.D0
00157       DO I=1,BIEF_NBPTS(11,MESH)
00158 !
00159         IF(INPOLY(X(I),Y(I),XSOM,YSOM,NSOM)) THEN
00160           UNORM = SQRT(UN%R(I)**2+VN%R(I)**2)
00161           FUDRAG%R(I) =  - 0.5D0 * N * DIAM * CD * UNORM
00162           FVDRAG%R(I) =  - 0.5D0 * N * DIAM * CD * UNORM
00163           AIRE = AIRE + T1%R(I)
00164         ENDIF
00165 !
00166       ENDDO
00167 !
00168 !     QUASI-BUBBLE POINTS
00169 !
00170       IF(FU%ELM.EQ.12) THEN
00171 !
00172         DISCLIN=11
00173         CALL CHGDIS(FUDRAG,DISCLIN,12,MESH)
00174         CALL CHGDIS(FVDRAG,DISCLIN,12,MESH)
00175 !
00176         DO IELEM = 1 , NELEM
00177           I4=IKLE%I(IELEM+3*NELMAX)
00178           X4=(X(IKLE%I(IELEM         ))+
00179      &        X(IKLE%I(IELEM+  NELMAX))+
00180      &        X(IKLE%I(IELEM+2*NELMAX)))/3.D0
00181           Y4=(Y(IKLE%I(IELEM         ))+
00182      &        Y(IKLE%I(IELEM+  NELMAX))+
00183      &        Y(IKLE%I(IELEM+2*NELMAX)))/3.D0
00184           IF(INPOLY(X4,Y4,XSOM,YSOM,NSOM)) AIRE = AIRE + T1%R(I4)
00185         ENDDO
00186 !
00187       ENDIF
00188 !
00189 !     IN PARALLEL THE AREA MAY BE SPLIT INTO SEVERAL SUB-DOMAINS
00190 !
00191       IF(NCSIZE.GT.0) AIRE=P_DSUM(AIRE)
00192 !
00193 !     NOW PREPARING THE DIVISION
00194 !
00195       IF(AIRE.GT.1.D-6) THEN
00196         SOM = 1.D0 / AIRE
00197       ELSE
00198         IF(LNG.EQ.1) WRITE(LU,*) 'DRAGFO : AIRE DE LA ZONE NULLE'
00199         IF(LNG.EQ.2) WRITE(LU,*) 'DRAGFO: AREA OF ZONE EQUAL TO ZERO'
00200         CALL PLANTE(1)
00201         STOP
00202       ENDIF
00203 !
00204 !     DIVIDING BY THE AREA
00205 !
00206       CALL OS('X=CX    ',X=FUDRAG,C=SOM)
00207       CALL OS('X=CX    ',X=FVDRAG,C=SOM)
00208 !
00209 !-----------------------------------------------------------------------
00210 !
00211       RETURN
00212       END

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