Télécharger kfm11.eso

Retour à la liste

Numérotation des lignes :

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

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