TABLE OF CONTENTS


PHY/USER/fct_iniw [ Modules ]

[ Top ] [ Modules ]

NOM

 fct_iniw(x,y,z,vprim,ifct)

DESCRIPTION

 Initialisation des variables primitives d une cellule par une fonction utilisateur

 Initialisation of primitive variables in a cell by a user function
 
    ENTREES / INPUT
    x,y,z : coordonnees / coordinates
    ifct  : numero de la fonction definissant les variables primitives 
          / number of the function defining the primitive variables
    
    SORTIES / OUTPUT
    vprim     : variables primitives / primitive variables
 modele bifluide : densite,vitesse suivant x,y,z, pression
 / two-fluid model: density, velocity along x,y,z, pressure
 modele St-Venant: hauteur d eau,vitesse suivant x,y
 /St-Venant model: water height, velocity along x,y

SOURCE

! Ce logiciel est regi par la licence [CeCILL-B]
! This software is governed by the [CeCILL-B] license
!=========================== DEBUT DES DECLARATIONS ====================
!.1-----  Implicit, Use
   use phy_typ
   IMPLICIT NONE
!.2-----  Declaration
   real(kind=kind(0.d0)), intent(in)    :: x,y,z !!coordonnees / coordinates
   type(vect_nvar) , intent(out)        :: vprim !!variables primitives / Primitive variables
   integer                              :: ifct !!numero de la fonction / Function number

   real(kind=kind(0.d0))                :: r,u,v,w,p
   real(kind=kind(0.d0))                :: h,zb
!=========================== DEBUT DU CODE EXECUTABLE ==================
r=0.d0;u=0.d0;v=0.d0;w=0.d0;p=0.d0*x*y*z
h=0.d0;zb=0.d0
vprim%v=0.d0

   SELECT CASE (ifct)

! ====== Bump   -------------------------------------
    CASE(1)
      !vprim%v(1)=0.66d0
      vprim%v(1)=0.33d0
      IF(x.gt.8.D0 .and. x.lt.12.d0)then
         zb=0.2d0-0.05d0*(x-10.d0)**2
         !vprim%v(1)=0.66d0-zb
         vprim%v(1)=0.33d0-zb
      ENDIF
! ====== Drop of water   -------------------------------------
    CASE(2)
      vprim%v(1)=1.d0
      vprim%v(5)=1.d5
      IF(y.le.0.007)then
        vprim%v(1)=1000.d0
        vprim%v(5)=1.d5+1000.d0*9.81d0*(0.007d0-y)
      ENDIF
      if(((x-0.045d0)**2+(y-0.1546d0)**2).le.0.00155d0**2)then
        vprim%v(1)=1000.d0
      endif
 ! ====== Drop of water 3D ------------------------------------
    CASE(3)
      vprim%v(1)=1.d0
      vprim%v(5)=1.d5
      IF(z.le.0.007)then
        vprim%v(1)=1000.d0
        vprim%v(5)=1.d5+1000.d0*9.81d0*(0.007d0-z)
      ENDIF
      if((x**2+y**2+(z-0.1546d0)**2).le.0.00155d0**2)then
        vprim%v(1)=1000.d0
      endif
     
    CASE DEFAULT
      call print_err('fct_iniw', 'No user function defined')

   END SELECT
!===========================   FIN DE LA ROUTINE    ====================
END SUBROUTINE fct_iniw