Télécharger kfm13.eso

Retour à la liste

Numérotation des lignes :

kfm13
  1. C KFM13 SOURCE OF166741 24/12/13 21:16:06 12097
  2. C KFM13 SOURCE CHAT 05/01/13 00:55:24 5004
  3. SUBROUTINE KFM13(IRES,IRN,IGN,IRETN,IGAMN,IVCO,
  4. & ICHPSU,ICHPDI,ICHPVO,INORM,
  5. & MELEMC,MELEMF,MELEFE,DTPS,DCFL,
  6. & MELLIM,ICHLIM,NJAC,ICOEV,
  7. & IDU,IPROBL)
  8. C************************************************************************
  9. C
  10. C PROJET : CASTEM 2000
  11. C
  12. C NOM : KFM13
  13. C
  14. C DESCRIPTION : Voir aussi KFM1
  15. C
  16. C Cas 3D, gaz "calorically perfect"
  17. C Méthode implicite sans Matrice résolue
  18. C par Jacobi par point.
  19. C
  20. C LANGAGE : FORTRAN 77 + ESOPE 2000 (avec estensions CISI)
  21. C
  22. C AUTEUR : T. KLOCZKO, DEN/DM2S/SFME/LTMF
  23. C
  24. C************************************************************************
  25. C ENTREES
  26. C
  27. C
  28. C 1) Pointeurs des CHPOINTs
  29. C
  30. C IRES : CHPOINT 'CENTRE' contenant le residu
  31. C
  32. C IRN : CHPOINT 'CENTRE' contenant la masse volumique
  33. C
  34. C IGN : CHPOINT 'CENTRE' contenant la q.d.m.
  35. C
  36. C IRETN : CHPOINT 'CENTRE' contenant l'energie totale
  37. C
  38. C IGAMN : CHPOINT 'CENTRE' contenant le gamma
  39. C
  40. C IVCO : CHPOINT 'CENTRE' contenant le cut-off
  41. C
  42. C ICHLIM : CHPOINT conditions aux bords
  43. C
  44. C ICOEV : CHPOINT 'CENTRE' contenant le (gamma - 1) K / (R \rho)
  45. C coeff pour calculer le ray. spect. de la matrice
  46. C visc.
  47. C
  48. C 3) Pointeurs de CHPOINTs de la table DOMAINE
  49. C
  50. C ICHPSU : CHPOINT "FACE" contenant la surface des faces
  51. C
  52. C ICHPDI : CHPOINT "CENTRE" contenant le diametre minimum
  53. C de chaque element
  54. C
  55. C ICHPVO : CHPOINT "CENTRE" contenant le volume
  56. C de chaque element
  57. C
  58. C INORM : CHPOINT "CENTRE" contenant le normales aux faces
  59. C
  60. C
  61. C 4) Pointeurs de MELEME de la table DOMAINE
  62. C
  63. C MELEMC : MELEME 'CENTRE' du SPG des CENTRES
  64. C
  65. C MELEMF : MELEME 'FACE' du SPG des FACES
  66. C
  67. C MELEFE : MELEME 'FACEL' du connectivité FACES -> ELEM
  68. C
  69. C MELLIM : MELEME SPG conditions aux bords
  70. C
  71. C 5)
  72. C
  73. C DCFL = le double de la CFL
  74. C
  75. C DTPS = pas de temps physique
  76. C
  77. C NJAC = nombre d'iterations dans le jacobien
  78. C
  79. C
  80. C SORTIES
  81. C
  82. C IDU : resultat
  83. C
  84. C IPROBL : si > 0, il y a un probleme
  85. C
  86. C************************************************************************
  87. C
  88. C HISTORIQUE (Anomalies et modifications éventuelles)
  89. C
  90. C HISTORIQUE : 2004 : création
  91. C
  92. C************************************************************************
  93. C
  94. C
  95. C N.B.: On suppose qu'on a déjà controllé RO, P > 0
  96. C GAMMA \in (1,3)
  97. C Y \in (0,1)
  98. C Si non il faut le faire!!!
  99. C
  100. C************************************************************************
  101. C
  102. IMPLICIT INTEGER(I-N)
  103. INTEGER IRN,IGN,IRETN,IGAMN,ICHPSU,ICHPDI,ICHPVO,INORM
  104. & ,MELEMC,MELEMF,MELEFE,IDU,NFAC
  105. & ,IGEOMF,IGEOMC, NGCEG, NGCED, NGCF, NLCF, NLCF1, NLCEG, NLCED
  106. & ,ICEN,NCEN,ICHLIM,MELLIM,NLLIM,IRES,NJAC,ICOMP
  107. & ,I1,I2, IBLJAC, IPROBL, IVCO, ICOEV
  108. REAL*8 ROG, RUXG, RUYG, RUZG, RETG, GAMG, RHTG, REC
  109. & , ROD, RUXD, RUYD, RUZD, RETD, GAMD, RHTD
  110. & , UXG, UYG, UZG, UNG, UTG, UVG, PG, VOLG, DIAMG, SURF
  111. & , UXD, UYD, UZD, UND, UTD, UVD, PD, VOLD, DIAMD
  112. & , CNX, CNY, CNZ, CTX, CTY, CTZ, CVX, CVY, CVZ
  113. & , DCFL, DTPS, UNSDT, UNSDTF
  114. & , FR, FRUX, FRUY, FRUZ, FRET
  115. & , QG, CG, UCOG, ROF, PF, UNF, GAMF, UCOF, CF, SIGMAF
  116. & , QN, PHI2, COEF, COEF1
  117. CHARACTER*8 TYPE
  118. C
  119. C**** LES INCLUDES
  120. C
  121.  
  122. -INC PPARAM
  123. -INC CCOPTIO
  124. -INC SMCHPOI
  125. POINTEUR MPOVSU.MPOVAL, MPOVDI.MPOVAL
  126. & , MPODU.MPOVAL, MPOVOL.MPOVAL
  127. & , MPRN.MPOVAL, MPGN.MPOVAL, MPRETN.MPOVAL, MPGAMN.MPOVAL
  128. & , MPNORM.MPOVAL, MPLIM.MPOVAL, MPORES.MPOVAL, MPOCO.MPOVAL
  129. & , MPOCO1.MPOVAL, MPCOEV.MPOVAL
  130. -INC SMCOORD
  131. -INC SMELEME
  132. -INC SMLMOTS
  133. -INC SMLENTI
  134. POINTEUR MLELIM.MLENTI
  135. C
  136. C**** POINTEUR vecteurs
  137. C
  138. SEGMENT VEC
  139. REAL*8 VALVEC(I1)
  140. ENDSEGMENT
  141. POINTEUR D1.VEC,SIGMA0.VEC, AN0.VEC, DN0.VEC
  142. & ,USDTI.VEC, PHI2V.VEC, SIGMAV.VEC, NEWLI.VEC
  143. C
  144. C**** POINTEUR matriciels
  145. C
  146. SEGMENT MAT
  147. REAL*8 VAL(I1,I2)
  148. ENDSEGMENT
  149. POINTEUR CONS1.MAT, CONS2.MAT, BN0.MAT, BN1.MAT
  150. & ,CN0.MAT, CN1.MAT, DU.MAT
  151. & , RES.MAT
  152. & , Q1.MAT, Q2.MAT
  153. C
  154. C**** IPROBL: si different de 0, un probleme a été detecté
  155. C
  156. IPROBL=0
  157. C
  158. C**** Initialisation des MLENTI des conditions aux limites
  159. C
  160. C
  161. CALL KRIPAD(MELLIM,MLELIM)
  162. C SEGINI MLELIM
  163. C
  164. C**** Initialisation des MELEMEs
  165. C
  166. C 'CENTRE', 'FACEL'
  167. C
  168. IPT2 = MELEFE
  169. SEGACT IPT2
  170. NFAC = IPT2.NUM(/2)
  171. C
  172. C**** KRIPAD pour la correspondance global/local de centre
  173. C
  174. CALL KRIPAD(MELEMC,MLENT1)
  175. C
  176. C**** MLENTI1 a nbpts elements
  177. C
  178. C Si i est le numero global d'un noeud de ICEN,
  179. C MLENT1.LECT(i) contient sa position, i.e.
  180. C
  181. C I = numero global du noeud centre
  182. C MLENT1.LECT(i) = numero local du noeud centre
  183. C
  184. C MLENT1 déjà activé, i.e.
  185. C
  186. C SEGINI MLENT1
  187. C
  188. C
  189. C**** KRIPAD pour la correspondance global/local de 'FACE'
  190. C
  191. CALL KRIPAD(MELEMF,MLENT2)
  192. C SEGINI MLENT2
  193. C
  194. C
  195. C**** CHPOINTs de la table DOMAINE
  196. C
  197. CALL LICHT(ICHPSU,MPOVSU,TYPE,IGEOMF)
  198. CALL LICHT(ICHPDI,MPOVDI,TYPE,IGEOMC)
  199. CALL LICHT(ICHPVO,MPOVOL,TYPE,IGEOMC)
  200. CALL LICHT(INORM,MPNORM,TYPE,IGEOMC)
  201. C
  202. C**** LICHT active les MPOVALs en *MOD
  203. C
  204. C i.e.
  205. C
  206. C SEGACT MPOVSU*MOD
  207. C SEGACT MPOVOL*MOD
  208. C SEGACT MPOVDI*MOD
  209. C SEGACT MPNORM*MOD
  210. C
  211. CALL LICHT(IDU,MPODU,TYPE,IGEOMC)
  212. C SEGACT MPODU*MOD
  213. C
  214. C USDTI initialisé a zero; USDTI = 1 / DT
  215. C
  216. NCEN=MPOVOL.VPOCHA(/1)
  217. I1=NCEN
  218. SEGINI USDTI
  219. C
  220. CALL LICHT(IRES,MPORES,TYPE,IGEOMC)
  221. CALL LICHT(IRN,MPRN,TYPE,IGEOMC)
  222. CALL LICHT(IGN,MPGN,TYPE,IGEOMC)
  223. CALL LICHT(IRETN,MPRETN,TYPE,IGEOMC)
  224. CALL LICHT(IGAMN,MPGAMN,TYPE,IGEOMC)
  225. CALL LICHT(IVCO,MPOCO,TYPE,IGEOMC)
  226. CALL LICHT(ICHLIM,MPLIM,TYPE,MELLIM)
  227. CALL LICHT(ICOEV,MPCOEV,TYPE,IGEOMC)
  228. C
  229. C SEGACT MPORES*MOD
  230. C SEGACT MPRN*MOD
  231. C SEGACT MPGN*MOD
  232. C SEGACT MPRETN*MOD
  233. C SEGACT MPGAMN*MOD
  234. C SEGACT MPOCO
  235. C SEGACT MPLIM*MOD
  236. C SEGACT MPCOEV*MOD
  237. C SEGACT MPTLI*MOD
  238. C
  239. SEGINI, MPOCO1=MPOCO
  240. C
  241. C**** MPOCO1 is the "corrected cut-off" speed.
  242. C It is bigger than the given cut-off and the local
  243. C speed.
  244. C
  245. IF(IGEOMF .NE. MELEMF)THEN
  246. WRITE(IOIMP,*) 'Anomalie dans kfm13.eso'
  247. WRITE(IOIMP,*) 'Probleme de SPG'
  248. C 21 2
  249. C Données incompatibles
  250. CALL ERREUR(21)
  251. GOTO 9999
  252. ENDIF
  253. IF(IGEOMC .NE. MELEMC)THEN
  254. WRITE(IOIMP,*) 'Anomalie dans kfm13.eso'
  255. WRITE(IOIMP,*) 'Probleme de SPG'
  256. C 21 2
  257. C Données incompatibles
  258. CALL ERREUR(21)
  259. GOTO 9999
  260. ENDIF
  261. C
  262. C**** On initialise GAMMA=I+Q1.(Q2)^t
  263. C
  264. I1=5
  265. I2=NCEN
  266. SEGINI Q1
  267. SEGINI Q2
  268. C
  269. C**** On initialise le segment de travail D1
  270. C
  271. I1=5
  272. SEGINI D1
  273. SEGINI NEWLI
  274. C
  275. C**** On initialise AN0, DN0, PHI2V
  276. C
  277. I1=NCEN
  278. SEGINI AN0
  279. SEGINI DN0
  280. SEGINI PHI2V
  281. C
  282. C**** On initialise BN0
  283. C
  284. I1=5
  285. I2=NCEN
  286. SEGINI BN0
  287. C
  288. C**** On initialise BN1
  289. C
  290. I1=5
  291. I2=NCEN
  292. SEGINI BN1
  293. C
  294. C**** On initialise CN0
  295. C
  296. I1=5
  297. I2=NCEN
  298. SEGINI CN0
  299. C
  300. C**** On initialise CN1
  301. C
  302. I1=5
  303. I2=NCEN
  304. SEGINI CN1
  305. C
  306. C**** On initialise SIGMA0, SIGMAV
  307. C
  308. I1=NFAC
  309. SEGINI SIGMA0
  310. SEGINI SIGMAV
  311. C
  312. C**** RES
  313. C
  314. I1=5
  315. I2=NCEN
  316. SEGINI RES
  317. DO ICEN=1,NCEN,1
  318. DO ICOMP=1,5,1
  319. RES.VAL(ICOMP,ICEN)=MPORES.VPOCHA(ICEN,ICOMP)
  320. ENDDO
  321. ENDDO
  322. SEGDES MPORES
  323. C
  324. C***** DU (increment des variables conservatives)
  325. C
  326. I1=5
  327. I2=NCEN
  328. SEGINI DU
  329. C
  330. C**** Les variables conservatives
  331. C
  332. C CONS1.VAL contient les variables conservatives + gamma
  333. C i.e. rho(i) = CONS.VAL(1,i)
  334. C rhoux(i) = CONS.VAL(2,i)
  335. C rhouy(i) = CONS.VAL(3,i)
  336. C rhouz(i) = CONS.VAL(4,i)
  337. C rhoet(i) = CONS.VAL(5,i)
  338. C gam(i) = CONS.VAL(6,i)
  339. C
  340. I1=6
  341. I2=NCEN
  342. SEGINI CONS1
  343. DO ICEN=1,NCEN,1
  344. CONS1.VAL(1,ICEN)=MPRN.VPOCHA(ICEN,1)
  345. CONS1.VAL(2,ICEN)=MPGN.VPOCHA(ICEN,1)
  346. CONS1.VAL(3,ICEN)=MPGN.VPOCHA(ICEN,2)
  347. CONS1.VAL(4,ICEN)=MPGN.VPOCHA(ICEN,3)
  348. CONS1.VAL(5,ICEN)=MPRETN.VPOCHA(ICEN,1)
  349. CONS1.VAL(6,ICEN)=MPGAMN.VPOCHA(ICEN,1)
  350. ENDDO
  351. SEGDES MPRN
  352. SEGDES MPRETN
  353. SEGDES MPGN
  354. SEGDES MPGAMN
  355. C
  356. SEGINI, CONS2=CONS1
  357. C
  358. C**** BOUCLE JACOBI
  359. C
  360. DO IBLJAC=1,NJAC,1
  361. C
  362. C**** BOUCLE SUR FACEL pour le calcul de AN0, BN0
  363. C
  364. DO NLCF = 1, NFAC
  365. C
  366. C******* NLCF = numero local du centre de facel
  367. C NGCF = numero global du centre de facel
  368. C NLCF1 = numero local du centre de face
  369. C NGCEG = numero global du centre ELT "gauche"
  370. C NLCEG = numero local du centre ELT "gauche"
  371. C NGCED = numero global du centre ELT "droite"
  372. C NLCED = numero local du centre ELT "droite"
  373. C
  374. NGCEG = IPT2.NUM(1,NLCF)
  375. NGCED = IPT2.NUM(3,NLCF)
  376. NGCF = IPT2.NUM(2,NLCF)
  377. NLCF1 = MLENT2.LECT(NGCF)
  378. NLCEG = MLENT1.LECT(NGCEG)
  379. NLCED = MLENT1.LECT(NGCED)
  380. C
  381. C******* NLCF != NLCF1 -> l'auteur (MOI) n'a rien compris.
  382. C
  383. IF(NLCF .NE. NLCF1)THEN
  384. WRITE(IOIMP,*) 'Anomalie dedans kfm11.eso'
  385. WRITE(IOIMP,*) 'Probleme de SPG'
  386. C 21 2
  387. C Données incompatibles
  388. CALL ERREUR(21)
  389. GOTO 9999
  390. ENDIF
  391. C
  392. CNX = MPNORM.VPOCHA(NLCF,7)
  393. CNY = MPNORM.VPOCHA(NLCF,8)
  394. CNZ = MPNORM.VPOCHA(NLCF,9)
  395. CTX = MPNORM.VPOCHA(NLCF,1)
  396. CTY = MPNORM.VPOCHA(NLCF,2)
  397. CTZ = MPNORM.VPOCHA(NLCF,3)
  398. CVX = MPNORM.VPOCHA(NLCF,4)
  399. CVY = MPNORM.VPOCHA(NLCF,5)
  400. CVZ = MPNORM.VPOCHA(NLCF,6)
  401.  
  402. SURF= MPOVSU.VPOCHA(NLCF,1)
  403. C
  404. C******* Recuperation des Etats "gauche" et "droite"
  405. C
  406. C
  407. ROG = CONS2.VAL(1,NLCEG)
  408. RUXG = CONS2.VAL(2,NLCEG)
  409. RUYG = CONS2.VAL(3,NLCEG)
  410. RUZG = CONS2.VAL(4,NLCEG)
  411. RETG = CONS2.VAL(5,NLCEG)
  412. GAMG = CONS2.VAL(6,NLCEG)
  413. C
  414. UXG = RUXG / ROG
  415. UYG = RUYG / ROG
  416. UZG = RUZG / ROG
  417. C
  418. UNG = (UXG * CNX) + (UYG * CNY) + (UZG * CNZ)
  419. UTG = (UXG * CTX) + (UYG * CTY) + (UZG * CTZ)
  420. UVG = (UXG * CVX) + (UYG * CVY) + (UZG * CVZ)
  421. C
  422. REC = 0.5D0 * (RUXG**2 + RUYG**2 + RUZG**2)
  423. REC = REC / ROG
  424. PG = (GAMG - 1.0D0) * (RETG - REC)
  425. C
  426. VOLG = MPOVOL.VPOCHA(NLCEG,1)
  427. DIAMG = MPOVDI.VPOCHA(NLCEG,1)
  428. C
  429. ROD = CONS2.VAL(1,NLCED)
  430. RUXD = CONS2.VAL(2,NLCED)
  431. RUYD = CONS2.VAL(3,NLCED)
  432. RUZD = CONS2.VAL(4,NLCED)
  433. RETD = CONS2.VAL(5,NLCED)
  434. GAMD = CONS2.VAL(6,NLCED)
  435. C
  436. UXD = RUXD / ROD
  437. UYD = RUYD / ROD
  438. UZD = RUZD / ROD
  439. C
  440. UND = (UXD * CNX) + (UYD * CNY) + (UZD * CNZ)
  441. UTD = (UXD * CTX) + (UYD * CTY) + (UZD * CTZ)
  442. UVD = (UXD * CVX) + (UYD * CVY) + (UZD * CVZ)
  443. C
  444. REC = 0.5D0 * (RUXD**2 + RUYD**2 + RUZD**2)
  445. REC = REC / ROD
  446. PD = (GAMD - 1.0D0) * (RETD - REC)
  447. C
  448. VOLD = MPOVOL.VPOCHA(NLCED,1)
  449. DIAMD = MPOVDI.VPOCHA(NLCED,1)
  450.  
  451. C
  452. IF(NLCEG .EQ. NLCED)THEN
  453. C Murs ou condition limite
  454. NLLIM=MLELIM.LECT(NGCF)
  455. IF(NLLIM .EQ.0)THEN
  456. C Mur
  457. UND = -1.0D0 * UNG
  458. UTD = UTG
  459. UVD = UVG
  460.  
  461. UXD = UND * CNX + UTD * CTX + UVD * CVX
  462. UYD = UND * CNY + UTD * CTY + UVD * CVY
  463. UZD = UND * CNZ + UTD * CTZ + UVD * CVZ
  464. C
  465. RUXD = ROD * UXD
  466. RUYD = ROD * UYD
  467. RUZD = ROD * UZD
  468. C
  469. ELSE
  470. ROD = MPLIM.VPOCHA(NLLIM,1)
  471. UXD = MPLIM.VPOCHA(NLLIM,2)
  472. UYD = MPLIM.VPOCHA(NLLIM,3)
  473. UZD = MPLIM.VPOCHA(NLLIM,4)
  474. PD = MPLIM.VPOCHA(NLLIM,5)
  475. C
  476. RUXD = ROD * UXD
  477. RUYD = ROD * UYD
  478. RUZD = ROD * UZD
  479. C
  480. GAMD = GAMG
  481. C
  482. UND = (UXD * CNX) + (UYD * CNY) + (UZD * CNZ)
  483. UTD = (UXD * CTX) + (UYD * CTY) + (UZD * CTZ)
  484. UVD = (UXD * CVX) + (UYD * CVY) + (UZD * CVZ)
  485. RETD = ((1.0D0/(GAMD - 1.0D0)) * PD)
  486. & + (0.5D0 * ROD * (UXD**2 + UYD**2 + UZD**2))
  487. VOLD = VOLG
  488. ENDIF
  489. ENDIF
  490. C
  491. C********** We check that density and pressure are positive
  492. C
  493. IF((ROG .LE. 0.0D0) .OR. (ROD .LE. 0.0D0) .OR.
  494. & (PG .LE. 0.0D0) .OR. (PD .LE. 0.0D0))THEN
  495. WRITE(IOIMP,*) 'FMM'
  496. C 22 0
  497. C*********** Opération malvenue. Résultat douteux
  498. C
  499. CALL ERREUR(22)
  500. IPROBL = 1
  501. GOTO 9998
  502. ENDIF
  503. C
  504. C********** Entahlpy
  505. C
  506. RHTG = RETG + PG
  507. RHTD = RETD + PD
  508. C
  509. C********** FIRST JACOBI ITERATION
  510. C
  511. IF(IBLJAC .EQ. 1)THEN
  512. C
  513. C************* We compute the interfacial state
  514. C
  515. ROF = 0.5D0 * (ROG + ROD)
  516. PF = 0.5D0 * (PG + PD)
  517. UNF = 0.5D0 * (UNG + UND)
  518. GAMF = 0.5D0 * (GAMG + GAMD)
  519. C
  520. C************* We compute SIGMA and the corrected cut-off speed
  521. C Here SIGMA is the spectral of the preconditioned Roe
  522. C matrix (|\Gamma^{-1} A| in the referred report)
  523. C
  524. UCOF = MAX(MPOCO.VPOCHA(NLCEG,1),MPOCO.VPOCHA(NLCED,1))
  525. UCOF = MAX(UCOF,((UNG**2+UTG**2+UVG**2)**0.5D0))
  526. UCOF = MAX(UCOF,((UND**2+UTD**2+UVD**2)**0.5D0))
  527. IF(UCOF .GT. MPOCO1.VPOCHA(NLCEG,1)) MPOCO1.VPOCHA(NLCEG
  528. $ ,1)= UCOF
  529. IF(UCOF .GT. MPOCO1.VPOCHA(NLCED,1)) MPOCO1.VPOCHA(NLCED
  530. $ ,1)= UCOF
  531. C
  532. QN = ABS(UNF)
  533. CF = (GAMF * PF / ROF)**0.5D0
  534. IF(UCOF .GE. CF)THEN
  535. PHI2 = 1.0D0
  536. ELSEIF(QN .GT. CF)THEN
  537. PHI2 = 1.0D0
  538. ELSEIF(QN .LT. UCOF)THEN
  539. PHI2 = UCOF / CF
  540. ELSE
  541. PHI2 = QN / CF
  542. ENDIF
  543. PHI2 = PHI2 * PHI2
  544. C
  545. SIGMAF = (1.0D0 - PHI2) * QN
  546. SIGMAF = SIGMAF * SIGMAF
  547. SIGMAF = SIGMAF + (4.0D0 * PHI2 * CF * CF)
  548. SIGMAF = SIGMAF**0.5D0
  549. SIGMAF = SIGMAF + ((1.0D0 + PHI2) * QN)
  550. SIGMAF = 0.5D0 * SIGMAF
  551. C
  552. C************* We store SIGMA into SIGMA0
  553. C
  554. SIGMA0.VALVEC(NLCF) = SIGMAF
  555. C
  556. C************* We compute the dual time step
  557. C
  558. UNSDT = USDTI.VALVEC(NLCEG)
  559. UNSDTF = SIGMAF / DIAMG
  560. IF(UNSDT .LT. UNSDTF) USDTI.VALVEC(NLCEG) = UNSDTF
  561. UNSDT = USDTI.VALVEC(NLCED)
  562. UNSDTF = SIGMAF / DIAMD
  563. IF(UNSDT .LT. UNSDTF) USDTI.VALVEC(NLCED) = UNSDTF
  564. C
  565. C************* We compute AN0
  566. C ANO in the referred report is equal to
  567. C \left(
  568. C \frac{1}{\Delta \tau_i ^0}
  569. C + \frac{1}{2{\Omega_i}}
  570. C \sum_j \sigma_{i,j}^{0} S_j
  571. C \right)
  572. C
  573. AN0.VALVEC(NLCEG) = AN0.VALVEC(NLCEG)
  574. & + (0.5D0 * SIGMAF * SURF / VOLG)
  575. IF(NLCEG .NE. NLCED)
  576. & AN0.VALVEC(NLCED) = AN0.VALVEC(NLCED)
  577. & + (0.5D0 * SIGMAF * SURF / VOLD)
  578. C
  579. C************* We compute SIGMAV
  580. C
  581. C COEF=FG
  582. COEF = (MCOORD.XCOOR(((NGCEG-1)*4)+1)
  583. & -MCOORD.XCOOR(((NGCF-1)*4)+1)) * CNX
  584. COEF = COEF
  585. & + (MCOORD.XCOOR(((NGCEG-1)*4)+2)
  586. & -MCOORD.XCOOR(((NGCF-1)*4)+2)) * CNY
  587. COEF = COEF
  588. & + (MCOORD.XCOOR(((NGCEG-1)*4)+3)
  589. & -MCOORD.XCOOR(((NGCF-1)*4)+3)) * CNZ
  590. C
  591. C COEF1=FD
  592. COEF1 = (MCOORD.XCOOR(((NGCED-1)*4)+1)
  593. & -MCOORD.XCOOR(((NGCF-1)*4)+1)) * CNX
  594. COEF1 = COEF1
  595. & + (MCOORD.XCOOR(((NGCED-1)*4)+2)
  596. & -MCOORD.XCOOR(((NGCF-1)*4)+2)) * CNY
  597. COEF1 = COEF1
  598. & + (MCOORD.XCOOR(((NGCED-1)*4)+3)
  599. & -MCOORD.XCOOR(((NGCF-1)*4)+3)) * CNZ
  600. C
  601. C COEF=|FG|+|FD|
  602. COEF = ABS(COEF)+ABS(COEF1)
  603. SIGMAF = 0.5D0 * (MPCOEV.VPOCHA(NLCEG,1)
  604. & +MPCOEV.VPOCHA(NLCED,1)) / COEF
  605. C
  606. C
  607. SIGMAV.VALVEC(NLCF) = SIGMAF
  608. C
  609. C
  610. C************* We compute the contribution of SIGMAV to
  611. C the diagonal part of the matrix to invert
  612. C
  613. C In the given report, DNO is a_i^0, i.e.
  614. C DN0 = AN0 (previously defined) +
  615. C + (\frac{1}{{\Omega_i}}
  616. C \sum_j \sigma_{V,i,j}^{0} S_j)
  617. C + 1 / \Delta t^n
  618. C
  619. COEF = SURF / VOLG
  620. DN0.VALVEC(NLCEG) = DN0.VALVEC(NLCEG)
  621. & + COEF * SIGMAF
  622. IF(NLCEG .NE. NLCED)THEN
  623. COEF = SURF / VOLD
  624. DN0.VALVEC(NLCED) = DN0.VALVEC(NLCED)
  625. & + COEF * SIGMAF
  626. ENDIF
  627. ENDIF
  628. C
  629. C********** ALL JACOBI ITERATIONS
  630. C
  631. C
  632. C********** On calcule BN1
  633. C
  634. C BN1 in the referred report is given by
  635. C \sum_j
  636. C \left\{
  637. C \frac{S_j}{2 \Omega_i} ~
  638. C \left(
  639. C \mathcal{F}(\mathbf{U}_{j,R}^{\ell})
  640. C -
  641. C 2 \sigma_{V,i,j}^{0}
  642. C \mathbf{U}_{j,R}^{\ell}
  643. C _right)
  644. C \right\}
  645. C
  646. C Central contribution
  647. C
  648. FR = (ROD * UND)
  649. FRUX = (ROD * UND * UXD) + (PD * CNX)
  650. FRUY = (ROD * UND * UYD) + (PD * CNY)
  651. FRUZ = (ROD * UND * UZD) + (PD * CNZ)
  652. FRET = (UND * RHTD)
  653. C
  654. C
  655. COEF = 0.5D0 * SURF / VOLG
  656. C
  657. BN1.VAL(1,NLCEG) = BN1.VAL(1,NLCEG)
  658. & + (COEF * FR)
  659. BN1.VAL(2,NLCEG) = BN1.VAL(2,NLCEG)
  660. & + (COEF * FRUX)
  661. BN1.VAL(3,NLCEG) = BN1.VAL(3,NLCEG)
  662. & + (COEF * FRUY)
  663. BN1.VAL(4,NLCEG) = BN1.VAL(4,NLCEG)
  664. & + (COEF * FRUZ)
  665. BN1.VAL(5,NLCEG) = BN1.VAL(5,NLCEG)
  666. & + (COEF * FRET)
  667. C
  668. C Viscous contribution
  669. C
  670. COEF = SURF * SIGMAV.VALVEC(NLCF) / VOLG
  671. C
  672. BN1.VAL(1,NLCEG) = BN1.VAL(1,NLCEG)
  673. & - (COEF * ROD)
  674. BN1.VAL(2,NLCEG) = BN1.VAL(2,NLCEG)
  675. & - (COEF * RUXD)
  676. BN1.VAL(3,NLCEG) = BN1.VAL(3,NLCEG)
  677. & - (COEF * RUYD)
  678. BN1.VAL(4,NLCEG) = BN1.VAL(4,NLCEG)
  679. & - (COEF * RUZD)
  680. BN1.VAL(5,NLCEG) = BN1.VAL(5,NLCEG)
  681. & - (COEF * RETD)
  682. C
  683. C********** On calcule CN1
  684. C
  685. C CN1 in the referred report is given by
  686. C \sum_j
  687. C \left\{
  688. C \frac{S_j}{2 \Omega_i} ~
  689. C \left(
  690. C \sigma_{i,j}^{0}
  691. C \mathbf{U}_{j,R}^{\ell}
  692. C \right)
  693. C \right\}
  694. C
  695. C
  696. COEF = 0.5D0 * SURF * SIGMA0.VALVEC(NLCF) / VOLG
  697. CN1.VAL(1,NLCEG) = CN1.VAL(1,NLCEG)
  698. & + (COEF * ROD)
  699. CN1.VAL(2,NLCEG) = CN1.VAL(2,NLCEG)
  700. & + (COEF * RUXD)
  701. CN1.VAL(3,NLCEG) = CN1.VAL(3,NLCEG)
  702. & + (COEF * RUYD)
  703. CN1.VAL(4,NLCEG) = CN1.VAL(4,NLCEG)
  704. & + (COEF * RUZD)
  705. CN1.VAL(5,NLCEG) = CN1.VAL(5,NLCEG)
  706. & + (COEF * RETD)
  707. C
  708. IF(NLCEG .NE. NLCED)THEN
  709. C
  710. C********** Domain interieur
  711. C
  712. C Central contribution
  713. C
  714. FR = (ROG * UNG)
  715. FRUX = (ROG * UNG * UXG) + (PG * CNX)
  716. FRUY = (ROG * UNG * UYG) + (PG * CNY)
  717. FRUZ = (ROG * UNG * UZG) + (PG * CNZ)
  718. FRET = (UNG * RHTG)
  719. C
  720. COEF = 0.5D0 * SURF / VOLD
  721. C
  722. BN1.VAL(1,NLCED) = BN1.VAL(1,NLCED)
  723. & - (COEF * FR)
  724. BN1.VAL(2,NLCED) = BN1.VAL(2,NLCED)
  725. & - (COEF * FRUX)
  726. BN1.VAL(3,NLCED) = BN1.VAL(3,NLCED)
  727. & - (COEF * FRUY)
  728. BN1.VAL(4,NLCED) = BN1.VAL(4,NLCED)
  729. & - (COEF * FRUZ)
  730. BN1.VAL(5,NLCED) = BN1.VAL(5,NLCED)
  731. & - (COEF * FRET)
  732. C
  733. C Viscous contribution
  734. C
  735. COEF = SURF * SIGMAV.VALVEC(NLCF) / VOLD
  736. C
  737. BN1.VAL(1,NLCED) = BN1.VAL(1,NLCED)
  738. & - (COEF * ROG)
  739. BN1.VAL(2,NLCED) = BN1.VAL(2,NLCED)
  740. & - (COEF * RUXG)
  741. BN1.VAL(3,NLCED) = BN1.VAL(3,NLCED)
  742. & - (COEF * RUYG)
  743. BN1.VAL(4,NLCED) = BN1.VAL(4,NLCED)
  744. & - (COEF * RUZG)
  745. BN1.VAL(5,NLCED) = BN1.VAL(5,NLCED)
  746. & - (COEF * RETG)
  747. C
  748. C Numerical diffusity contribution
  749. C
  750. COEF = 0.5D0 * SURF * SIGMA0.VALVEC(NLCF) / VOLD
  751. C
  752. CN1.VAL(1,NLCED) = CN1.VAL(1,NLCED)
  753. & + (COEF * ROG)
  754. CN1.VAL(2,NLCED) = CN1.VAL(2,NLCED)
  755. & + (COEF * RUXG)
  756. CN1.VAL(3,NLCED) = CN1.VAL(3,NLCED)
  757. & + (COEF * RUYG)
  758. CN1.VAL(4,NLCED) = CN1.VAL(4,NLCED)
  759. & + (COEF * RUZG)
  760. CN1.VAL(5,NLCED) = CN1.VAL(5,NLCED)
  761. & + (COEF * RETG)
  762.  
  763. ENDIF
  764. C
  765. C********** Fin boucle sur les faces
  766. C
  767. ENDDO
  768.  
  769. C
  770. C********** Loop on the centre
  771. C Computation of GAMMA
  772. C DMAT
  773. C
  774. DO ICEN=1,NCEN,1
  775. C
  776. IF(IBLJAC .EQ. 1)THEN
  777. C
  778. ROG = CONS2.VAL(1,ICEN)
  779. RUXG = CONS2.VAL(2,ICEN)
  780. RUYG = CONS2.VAL(3,ICEN)
  781. RUZG = CONS2.VAL(4,ICEN)
  782. RETG = CONS2.VAL(5,ICEN)
  783. GAMG = CONS2.VAL(6,ICEN)
  784. C
  785. UXG = RUXG / ROG
  786. UYG = RUYG / ROG
  787. UZG = RUZG / ROG
  788. C
  789. REC = 0.5D0 * (RUXG**2 + RUYG**2 + RUZG**2)
  790. REC = REC / ROG
  791. PG = (GAMG - 1.0D0) * (RETG - REC)
  792. C
  793. C************* Note that the Cut-off is the corrected one
  794. C
  795. CG = (GAMG * PG / ROG)**0.5D0
  796. UCOG = MPOCO1.VPOCHA(ICEN,1)
  797. QG = 2.0D0 * REC / ROG
  798. QG = QG**0.5D0
  799. C
  800. IF(UCOG .GE. CG)THEN
  801. PHI2 = 1.0D0
  802. ELSEIF(QG .GT. CG)THEN
  803. PHI2 = 1.0D0
  804. ELSEIF(QG .LT. UCOG)THEN
  805. PHI2 = UCOG / CG
  806. ELSE
  807. PHI2 = QG / CG
  808. ENDIF
  809. PHI2 = PHI2 * PHI2
  810. PHI2V.VALVEC(ICEN) = PHI2
  811. C
  812. C************* We compute GAMMA
  813. C GAMMA=I+((1-PHI2)/PHI2*Q1.(Q2)^t)
  814. C
  815. C In the referred report, Q2 is the line vector
  816. C
  817. C ( \frac{q^2}{2} , -u , -v , 1)
  818. C
  819. C and Q1 is the column vector
  820. C
  821. C \frac{\gamma - 1}{c^2}
  822. C \left(
  823. C \begin{array}{c}
  824. C 1 \\
  825. C u \\
  826. C v \\
  827. C H \\
  828. C \end{array}
  829. C
  830. C
  831. Q2.VAL(1,ICEN) = (0.5D0 * QG * QG)
  832. Q2.VAL(2,ICEN) = -1.0D0 * RUXG / ROG
  833. Q2.VAL(3,ICEN) = -1.0D0 * RUYG / ROG
  834. Q2.VAL(4,ICEN) = -1.0D0 * RUZG / ROG
  835. Q2.VAL(5,ICEN) = 1.0D0
  836. C
  837. COEF1 = (GAMG - 1.0D0) / (CG*CG)
  838. COEF = (1.0D0 / COEF1) + (0.5D0 * QG * QG)
  839. C COEF=HT
  840. Q1.VAL(1,ICEN) = COEF1
  841. Q1.VAL(2,ICEN) = COEF1 * RUXG / ROG
  842. Q1.VAL(3,ICEN) = COEF1 * RUYG / ROG
  843. Q1.VAL(4,ICEN) = COEF1 * RUZG / ROG
  844. Q1.VAL(5,ICEN) = COEF1 * COEF
  845. C
  846. C************* Ebd of the computation of AN0 and DN0
  847. C
  848. AN0.VALVEC(ICEN) = AN0.VALVEC(ICEN)
  849. & + USDTI.VALVEC(ICEN) * 2.0D0 / DCFL
  850. C
  851. DN0.VALVEC(ICEN) = DN0.VALVEC(ICEN)
  852. & + (1.0D0 / DTPS)
  853. C
  854. C
  855. C************* We save BN1, CN1 into BN0 and CN0
  856. C
  857. DO ICOMP=1,5,1
  858. BN0.VAL(ICOMP,ICEN) = BN1.VAL(ICOMP,ICEN)
  859. ENDDO
  860. C
  861. DO ICOMP=1,5,1
  862. CN0.VAL(ICOMP,ICEN) = CN1.VAL(ICOMP,ICEN)
  863. ENDDO
  864. C
  865. ENDIF
  866. C
  867. C********** IBLJAC => 1
  868. C
  869. DO ICOMP=1,5,1
  870. D1.VALVEC(ICOMP) = 0.0D0
  871. ENDDO
  872. C
  873. COEF=0.0D0
  874. DO I1=1,5,1
  875. COEF = COEF
  876. & + (Q2.VAL(I1,ICEN) * (CN1.VAL(I1,ICEN)
  877. & -CN0.VAL(I1,ICEN)))
  878. ENDDO
  879. COEF = COEF
  880. & * (1.0D0 - PHI2V.VALVEC(ICEN)) / PHI2V.VALVEC(ICEN)
  881. C
  882. DO I1=1,5,1
  883. D1.VALVEC(I1) = (CN1.VAL(I1,ICEN) - CN0.VAL(I1,ICEN))
  884. & + (COEF * Q1.VAL(I1,ICEN))
  885. ENDDO
  886. C
  887. C********** At this moment D1 = \Gamma \cdot (\Delta CN1)
  888. C
  889. DO ICOMP=1,5,1
  890. C
  891. C************* First increment
  892. C
  893. D1.VALVEC(ICOMP) = ( D1.VALVEC(ICOMP)
  894. & + RES.VAL(ICOMP,ICEN)
  895. & + (BN0.VAL(ICOMP,ICEN)
  896. & -BN1.VAL(ICOMP,ICEN)))
  897. & / (AN0.VALVEC(ICEN) + DN0.VALVEC(ICEN))
  898. ENDDO
  899. C
  900. C********** At this moment, in the referred report,
  901. C D1 is (\delta \mathbf{U}')^{l+1}_i in section A3
  902. C
  903. C********** Second increment
  904. C
  905. COEF=0.0D0
  906. DO I1=1,5,1
  907. COEF = COEF + (Q2.VAL(I1,ICEN) * D1.VALVEC(I1))
  908. ENDDO
  909. C
  910. C********** COEF is the scalar product between Q2 and the first
  911. C increment.
  912. C Let us multiply it by
  913. C b_i^0 / (a_i^0 + b_i^0)
  914. C
  915. COEF = COEF
  916. & * AN0.VALVEC(ICEN)
  917. & * (PHI2V.VALVEC(ICEN) - 1.0D0)
  918. COEF = COEF
  919. & / ( AN0.VALVEC(ICEN)
  920. & + (DN0.VALVEC(ICEN) * PHI2V.VALVEC(ICEN)))
  921. C
  922. DO I1=1,5,1
  923. D1.VALVEC(I1) = D1.VALVEC(I1) + COEF * Q1.VAL(I1,ICEN)
  924. ENDDO
  925. C
  926. C********** D2 = \delta \mathbf{U}
  927. C
  928. DO ICOMP=1,5,1
  929. DU.VAL(ICOMP,ICEN) = D1.VALVEC(ICOMP)
  930. CONS2.VAL(ICOMP,ICEN) = CONS1.VAL(ICOMP,ICEN)
  931. & + D1.VALVEC(ICOMP)
  932. BN1.VAL(ICOMP,ICEN) = 0.0D0
  933. CN1.VAL(ICOMP,ICEN) = 0.0D0
  934. ENDDO
  935. ENDDO
  936. C
  937. C**** Fin boucle JACOBI
  938. C
  939. ENDDO
  940. C
  941. 9998 CONTINUE
  942. C
  943. C**** Exit Data
  944. C
  945. DO ICEN=1,NCEN,1
  946. DO ICOMP=1,5,1
  947. MPODU.VPOCHA(ICEN,ICOMP) = DU.VAL(ICOMP,ICEN)
  948. ENDDO
  949. ENDDO
  950. C
  951. C
  952. C
  953. SEGSUP DU
  954. SEGSUP RES
  955. SEGSUP CONS1
  956. SEGSUP CONS2
  957. SEGSUP Q1
  958. SEGSUP Q2
  959. SEGSUP D1
  960. SEGSUP SIGMA0
  961. SEGSUP SIGMAV
  962. SEGSUP AN0
  963. SEGSUP BN0
  964. SEGSUP BN1
  965. SEGSUP CN0
  966. SEGSUP CN1
  967. SEGSUP DN0
  968. SEGSUP PHI2V
  969. SEGSUP USDTI
  970. C
  971. SEGDES MPOVSU
  972. SEGDES MPOVDI
  973. SEGDES MPOVOL
  974. SEGDES MPNORM
  975. SEGDES MPOCO
  976. SEGDES MPCOEV
  977. C
  978. SEGSUP MPOCO1
  979. C
  980. SEGSUP NEWLI
  981. C
  982. SEGDES MPODU
  983. C
  984. SEGDES IPT2
  985. SEGSUP MLENT1
  986. SEGSUP MLENT2
  987. C
  988. SEGSUP MLELIM
  989. IF(MPLIM .GT. 0) SEGDES MPLIM
  990. C
  991. 9999 CONTINUE
  992. RETURN
  993. END
  994. C
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  

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