TABLE OF CONTENTS


PHY/fluxnumnoncons [ Modules ]

[ Top ] [ Modules ]

NOM

 fluxnumnoncons(wL,wR,vn,fluxnc,itypflux)

DESCRIPTION

 Calcul du flux numerique non conservatif
 Calculation of non-conservative numerical flux
 
    ENTREES / INPUT
 wL   : objet de type "state" Etat de la partie gauche / left state
 wR   : objet de type "state" Etat de la partie droite / right state
 vn   : objet de type "vect_3", normale a la face / normal vector to the face
 itypflux   : type de flux / type of flux

    SORTIES / OUTPUT
 fluxnc : objet de type "vect_nvar", flux non conservatif
 c est a dire que fluxnc(-vn) n est pas egal a -fluxnc(vn)
 / non-conservative flux, i.e. fluxnc(-vn) is not equal to -fluxnc(vn)

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
  type(state), intent(in)            :: wL,wR !! Etat gauche et droit / left and right state 
  type(vect_3),intent(in)            :: vn !! Vecteur normal a la face / Normal vector to the face
  type(vect_nvar),intent(out)        :: fluxnc !! flux non conservatif / non-conservative flux
  integer                            :: itypflux !! type de flux / type of flux
  
  type(vect_3)                       :: uL,uR
  real(kind=kind(0.d0))              :: unL,unR,hL,zL,zR,hL_reco
  integer                            :: iphi
!=========================== DEBUT DU CODE EXECUTABLE ==================
!-------  Initialisations
  fluxnc%v=0

  IF (imodel_phy.eq.2) iphi=5 ! isotherme bifluide  6 variables
  IF (imodel_phy.eq.2) THEN
      SELECT CASE (itypflux)
      
          CASE (0) ! rusanov
              uL%v(1)=wL%vprim%v(2)
              uL%v(2)=wL%vprim%v(3)
              uL%v(3)=wL%vprim%v(4)
              unL=uL%v(1)*vn%v(1)+uL%v(2)*vn%v(2)+uL%v(3)*vn%v(3)
            
              uR%v(1)=wR%vprim%v(2)
              uR%v(2)=wR%vprim%v(3)
              uR%v(3)=wR%vprim%v(4)
              unR=uR%v(1)*vn%v(1)+uR%v(2)*vn%v(2)+uR%v(3)*vn%v(3)
            
              fluxnc%v(iphi)=unL*0.5d0*(wR%vbal%v(iphi)-wL%vbal%v(iphi))
            
          CASE (1) !godunov
            fluxnc%v(iphi) =min(0.d0,vi_phy) *(wR%vbal%v(iphi)-wL%vbal%v(iphi))
      
      END SELECT
  END IF

! Cas du modele de Saint Venant : on rajoute les termes necessaires a la reconstruction hydrostatique
! si la bathymetrie est nulle le flux non conservatif est nul
  IF (imodel_phy.eq.1) THEN
     hL=wL%vprim%v(1)
     zL=wL%vprim%v(5)
     zR=wR%vprim%v(5)

     IF(hL.LE.hzero_phy)hL=0.d0
     hL_reco=max(0.d0,hL+zL-max(zL,zR))
     IF(hL_reco.LE.hzero_phy)hL_reco=0.d0
     
     fluxnc%v(1)=0.d0
     fluxnc%v(2)= gpes_phy*vn%v(1)*(hL**2-hL_reco**2)/2.d0
     fluxnc%v(3)= gpes_phy*vn%v(2)*(hL**2-hL_reco**2)/2.d0
     fluxnc%v(4)=0.d0
     fluxnc%v(5)=0.d0
  ENDIF
  
!===========================   FIN DE LA ROUTINE    ====================
END SUBROUTINE fluxnumnoncons