1
1
!-------------------------------------------------------------------------------
3
! This file is part of the Code_Saturne Kernel, element of the
4
! Code_Saturne CFD tool.
6
! Copyright (C) 1998-2009 EDF S.A., France
8
! contact: saturne-support@edf.fr
10
! The Code_Saturne Kernel is free software; you can redistribute it
11
! and/or modify it under the terms of the GNU General Public License
12
! as published by the Free Software Foundation; either version 2 of
13
! the License, or (at your option) any later version.
15
! The Code_Saturne Kernel is distributed in the hope that it will be
16
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
! GNU General Public License for more details.
20
! You should have received a copy of the GNU General Public License
21
! along with the Code_Saturne Kernel; if not, write to the
22
! Free Software Foundation, Inc.,
23
! 51 Franklin St, Fifth Floor,
24
! Boston, MA 02110-1301 USA
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.
26
21
!-------------------------------------------------------------------------------
28
23
subroutine dvvpst &
31
( idbia0 , idbra0 , nummai , numtyp , &
32
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
33
nnod , lndfac , lndfbr , ncelbr , &
34
nvar , nscal , nphas , nvlsta , nvisbr , &
27
nvar , nscal , nvlsta , nvisbr , &
35
28
ncelps , nfacps , nfbrps , &
36
nideve , nrdeve , nituse , nrtuse , &
37
itypps , ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
38
ipnfac , nodfac , ipnfbr , nodfbr , &
39
30
lstcel , lstfac , lstfbr , &
40
idevel , ituser , ia , &
41
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
42
31
dt , rtpa , rtp , propce , propfa , propfb , &
43
32
coefa , coefb , statce , stativ , statfb , &
44
tracel , trafac , trafbr , rdevel , rtuser , ra )
33
tracel , trafac , trafbr , &
45
36
!===============================================================================
54
45
!__________________.____._____.________________________________________________.
55
46
! name !type!mode ! role !
56
47
!__________________!____!_____!________________________________________________!
57
! idbia0 ! i ! <-- ! number of first free position in ia !
58
! idbra0 ! i ! <-- ! number of first free position in ra !
59
48
! nummai ! ec ! <-- ! numero du maillage post !
60
49
! numtyp ! ec ! <-- ! numero de type de post-traitement !
61
50
! ! ! ! (-1: volume, -2: bord, nummai par defaut) !
62
! ndim ! i ! <-- ! spatial dimension !
63
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
64
! ncel ! i ! <-- ! number of cells !
65
! nfac ! i ! <-- ! number of interior faces !
66
! nfabor ! i ! <-- ! number of boundary faces !
67
! nfml ! i ! <-- ! number of families (group classes) !
68
! nprfml ! i ! <-- ! number of properties per family (group class) !
69
! nnod ! i ! <-- ! number of vertices !
70
! lndfac ! i ! <-- ! size of nodfac indexed array !
71
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
72
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
73
51
! nvar ! i ! <-- ! total number of variables !
74
52
! nscal ! i ! <-- ! total number of scalars !
75
! nphas ! i ! <-- ! number of phases !
76
53
! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
77
54
! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
78
55
! ncelps ! e ! <-- ! nombre de cellules du maillage post !
79
56
! nfacps ! e ! <-- ! nombre de faces interieur post !
80
57
! nfbrps ! e ! <-- ! nombre de faces de bord post !
81
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
82
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
83
58
! itypps(3) ! te ! <-- ! indicateur de presence (0 ou 1) de !
84
59
! ! ! ! cellules (1), faces (2), ou faces de !
85
60
! ! ! ! de bord (3) dans le maillage post !
86
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
87
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
88
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
89
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
90
! iprfml ! ia ! <-- ! property numbers per family !
91
! (nfml, nprfml) ! ! ! !
92
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
93
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
94
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
95
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
96
61
! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
97
62
! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
98
63
! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
99
! idevel(nideve) ! ia ! <-> ! integer work array for temporary development !
100
! ituser(nituse) ! ia ! <-> ! user-reserved integer work array !
101
! ia(*) ! te ! --- ! macro tableau entier !
102
! xyzcen ! ra ! <-- ! cell centers !
103
! (ndim, ncelet) ! ! ! !
104
! surfac ! ra ! <-- ! interior faces surface vectors !
105
! (ndim, nfac) ! ! ! !
106
! surfbo ! ra ! <-- ! boundary faces surface vectors !
107
! (ndim, nfabor) ! ! ! !
108
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
109
! (ndim, nfac) ! ! ! !
110
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
111
! (ndim, nfabor) ! ! ! !
112
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
113
! (ndim, nnod) ! ! ! !
114
! volume ! tr ! <-- ! volume d'un des ncelet elements !
116
64
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
117
65
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
118
66
! (ncelet, *) ! ! ! (at current and previous time steps) !
141
87
! --- tableau de travail
142
88
!===============================================================================
90
!===============================================================================
92
!===============================================================================
112
!===============================================================================
146
!===============================================================================
148
!===============================================================================
167
!===============================================================================
171
integer idbia0 , idbra0
172
118
integer nummai , numtyp
173
integer ndim , ncelet , ncel , nfac , nfabor
174
integer nfml , nprfml
175
integer nnod , lndfac , lndfbr , ncelbr
176
integer nvar , nscal , nphas , nvlsta , nvisbr
119
integer nvar , nscal , nvlsta , nvisbr
177
120
integer ncelps , nfacps , nfbrps
178
integer nideve , nrdeve , nituse , nrtuse
180
122
integer itypps(3)
181
integer ifacel(2,nfac) , ifabor(nfabor)
182
integer ifmfbr(nfabor) , ifmcel(ncelet)
183
integer iprfml(nfml,nprfml)
184
integer ipnfac(nfac+1), nodfac(lndfac)
185
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
186
123
integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
187
integer idevel(nideve), ituser(nituse), ia(*)
189
double precision xyzcen(ndim,ncelet)
190
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
191
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
192
double precision xyznod(ndim,nnod), volume(ncelet)
193
125
double precision dt(ncelet), rtpa(ncelet,*), rtp(ncelet,*)
194
126
double precision propce(ncelet,*)
195
127
double precision propfa(nfac,*), propfb(nfabor,*)
206
137
character*32 namevr, namev1, namev2
207
138
character*80 name80
209
integer idebia, idebra, ifinia, ifinra
210
integer igradx, igrady, igradz
211
integer itravx, itravy, itravz, itreco
213
integer inc , iccocg, nswrgp, imligp, iwarnp, iphydp
140
integer inc , iccocg, nswrgp, imligp, iwarnp
214
141
integer isorva, isaut
215
integer ifac , iloc , iphas , ivar , iclvar
142
integer ifac , iloc , ivar , iclvar
216
143
integer ira , idivdt, ineeyp
217
144
integer ipp , idimt , ii , kk , iel
218
integer ivarl , iip , iph
219
146
integer iii, ivarl1 , ivarlm , iflu , ilpd1 , icla
220
147
integer iscal , ipcvsl, ipcvst, iflmab
221
integer idimte, itenso, ientla, ivarpr
148
integer ientla, ivarpr
223
149
integer ipccp , ipcrom
225
double precision cp0iph, xcp , xvsl , surfbn, distbr
151
double precision xcp , xvsl , srfbn, distbr
226
152
double precision visct , flumab, diipbx, diipby, diipbz
227
153
double precision epsrgp, climgp, extrap
228
154
double precision omgnrm, daxis2
229
156
double precision rbid(1)
158
double precision, allocatable, dimension(:,:) :: grad
159
double precision, allocatable, dimension(:) :: treco
232
161
!===============================================================================
163
! Initialize variables to avoid compiler warnings
237
170
!===============================================================================
238
171
! 1.1. TRAITEMENT POUR LE MAILLAGE FLUIDE
646
563
if(mod(ipstdv,ipstft).eq.0) then
651
if(iscalt(iphas).gt.0 .and. nscal.gt.0 .and. &
652
iscalt(iphas).le.nscal) then
661
write(namevr,2000)iphas
662
2000 format('Flux th. entrant W.m-2 Phase',I2.2)
664
NAMEVR = 'Flux thermique entrant W.m-2'
667
! Dimension de la variable (3 = vecteur, 1=scalaire)
670
! Numero de la variable
672
iscal = iscalt(iphas)
674
iclvar = iclrtp(ivar,icoef)
676
! Calcul des valeurs de la variable sur les faces de bord
678
! Reservation de la memoire pour reconstruction
683
igrady = igradx+ncelet
684
igradz = igrady+ncelet
685
itravx = igradz+ncelet
686
itravy = itravx+ncelet
687
itravz = itravy+ncelet
688
itreco = itravz+ncelet
689
ifinra = itreco+nfabor
691
! Verification de la disponibilite de la memoire
693
CALL IASIZE('DVVPST',IFINIA)
694
CALL RASIZE('DVVPST',IFINRA)
697
! Calcul du gradient de la temperature / enthalpie
700
! Pour calculer le gradient de Temperature
701
! - dans les calculs paralleles, il est necessaire que
702
! les cellules situees sur un bord de sous-domaine connaissent
703
! la valeur de temperature dans les cellules situees en
704
! vis-a-vis sur le sous-domaine voisin.
705
! - dans les calculs periodiques, il est necessaire que
706
! les cellules periodiques aient acces a la valeur de la
707
! temperature des cellules periodiques correspondantes
709
! Pour cela, il est necessaire d'appeler les routines de
710
! communication PARCOM (parallelisme) et PERCOM (periodicite)
711
! pour echanger les valeurs de temperature avant de calculer le
712
! gradient. L'appel a ces routines doit etre fait dans cet ordre
713
! PARCOM puis PERCOM (pour les cas ou parallelisme et periodicite
715
! En effet, on se situe ici a la fin du pas de temps n. Or,
716
! les variables RTP ne seront echangees qu'en debut du pas de
717
! temps n+1. Ici, seules les variables RTPA (obtenues a la fin
718
! du pas de temps n-1) ont deja ete echangees.
720
! Si le calcul n'est ni periodique, ni parallele, on peut conserver
721
! appels (les tests sur IPERIO et IRANGP assurent la generalite)
724
! Echange pour le parallelisme
728
call parcom (rtp(1,ivar))
733
! Echange pour la periodicite
741
( idimte , itenso , &
742
rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
743
rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
744
rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
753
nswrgp = nswrgr(ivar)
754
imligp = imligr(ivar)
755
iwarnp = iwarni(ivar)
756
epsrgp = epsrgr(ivar)
757
climgp = climgr(ivar)
758
extrap = extrag(ivar)
565
if(iscalt.gt.0 .and. nscal.gt.0 .and. &
566
iscalt.le.nscal) then
574
NAMEVR = 'Flux thermique entrant W.m-2'
576
! Dimension de la variable (3 = vecteur, 1=scalaire)
579
! Numero de la variable
583
iclvar = iclrtp(ivar,icoef)
585
! Calcul des valeurs de la variable sur les faces de bord
587
! Reservation de la memoire pour reconstruction
589
allocate(treco(nfabor))
591
! Calcul du gradient de la temperature / enthalpie
594
! Pour calculer le gradient de Temperature
595
! - dans les calculs paralleles, il est necessaire que
596
! les cellules situees sur un bord de sous-domaine connaissent
597
! la valeur de temperature dans les cellules situees en
598
! vis-a-vis sur le sous-domaine voisin.
599
! - dans les calculs periodiques, il est necessaire que
600
! les cellules periodiques aient acces a la valeur de la
601
! temperature des cellules periodiques correspondantes
603
! Pour cela, il est necessaire d'appeler les routines de
604
! de synchronisation des halos pour echanger les valeurs de temperature
605
! avant de calculer le gradient.
606
! En effet, on se situe ici a la fin du pas de temps n. Or,
607
! les variables RTP ne seront echangees qu'en debut du pas de
608
! temps n+1. Ici, seules les variables RTPA (obtenues a la fin
609
! du pas de temps n-1) ont deja ete echangees.
611
! Si le calcul n'est ni periodique, ni parallele, on peut conserver
612
! appels (les tests sur IPERIO et IRANGP assurent la generalite)
615
! Echange pour le parallelisme et la periodicite
617
if (irangp.ge.0.or.iperio.eq.1) then
618
call synsca(rtp(1,ivar))
763
( ifinia , ifinra , &
764
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
765
nnod , lndfac , lndfbr , ncelbr , nphas , &
766
nideve , nrdeve , nituse , nrtuse , &
767
ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
622
! Allocate a temporary array for the gradient calculation
623
allocate(grad(ncelet,3))
629
nswrgp = nswrgr(ivar)
630
imligp = imligr(ivar)
631
iwarnp = iwarni(ivar)
632
epsrgp = epsrgr(ivar)
633
climgp = climgr(ivar)
634
extrap = extrag(ivar)
638
( ivar , imrgra , inc , iccocg , nswrgp , imligp , &
768
639
iwarnp , nfecra , &
769
640
epsrgp , climgp , extrap , &
770
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
771
ipnfac , nodfac , ipnfbr , nodfbr , &
772
idevel , ituser , ia , &
773
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
774
ra(itravx) , ra(itravx) , ra(itravx) , &
775
641
rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
776
ra(igradx) , ra(igrady) , ra(igradz) , &
777
! ---------- ---------- ----------
778
ra(itravx) , ra(itravy) , ra(itravz) , &
779
rdevel , rtuser , ra )
782
! Calcul de la valeur reconstruite dans les cellules de bord
786
iii = idiipb-1+3*(ifac-1)
790
ra(itreco+ifac-1) = rtp(iel,ivar) &
791
+ diipbx*ra(igradx+iel-1) &
792
+ diipby*ra(igrady+iel-1) &
793
+ diipbz*ra(igradz+iel-1)
796
! Calcul du flux (ouf !) convectif et diffusif
798
if(ivisls(iscal).gt.0) then
799
ipcvsl = ipproc(ivisls(iscal))
803
ipcvst = ipproc(ivisct(iphas))
804
iflmab = ipprob(ifluma(ivar))
645
! Calcul de la valeur reconstruite dans les cellules de bord
649
diipbx = diipb(1,ifac)
650
diipby = diipb(2,ifac)
651
diipbz = diipb(3,ifac)
652
treco(ifac) = rtp(iel,ivar) &
653
+ diipbx*grad(iel,1) &
654
+ diipby*grad(iel,2) &
663
! Calcul du flux (ouf !) convectif et diffusif
665
if(ivisls(iscal).gt.0) then
666
ipcvsl = ipproc(ivisls(iscal))
670
ipcvst = ipproc(ivisct)
671
iflmab = ipprob(ifluma(ivar))
678
xvsl = propce(iel,ipcvsl)
684
visct = propce(iel,ipcvst)
685
flumab = propfb(ifac,iflmab)
687
trafbr(1 + (iloc-1)*idimt) = &
688
(xvsl+visct/sigmas(iscal))/max(distbr,epzero)* &
689
(coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0)* &
691
- flumab/max(srfbn,epzero**2)* &
692
(coefa(ifac,iclvar)+ coefb(ifac,iclvar)* &
697
! Pour la temperature, on multiplie par CP
698
if(abs(iscsth(iscal)).eq.1) then
806
704
do iloc = 1, nfbrps
807
705
ifac = lstfbr(iloc)
808
706
iel = ifabor(ifac)
811
xvsl = propce(iel,ipcvsl)
708
xcp = propce(iel,ipccp)
815
surfbn = ra(isrfbn-1+ifac)
816
distbr = ra(idistb-1+ifac)
817
visct = propce(iel,ipcvst)
818
flumab = propfb(ifac,iflmab)
820
trafbr(1 + (iloc-1)*idimt) = &
821
(xvsl+visct/sigmas(iscal))/max(distbr,epzero)* &
822
(coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0)* &
824
- flumab/max(surfbn,epzero**2)* &
825
(coefa(ifac,iclvar)+ coefb(ifac,iclvar)* &
712
trafbr(1 + (iloc-1)*idimt) &
713
= xcp*trafbr(1 + (iloc-1)*idimt)
830
! Pour la temperature, on multiplie par CP
831
if(abs(iscsth(iscal)).eq.1) then
832
if(icp(iphas).gt.0) then
833
ipccp = ipproc(icp (iphas))
842
xcp = propce(iel,ipccp)
846
trafbr(1 + (iloc-1)*idimt) &
847
= xcp*trafbr(1 + (iloc-1)*idimt)
851
! Valeurs entrelac�es, d�finies sur tableau de travail
855
call psteva(nummai, namevr, idimt, ientla, ivarpr, &
857
ntcabs, ttcabs, rbid, rbid, trafbr)
860
! Fin du test sur variable thermique
863
! Fin de boucle sur les phases
717
! Valeurs entrelac�es, d�finies sur tableau de travail
721
call psteva(nummai, namevr, idimt, ientla, ivarpr, &
723
ntcabs, ttcabs, rbid, rbid, trafbr)
726
! Fin du test sur variable thermique
866
! Fin du test sur sortie des flux thermiques
729
! Fin du test sur sortie des flux thermiques
868
731
! -- 1.2.4 TRAITEMENT DES EFFORTS AUX BORDS
869
732
! --------------------------------------
960
( ifinia , ifinra , &
961
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
962
nnod , lndfac , lndfbr , ncelbr , &
963
nvar , nscal , nphas , nvlsta , &
964
nideve , nrdeve , nituse , nrtuse , &
820
( nvar , nscal , nvlsta , &
965
821
ivarl , ivarl1 , ivarlm , iflu , ilpd1 , icla , &
966
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
967
ipnfac , nodfac , ipnfbr , nodfbr , &
968
idevel , ituser , ia , &
969
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
970
822
dt , rtpa , rtp , propce , propfa , propfb , &
971
coefa , coefb , statce , stativ , tracel , &
972
rdevel , rtuser , ra )
823
coefa , coefb , statce , stativ , tracel )
974
825
! La variable est deja definie sur le maillage volumique
975
826
! global ; on utilise donc l'indirection (donc IVARPR = 1)
1008
( ifinia , ifinra , &
1009
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
1010
nnod , lndfac , lndfbr , ncelbr , &
1011
nvar , nscal , nphas , nvlsta , &
1012
nideve , nrdeve , nituse , nrtuse , &
859
( nvar , nscal , nvlsta , &
1013
860
ivarl , ivarl1 , ivarlm , iflu , ilpd1 , icla , &
1014
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
1015
ipnfac , nodfac , ipnfbr , nodfbr , &
1016
idevel , ituser , ia , &
1017
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
1018
861
dt , rtpa , rtp , propce , propfa , propfb , &
1019
coefa , coefb , statce , stativ , tracel , &
1020
rdevel , rtuser , ra )
862
coefa , coefb , statce , stativ , tracel )
1022
864
! La variable est deja definie sur le maillage volumique
1023
865
! global ; on utilise donc l'indirection (donc IVARPR = 1)
1186
1028
.or. ippmod(ielarc).ge.1 &
1187
1029
.or. ippmod(ielion).ge.1) then
1192
iw2 = iw1 + ncelet*3
1193
ifinra = iw2 + ncelet*3
1195
CALL RASIZE ('DVVPST', IFINRA)
1200
( ifinia , ifinra , nummai , &
1201
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
1202
nnod , lndfac , lndfbr , ncelbr , &
1203
nvar , nscal , nphas , &
1204
1035
ncelps , nfacps , nfbrps , &
1205
nideve , nrdeve , nituse , nrtuse , &
1206
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
1207
ipnfac , nodfac , ipnfbr , nodfbr , &
1208
1036
lstcel , lstfac , lstfbr , &
1209
idevel , ituser , ia , &
1210
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
1211
1037
dt , rtpa , rtp , propce , propfa , propfb , &
1212
1038
coefa , coefb , &
1213
ra(iw1) , ra(iw2) , &
1214
tracel , trafac , trafbr , rdevel , rtuser , ra )
1039
tracel , trafac , trafbr )