1
!-------------------------------------------------------------------------------
3
! This file is part of Code_Saturne, a general-purpose CFD tool.
5
! Copyright (C) 1998-2011 EDF S.A.
7
! This program is free software; you can redistribute it and/or modify it under
8
! the terms of the GNU General Public License as published by the Free Software
9
! Foundation; either version 2 of the License, or (at your option) any later
12
! This program is distributed in the hope that it will be useful, but WITHOUT
13
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
! You should have received a copy of the GNU General Public License along with
18
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
!-------------------------------------------------------------------------------
23
subroutine cs_fuel_htconvers2 &
24
!============================
25
( mode , enthal , xsolid , temper )
27
!===============================================================================
30
! CALCUL DE LA TEMPERATURE DES PARTICULES
31
! EN FONCTION DE L'ENTHALPIE ET DES CONCENTRATIONS
33
! CALCUL DE L'ENTHALPIE DES PARTICULES
34
! EN FONCTION DE LA TEMPERATURE ET DES CONCENTRATIONS
36
!-------------------------------------------------------------------------------
38
!__________________.____._____.________________________________________________.
39
! name !type!mode ! role !
40
!__________________!____!_____!________________________________________________!
41
! mode ! e ! <-- ! -1 : t -> h ; 1 : h -> t !
42
! icla ! e ! <-- ! numero de la classe !
43
! enthal ! r ! <-- ! enthalpie massique j/kg !
44
! xsolid ! tr ! <-- ! fraction massique des constituants !
45
! temper ! r ! <-- ! temperature en kelvin !
46
!__________________!____!_____!________________________________________________!
47
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
48
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
49
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
50
! --- tableau de travail
51
!===============================================================================
53
!===============================================================================
55
!===============================================================================
69
!===============================================================================
77
double precision xsolid(2)
78
double precision temper , enthal
82
integer it , isol , ihflt2
84
double precision eh1 , eh0 , x2
86
!===============================================================================
90
if ( ihflt2.eq.0 ) then
92
!===============================================================================
93
! 2. H2 FONCTION LINEAIRE T2
94
!===============================================================================
96
if ( mode.eq.-1 ) then
98
! --> Loi temperature -> enthalpie (MODE = -1)
100
enthal = h02fol + cp2fol*(temper-trefth)
102
elseif ( mode.eq.1 ) then
104
! --> Loi enthalpie -> temperature (MODE = 1)
106
temper = (enthal-h02fol)/cp2fol + trefth
108
if ( temper .le. th(1) ) temper = th(1)
109
if ( temper .gt. th(npo) ) temper = th(npo)
113
write(nfecra,1000) mode
120
elseif( ihflt2.ne.0 ) then
122
!===============================================================================
124
!===============================================================================
126
if ( mode.eq.-1 ) then
128
! --> Loi temperature -> enthalpie (MODE = -1)
131
if ( temper.ge.thc(it) ) then
134
enthal = enthal + xsolid(isol)*ehsoli(isol,it)
140
if ( temper.le.thc(it) ) then
143
enthal = enthal + xsolid(isol)*ehsoli(isol,it)
151
if ( temper.le.thc(it) ) then
155
eh0 = eh0 + xsolid(isol)*ehsoli(isol,it-1)
156
eh1 = eh1 + xsolid(isol)*ehsoli(isol,it )
159
+ (eh1-eh0)*(temper-thc(it-1))/(thc(it)-thc(it-1))
165
elseif ( mode.eq.1 ) then
167
! --> Loi enthalpie -> temperature (MODE = 1)
172
eh1 = eh1 + xsolid(isol)*ehsoli(isol,it+1)
174
if ( enthal.ge.eh1 ) temper = thc(it+1)
179
eh0 = eh0 + xsolid(isol)*ehsoli(isol,it )
181
if ( enthal.le.eh0 ) temper = thc(it)
187
eh0 = eh0 + xsolid(isol)*ehsoli(isol,it )
188
eh1 = eh1 + xsolid(isol)*ehsoli(isol,it+1)
190
if ( enthal.ge.eh0 .and. enthal.le.eh1 ) &
191
temper = thc(it)+(enthal-eh0)*(thc(it+1)-thc(it))/(eh1-eh0)
197
write(nfecra,1000) mode
211
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
213
'@ @@ ATTENTION : ERREUR DANS CS_FUEL_HTCONVERS2 ',/,&
215
'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
216
'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
217
'@ IL VAUT ICI ',I10 ,/,&
219
'@ Le calcul ne peut etre execute. ',/,&
221
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&