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
!-------------------------------------------------------------------------------
26
( ncelet , ncel , nfac , nfabor , &
27
iconvp , idiffp , ndircp , isym , nfecra , &
30
coefbu , cofbfu , fimp , flumas , flumab , viscf , viscb , &
33
!===============================================================================
37
! CONSTRUCTION DE LA MATRICE DE CONVECTION UPWIND/DIFFUSION/TS DE LA VITESSE
39
! IL EST INTERDIT DE MODIFIER FIMP ICI
42
!-------------------------------------------------------------------------------
44
!__________________.____._____.________________________________________________.
45
! name !type!mode ! role !
46
!__________________!____!_____!________________________________________________!
47
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
48
! ncel ! i ! <-- ! number of cells !
49
! nfac ! i ! <-- ! number of interior faces !
50
! nfabor ! i ! <-- ! number of boundary faces !
51
! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
52
! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
53
! ndircp ! e ! <-- ! indicateur = 0 si decalage diagonale !
54
! isym ! e ! <-- ! indicateur = 1 matrice symetrique !
55
! ! ! ! 2 matrice non symetrique !
56
! thetap ! r ! <-- ! coefficient de ponderation pour le !
57
! ! ! ! theta-schema (on ne l'utilise pour le !
58
! ! ! ! moment que pour u,v,w et les scalaire !
59
! ! ! ! - thetap = 0.5 correspond a un schema !
60
! ! ! ! totalement centre en temps (mixage !
61
! ! ! ! entre crank-nicolson et adams- !
63
! ifacel(2,nfac) ! te ! <-- ! no des elts voisins d'une face intern !
64
! ifabor(nfabor) ! te ! <-- ! no de l'elt voisin d'une face de bord !
65
! coefbu(3,3,nfabor! tr ! <-- ! tab b des cl pour la vitesse !
66
! cofbfu(3,3,nfabor! tr ! <-- ! tab b des cl de flux pour la vitesse !
67
! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
68
! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
69
! viscf(nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
70
! viscb(nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
71
! da (3,3,ncelet) ! tr ! --> ! partie diagonale de la matrice !
72
! xa (*,nfac) ! tr ! --> ! extra interleaved diagonale de la matrice !
73
!__________________!____!_____!________________________________________________!
75
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
76
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
77
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
78
! --- tableau de travail
79
!===============================================================================
81
!===============================================================================
83
!===============================================================================
87
!===============================================================================
93
integer ncelet , ncel , nfac , nfabor
94
integer iconvp , idiffp , ndircp , isym
96
double precision thetap
98
integer ifacel(2,nfac), ifabor(nfabor)
99
double precision coefbu(3,3,nfabor), fimp(3,3,ncelet), cofbfu(3,3,nfabor)
100
double precision flumas(nfac), flumab(nfabor)
101
double precision viscf(nfac), viscb(nfabor)
102
double precision da(3,3,ncelet),xa(isym,nfac)
106
integer ifac,ii,jj,iel, isou, jsou
107
double precision flui,fluj,epsi
109
!===============================================================================
111
!===============================================================================
113
!===============================================================================
115
if(isym.ne.1.and.isym.ne.2) then
116
write(nfecra,1000) isym
125
da(isou,jsou,iel) = fimp(isou,jsou,iel)
129
if(ncelet.gt.ncel) then
130
do iel = ncel+1, ncelet
133
da(isou,jsou,iel) = 0.d0
150
!===============================================================================
151
! 2. CALCUL DES TERMES EXTRADIAGONAUX
152
!===============================================================================
157
flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
158
fluj =-0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
159
xa(1,ifac) = thetap*(iconvp*flui -idiffp*viscf(ifac))
160
xa(2,ifac) = thetap*(iconvp*fluj -idiffp*viscf(ifac))
166
flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
167
xa(1,ifac) = thetap*(iconvp*flui -idiffp*viscf(ifac))
172
!===============================================================================
173
! 3. CONTRIBUTION DES TERMES X-TRADIAGONAUX A LA DIAGONALE
174
!===============================================================================
182
da(isou,isou,ii) = da(isou,isou,ii) -xa(2,ifac)
183
da(isou,isou,jj) = da(isou,isou,jj) -xa(1,ifac)
194
da(isou,isou,ii) = da(isou,isou,ii) -xa(1,ifac)
195
da(isou,isou,jj) = da(isou,isou,jj) -xa(1,ifac)
201
!===============================================================================
202
! 4. CONTRIBUTION DES FACETTES DE BORDS A LA DIAGONALE
203
!===============================================================================
207
flui = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
208
fluj =-0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
211
if(isou.eq.jsou) then
212
da(isou,jsou,ii) = da(isou,jsou,ii) + thetap*( &
213
iconvp*(-fluj + flui*coefbu(isou,jsou,ifac) ) &
214
+idiffp*viscb(ifac)*(1.d0-cofbfu(isou,jsou,ifac)) &
217
da(isou,jsou,ii) = da(isou,jsou,ii) + thetap*( &
218
iconvp*( flui*coefbu(isou,jsou,ifac) ) &
219
+idiffp*viscb(ifac)*(-cofbfu(isou,jsou,ifac)) &
227
!===============================================================================
228
! 5. NON PRESENCE DE PTS DIRICHLET --> LEGER RENFORCEMENT DE LA
229
! DIAGONALE POUR DECALER LE SPECTRE DES VALEURS PROPRES
230
!===============================================================================
231
! (si IDIRCL=0, on a force NDIRCP a valoir au moins 1 pour ne pas
232
! decaler la diagonale)
234
if ( ndircp.le.0 ) then
237
da(isou,isou,iel) = (1.d0+epsi)*da(isou,isou,iel)
246
#if defined(_CS_LANG_FR)
250
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
252
'@ @@ ATTENTION : ARRET DANS matrxv ',/,&
254
'@ APPEL DE matrxv AVEC ISYM = ',I10 ,/,&
256
'@ Le calcul ne peut pas etre execute. ',/,&
258
'@ Contacter l''assistance. ',/,&
260
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
267
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
269
'@ @@ WARNING: ABORT IN matrxv' ,/,&
271
'@ matrxv CALLED WITH ISYM = ',I10 ,/,&
273
'@ The calculation will not be run.' ,/,&
275
'@ Contact support.' ,/,&
277
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&