Télécharger konjr1.eso

Retour à la liste

Numérotation des lignes :

konjr1
  1. C KONJR1 SOURCE OF166741 24/12/13 21:16:42 12097
  2. SUBROUTINE KONJR1(ILINC,IRN,IUN,IPN,IGAMN,INORM,ICHPVO
  3. $ ,ICHPSU,IUINF,IUPRI,MELEMC,MELEFE,MELLIM,IMAT)
  4. C
  5. C************************************************************************
  6. C
  7. C PROJET : CASTEM 2000
  8. C
  9. C NOM : KONJR1
  10. C
  11. C DESCRIPTION : Voir KON12
  12. C Calcul du jacobien du résidu pour la méthode
  13. C RUSANOLM (CENTERED + diff. num)
  14. C
  15. C Cas deux dimensions, gaz "calorically perfect"
  16. C
  17. C LANGAGE : FORTRAN 77 + ESOPE 2000 (avec estensions CISI)
  18. C
  19. C AUTEUR : A. BECCANTINI, DRN/DMT/SEMT/LTMF
  20. C
  21. C************************************************************************
  22. C
  23. C
  24. C APPELES (Outils
  25. C CASTEM) : KRIPAD, LICHT, ERREUR
  26. C
  27. C APPELES (Calcul) : CENTJ0, CENTJ2, FRBM1
  28. C
  29. C************************************************************************
  30. C
  31. C ENTREES
  32. C
  33. C ILINC : liste des inconnues (pointeur d'un objet de type LISTMOTS)
  34. C
  35. C 1) Pointeurs des CHPOINT
  36. C
  37. C IRN : CHPOINT CENTRE contenant la masse volumique ;
  38. C
  39. C IUN : CHPOINT CENTRE contenant la vitesse ;
  40. C
  41. C IPN : CHPOINT CENTRE contenant la pression ;
  42. C
  43. C IGAMN : CHPOINT CENTRE contenant le gamma ;
  44. C
  45. C INORM : CHPOINT FACE contenant les normales aux faces ;
  46. C
  47. C ICHPVO : CHPOINT VOLUME contenant le volume
  48. C
  49. C ICHPSU : CHPOINT FACE contenant la surface des faces
  50. C
  51. C
  52. C 2) Pointeurs de MELEME de la table DOMAINE
  53. C
  54. C MELEMC : MELEME 'CENTRE' du SPG des CENTRES
  55. C
  56. C MELEFE : MELEME 'FACEL' du connectivité Faces -> Elts
  57. C
  58. C MELLIM : MELEME sur lequel on ne veut pas calculer
  59. C la contribution à la matrice jacobienne
  60. C
  61. C 3) Cas Bas Mach
  62. C
  63. C IUINF : CHPOINT, one component, "cut-off velocity"
  64. C 0 if there is no Bas MACH
  65. C
  66. C IUPRI : CHPOINT, one component, second "cut-off velocity"
  67. C 0 if there is no Bas MACH
  68. C
  69. C
  70. C SORTIES
  71. C
  72. C IMAT : pointeur de la MATRIK du jacobien du residu
  73. C
  74. C************************************************************************
  75. C
  76. C HISTORIQUE (Anomalies et modifications éventuelles)
  77. C
  78. C HISTORIQUE :
  79. C
  80. C************************************************************************
  81. C
  82. C
  83. C N.B.: On suppose qu'on a déjà controllé RO, P > 0
  84. C GAMMA \in (1,3)
  85. C Si non il faut le faire!!!
  86. C
  87. C************************************************************************
  88. C
  89. IMPLICIT INTEGER(I-N)
  90. INTEGER ILINC, IRN,IUN,IPN,IGAMN,INORM,ICHPVO,ICHPSU, IUINF, IUPRI
  91. & , IMAT, IGEOMC, IGEOMF
  92. & , NFAC, NBSOUS, NBREF, NBELEM, NBNN, NRIGE, NMATRI, NKID
  93. & , NKMT, NBME, NBEL, MP, NP
  94. & , IFAC, NGCF, NLCF, NGCG, NGCD, NLCG, NLCD, NLFL, I1
  95. REAL*8 ROG, PG, UXG, UYG, GAMG, VOLG
  96. & , ROD, PD, UXD, UYD, GAMD, VOLD
  97. & , SURF, CNX, CNY, CTX, CTY, FUNCEL
  98. & , DFRO(4), DFRET(4), DFRUN(4), DFRUT(4), VINF
  99. & , UNG, UTG, UND, UTD, ROF, PF, UNF, UTF, GAMF, AMAT(4,4)
  100. & , RLAMMA, BMAT(4,4)
  101. CHARACTER*8 TYPE
  102. C
  103. C**** LES INCLUDES
  104. C
  105.  
  106. -INC PPARAM
  107. -INC CCOPTIO
  108. -INC SMCHPOI
  109. -INC SMELEME
  110. -INC SMLMOTS
  111. -INC SMLENTI
  112. POINTEUR MPRN.MPOVAL, MPUN.MPOVAL, MPPN.MPOVAL, MPGAMN.MPOVAL,
  113. & MPNORM.MPOVAL, MPVOLU.MPOVAL, MPOVSU.MPOVAL,
  114. & MPUPRI.MPOVAL, MPUINF.MPOVAL
  115. POINTEUR MELEMC.MELEME, MELEMF.MELEME, MELEFE.MELEME,
  116. & MELEDU.MELEME, MELLIM.MELEME
  117. POINTEUR MLENTC.MLENTI, MLENTF.MLENTI, MLELIM.MLENTI
  118. POINTEUR RR.IZAFM, RUX.IZAFM, RUY.IZAFM, RRET.IZAFM,
  119. & UXR.IZAFM, UXUX.IZAFM, UXUY.IZAFM, UXRET.IZAFM,
  120. & UYR.IZAFM, UYUX.IZAFM, UYUY.IZAFM, UYRET.IZAFM,
  121. & RETR.IZAFM, RETUX.IZAFM, RETUY.IZAFM, RETRET.IZAFM
  122. POINTEUR MLMINC.MLMOTS
  123. C
  124. C**** KRIPAD pour la correspondance global/local des conditions limits
  125. C
  126. CALL KRIPAD(MELLIM,MLELIM)
  127. c SEGACT MELLIM
  128. C
  129. C**** KRIPAD pour la correspondance global/local des centres
  130. C
  131. CALL KRIPAD(MELEMC,MLENTC)
  132. C
  133. C SEGACT MLENTC
  134. SEGACT MELEMC
  135. C
  136. SEGACT MELEFE
  137. C
  138. CALL LICHT(ICHPSU,MPOVSU,TYPE,IGEOMF)
  139. CALL LICHT(INORM,MPNORM,TYPE,IGEOMF)
  140. CALL LICHT(ICHPVO,MPVOLU,TYPE,IGEOMC)
  141. C
  142. C**** LICHT active les MPOVALs en *MOD
  143. C
  144. C i.e.
  145. C
  146. C SEGACT MPOVSU*MOD
  147. C SEGACT MPOVNO*MOD
  148. C SEGACT MPVOLU*MOD
  149. C
  150. MELEMF = IGEOMF
  151. CALL KRIPAD(MELEMF,MLENTF)
  152. C
  153. C SEGACT MLENTF
  154. SEGACT MELEMF
  155. C
  156. CALL LICHT(IRN,MPRN,TYPE,IGEOMC)
  157. CALL LICHT(IPN,MPPN,TYPE,IGEOMC)
  158. CALL LICHT(IUN,MPUN,TYPE,IGEOMC)
  159. CALL LICHT(IGAMN,MPGAMN,TYPE,IGEOMC)
  160. C
  161. C SEGACT MPRN*MOD
  162. C SEGACT MPPN*MOD
  163. C SEGACT MPUN*MOD
  164. C SEGACT MPGAMN*MOD
  165. C
  166. C**************************************************************
  167. C Bas Mach
  168. C**************************************************************
  169. CALL LICHT(IUPRI,MPUPRI,TYPE,IGEOMC)
  170. CALL LICHT(IUINF,MPUINF,TYPE,IGEOMC)
  171. C
  172. NFAC = MELEFE.NUM(/2)
  173. C
  174. C**** Maillage des inconnues primales
  175. C
  176. NBSOUS = 0
  177. NBREF = 0
  178. NBELEM = NFAC
  179. NBNN = 2
  180. C
  181. SEGINI MELEDU
  182. C MELEPR = MELEDU
  183. C
  184. C**** MELEDU = 'SEG2'
  185. C
  186. MELEDU.ITYPEL = 2
  187. C
  188. NRIGE = 7
  189. NMATRI = 1
  190. NKID = 9
  191. NKMT = 7
  192. C
  193. SEGINI MATRIK
  194. IMAT = MATRIK
  195. MATRIK.IRIGEL(1,1) = MELEDU
  196. MATRIK.IRIGEL(2,1) = MELEDU
  197. C
  198. C**** Matrice non symetrique
  199. C
  200. MATRIK.IRIGEL(7,1) = 2
  201. C
  202. NBME = 16
  203. NBSOUS = 1
  204. SEGINI IMATRI
  205. MLMINC = ILINC
  206. SEGACT MLMINC
  207. MATRIK.IRIGEL(4,1) = IMATRI
  208. C
  209. IMATRI.LISPRI(1) = MLMINC.MOTS(1)
  210. IMATRI.LISPRI(2) = MLMINC.MOTS(2)
  211. IMATRI.LISPRI(3) = MLMINC.MOTS(3)
  212. IMATRI.LISPRI(4) = MLMINC.MOTS(4)
  213. IMATRI.LISPRI(5) = MLMINC.MOTS(1)
  214. IMATRI.LISPRI(6) = MLMINC.MOTS(2)
  215. IMATRI.LISPRI(7) = MLMINC.MOTS(3)
  216. IMATRI.LISPRI(8) = MLMINC.MOTS(4)
  217. IMATRI.LISPRI(9) = MLMINC.MOTS(1)
  218. IMATRI.LISPRI(10) = MLMINC.MOTS(2)
  219. IMATRI.LISPRI(11) = MLMINC.MOTS(3)
  220. IMATRI.LISPRI(12) = MLMINC.MOTS(4)
  221. IMATRI.LISPRI(13) = MLMINC.MOTS(1)
  222. IMATRI.LISPRI(14) = MLMINC.MOTS(2)
  223. IMATRI.LISPRI(15) = MLMINC.MOTS(3)
  224. IMATRI.LISPRI(16) = MLMINC.MOTS(4)
  225. C
  226. IMATRI.LISDUA(1) = MLMINC.MOTS(1)
  227. IMATRI.LISDUA(2) = MLMINC.MOTS(1)
  228. IMATRI.LISDUA(3) = MLMINC.MOTS(1)
  229. IMATRI.LISDUA(4) = MLMINC.MOTS(1)
  230. IMATRI.LISDUA(5) = MLMINC.MOTS(2)
  231. IMATRI.LISDUA(6) = MLMINC.MOTS(2)
  232. IMATRI.LISDUA(7) = MLMINC.MOTS(2)
  233. IMATRI.LISDUA(8) = MLMINC.MOTS(2)
  234. IMATRI.LISDUA(9) = MLMINC.MOTS(3)
  235. IMATRI.LISDUA(10) = MLMINC.MOTS(3)
  236. IMATRI.LISDUA(11) = MLMINC.MOTS(3)
  237. IMATRI.LISDUA(12) = MLMINC.MOTS(3)
  238. IMATRI.LISDUA(13) = MLMINC.MOTS(4)
  239. IMATRI.LISDUA(14) = MLMINC.MOTS(4)
  240. IMATRI.LISDUA(15) = MLMINC.MOTS(4)
  241. IMATRI.LISDUA(16) = MLMINC.MOTS(4)
  242. C
  243. NBEL = NBELEM
  244. NBSOUS = 1
  245. NP = 2
  246. MP = 2
  247. SEGINI RR , RUX , RUY , RRET ,
  248. & UXR , UXUX , UXUY , UXRET ,
  249. & UYR , UYUX , UYUY , UYRET ,
  250. & RETR , RETUX , RETUY , RETRET
  251. C
  252. C**** Duale = IMATRI.LISDUA(1) = 'RN'
  253. C Primale = IMATRI.LISPRI(1) = 'RN'
  254. C -> IMATRI.LIZAFM(1,1) = RR
  255. C
  256. C Duale = IMATRI.LISDUA(2) = 'RN'
  257. C Primale = IMATRI.LISPRI(1) = 'RUXN'
  258. C -> IMATRI.LIZAFM(1,2) = RUX
  259. C ...
  260. C
  261. IMATRI.LIZAFM(1,1) = RR
  262. IMATRI.LIZAFM(1,2) = RUX
  263. IMATRI.LIZAFM(1,3) = RUY
  264. IMATRI.LIZAFM(1,4) = RRET
  265. IMATRI.LIZAFM(1,5) = UXR
  266. IMATRI.LIZAFM(1,6) = UXUX
  267. IMATRI.LIZAFM(1,7) = UXUY
  268. IMATRI.LIZAFM(1,8) = UXRET
  269. IMATRI.LIZAFM(1,9) = UYR
  270. IMATRI.LIZAFM(1,10) = UYUX
  271. IMATRI.LIZAFM(1,11) = UYUY
  272. IMATRI.LIZAFM(1,12) = UYRET
  273. IMATRI.LIZAFM(1,13) = RETR
  274. IMATRI.LIZAFM(1,14) = RETUX
  275. IMATRI.LIZAFM(1,15) = RETUY
  276. IMATRI.LIZAFM(1,16) = RETRET
  277. C
  278. DO IFAC = 1, NFAC, 1
  279. NGCF = MELEFE.NUM(2,IFAC)
  280. NLCF = MLENTF.LECT(NGCF)
  281. IF(NLCF .NE. IFAC)THEN
  282. WRITE(IOIMP,*) 'Il ne faut pas jouer avec la table domaine'
  283. CALL ERREUR(5)
  284. GOTO 9999
  285. ENDIF
  286. NGCG = MELEFE.NUM(1,IFAC)
  287. NGCD = MELEFE.NUM(3,IFAC)
  288. NLFL = MLELIM.LECT(NGCF)
  289. IF(NLFL .NE. 0)THEN
  290. C
  291. C********** The point belongs on BC -> No contribution to jacobian!
  292. C
  293. MELEDU.NUM(1,IFAC) = NGCG
  294. MELEDU.NUM(2,IFAC) = NGCD
  295.  
  296. ELSEIF(NGCG .NE. NGCD)THEN
  297. C
  298. C********** Les MELEMEs
  299. C
  300. MELEDU.NUM(1,IFAC) = NGCG
  301. MELEDU.NUM(2,IFAC) = NGCD
  302. C
  303. C********** Les etats G et D
  304. C
  305. NLCG = MLENTC.LECT(NGCG)
  306. NLCD = MLENTC.LECT(NGCD)
  307. C
  308. ROG = MPRN.VPOCHA(NLCG,1)
  309. PG = MPPN.VPOCHA(NLCG,1)
  310. UXG = MPUN.VPOCHA(NLCG,1)
  311. UYG = MPUN.VPOCHA(NLCG,2)
  312. GAMG = MPGAMN.VPOCHA(NLCG,1)
  313. VOLG = MPVOLU.VPOCHA(NLCG,1)
  314. C
  315. ROD = MPRN.VPOCHA(NLCD,1)
  316. PD = MPPN.VPOCHA(NLCD,1)
  317. UXD = MPUN.VPOCHA(NLCD,1)
  318. UYD = MPUN.VPOCHA(NLCD,2)
  319. GAMD = MPGAMN.VPOCHA(NLCD,1)
  320. VOLD = MPVOLU.VPOCHA(NLCD,1)
  321. C
  322. C********** La normale G->D
  323. C La tangente
  324. C
  325. SURF = MPOVSU.VPOCHA(NLCF,1)
  326. CNX = MPNORM.VPOCHA(NLCF,1)
  327. CNY = MPNORM.VPOCHA(NLCF,2)
  328. CTX = -1.0D0 * CNY
  329. CTY = CNX
  330. C
  331. C********** Cut off
  332. C
  333. VINF=MPUPRI.VPOCHA(NLCG,1)
  334. VINF=MAX(VINF,MPUPRI.VPOCHA(NLCD,1))
  335. VINF=MAX(VINF,MPUINF.VPOCHA(NLCG,1))
  336. VINF=MAX(VINF,MPUINF.VPOCHA(NLCD,1))
  337. C
  338. C********** L'etat moyen au centre
  339. C
  340. UNG=UXG*CNX+UYG*CNY
  341. UTG=UXG*CTX+UYG*CTY
  342. UND=UXD*CNX+UYD*CNY
  343. UTD=UXD*CTX+UYD*CTY
  344. UNF=0.5D0*(UNG+UND)
  345. UTF=0.5D0*(UTG+UTD)
  346. ROF=0.5D0*(ROG+ROD)
  347. PF=0.5D0*(PG+PD)
  348. GAMF=0.5D0*(GAMG+GAMD)
  349. C
  350. C********** We include in the cut-off UNG,UND,UTG,UTD in order to
  351. C avoid low diffusivity in stagnation regions
  352. C
  353. VINF=MAX(VINF,((UNG*UNG+UTG*UTG)**0.5D0))
  354. VINF=MAX(VINF,((UND*UND+UTD*UTD)**0.5D0))
  355. C
  356. C********** Calcule de la matrice de diffusivité pour le variables
  357. C conservatives.
  358. C Dans le repaire (n,t) local
  359. C F(UL,Ur) = 0.5 (F(UL)+F(UR)+AMAT*RLAMMA*(UL-UR))
  360. C
  361. CALL FRBM1(VINF, ROF,UNF,UTF,PF,GAMF,AMAT, RLAMMA)
  362. C
  363. C Ici U=(\rho,\rho un, \rho ut, \rho et)
  364. C Il faut calculer la contribution sur F dans le repaire
  365. C (n,t) par rapport aux variables
  366. C U=(\rho,\rho ux, \rho uy, \rho et)
  367. C
  368. DO I1 = 1,4,1
  369. BMAT(I1,1) = AMAT(I1,1)
  370. BMAT(I1,2) = AMAT(I1,2) * CNX + AMAT(I1,3) * CTX
  371. BMAT(I1,3) = AMAT(I1,2) * CNY + AMAT(I1,3) * CTY
  372. BMAT(I1,4) = AMAT(I1,4)
  373. ENDDO
  374. C
  375. C********** La contribution de Gauche
  376. C
  377. C Partie centrée
  378. C
  379. CALL CENTJ0(ROG,UXG,UYG,PG,GAMG,CNX,CNY,CTX,CTY,
  380. & DFRO,DFRUN,DFRUT,DFRET)
  381. C
  382. C********** Centrée + Decentrée
  383. C
  384. C DFRO = derivative of the numerical approx. of (\rho un)
  385. C in the frame (x,y) (centered part)
  386. C BMAT(1,*) = derivative of the numerical approx. of (\rho un)
  387. C in the frame (x,y) (diff. part)
  388. C
  389. DO I1=1,4,1
  390. DFRO(I1) = DFRO(I1) + 0.5D0 * RLAMMA * BMAT(1,I1)
  391. DFRUN(I1) = DFRUN(I1) + 0.5D0 * RLAMMA * BMAT(2,I1)
  392. DFRUT(I1) = DFRUT(I1) + 0.5D0 * RLAMMA * BMAT(3,I1)
  393. DFRET(I1) = DFRET(I1) + 0.5D0 * RLAMMA * BMAT(4,I1)
  394. ENDDO
  395. C
  396. C
  397. C********** AB.AM(IFAC,IPRIM,IDUAL)
  398. C A = nom de l'inconnu duale (Ro,rUX,rUY,RET)
  399. C B = nom de l'inconnu primale (Ro,rUX,rUY,RET)
  400. C IPRIM = 1, 2 -> G, D
  401. C IDUAL = 1, 2 -> G, D
  402. C i.e.
  403. C A_IDUAL = AB.AM(IFAC,IPRIM,IDUAL) * B_IPRIM + ...
  404. C
  405. C
  406. C********** Dual RN
  407. C
  408. FUNCEL = SURF * DFRO(1)
  409. RR.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  410. RR.AM(IFAC,1,2) = FUNCEL / VOLD
  411. C
  412. FUNCEL = SURF * DFRO(2)
  413. RUX.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  414. RUX.AM(IFAC,1,2) = FUNCEL / VOLD
  415. C
  416. FUNCEL = SURF * DFRO(3)
  417. RUY.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  418. RUY.AM(IFAC,1,2) = FUNCEL / VOLD
  419. C
  420. FUNCEL = SURF * DFRO(4)
  421. RRET.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  422. RRET.AM(IFAC,1,2) = FUNCEL / VOLD
  423. C
  424. C********** Dual RUXN
  425. C
  426. FUNCEL = SURF * (DFRUN(1) * CNX + DFRUT(1) * CTX)
  427. UXR.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  428. UXR.AM(IFAC,1,2) = FUNCEL / VOLD
  429. C
  430. FUNCEL = SURF * (DFRUN(2) * CNX + DFRUT(2) * CTX)
  431. UXUX.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  432. UXUX.AM(IFAC,1,2) = FUNCEL / VOLD
  433. C
  434. FUNCEL = SURF * (DFRUN(3) * CNX + DFRUT(3) * CTX)
  435. UXUY.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  436. UXUY.AM(IFAC,1,2) = FUNCEL / VOLD
  437. C
  438. FUNCEL = SURF * (DFRUN(4) * CNX + DFRUT(4) * CTX)
  439. UXRET.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  440. UXRET.AM(IFAC,1,2) = FUNCEL / VOLD
  441. C
  442. C********** Dual RUYN
  443. C
  444. FUNCEL = SURF * (DFRUN(1) * CNY + DFRUT(1) * CTY)
  445. UYR.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  446. UYR.AM(IFAC,1,2) = FUNCEL / VOLD
  447. C
  448. FUNCEL = SURF * (DFRUN(2) * CNY + DFRUT(2) * CTY)
  449. UYUX.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  450. UYUX.AM(IFAC,1,2) = FUNCEL / VOLD
  451. C
  452. FUNCEL = SURF * (DFRUN(3) * CNY + DFRUT(3) * CTY)
  453. UYUY.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  454. UYUY.AM(IFAC,1,2) = FUNCEL / VOLD
  455. C
  456. FUNCEL = SURF * (DFRUN(4) * CNY + DFRUT(4) * CTY)
  457. UYRET.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  458. UYRET.AM(IFAC,1,2) = FUNCEL / VOLD
  459. C
  460. C********** Dual RETN
  461. C
  462. FUNCEL = SURF * DFRET(1)
  463. RETR.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  464. RETR.AM(IFAC,1,2) = FUNCEL / VOLD
  465. C
  466. FUNCEL = SURF * DFRET(2)
  467. RETUX.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  468. RETUX.AM(IFAC,1,2) = FUNCEL / VOLD
  469. C
  470. FUNCEL = SURF * DFRET(3)
  471. RETUY.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  472. RETUY.AM(IFAC,1,2) = FUNCEL / VOLD
  473. C
  474. FUNCEL = SURF * DFRET(4)
  475. RETRET.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  476. RETRET.AM(IFAC,1,2) = FUNCEL / VOLD
  477. C
  478. C
  479. C********** La contribution de D
  480. C Je change l'orientation de normales
  481. C Dans ce cas F(UD,UG) = 0.5 * (F(UD)+F(UD)
  482. C + RLAMMA * AMAT * (UD - UG))
  483. C
  484. CNX = -1.0D0 * CNX
  485. CNY = -1.0D0 * CNY
  486. CTX = -1.0D0 * CTX
  487. CTY = -1.0D0 * CTY
  488. C
  489. C********** L'etat moyen au centre
  490. C Meme que avant; mais UNF, UTF change de signe
  491. C
  492. UNF=-1.0D0*UNF
  493. UTF=-1.0D0*UTF
  494. C
  495. C********** On recalcule de la matrice de diffusivité pour le variables
  496. C conservatives (pas d'optimisation illisible!!!)
  497. C
  498. CALL FRBM1(VINF, ROF,UNF,UTF,PF,GAMF,AMAT, RLAMMA)
  499. C
  500. C Ici U=(\rho,\rho un, \rho ut, \rho et)
  501. C Il faut calculer la contribution sur F dans le repaire
  502. C (n,t) par rapport aux variables
  503. C U=(\rho,\rho ux, \rho uy, \rho et)
  504. C
  505. DO I1 = 1,4,1
  506. BMAT(I1,1) = AMAT(I1,1)
  507. BMAT(I1,2) = AMAT(I1,2) * CNX + AMAT(I1,3) * CTX
  508. BMAT(I1,3) = AMAT(I1,2) * CNY + AMAT(I1,3) * CTY
  509. BMAT(I1,4) = AMAT(I1,4)
  510. ENDDO
  511. C
  512. CALL CENTJ0(ROD,UXD,UYD,PD,GAMD,CNX,CNY,CTX,CTY,
  513. & DFRO,DFRUN,DFRUT,DFRET)
  514. C
  515. C********** Centrée + Decentrée
  516. C
  517. DO I1=1,4,1
  518. DFRO(I1) = DFRO(I1) + 0.5D0 * RLAMMA * BMAT(1,I1)
  519. DFRUN(I1) = DFRUN(I1) + 0.5D0 * RLAMMA * BMAT(2,I1)
  520. DFRUT(I1) = DFRUT(I1) + 0.5D0 * RLAMMA * BMAT(3,I1)
  521. DFRET(I1) = DFRET(I1) + 0.5D0 * RLAMMA * BMAT(4,I1)
  522. ENDDO
  523. C
  524. C
  525. C********** Dual RN
  526. C
  527. FUNCEL = SURF * DFRO(1)
  528. RR.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  529. RR.AM(IFAC,2,1) = FUNCEL / VOLG
  530. C
  531. FUNCEL = SURF * DFRO(2)
  532. RUX.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  533. RUX.AM(IFAC,2,1) = FUNCEL / VOLG
  534. C
  535. FUNCEL = SURF * DFRO(3)
  536. RUY.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  537. RUY.AM(IFAC,2,1) = FUNCEL / VOLG
  538. C
  539. FUNCEL = SURF * DFRO(4)
  540. RRET.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  541. RRET.AM(IFAC,2,1) = FUNCEL / VOLG
  542. C
  543. C********** Dual RUXN
  544. C
  545. FUNCEL = SURF * (DFRUN(1) * CNX + DFRUT(1) * CTX)
  546. UXR.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  547. UXR.AM(IFAC,2,1) = FUNCEL / VOLG
  548. C
  549. FUNCEL = SURF * (DFRUN(2) * CNX + DFRUT(2) * CTX)
  550. UXUX.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  551. UXUX.AM(IFAC,2,1) = FUNCEL / VOLG
  552. C
  553. FUNCEL = SURF * (DFRUN(3) * CNX + DFRUT(3) * CTX)
  554. UXUY.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  555. UXUY.AM(IFAC,2,1) = FUNCEL / VOLG
  556. C
  557. FUNCEL = SURF * (DFRUN(4) * CNX + DFRUT(4) * CTX)
  558. UXRET.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  559. UXRET.AM(IFAC,2,1) = FUNCEL / VOLG
  560. C
  561. C********** Dual RUYN
  562. C
  563. FUNCEL = SURF * (DFRUN(1) * CNY + DFRUT(1) * CTY)
  564. UYR.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  565. UYR.AM(IFAC,2,1) = FUNCEL / VOLG
  566. C
  567. FUNCEL = SURF * (DFRUN(2) * CNY + DFRUT(2) * CTY)
  568. UYUX.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  569. UYUX.AM(IFAC,2,1) = FUNCEL / VOLG
  570. C
  571. FUNCEL = SURF * (DFRUN(3) * CNY + DFRUT(3) * CTY)
  572. UYUY.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  573. UYUY.AM(IFAC,2,1) = FUNCEL / VOLG
  574. C
  575. FUNCEL = SURF * (DFRUN(4) * CNY + DFRUT(4) * CTY)
  576. UYRET.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  577. UYRET.AM(IFAC,2,1) = FUNCEL / VOLG
  578. C
  579. C********** Dual RETN
  580. C
  581. FUNCEL = SURF * DFRET(1)
  582. RETR.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  583. RETR.AM(IFAC,2,1) = FUNCEL / VOLG
  584. C
  585. FUNCEL = SURF * DFRET(2)
  586. RETUX.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  587. RETUX.AM(IFAC,2,1) = FUNCEL / VOLG
  588. C
  589. FUNCEL = SURF * DFRET(3)
  590. RETUY.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  591. RETUY.AM(IFAC,2,1) = FUNCEL / VOLG
  592. C
  593. FUNCEL = SURF * DFRET(4)
  594. RETRET.AM(IFAC,2,2) = -1.0D0 * FUNCEL / VOLD
  595. RETRET.AM(IFAC,2,1) = FUNCEL / VOLG
  596. C
  597. ELSE
  598. C
  599. C********** Murs (NGCG = NGCD)
  600. C
  601. C
  602. C********** Les MELEMEs
  603. C
  604. MELEDU.NUM(1,IFAC) = NGCG
  605. MELEDU.NUM(2,IFAC) = NGCD
  606. NLCG = MLENTC.LECT(NGCG)
  607. C
  608. ROG = MPRN.VPOCHA(NLCG,1)
  609. PG = MPPN.VPOCHA(NLCG,1)
  610. UXG = MPUN.VPOCHA(NLCG,1)
  611. UYG = MPUN.VPOCHA(NLCG,2)
  612. GAMG = MPGAMN.VPOCHA(NLCG,1)
  613. VOLG = MPVOLU.VPOCHA(NLCG,1)
  614. C
  615. C********** Cut off
  616. C
  617. VINF=MPUPRI.VPOCHA(NLCG,1)
  618. VINF=MAX(VINF,MPUINF.VPOCHA(NLCG,1))
  619. C
  620. C********** La normale sortante
  621. C
  622. SURF = MPOVSU.VPOCHA(NLCF,1)
  623. CNX = MPNORM.VPOCHA(NLCF,1)
  624. CNY = MPNORM.VPOCHA(NLCF,2)
  625. C
  626. C********** L'etat moyen au centre
  627. C
  628. UNF=0.0D0
  629. UTF=0.5D0*(UXG*CTX+UYG*CTY)
  630. ROF=ROG
  631. PF=PG
  632. GAMF=GAMG
  633. C
  634. C********** We include in the cut-off UG
  635. C
  636. VINF=MAX(VINF,((UXG*UXG+UYG*UYG)**0.5D0))
  637. C
  638. C********** Calcule de la matrice de diffusivité pour le variables
  639. C conservatives.
  640. C Dans le repaire (n,t) local
  641. C F(UL,Ur) = 0.5 (F(UL)+F(UR)+AMAT*RLAMMA*(UL-UR))
  642. C
  643. CALL FRBM1(VINF, ROF,UNF,UTF,PF,GAMF,AMAT, RLAMMA)
  644. C
  645. C Ici U=(\rho,\rho un, \rho ut, \rho et)
  646. C Il faut calculer la contribution sur F dans le repaire
  647. C (n,t) par rapport aux variables
  648. C U=(\rho,\rho ux, \rho uy, \rho et)
  649. C Dans le cas murs, le seul flux normal donne une contribution
  650. C non nulle
  651. C En plus AMAT(1,2)=AMAT(3,2)=AMAT(4,2)=0
  652. C AMAT(2,2)=1.0D0
  653. C
  654. C write(*,*) 'AMAT(*,2)=',(AMAT(I1,2),I1=1,4)
  655. C
  656. C********** Contribution centrée
  657. C
  658. CALL CENTJ2(ROG,UXG,UYG,GAMG,CNX,CNY,
  659. & DFRUN)
  660. C
  661. C********** Centrée + Decentrée
  662. C
  663. DFRUN(2) = DFRUN(2) + (RLAMMA * CNX)
  664. DFRUN(3) = DFRUN(3) + (RLAMMA * CNY)
  665. C
  666. C********** Dual RN
  667. C
  668. RR.AM(IFAC,1,1) = 0.0D0
  669. RR.AM(IFAC,1,2) = 0.0D0
  670. C
  671. RUX.AM(IFAC,1,1) = 0.0D0
  672. RUX.AM(IFAC,1,2) = 0.0D0
  673. C
  674. RUY.AM(IFAC,1,1) = 0.0D0
  675. RUY.AM(IFAC,1,2) = 0.0D0
  676. C
  677. RRET.AM(IFAC,1,1) = 0.0D0
  678. RRET.AM(IFAC,1,2) = 0.0D0
  679. C
  680. C********** Dual RUXN
  681. C
  682. FUNCEL = SURF * DFRUN(1) * CNX
  683. UXR.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  684. UXR.AM(IFAC,1,2) = 0.0D0
  685. C
  686. FUNCEL = SURF * DFRUN(2) * CNX
  687. UXUX.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  688. UXUX.AM(IFAC,1,2) = 0.0D0
  689. C
  690. FUNCEL = SURF * DFRUN(3) * CNX
  691. UXUY.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  692. UXUY.AM(IFAC,1,2) = 0.0D0
  693. C
  694. FUNCEL = SURF * DFRUN(4) * CNX
  695. UXRET.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  696. UXRET.AM(IFAC,1,2) = 0.0D0
  697. C
  698. C********** Dual RUYN
  699. C
  700. FUNCEL = SURF * DFRUN(1) * CNY
  701. UYR.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  702. UYR.AM(IFAC,1,2) = 0.0D0
  703. C
  704. FUNCEL = SURF * DFRUN(2) * CNY
  705. UYUX.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  706. UYUX.AM(IFAC,1,2) = 0.0D0
  707. C
  708. FUNCEL = SURF * DFRUN(3) * CNY
  709. UYUY.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  710. UYUY.AM(IFAC,1,2) = 0.0D0
  711. C
  712. FUNCEL = SURF * DFRUN(4) * CNY
  713. UYRET.AM(IFAC,1,1) = -1.0D0 * FUNCEL / VOLG
  714. UYRET.AM(IFAC,1,2) = 0.0D0
  715. C
  716. C********** Dual RETN
  717. C
  718. RETR.AM(IFAC,1,1) = 0.0D0
  719. RETR.AM(IFAC,1,2) = 0.0D0
  720. C
  721. RETUX.AM(IFAC,1,1) = 0.0D0
  722. RETUX.AM(IFAC,1,2) = 0.0D0
  723. C
  724. RETUY.AM(IFAC,1,1) = 0.0D0
  725. RETUY.AM(IFAC,1,2) = 0.0D0
  726. C
  727. RETRET.AM(IFAC,1,1) = 0.0D0
  728. RETRET.AM(IFAC,1,2) = 0.0D0
  729. C
  730. C********** Dual RN
  731. C
  732. RR.AM(IFAC,2,2) = 0.0D0
  733. RR.AM(IFAC,2,1) = 0.0D0
  734. C
  735. RUX.AM(IFAC,2,2) = 0.0D0
  736. RUX.AM(IFAC,2,1) = 0.0D0
  737. C
  738. RUY.AM(IFAC,2,2) = 0.0D0
  739. RUY.AM(IFAC,2,1) = 0.0D0
  740. C
  741. RRET.AM(IFAC,2,2) = 0.0D0
  742. RRET.AM(IFAC,2,1) = 0.0D0
  743. C
  744. C********** Dual RUXN
  745. C
  746. UXR.AM(IFAC,2,2) = 0.0D0
  747. UXR.AM(IFAC,2,1) = 0.0D0
  748. C
  749. UXUX.AM(IFAC,2,2) = 0.0D0
  750. UXUX.AM(IFAC,2,1) = 0.0D0
  751. C
  752. UXUY.AM(IFAC,2,2) = 0.0D0
  753. UXUY.AM(IFAC,2,1) = 0.0D0
  754. C
  755. UXRET.AM(IFAC,2,2) = 0.0D0
  756. UXRET.AM(IFAC,2,1) = 0.0D0
  757. C
  758. C********** Dual RUYN
  759. C
  760. UYR.AM(IFAC,2,2) = 0.0D0
  761. UYR.AM(IFAC,2,1) = 0.0D0
  762. C
  763. UYUX.AM(IFAC,2,2) = 0.0D0
  764. UYUX.AM(IFAC,2,1) = 0.0D0
  765. C
  766. UYUY.AM(IFAC,2,2) = 0.0D0
  767. UYUY.AM(IFAC,2,1) = 0.0D0
  768. C
  769. UYRET.AM(IFAC,2,2) = 0.0D0
  770. UYRET.AM(IFAC,2,1) = 0.0D0
  771. C
  772. C********** Dual RETN
  773. C
  774. RETR.AM(IFAC,2,2) = 0.0D0
  775. RETR.AM(IFAC,2,1) = 0.0D0
  776. C
  777. RETUX.AM(IFAC,2,2) = 0.0D0
  778. RETUX.AM(IFAC,2,1) = 0.0D0
  779. C
  780. RETUY.AM(IFAC,2,2) = 0.0D0
  781. RETUY.AM(IFAC,2,1) = 0.0D0
  782. C
  783. RETRET.AM(IFAC,2,2) = 0.0D0
  784. RETRET.AM(IFAC,2,1) = 0.0D0
  785. C
  786. ENDIF
  787. ENDDO
  788. C
  789. SEGDES MELEMC
  790. SEGDES MELEFE
  791. SEGDES MELEMF
  792. C
  793. SEGDES MPOVSU
  794. SEGDES MPVOLU
  795. SEGDES MPNORM
  796. C
  797. SEGDES MPRN
  798. SEGDES MPPN
  799. SEGDES MPUN
  800. SEGDES MPGAMN
  801. C
  802. SEGDES MELEDU
  803. SEGDES MATRIK
  804. SEGDES IMATRI
  805. C
  806. SEGDES RR , RUX , RUY , RRET ,
  807. & UXR , UXUX , UXUY , UXRET ,
  808. & UYR , UYUX , UYUY , UYRET ,
  809. & RETR , RETUX , RETUY , RETRET
  810.  
  811. SEGSUP MLENTC
  812. SEGSUP MLENTF
  813. SEGDES MLMINC
  814. SEGSUP MLELIM
  815. C
  816. IF(MELLIM .NE.0) SEGDES MELLIM
  817. C
  818. SEGDES MPUPRI
  819. SEGDES MPUINF
  820. C
  821. 9999 CONTINUE
  822. RETURN
  823. END
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales