The TELEMAC-MASCARET system  trunk
reaer_weir.f
Go to the documentation of this file.
1 ! **********************
2  SUBROUTINE reaer_weir
3 ! **********************
4 !
5  &(formrs,h1,h2,abrs,wattemp,eps,o2satu,trup,tn,ind_o2,ir)
6 !
7 !***********************************************************************
8 ! TELEMAC2D V7P1
9 !***********************************************************************
10 !
11 !brief COMPUTES THE REAERATION AT WEIRS
12 !
13 !warning: this is not a source term, this routine changes directly TN
14 ! questions:
15 ! 1- it changes TN at time tn while it has to be done in tn+1
16 ! 2- it affects the mass conservation !! to adapt bilant
17 !
18 !history R. ATA (LNHE)
19 !+ 02/09/2015
20 !+ V7P1
21 !+
22 !
23 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 !| ABRS |-->| COEFFICIENT A AND B USED IN RS FORMUL
25 !| EPS |-->| TO AVOID DIVISION BY 0
26 !| FORMRS |-->| WHICH FROMULA TO COMPUTE RS
27 !| H1,H2 |-->| WATER DEPTH UPSRTEAM AND DOWNSTREAM WEIR
28 !| IR |-->| NODE NUMBER (BELONGS TO WEIR DOWNSTREAM)
29 !| O2SATU |-->| O2 SATURATION DENSITY OF WATER (CS)
30 !| TN |<--| TRACER AT TIME tn
31 !| TRUP |-->| TRACER VALUE UPSTREAM WEIR
32 !| WATTEMP |-->| TEMPERATURE OF WATER
33 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 !
35  USE bief
38  USE interface_waqtel, ex_reaer_weir => reaer_weir
39 !
40  IMPLICIT NONE
41 !
42 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 !
44  INTEGER , INTENT(IN) :: FORMRS,IR
45  DOUBLE PRECISION, INTENT(IN) :: EPS,H1,H2,ABRS(2),WATTEMP
46  DOUBLE PRECISION, INTENT(IN) :: TRUP,O2SATU
47  INTEGER, INTENT(IN) :: IND_O2
48  TYPE(bief_obj) , INTENT(INOUT) :: TN
49  INTRINSIC abs
50 !
51 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 !
53 ! LOCAL VARIABLES
54  DOUBLE PRECISION DZ,RSW,TRDO,AB
55 !
56 !
57  dz= abs(h2-h1)
58  rsw = 0.d0
59 ! LETS'S COMPUTE RS IF IT IS NOT TAKEN CONSTANT
60  IF(formrs.NE.0) THEN
61  ab=abrs(1)*abrs(2)
62 ! GAMESON FORMULA 1
63  IF(formrs.EQ.1) THEN
64  rsw=1.d0+0.5d0*ab*dz
65 ! GAMESON FORMULA2
66  ELSEIF(formrs.EQ.2) THEN
67 ! BUG BEFORE V8P0, NOT RSW = 0.11*AB*...
68  rsw = 1.d0+0.36d0*ab*(1.d0+0.046d0*wattemp)*dz
69 ! WRL FORMULA 1 (NO NEED TO AB ? )
70  ELSEIF(formrs.EQ.3 )THEN
71  rsw = 1.d0+0.69d0*dz*(1.d0-0.11d0*dz )
72  & *( 1.d0+0.046d0*wattemp)
73 ! WRL FORMULA 2
74  ELSEIF (formrs.EQ.4)THEN
75  rsw = 1.d0+0.38d0*ab*dz*(1.d0-0.11d0*dz)
76  & * (1.d0+0.046d0*wattemp )
77  ELSE
78  WRITE(lu,*)'FORMULA FOR RS (WEIR REAERATION) '
79  WRITE(lu,*)' NOT VALID :',formrs
80  WRITE(lu,*)'POSSIBLE CHOICES ARE FROM 1 TO 4'
81  CALL plante(1)
82  stop
83  ENDIF
84 !
85 ! FORCING O2 DENSITY DOWNSTREAM THE WEIR
86 !
87  IF(abs(rsw).GT.eps)THEN
88  trdo = o2satu + (trup-o2satu)/rsw
89  ELSE
90  WRITE(lu,*)'REAER_WEIR:RSW VERY SMALL',rsw
91  CALL plante(1)
92  stop
93  ENDIF
94  IF(ncsize.GT.1)trdo = p_min(trdo)+p_max(trdo)
95 ! O2 PROCESS
96  tn%ADR(ind_o2)%P%R(ir)=trdo
97  ENDIF
98 !
99  RETURN
100  END
101 !
102 !-----------------------------------------------------------------------
103 !
subroutine reaer_weir(FORMRS, H1, H2, ABRS, WATTEMP, EPS, O2SATU, TRUP, TN, IND_O2, IR)
Definition: reaer_weir.f:7
Definition: bief.f:3