TABLE OF CONTENTS


PHY/sources(w, s,
iordre, dt) [ Modules ]

[ Top ] [ Modules ]

NOM

 source

DESCRIPTION

 Calcul des termes source du modele physique 
 Calculation of the physics model source terms 
 
    ENTREES / INPUT
    w :  état / state
    iordre: ordre du schema en espace / order of the scheme in space

    SORTIES / OUTPUT
    s : un vecteur de taille nvar avec le terme source / a vector of size nvar with the source term

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(inout)                :: w !! Variables d etat / State variables
  type(vect_nvar),intent(out)               :: s  
!!un vecteur de taille nvar avec le terme source / a vector of size nvar with the source term
  integer,intent(in)                        :: iordre !!ordre du schema en espace / order of the scheme in space
  
  real(kind=kind(0.d0))                     :: gxphi,gyphi,gzphi
!=========================== DEBUT DU CODE EXECUTABLE ==================
! Initialisations
  s%v=0.d0

  SELECT CASE (imodel_phy)

      !----------------------------------------------------
      CASE (2) ! bifluide isotherme   
          if(pes_xyz.ne.0)s%v(pes_xyz+1)=gpes_phy*w%vprim%v(1)
 
          IF (iordre.eq.2) then
                gxphi=(w%gprim(1)%v(5)/c_phy/c_phy-w%gprim(1)%v(1))/(rho0W_phy-rho0A_phy)
                gyphi=(w%gprim(2)%v(5)/c_phy/c_phy-w%gprim(2)%v(1))/(rho0W_phy-rho0A_phy)
                gzphi=(w%gprim(3)%v(5)/c_phy/c_phy-w%gprim(3)%v(1))/(rho0W_phy-rho0A_phy)
                 
                s%v(5)=w%vprim%v(2)*gxphi+w%vprim%v(3)*gyphi+w%vprim%v(4)*gzphi
          END IF
      !----------------------------------------------------

      !---------------------------------------------------
      CASE (1) ! Saint Venant
          IF(iordre.eq.2)THEN
              s%v(2)=gpes_phy*w%vprim%v(1)*w%gprim(1)%v(5)
              s%v(3)=gpes_phy*w%vprim%v(1)*w%gprim(2)%v(5)
          ENDIF

      !---------------------------------------------------
       CASE DEFAULT
          call print_err('SOURCES',' Physical model not defined')

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