Hi everyone,
I’ve some questions about the subroutine prosou.f.
In my case I’ve a set of sources, one is supposed to have a positive discharge (which is managed with the source file) and for the other I want the discharge to be function of the depth in such a way water which reach these source point is totally “absorbed” (like in a bathtub with multiple water outlet).
Thanks to some other subjects on this forum, I found that I can manage discharge thanks to the subroutine prosou.f
First i think the part i need to modify is this one and especially the part concerning the continuity equation ?
!
! SOURCES
!
IF(NREJET.GT.0) THEN
!
YASMH = .TRUE.
!
! SOURCE TERMS IN THE CONTINUITY EQUATION
! BEWARE, SMH IS ALSO USED FOR TRACER
!
DO I = 1 , NREJET
IR = ISCE(I)
! THE TEST IS USEFUL IN PARALLEL MODE, WHEN THE POINT SOURCE
! IS NOT IN THE SUB-DOMAIN
IF(IR.GT.0) THEN
IF(OPTSOU.EQ.1) THEN
! "NORMAL" VERSION
SMH%R(IR)=SMH%R(IR)+DSCE(I)*UNSV2D%R(IR) !! Here, if type of source is 1
ELSE
! "DIRAC" VERSION
SMH%R(IR)=SMH%R(IR)+DSCE(I) !! Here, if type of source is 2
ENDIF
ENDIF
ENDDO
!
! SOURCE TERMS IN THE MOMENTUM EQUATIONS
! EXPLICIT TREATMENT OF MOMENTUM CONTRIBUTIONS TO THE SOURCES
!
IF(NREJEU.GT.0) THEN
DO I = 1 , NREJEU
IR = ISCE(I)
! THE TEST IS USEFUL IN PARALLEL MODE, WHEN THE POINT SOURCE
! IS NOT IN THE SUB-DOMAIN
IF(IR.GT.0) THEN
! MOMENTUM ADDED BY THE SOURCE
! - MOMENTUM TAKEN BY THE SOURCE
FU%R(IR)=FU%R(IR) + (VUSCE(AT,I)-UN%R(IR))*
& DSCE(I)*UNSV2D%R(IR)/MAX(HN%R(IR),0.1D0)
FV%R(IR)=FV%R(IR) + (VVSCE(AT,I)-VN%R(IR))*
& DSCE(I)*UNSV2D%R(IR)/MAX(HN%R(IR),0.1D0)
ENDIF
ENDDO
ENDIF
!
ENDIF
The first thing I did was to introduce a new "IF bloc" to separate the two cases:
IF(DSCE(I).LT.0) THEN ! Water outlets are identified by negative values in the source file
! EXPRESSION
ELSE
SMH%R(IR)=SMH%R(IR)+DSCE(I) ! or SMH%R(IR)=SMH%R(IR)+DSCE(I)*UNSV2D%R(IR) depending of the source type.
ENDIF
Like this, water inlet is read in the source file, and i need to add a mathematical expression for water outlet.
The question is which one ?
Many variables are available in this subroutine like : HN (depth at time TN), UN and VN (speed along x and y axes ?), ...
So i wonder if you have any idea to prescribe discharge function of water depth ?
Thanks for your help !