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_coal_thfieldconv2 &
28
!===============================================================================
31
! CALCUL DE LA TEMPERATURE DES PARTICULES
32
! EN FONCTION DE L'ENTHALPIE DU SOLIDE ET DES CONCENTRATIONS
34
!__________________.____._____.________________________________________________.
35
! name !type!mode ! role !
36
!__________________!____!_____!________________________________________________!
37
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
38
! ncel ! i ! <-- ! number of cells !
39
! rtp ! tr ! <-- ! variables de calcul au centre des !
40
! (ncelet,*) ! ! ! cellules (instant courant) !
41
! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
42
! eh0 ! tr ! <-- ! tableau reel de travail !
43
! eh1 ! tr ! <-- ! tableau reel de travail !
44
!__________________!____!_____!________________________________________________!
45
! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
46
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
47
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
48
! --- tableau de travail
49
!===============================================================================
51
!==============================================================================
53
!==============================================================================
67
!===============================================================================
74
double precision rtp(ncelet,*), propce(ncelet,*)
78
integer i , icla , icha , icel
79
integer ipcte1 , ipcte2
81
double precision h2 , x2 , xch , xck
82
double precision xash , xnp , xtes , xwat
85
double precision , dimension ( : ) , allocatable :: eh0,eh1
87
!===============================================================================
88
! Methode de conversion
92
!===============================================================================
93
! 1. CALCULS PRELIMINAIRES
94
!===============================================================================
96
!===============================================================================
97
! Deallocation dynamic arrays
99
allocate(eh0(1:ncel),eh1(1:ncel),STAT=iok1)
102
write(nfecra,*) ' Memory allocation error inside: '
103
write(nfecra,*) ' cs_coal_thfieldconv2 '
106
!===============================================================================
108
! --- Initialisation des tableaux
112
! --- Initialisation de T2 a T1
114
ipcte1 = ipproc(itemp1)
116
ipcte2 = ipproc(itemp2(icla))
118
propce(icel,ipcte2) = propce(icel,ipcte1)
122
!===============================================================================
123
! 2. CALCUL DE LA TEMPERATURE DES PARTICULES
124
!===============================================================================
126
if ( ihflt2.eq.0 ) then
128
! --> H2 fonction lineaire de T2
131
ipcte2 = ipproc(itemp2(icla))
134
propce(icel,ipcte2) = &
135
(rtp(icel,isca(ih2(icla)))-h02ch(icha)) &
136
/ cp2ch(icha) + trefth
146
ipcte2 = ipproc(itemp2(icla))
150
xch = rtp(icel,isca(ixch(icla)))
151
xnp = rtp(icel,isca(inp(icla)))
152
xck = rtp(icel,isca(ixck(icla)))
153
xash = xmash(icla)*xnp
154
if ( ippmod(iccoal) .eq. 1 ) then
155
xwat = rtp(icel,isca(ixwt(icla)))
160
x2 = xch + xck + xash + xwat
162
if ( x2 .gt. epsicp*100.d0 ) then
164
h2 = rtp(icel,isca(ih2(icla)))/x2
166
xtes = xmp0(icla)*xnp
168
if ( xtes.gt.epsicp .and. x2.gt.epsicp*100.d0 ) then
169
eh1(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i+1) &
170
+ xck /x2 * ehsoli(ick(ichcor(icla) ),i+1) &
171
+ xash/x2 * ehsoli(iash(ichcor(icla)),i+1) &
172
+ xwat/x2 * ehsoli(iwat(ichcor(icla)),i+1)
173
if ( h2.ge.eh1(icel) ) then
174
propce(icel,ipcte2) = thc(i+1)
185
xch = rtp(icel,isca(ixch(icla)))
186
xnp = rtp(icel,isca(inp(icla)))
187
xck = rtp(icel,isca(ixck(icla)))
188
xash = xmash(icla)*xnp
189
if ( ippmod(iccoal) .eq. 1 ) then
190
xwat = rtp(icel,isca(ixwt(icla)))
195
x2 = xch + xck + xash + xwat
197
if ( x2 .gt. epsicp*100.d0 ) then
199
h2 = rtp(icel,isca(ih2(icla)))/x2
201
xtes = xmp0(icla)*xnp
203
if ( xtes.gt.epsicp .and. x2.gt.epsicp*100.d0 ) then
204
eh0(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i) &
205
+ xck /x2 * ehsoli(ick(ichcor(icla) ),i) &
206
+ xash/x2 * ehsoli(iash(ichcor(icla)),i) &
207
+ xwat/x2 * ehsoli(iwat(ichcor(icla)),i)
208
if ( h2.le.eh0(icel) ) then
209
propce(icel,ipcte2) = thc(i)
219
xch = rtp(icel,isca(ixch(icla)))
220
xnp = rtp(icel,isca(inp(icla)))
221
xck = rtp(icel,isca(ixck(icla)))
222
xash = xmash(icla)*xnp
223
if ( ippmod(iccoal) .eq. 1 ) then
224
xwat = rtp(icel,isca(ixwt(icla)))
229
x2 = xch + xck + xash + xwat
231
if ( x2 .gt. epsicp*100.d0 ) then
233
h2 = rtp(icel,isca(ih2(icla)))/x2
235
xtes = xmp0(icla)*xnp
237
if ( xtes.gt.epsicp .and. x2.gt.epsicp*100.d0 ) then
238
eh0(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i ) &
239
+ xck /x2 * ehsoli(ick(ichcor(icla) ),i ) &
240
+ xash/x2 * ehsoli(iash(ichcor(icla)),i ) &
241
+ xwat/x2 * ehsoli(iwat(ichcor(icla)),i )
243
eh1(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i+1) &
244
+ xck /x2 * ehsoli(ick(ichcor(icla) ),i+1) &
245
+ xash/x2 * ehsoli(iash(ichcor(icla)),i+1) &
246
+ xwat/x2 * ehsoli(iwat(ichcor(icla)),i+1)
248
if ( h2.ge.eh0(icel) .and. h2.le.eh1(icel) ) then
249
propce(icel,ipcte2) = thc(i) + (h2-eh0(icel)) * &
250
(thc(i+1)-thc(i))/(eh1(icel)-eh0(icel))
263
!===============================================================================
264
! Deallocation dynamic arrays
266
deallocate(eh0,eh1,STAT=iok1)
269
write(nfecra,*) ' Memory deallocation error inside: '
270
write(nfecra,*) ' cs_coal_thfieldconv2 '
273
!===============================================================================