Télécharger kodfl1.eso

Retour à la liste

Numérotation des lignes :

kodfl1
  1. C KODFL1 SOURCE CB215821 20/11/25 13:31:45 10792
  2. SUBROUTINE KODFL1(INDK0,NESP,NORD,TMAX,RUNIV,PROPHY,
  3. & MLRCHE,MLRMFR,
  4. & INDMET,
  5. & ICHPA1, ICHPA2,
  6. & IALF1,IROF1,IVITF1,IPF1,
  7. & IALF2,IROF2,IVITF2,IPF2,
  8. & IUINF1, IUINF2,
  9. & K0, ICHPK0,IGRALP,EPS,
  10. & ICHPSU,ICHPDI,ICHPVO,
  11. & MELEMC,MELEMF,MELEFE,MELLIM,
  12. & ICHRES,
  13. & DT,SURFL,
  14. & LOGNC,LOGAN,MESERR)
  15. C************************************************************************
  16. C
  17. C PROJET : CASTEM 2000
  18. C
  19. C NOM : KODFL1
  20. C
  21. C DESCRIPTION : Voir KONV13
  22. C
  23. C Cas deux dimensions, DEM
  24. C
  25. C LANGAGE : FORTRAN 77 + ESOPE 2000 (avec estensions CISI)
  26. C
  27. C AUTEUR : A. BECCANTINI, DEN/DM2S/SFME/LTMF
  28. C
  29. C************************************************************************
  30. C
  31. C ENTREES
  32. C
  33. C 0) INDK0 = 1 => K0 = constant
  34. C INDK0 = 2 => K0 = variable
  35. C
  36. C 1) Parameters concerning some gas properties
  37. C
  38. C NESP : nombre d'especes dans le melange.
  39. C
  40. C NORD : ordre des polynoms du cv_i
  41. C
  42. C TMAX : maximum temperature for cv expansion
  43. C
  44. C RUNIV : universal constant for gases
  45. C
  46. C PROPHY : thermodynamic properties for the gases
  47. C
  48. C MLRCHE : LISTREEL with the coefS involved in the chemical
  49. C reaction
  50. C
  51. C MLRMFR : LISTREEL with the mass fractions before or after
  52. C the chemical reaction
  53. C
  54. C 2) Numerical scheme
  55. C
  56. C INDMET : 1 VLH (non-reactive) + SS (reactive)
  57. C
  58. C INDMET : 2 SS (non-reactive) + SS (reactive)
  59. C
  60. C INDMET : 3 AUSM+up (non-reactive) + SS (reactive)
  61. C
  62. C 3) Pointers for the CHPOINTs/MCHAML des variables
  63. C
  64. C ICHPA1 : chpoint CENTRE contenant alpha1
  65. C ICHPA2 : chpoint CENTRE contenant alpha2
  66. C
  67. C IALF1 : MCHAML sur "FACEL" contenant alpha1
  68. C ("gauche" et "droite");
  69. C
  70. C IROF1 : MCHAML sur "FACEL" contenant la masse volumique 1
  71. C ("gauche" et "droite");
  72. C
  73. C IVITF1 : MCHAML sur "FACEL" contenant la vitesse 1 dans le repaire
  74. C local (n,t) et les cosinus directeurs des repaire local;
  75. C
  76. C IPF1 : MCHAML sur "FACEL" contenant la pression 1;
  77. C
  78. C IALF2 : MCHAML sur "FACEL" contenant alpha1
  79. C ("gauche" et "droite");
  80. C
  81. C IROF2 : MCHAML sur "FACEL" contenant la masse volumique 1
  82. C ("gauche" et "droite");
  83. C
  84. C IVITF2 : MCHAML sur "FACEL" contenant la vitesse 1 dans le repaire
  85. C local (n,t) et les cosinus directeurs des repaire local;
  86. C
  87. C IPF2 : MCHAML sur "FACEL" contenant la pression 1;
  88. C
  89. C IUINF1 : CHPOINT, one component, "cut-off velocity" 1
  90. C 0 if no Bas MACH
  91. C
  92. C IUINF2 : CHPOINT, one component, "cut-off velocity" 2
  93. C
  94. C
  95. C 4) Others
  96. C
  97. C K0 or
  98. C ICHPK0 : fundamental flame speed
  99. C
  100. C IGRALP : CHPOINT "FACE" contenant grad(alpha)/alpha
  101. C
  102. C EPS : "zero"
  103. C
  104. C ICHPSU : CHPOINT "FACE" contenant la surface des faces
  105. C
  106. C ICHPDI : CHPOINT "CENTRE" contenant le diametre minimum
  107. C de chaque element
  108. C
  109. C ICHPVO : CHPOINT "CENTRE" contenant le volume
  110. C de chaque element
  111. C
  112. C 5) Pointeurs de MELEME de la table DOMAINE
  113. C
  114. C MELEMC : MELEME 'CENTRE' du SPG des CENTRES
  115. C
  116. C MELEMF : MELEME 'FACE' du SPG des FACES
  117. C
  118. C MELEFE : MELEME 'FACEL' du connectivité FACES -> ELEM
  119. C
  120. C MELLIM : MAILLAGE where the flux (or residu) will not be found
  121. C
  122. C SORTIES (il faudrait dire E/S)
  123. C
  124. C ICHRES : pointeurs de CHPOINTs "FACE" des flux aux interfaces:
  125. C
  126. C DT : pas de temps pour le respect de la CFL-like condition
  127. C DT < DIAMEL /2 /max(Lambda_i)
  128. C En maillage regulier cette condition garantie la
  129. C non-interaction des ondes
  130. C
  131. C LOGNC : (LOGICAL): si .TRUE. la methode de Newton-Rapson, utilisée
  132. C dans pour la solution du probleme Riemann n'a pas bien
  133. C marchéee
  134. C
  135. C LOGAN : (LOGICAL): si .TRUE. une anomalie à été detectée
  136. C
  137. C MESERR : pour l'ecriture des messages d'erreurs
  138. C
  139. C************************************************************************
  140. C
  141. C HISTORIQUE (Anomalies et modifications éventuelles)
  142. C
  143. C 07.12.09 Creation
  144. C 21.12.2010 Estension au 3D
  145. C
  146. C************************************************************************
  147. C
  148. C
  149. C N.B.: On suppose qu'on a déjà controllé RO, P > 0
  150. C Y \in (0,1)
  151. C Si non il faut le faire!!!
  152. C
  153. C************************************************************************
  154. C
  155. C
  156. IMPLICIT INTEGER(I-N)
  157. INTEGER I1, I2, ICOMP
  158. & , NESP,NORD ,INDMET
  159. & , ICHPA1, ICHPA2
  160. & , IALF1, IROF1, IVITF1, IPF1
  161. & , IALF2, IROF2, IVITF2, IPF2
  162. & , IUINF1, IUINF2
  163. & , IGRALP, ICHPK0
  164. & , ICHPSU, ICHPDI, ICHPVO, MELEMC, MELEMF, MELEFE, MELLIM
  165. & , IGEOMC, IGEOMF
  166. & , ICHRES
  167. & , NFAC
  168. & , NLCF, NGCEG, NGCED, NLCEG, NLCED
  169. & , NGCF, NLCF1, SPG1, SPG2, NLFL
  170. & , NLHS
  171. REAL*8 TMAX, RUNIV, K0, K0G, K0D, EPS
  172. REAL*8 DT, UNSDT, CELLT, CELLTM
  173. & , AG1C, ALPG1, ROG1, UNG1, UTG1, UVG1, PG1
  174. & , AG2C, ALPG2, ROG2, UNG2, UTG2, UVG2, PG2
  175. & , AD1C, ALPD1, ROD1, UND1, UTD1, UVD1, PD1
  176. & , AD2C, ALPD2, ROD2, UND2, UTD2, UVD2, PD2
  177. & , SURF,CNX, CNY, CNZ, CTX , CTY, CTZ, CVX, CVY, CVZ
  178. & , V_INF
  179. & , GRALX, GRALY, GRALZ
  180. & , CNNA, CTNA, CVNA
  181. & , CELL, DIAMG, DIAMD, DIAM, VOLG, VOLD
  182. & , FLUCEL, SCON1, SG1, SD1, SCON2, SG2, SD2
  183. & , S1_11, S2_22, S1_12, S1_21, S2_12, S2_21
  184. & , S1_21l, S1_12l, S2_21l, S2_12l
  185. & , S1_21r, S1_12r, S2_21r, S2_12r
  186. & , S1_21e, S1_12e, S2_21e, S2_12e
  187. & , RESG(12), RESD(12)
  188. & , SURFL, SURF0
  189. LOGICAL LOGNC, LOGAN
  190. CHARACTER*(40) MESERR
  191. CHARACTER*(8) TYPE
  192. C
  193. C**** Segment des proprietes du gaz
  194. C
  195. SEGMENT PROPHY
  196. REAL*8 XTAB(N1,N2)
  197. C REAL*8 ACV(NORDP1,NESP+1), W(NESP+1), H0K(NESP+1)
  198. C & ,ACVTOG(NORDP1), ACVTOD(NORDP1)
  199. ENDSEGMENT
  200. C N1 = NORD + 3
  201. C N2 = NESP
  202. C
  203. C**** LES INCLUDES
  204. C
  205.  
  206. -INC PPARAM
  207. -INC CCOPTIO
  208. -INC SMCOORD
  209. -INC SMELEME
  210. -INC SMCHAML
  211. C Normal and tangent
  212. POINTEUR MELVNX.MELVAL, MELVNY.MELVAL, MELVNZ.MELVAL,
  213. & MELT1X.MELVAL, MELT1Y.MELVAL, MELT1Z.MELVAL,
  214. & MELT2X.MELVAL, MELT2Y.MELVAL, MELT2Z.MELVAL
  215. POINTEUR MELUN1.MELVAL, MELUT1.MELVAL, MELUV1.MELVAL
  216. POINTEUR MELAL1.MELVAL, MELRO1.MELVAL, MELP1.MELVAL
  217. POINTEUR MELUN2.MELVAL, MELUT2.MELVAL, MELUV2.MELVAL
  218. POINTEUR MELAL2.MELVAL, MELRO2.MELVAL, MELP2.MELVAL
  219. -INC SMCHPOI
  220. POINTEUR MPOVSU.MPOVAL, MPOVDI.MPOVAL, MPOVVO.MPOVAL
  221. & , MPORES.MPOVAL, MPOALP.MPOVAL
  222. & , MPALP1.MPOVAL, MPALP2.MPOVAL
  223. & , MPUIN2.MPOVAL, MPUIN1.MPOVAL
  224. & , MPOK0.MPOVAL
  225. -INC SMLMOTS
  226. -INC SMLENTI
  227. POINTEUR MLELIM.MLENTI
  228. INTEGER JG
  229. -INC SMLREEL
  230. POINTEUR MLRMFR.MLREEL, MLRCHE.MLREEL
  231. C
  232. C**** Segment for the subroutine prithe
  233. C
  234. POINTEUR IWST_L.MLREEL, IWST_R.MLREEL, IWWORK.MLREEL
  235. C 1:(4+IDIM+NESP)
  236. POINTEUR IY.MLREEL
  237. C 1:NESP
  238. POINTEUR ICVL.MLREEL, ICVR.MLREEL, ICVRSS.MLREEL, ICVWOR.MLREEL
  239. C 0:NORD
  240. C
  241. POINTEUR IFLU.MLREEL, IFLULA.MLREEL
  242. C
  243. C**** Surface de flamme totale
  244. C
  245. SURFL = 0.0D0
  246. C
  247. C**** KRIPAD pour la correspondance global/local des conditions limits
  248. C
  249. CALL KRIPAD(MELLIM,MLELIM)
  250. C SEGINI MLELIM
  251. C
  252. C**** Initialisation des MCHAMLs
  253. C
  254. C Alpha
  255. C
  256. MCHEL1 = IALF1
  257. SEGACT MCHEL1
  258. MCHAM1 = MCHEL1.ICHAML(1)
  259. SEGACT MCHAM1
  260. MELAL1 = MCHAM1.IELVAL(1)
  261. SEGDES MCHEL1
  262. SEGDES MCHAM1
  263. C
  264. C Masse volumique
  265. C
  266. MCHEL1 = IROF1
  267. SEGACT MCHEL1
  268. MCHAM1 = MCHEL1.ICHAML(1)
  269. SEGACT MCHAM1
  270. MELRO1 = MCHAM1.IELVAL(1)
  271. SEGDES MCHEL1
  272. SEGDES MCHAM1
  273. C
  274. C Pression
  275. C
  276. MCHEL1 = IPF1
  277. SEGACT MCHEL1
  278. MCHAM1 = MCHEL1.ICHAML(1)
  279. SEGACT MCHAM1
  280. MELP1 = MCHAM1.IELVAL(1)
  281. SEGDES MCHEL1
  282. SEGDES MCHAM1
  283. C
  284. C Vitesse et cosinus directeurs du repere (n,t)
  285. C
  286. MCHEL1 = IVITF1
  287. SEGACT MCHEL1
  288. C
  289. C La vitesse a comme SPG MELEFE
  290. C Le cosinus directeurs ont comme SPG MELEMF
  291. C
  292. C MCHAM1 -> Cosinus directeurs
  293. C MCHAM2 -> Vitesse
  294. C
  295. SPG1 = MCHEL1.IMACHE(1)
  296. SPG2 = MCHEL1.IMACHE(2)
  297. IF((SPG1 .EQ. MELEMF) .AND. (SPG2 .EQ. MELEFE))THEN
  298. MCHAM1 = MCHEL1.ICHAML(1)
  299. MCHAM2 = MCHEL1.ICHAML(2)
  300. ELSEIF((SPG1 .EQ. MELEFE) .AND. (SPG2 .EQ. MELEMF))THEN
  301. MCHAM1 = MCHEL1.ICHAML(2)
  302. MCHAM2 = MCHEL1.ICHAML(1)
  303. ELSE
  304. LOGAN = .TRUE.
  305. GOTO 9999
  306. ENDIF
  307. SEGACT MCHAM1
  308. SEGACT MCHAM2
  309. IF (IDIM .EQ. 2) THEN
  310. MELVNX = MCHAM1.IELVAL(1)
  311. MELVNY = MCHAM1.IELVAL(2)
  312. MELT1X = MCHAM1.IELVAL(3)
  313. MELT1Y = MCHAM1.IELVAL(4)
  314. MELUN1 = MCHAM2.IELVAL(1)
  315. MELUT1 = MCHAM2.IELVAL(2)
  316. ELSE
  317. MELVNX = MCHAM1.IELVAL(1)
  318. MELVNY = MCHAM1.IELVAL(2)
  319. MELVNZ = MCHAM1.IELVAL(3)
  320. MELT1X = MCHAM1.IELVAL(4)
  321. MELT1Y = MCHAM1.IELVAL(5)
  322. MELT1Z = MCHAM1.IELVAL(6)
  323. MELT2X = MCHAM1.IELVAL(7)
  324. MELT2Y = MCHAM1.IELVAL(8)
  325. MELT2Z = MCHAM1.IELVAL(9)
  326. MELUN1 = MCHAM2.IELVAL(1)
  327. MELUT1 = MCHAM2.IELVAL(2)
  328. MELUV1 = MCHAM2.IELVAL(3)
  329. ENDIF
  330. SEGDES MCHAM1
  331. SEGDES MCHAM2
  332. SEGDES MCHEL1
  333. C
  334. C Alpha
  335. C
  336. MCHEL1 = IALF2
  337. SEGACT MCHEL1
  338. MCHAM1 = MCHEL1.ICHAML(1)
  339. SEGACT MCHAM1
  340. MELAL2 = MCHAM1.IELVAL(1)
  341. SEGDES MCHEL1
  342. SEGDES MCHAM1
  343. C
  344. C Masse volumique
  345. C
  346. MCHEL1 = IROF2
  347. SEGACT MCHEL1
  348. MCHAM1 = MCHEL1.ICHAML(1)
  349. SEGACT MCHAM1
  350. MELRO2 = MCHAM1.IELVAL(1)
  351. SEGDES MCHEL1
  352. SEGDES MCHAM1
  353. C
  354. C Pression
  355. C
  356. MCHEL1 = IPF2
  357. SEGACT MCHEL1
  358. MCHAM1 = MCHEL1.ICHAML(1)
  359. SEGACT MCHAM1
  360. MELP2 = MCHAM1.IELVAL(1)
  361. SEGDES MCHEL1
  362. SEGDES MCHAM1
  363. C
  364. C Vitesse et cosinus directeurs du repere (n,t)
  365. C
  366. MCHEL1 = IVITF2
  367. SEGACT MCHEL1
  368. C
  369. C La vitesse a comme SPG MELEFE
  370. C Le cosinus directeurs ont comme SPG MELEMF
  371. C
  372. C MCHAM1 -> Cosinus directeurs
  373. C MCHAM2 -> Vitesse
  374. C
  375. SPG1 = MCHEL1.IMACHE(1)
  376. SPG2 = MCHEL1.IMACHE(2)
  377. IF((SPG1 .EQ. MELEMF) .AND. (SPG2 .EQ. MELEFE))THEN
  378. MCHAM1 = MCHEL1.ICHAML(1)
  379. MCHAM2 = MCHEL1.ICHAML(2)
  380. ELSEIF((SPG1 .EQ. MELEFE) .AND. (SPG2 .EQ. MELEMF))THEN
  381. MCHAM1 = MCHEL1.ICHAML(2)
  382. MCHAM2 = MCHEL1.ICHAML(1)
  383. ELSE
  384. LOGAN = .TRUE.
  385. GOTO 9999
  386. ENDIF
  387. C SEGACT MCHAM1
  388. C MELVNX = MCHAM1.IELVAL(1)
  389. C MELVNY = MCHAM1.IELVAL(2)
  390. C MELT1X = MCHAM1.IELVAL(3)
  391. C MELT1Y = MCHAM1.IELVAL(4)
  392. C SEGDES MCHAM1
  393. SEGACT MCHAM2
  394. MELUN2 = MCHAM2.IELVAL(1)
  395. MELUT2 = MCHAM2.IELVAL(2)
  396. IF (IDIM .EQ. 3) MELUV2 = MCHAM2.IELVAL(3)
  397. SEGDES MCHAM2
  398. SEGDES MCHEL1
  399. C write(*,*) 'Son in kodfl1'
  400. C write(*,*) 'Ho letto gli MCHAM'
  401. C
  402. C**** Segment for fcolre
  403. C
  404. C Chemical coefficients in MLRCHE.MLREEL.
  405. SEGACT MLRCHE
  406. NLHS = 0
  407. DO I1 = 1, NESP, 1
  408. IF (MLRCHE.PROG(I1) .GT. 0.0D0) NLHS = NLHS + 1
  409. C write(*,*) MLRCHE.PROG(I1)
  410. ENDDO
  411. c write(*,*) NLHS
  412. C
  413. C Mass fractions
  414. C MLRMFR.PROG(1) = YINI_first
  415. C MLRMFR.PROG(2) = YFIN_first
  416. C MLRMFR.PROG(3) = YFIN_second
  417. C ...
  418. C MLRMFR.PROG(nLHS+1) = YFIN_nLHS
  419. C MLRMFR.PROG(nLHS+2) = YINI_(nLHS+1)
  420. C
  421. SEGACT MLRMFR
  422. C
  423. C cv, molar weicht formation energy in PROPHY.XTAB,
  424. C already active
  425. C
  426. C States
  427. JG = NESP + IDIM + 4
  428. SEGINI IWWORK
  429. SEGINI IWST_R
  430. SEGINI IWST_L
  431. C
  432. C Mass fractions
  433. JG = NESP
  434. SEGINI IY
  435. C
  436. C Coeff for CV
  437. JG = NORD + 1
  438. SEGINI ICVL
  439. SEGINI ICVR
  440. SEGINI ICVRSS
  441. SEGINI ICVWOR
  442. C
  443. C Fluxes
  444. JG = NESP + IDIM + 4
  445. SEGINI IFLU
  446. SEGINI IFLULA
  447. C
  448. C Since the mixture here considered is homogeneous, we first fill
  449. C the part of IWST_L and IWST_R involving the species mass fractions
  450. C and K0
  451. C
  452. IWST_L.PROG(4 + IDIM) = MLRMFR.PROG(2)
  453. IWST_R.PROG(4 + IDIM) = MLRMFR.PROG(2)
  454. DO I2 = 3, NESP, 1
  455. I1 = 2 + IDIM + I2
  456. C DO I1 = 5 + IDIM, 2 + IDIM + NESP
  457. IWST_L.PROG(I1) = MLRMFR.PROG(I2)
  458. IWST_R.PROG(I1) = MLRMFR.PROG(I2)
  459. ENDDO
  460. IWST_L.PROG(3 + IDIM + NESP) = MLRMFR.PROG(1) - MLRMFR.PROG(2)
  461. IWST_R.PROG(3 + IDIM + NESP) = MLRMFR.PROG(1) - MLRMFR.PROG(2)
  462. C
  463. C
  464. C**** Initialisation des MELEMEs
  465. C
  466. C 'CENTRE', 'FACEL'
  467. C
  468. IPT2 = MELEFE
  469. SEGACT IPT2
  470. NFAC = IPT2.NUM(/2)
  471. C
  472. C**** KRIPAD pour la correspondance global/local de centre
  473. C
  474. CALL KRIPAD(MELEMC,MLENT1)
  475. C
  476. C**** MLENTI1 a MCORD.XCOORD(/1)/(IDIM+1) elements
  477. C
  478. C Si i est le numero global d'un noeud de ICEN,
  479. C MLENT1.LECT(i) contient sa position, i.e.
  480. C
  481. C I = numero global du noeud centre
  482. C MLENT1.LECT(i) = numero local du noeud centre
  483. C
  484. C MLENT1 déjà activé, i.e.
  485. C
  486. C SEGINI MLENT1
  487. C
  488. C
  489. C**** KRIPAD pour la correspondance global/local de 'FACE'
  490. C
  491. CALL KRIPAD(MELEMF,MLENT2)
  492. C SEGINI MLENT2
  493. C
  494. C
  495. C**** CHPOINTs de la normale à alpha
  496. C
  497. CALL LICHT(IGRALP,MPOALP,TYPE,IGEOMF)
  498. IF (INDK0 .EQ. 2) CALL LICHT(ICHPK0,MPOK0,TYPE,IGEOMF)
  499. C SEGACT MPOALP
  500. C SEGDES MPOK0
  501. C
  502. C**** CHPOINTs de la table DOMAINE
  503. C
  504. CALL LICHT(ICHPSU,MPOVSU,TYPE,IGEOMF)
  505. CALL LICHT(ICHPDI,MPOVDI,TYPE,IGEOMC)
  506. CALL LICHT(ICHPVO,MPOVVO,TYPE,IGEOMC)
  507. C
  508. C**** LICHT active les MPOVALs en *MOD
  509. C
  510. C i.e.
  511. C
  512. C SEGACT MPOVSU*MOD
  513. C SEGACT MPOVDI*MOD
  514. C SEGACT MPOVVO*MOD
  515. C
  516. C
  517. C**** Les FLUX aux face
  518. C
  519. CALL LICHT(ICHRES,MPORES,TYPE,IGEOMC)
  520. C SEGACT MPORES*MOD
  521. C
  522. C**** Activation des MCHAMLs
  523. C
  524. SEGACT MELAL1
  525. SEGACT MELRO1
  526. SEGACT MELP1
  527. SEGACT MELUN1
  528. SEGACT MELUT1
  529. SEGACT MELAL2
  530. SEGACT MELRO2
  531. SEGACT MELP2
  532. SEGACT MELUN2
  533. SEGACT MELUT2
  534. SEGACT MELVNX
  535. SEGACT MELVNY
  536. SEGACT MELT1X
  537. SEGACT MELT1Y
  538. IF (IDIM .EQ. 3) THEN
  539. SEGACT MELUV1
  540. SEGACT MELUV2
  541. SEGACT MELVNZ
  542. SEGACT MELT1Z
  543. SEGACT MELT2X
  544. SEGACT MELT2Y
  545. SEGACT MELT2Z
  546. ENDIF
  547. C
  548. C**** Lecture des MPOVALs ICHPA1, ICHPA2
  549. C
  550. CALL LICHT(ICHPA1, MPALP1, TYPE, IGEOMC)
  551. CALL LICHT(ICHPA2, MPALP2, TYPE, IGEOMC)
  552. C SEGACT MPALP1
  553. C SEGACT MPALP2
  554. C
  555. C**** Bas Mach
  556. C
  557. IF(IUINF1 .NE. 0)THEN
  558. CALL LICHT(IUINF2,MPUIN2,TYPE,IGEOMC)
  559. CALL LICHT(IUINF1,MPUIN1,TYPE,IGEOMC)
  560. C SEGACT MPUIN2*MOD
  561. C SEGACT MPUIN1*MOD
  562. ELSE
  563. MPUIN2=0
  564. MPUIN1=0
  565. ENDIF
  566. C
  567. C**** Initialisation de 1/DT et d'autres variables
  568. C
  569. UNSDT = 0.0D0
  570. GRALZ = 0.0D0
  571. CNZ = 0.0D0
  572. CTZ = 0.0D0
  573. CVX = 0.0D0
  574. CVY = 0.0D0
  575. CVZ = 0.0D0
  576. UVG1 = 0.0D0
  577. UVD1 = 0.0D0
  578. UVG2 = 0.0D0
  579. UVD2 = 0.0D0
  580. C
  581. C**** BOUCLE SUR FACEL pour le calcul du FLUX/RESIDU
  582. C
  583. DO NLCF = 1, NFAC
  584. C
  585. C******* NLCF = numero local du centre de facel
  586. C NGCF = numero global du centre de facel
  587. C NLCF1 = numero local du centre de face
  588. C NGCEG = numero global du centre ELT "gauche"
  589. C NLCEG = numero local du centre ELT "gauche"
  590. C NGCED = numero global du centre ELT "droite"
  591. C NLCED = numero local du centre ELT "droite"
  592. C
  593. NGCEG = IPT2.NUM(1,NLCF)
  594. NGCED = IPT2.NUM(3,NLCF)
  595. NGCF = IPT2.NUM(2,NLCF)
  596. NLCF1 = MLENT2.LECT(NGCF)
  597. NLCEG = MLENT1.LECT(NGCEG)
  598. NLCED = MLENT1.LECT(NGCED)
  599. NLFL = MLELIM.LECT(NGCF)
  600. C
  601. VOLG = MPOVVO.VPOCHA(NLCEG,1)
  602. VOLD = MPOVVO.VPOCHA(NLCED,1)
  603. SURF0 = MPOVSU.VPOCHA(NLCF,1)
  604. C
  605. C******* NLCF != NLCF1 -> l'auteur (MOI) n'a rien compris.
  606. C
  607. IF(NLCF .NE. NLCF1)THEN
  608. MESERR = 'Il ne faut pas jouer avec la console. '
  609. LOGAN = .TRUE.
  610. GOTO 9999
  611. ENDIF
  612. IF(NLFL .EQ. 0)THEN
  613. CELLTM = 0.0D0
  614. C
  615. C********** Recuperation des Etats "gauche" et "droite"
  616. C
  617. AG1C = MPALP1.VPOCHA(NLCEG,1)
  618. ALPG1 = MELAL1.VELCHE(1,NLCF)
  619. ROG1 = MELRO1.VELCHE(1,NLCF)
  620. UNG1 = MELUN1.VELCHE(1,NLCF)
  621. UTG1 = MELUT1.VELCHE(1,NLCF)
  622. PG1 = MELP1.VELCHE(1,NLCF)
  623. AG2C = MPALP2.VPOCHA(NLCEG,1)
  624. ALPG2 = MELAL2.VELCHE(1,NLCF)
  625. ROG2 = MELRO2.VELCHE(1,NLCF)
  626. UNG2 = MELUN2.VELCHE(1,NLCF)
  627. UTG2 = MELUT2.VELCHE(1,NLCF)
  628. PG2 = MELP2.VELCHE(1,NLCF)
  629. C
  630. AD1C = MPALP1.VPOCHA(NLCED,1)
  631. ALPD1 = MELAL1.VELCHE(3,NLCF)
  632. ROD1 = MELRO1.VELCHE(3,NLCF)
  633. UND1 = MELUN1.VELCHE(3,NLCF)
  634. UTD1 = MELUT1.VELCHE(3,NLCF)
  635. PD1 = MELP1.VELCHE(3,NLCF)
  636. AD2C = MPALP2.VPOCHA(NLCED,1)
  637. ALPD2 = MELAL2.VELCHE(3,NLCF)
  638. ROD2 = MELRO2.VELCHE(3,NLCF)
  639. UND2 = MELUN2.VELCHE(3,NLCF)
  640. UTD2 = MELUT2.VELCHE(3,NLCF)
  641. PD2 = MELP2.VELCHE(3,NLCF)
  642. C
  643. CNX = MELVNX.VELCHE(1,NLCF)
  644. CNY = MELVNY.VELCHE(1,NLCF)
  645. CTX = MELT1X.VELCHE(1,NLCF)
  646. CTY = MELT1Y.VELCHE(1,NLCF)
  647. C
  648. GRALX = MPOALP.VPOCHA(NLCF,1)
  649. GRALY = MPOALP.VPOCHA(NLCF,2)
  650. C
  651. C GRALX = CNX
  652. C GRALY = CNY
  653. C
  654. IF (IDIM .EQ. 3) THEN
  655. GRALZ = MPOALP.VPOCHA(NLCF,3)
  656. CNZ = MELVNZ.VELCHE(1,NLCF)
  657. CTZ = MELT1Z.VELCHE(1,NLCF)
  658. CVX = MELT2X.VELCHE(1,NLCF)
  659. CVY = MELT2Y.VELCHE(1,NLCF)
  660. CVZ = MELT2Z.VELCHE(1,NLCF)
  661. UVG1 = MELUV1.VELCHE(1,NLCF)
  662. UVD1 = MELUV1.VELCHE(3,NLCF)
  663. UVG2 = MELUV2.VELCHE(1,NLCF)
  664. UVD2 = MELUV2.VELCHE(3,NLCF)
  665. ENDIF
  666. C
  667. CNNA = (GRALX * CNX) + (GRALY * CNY) + (GRALZ * CNZ)
  668. CTNA = (GRALX * CTX) + (GRALY * CTY) + (GRALZ * CTZ)
  669. CVNA = (GRALX * CVX) + (GRALY * CVY) + (GRALZ * CVZ)
  670. C
  671. C if ((ngcf .eq. 90) .or. (ngcf .eq. 84) .or. (ngcf .eq. 110))
  672. C $ then
  673. C write(*,*) 'ngcf = ', ngcf
  674. C endif
  675. C
  676. C write(*,*) cnna
  677. C
  678. C write(*,*) alpg1, rog1, ung1, utg1, pg1
  679. C write(*,*) alpg2, rog2, ung2, utg2, pg2
  680. C write(*,*) alpd1, rod1, und1, utd1, pd1
  681. C write(*,*) alpd2, rod2, und2, utd2, pd2
  682. C
  683. C
  684. C
  685. C********** Computation of the partition of the surface
  686. C
  687. S1_11 = min (ALPG1, ALPD1)
  688. S2_22 = min (ALPG2, ALPD2)
  689. C S2_22 = 1.0d0 - (max (ALPG1, ALPD1))
  690. S1_21 = max (0.0d0, (AD1C - AG1C))
  691. S1_21r = max (0.0d0, (AD1C - ALPD1))
  692. S1_21e = max (0.0d0, (ALPD1 - ALPG1))
  693. S1_21l = max (0.0d0, (ALPG1 - AG1C))
  694. S2_21 = max (0.0d0, (AG2C - AD2C))
  695. S2_21l = max (0.0d0, (AG2C - ALPG2))
  696. S2_21e = max (0.0d0, (ALPG2 - ALPD2))
  697. S2_21r = max (0.0d0, (ALPD2 - AD2C))
  698. C
  699. C S1_21 = min (S1_21, S2_21)
  700. C S2_21 = S1_21
  701. S1_12 = max (0.0d0, (AG1C - AD1C))
  702. S1_12l = max (0.0d0, (AG1C - ALPG1))
  703. S1_12e = max (0.0d0, (ALPG1 - ALPD1))
  704. S1_12r = max (0.0d0, (ALPD1 - AD1C))
  705. S2_12 = max (0.0d0, (AD2C - AG2C))
  706. S2_12r = max (0.0d0, (AD2C - ALPD2))
  707. S2_12e = max (0.0d0, (ALPD2 - ALPG2))
  708. S2_12l = max (0.0d0, (ALPG2 - AG2C))
  709. C
  710. C write(*,*) 'NGCF =', NGCF
  711. C write(*,*) (S1_11 + S2_22 + S1_12 + S1_21)
  712. C write(*,*) (S1_11 + S2_22 + S2_12 + S2_21)
  713. *
  714. C write(*,*) (S1_11 + S2_22 + S1_12 + S1_21)
  715. C write(*,*) (S1_11 + S2_22 + S2_12 + S2_21)
  716. c CNNA = 1.0D0
  717. c CTNA = 0.0D0
  718. c CVNA = 0.0D0
  719. C
  720. C SURFL = Surface which burns * (CNNA)
  721. *
  722. SURFL = SURFL + ((ABS ((S1_12 + S1_21) * CNNA)) * SURF0)
  723. C
  724. C Flame speed
  725. C
  726. IF (INDK0 .EQ. 1) THEN
  727. K0G = K0
  728. K0D = K0
  729. ELSE
  730. K0G = MPOK0.VPOCHA(NLCEG,1)
  731. K0D = MPOK0.VPOCHA(NLCED,1)
  732. ENDIF
  733. IWST_L.PROG(4 + IDIM + NESP) = K0G
  734. IWST_R.PROG(4 + IDIM + NESP) = K0D
  735. C
  736. C********** Riemann problem 1-1
  737. C
  738. IF (S1_11 .GE. EPS) THEN
  739. IWST_L.PROG(1) = ROG1
  740. IWST_L.PROG(2) = UNG1
  741. C IWST_L.PROG(2) = 0.0D0
  742. IWST_L.PROG(3) = UTG1
  743. C IDIM + 2 = 2 in 2D case
  744. IWST_L.PROG(IDIM + 2)= PG1
  745. IWST_L.PROG(IDIM + 3) = 0.0D0
  746. C
  747. IWST_R.PROG(1) = ROD1
  748. IWST_R.PROG(2) = UND1
  749. C IWST_R.PROG(2) = 0.0D0
  750. IWST_R.PROG(3) = UTD1
  751. IWST_R.PROG(IDIM + 2) = PD1
  752. IWST_R.PROG(IDIM + 3) = 0.0D0
  753. IF (IDIM .EQ. 3) THEN
  754. IWST_L.PROG(IDIM + 1) = UVG1
  755. IWST_R.PROG(IDIM + 1) = UVD1
  756. ENDIF
  757. C
  758. C do i2 = 1 , 4 + NESP + IDIM, 1
  759. C write(*,*) i2, iwst_l.prog(i2), iwst_r.prog(i2)
  760. C enddo
  761. C
  762. IF (INDMET .EQ. 1) THEN
  763. CALL FVLHRE(IDIM, NESP, NLHS, NORD,
  764. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  765. & TMAX,
  766. & CNNA, CTNA, CVNA,
  767. & IWST_L.PROG,
  768. & IWST_R.PROG,
  769. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  770. & ICVRSS.PROG, ICVWOR.PROG,
  771. & IFLU.PROG, IFLULA.PROG, CELLT,
  772. & LOGAN)
  773. ELSEIF(INDMET .EQ. 2)THEN
  774. CALL FBECRE(IDIM, NESP, NLHS, NORD,
  775. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  776. & TMAX,
  777. & CNNA, CTNA, CVNA,
  778. & IWST_L.PROG,
  779. & IWST_R.PROG,
  780. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  781. & ICVRSS.PROG, ICVWOR.PROG,
  782. & IFLU.PROG, IFLULA.PROG, CELLT,
  783. & LOGAN)
  784. ELSEIF(INDMET .EQ. 3)THEN
  785. C
  786. C********** AUSMP-up
  787. C
  788. V_INF=MAX(MPUIN1.VPOCHA(NLCEG,1),
  789. & MPUIN1.VPOCHA(NLCED,1))
  790. CALL FAUSRE(IDIM, NESP, NLHS, NORD,
  791. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  792. & TMAX,V_INF,
  793. & CNNA, CTNA, CVNA,
  794. & IWST_L.PROG,
  795. & IWST_R.PROG,
  796. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  797. & ICVRSS.PROG, ICVWOR.PROG,
  798. & IFLU.PROG, IFLULA.PROG, CELLT,
  799. & LOGAN)
  800. ENDIF
  801.  
  802. C write(*,*) 'Riemann problem 1-1'
  803. C write(*,*) iflula.prog(idim+1), iflu.prog(idim+1)
  804. C
  805. C subroutine fcolre(ndim, nesp, nLHS, nordpo,
  806. C & reacoe, aprop, Runiv,
  807. C & Tmaxcv,
  808. C & wvect_l,
  809. C & wvect_r,
  810. C & wwork, y, acv_l, acv_r, acv_rss, acv_work,
  811. C & flu, flu_lag, cellt,
  812. C & logan)
  813. C
  814. C
  815. IF (LOGAN) THEN
  816. WRITE(IOIMP,*) 'SUBROUTINE KODFL1'
  817. WRITE(IOIMP,*) 'RIEMANN PROBLEM 1-1'
  818. WRITE(IOIMP,*) 'FACE ', NGCF, ' S11 ', S1_11
  819. WRITE(IOIMP,*) ' ICOMP WVECT_L WVECT_R'
  820. DO I2 = 1, 2 + IDIM
  821. WRITE(IOIMP,'(I6,2E16.6)') I2, IWST_L.PROG(I2),
  822. $ IWST_R.PROG(I2)
  823. ENDDO
  824. WRITE(IOIMP,*) 'ANOMALY DETECTED'
  825. GOTO 9999
  826. ENDIF
  827. C
  828. CELLTM = MAX(CELLT, CELLTM)
  829. C
  830. C************* Ecriture du residu
  831. C
  832. C FLUX(2) = RO Un RO Un
  833. C FLUX(3) = RO Un Un + P -> RO Un Ux + P CNX
  834. C FLUX(4) = RO Un Ut -> RO Un Uy + P CNY
  835. C FLUX(2 + IDIM) = RO Un Et RO Un Et
  836. C
  837. SURF = SURF0 * S1_11
  838. FLUCEL = IFLU.PROG(1) * SURF
  839. C write(*,*) 'flux', iflu.prog(1)
  840. C write(*,*) 'nlceg, nlced', nlceg, nlced
  841. C write(*,*) 'surf', surf
  842. C
  843. C Rho un
  844. C
  845. MPORES.VPOCHA(NLCEG,2) = MPORES.VPOCHA(NLCEG,2) -
  846. & (FLUCEL / VOLG)
  847. IF (NLCED .NE. NLCEG)
  848. & MPORES.VPOCHA(NLCED,2) = MPORES.VPOCHA(NLCED,2) +
  849. & (FLUCEL / VOLD)
  850. C
  851. C Rho (Un Ux + P CNX)
  852. C NB : In 2D (IFLU.PROG(4)*CVX) = RO Un Et * 0 = 0
  853. C In 3D (IFLU.PROG(4)*CVX) = RO Un uv * CVX
  854. C
  855. FLUCEL = ( (IFLU.PROG(2)*CNX) + (IFLU.PROG(3)*CTX) +
  856. & (IFLU.PROG(4)*CVX)) * SURF
  857. MPORES.VPOCHA(NLCEG,3) = MPORES.VPOCHA(NLCEG,3) -
  858. & (FLUCEL / VOLG)
  859. IF (NLCED .NE. NLCEG)
  860. & MPORES.VPOCHA(NLCED,3) = MPORES.VPOCHA(NLCED,3) +
  861. & (FLUCEL / VOLD)
  862. C
  863. C Rho (Un Uy + P CNY)
  864. C
  865. FLUCEL = ( (IFLU.PROG(2)*CNY) + (IFLU.PROG(3)*CTY)
  866. & + (IFLU.PROG(4)*CVY) ) * SURF
  867. MPORES.VPOCHA(NLCEG,4) = MPORES.VPOCHA(NLCEG,4) -
  868. & (FLUCEL / VOLG)
  869. IF (NLCED .NE. NLCEG)
  870. & MPORES.VPOCHA(NLCED,4) = MPORES.VPOCHA(NLCED,4) +
  871. & (FLUCEL / VOLD)
  872. C
  873. C Rho (Un Uz + P CNZ)
  874. C
  875. IF (IDIM .EQ. 3) THEN
  876. FLUCEL = ( (IFLU.PROG(2)*CNZ) + (IFLU.PROG(3)*CTZ)
  877. & + (IFLU.PROG(4)*CVZ) ) * SURF
  878. MPORES.VPOCHA(NLCEG,5) = MPORES.VPOCHA(NLCEG,5) -
  879. & (FLUCEL / VOLG)
  880. IF (NLCED .NE. NLCEG)
  881. & MPORES.VPOCHA(NLCED,5) = MPORES.VPOCHA(NLCED,5) +
  882. & (FLUCEL / VOLD)
  883. ENDIF
  884. C
  885. C Rho Un et
  886. C
  887. FLUCEL = IFLU.PROG(2 + IDIM) * SURF
  888. MPORES.VPOCHA(NLCEG,3 + IDIM) =
  889. & MPORES.VPOCHA(NLCEG, 3 + IDIM) -
  890. & (FLUCEL / VOLG)
  891. IF (NLCED .NE. NLCEG)
  892. & MPORES.VPOCHA(NLCED, 3 + IDIM) =
  893. & MPORES.VPOCHA(NLCED, 3 + IDIM) +
  894. & (FLUCEL / VOLD)
  895. C
  896. ENDIF
  897. C
  898. C********** Riemann problem 2-2
  899. C
  900. IF (S2_22 .GE. EPS) THEN
  901. IWST_L.PROG(1) = ROG2
  902. IWST_L.PROG(2) = UNG2
  903. C IWST_L.PROG(2) = 0.0D0
  904. IWST_L.PROG(3) = UTG2
  905. IWST_L.PROG(IDIM + 2) = PG2
  906. IWST_L.PROG(IDIM + 3) = 1.0D0
  907. C
  908. IWST_R.PROG(1) = ROD2
  909. IWST_R.PROG(2) = UND2
  910. C IWST_R.PROG(2) = 0.0D0
  911. IWST_R.PROG(3) = UTD2
  912. IWST_R.PROG(IDIM + 2) = PD2
  913. IWST_R.PROG(IDIM + 3) = 1.0D0
  914. IF (IDIM .EQ. 3) THEN
  915. IWST_L.PROG(4) = UVG2
  916. IWST_R.PROG(4) = UVD2
  917. ENDIF
  918. C
  919. C do i2 = 1 , 4 + NESP + IDIM, 1
  920. C write(*,*) i2, iwst_l.prog(i2), iwst_r.prog(i2)
  921. C enddo
  922. C
  923. IF (INDMET .EQ. 1) THEN
  924. CALL FVLHRE(IDIM, NESP, NLHS, NORD,
  925. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  926. & TMAX,
  927. & CNNA, CTNA, CVNA,
  928. & IWST_L.PROG,
  929. & IWST_R.PROG,
  930. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  931. & ICVRSS.PROG, ICVWOR.PROG,
  932. & IFLU.PROG, IFLULA.PROG, CELLT,
  933. & LOGAN)
  934. ELSEIF(INDMET .EQ. 2)THEN
  935. CALL FBECRE(IDIM, NESP, NLHS, NORD,
  936. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  937. & TMAX,
  938. & CNNA, CTNA, CVNA,
  939. & IWST_L.PROG,
  940. & IWST_R.PROG,
  941. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  942. & ICVRSS.PROG, ICVWOR.PROG,
  943. & IFLU.PROG, IFLULA.PROG, CELLT,
  944. & LOGAN)
  945. ELSEIF(INDMET .EQ. 3)THEN
  946. C
  947. C********** AUSMP-up
  948. C
  949. V_INF=MAX(MPUIN2.VPOCHA(NLCEG,1),
  950. & MPUIN2.VPOCHA(NLCED,1))
  951. CALL FAUSRE(IDIM, NESP, NLHS, NORD,
  952. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  953. & TMAX, V_INF,
  954. & CNNA, CTNA, CVNA,
  955. & IWST_L.PROG,
  956. & IWST_R.PROG,
  957. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  958. & ICVRSS.PROG, ICVWOR.PROG,
  959. & IFLU.PROG, IFLULA.PROG, CELLT,
  960. & LOGAN)
  961. ENDIF
  962. C
  963. C write(*,*) 'Riemann problem 2-2'
  964. C write(*,*) iflula.prog(idim+1), iflu.prog(idim+1)
  965. C
  966. C subroutine fcolre(ndim, nesp, nLHS, nordpo,
  967. C & reacoe, aprop, Runiv,
  968. C & Tmaxcv,
  969. C & wvect_l,
  970. C & wvect_r,
  971. C & wwork, y, acv_l, acv_r, acv_rss, acv_work,
  972. C & flu, flu_lag, cellt,
  973. C & logan)
  974. C
  975. C
  976. IF (LOGAN) THEN
  977. WRITE(IOIMP,*) 'SUBROUTINE KODFL1'
  978. WRITE(IOIMP,*) 'RIEMANN PROBLEM 2-2'
  979. WRITE(IOIMP,*) 'FACE ', NGCF, ' S22 ', S2_22
  980. WRITE(IOIMP,*) ' ICOMP WVECT_L WVECT_R'
  981. DO I2 = 1, 2 + IDIM
  982. WRITE(IOIMP,'(I6,2E16.6)') I2, IWST_L.PROG(I2),
  983. $ IWST_R.PROG(I2)
  984. ENDDO
  985. WRITE(IOIMP,*) 'ANOMALY DETECTED'
  986. GOTO 9999
  987. ENDIF
  988. C
  989. CELLTM = MAX(CELLT, CELLTM)
  990. C
  991. C
  992. C************* Ecriture du residu
  993. C
  994. C FLUX(7) = RO Un RO Un
  995. C FLUX(8) = RO Un Un + P -> RO Un Ux + P CNX
  996. C FLUX(9) = RO Un Ut -> RO Un Uy + P CNY
  997. C FLUX(10)= RO Un Et RO Un Et
  998. C
  999. SURF = SURF0 * S2_22
  1000. C
  1001. C Rho un
  1002. C
  1003. FLUCEL = IFLU.PROG(1) * SURF
  1004. MPORES.VPOCHA(NLCEG, (IDIM + 5)) =
  1005. & MPORES.VPOCHA(NLCEG, (IDIM + 5)) -
  1006. & (FLUCEL / VOLG)
  1007. IF (NLCED .NE. NLCEG)
  1008. & MPORES.VPOCHA(NLCED, (IDIM + 5)) =
  1009. & MPORES.VPOCHA(NLCED, (IDIM + 5)) +
  1010. & (FLUCEL / VOLD)
  1011. C
  1012. C Rho un ux + P cnx
  1013. C
  1014. FLUCEL = ((IFLU.PROG(2)*CNX) + (IFLU.PROG(3)*CTX) +
  1015. & (IFLU.PROG(4)*CVX)) * SURF
  1016. MPORES.VPOCHA(NLCEG, (IDIM + 6)) =
  1017. & MPORES.VPOCHA(NLCEG, (IDIM + 6)) -
  1018. & (FLUCEL / VOLG)
  1019. IF (NLCED .NE. NLCEG)
  1020. & MPORES.VPOCHA(NLCED, (IDIM + 6)) =
  1021. & MPORES.VPOCHA(NLCED, (IDIM + 6)) +
  1022. & (FLUCEL / VOLD)
  1023. C
  1024. C Rho un uy + P cny
  1025. C
  1026. FLUCEL = ((IFLU.PROG(2)*CNY) + (IFLU.PROG(3)*CTY) +
  1027. & (IFLU.PROG(4)*CVY)) * SURF
  1028. MPORES.VPOCHA(NLCEG, (IDIM + 7)) =
  1029. & MPORES.VPOCHA(NLCEG, (IDIM + 7)) -
  1030. & (FLUCEL / VOLG)
  1031. IF (NLCED .NE. NLCEG)
  1032. & MPORES.VPOCHA(NLCED, (IDIM + 7)) =
  1033. & MPORES.VPOCHA(NLCED, (IDIM + 7)) +
  1034. & (FLUCEL / VOLD)
  1035. C
  1036. C Rho un uz + P cnz
  1037. C
  1038. IF (IDIM .EQ. 3) THEN
  1039. FLUCEL = ((IFLU.PROG(2)*CNZ) + (IFLU.PROG(3)*CTZ) +
  1040. & (IFLU.PROG(4)*CVZ)) * SURF
  1041. MPORES.VPOCHA(NLCEG, (IDIM + 8)) =
  1042. & MPORES.VPOCHA(NLCEG, (IDIM + 8)) -
  1043. & (FLUCEL / VOLG)
  1044. IF (NLCED .NE. NLCEG)
  1045. & MPORES.VPOCHA(NLCED, (IDIM + 8)) =
  1046. & MPORES.VPOCHA(NLCED, (IDIM + 8)) +
  1047. & (FLUCEL / VOLD)
  1048. ENDIF
  1049. C
  1050. C Rho un et
  1051. C
  1052. FLUCEL = IFLU.PROG(IDIM + 2) * SURF
  1053. MPORES.VPOCHA(NLCEG, ((2 * IDIM) + 6)) =
  1054. & MPORES.VPOCHA(NLCEG, ((2 * IDIM) + 6)) -
  1055. & (FLUCEL / VOLG)
  1056. IF (NLCED .NE. NLCEG)
  1057. & MPORES.VPOCHA(NLCED, ((2 * IDIM) + 6)) =
  1058. & MPORES.VPOCHA(NLCED, ((2 * IDIM) + 6)) +
  1059. & (FLUCEL / VOLD)
  1060. ENDIF
  1061. C
  1062. C********** Riemann problem 1-2
  1063. C From a numerical point of view, S1_12 and S2_12 are identical.
  1064. C The volume fraction of 1 is larger in l than in r.
  1065. C
  1066. C rho, u, p for the phase 1 and 2.
  1067. C NB in case of wall-boundary conditions, we cannot be here
  1068. C since ALPD1 = ALPG1, ALPD2 = ALPG2.
  1069. C
  1070. IF ((S1_12 .gt. EPS) .or. (S2_12 .gt. EPS)) THEN
  1071. C
  1072. IWST_L.PROG(1) = ROG1
  1073. IWST_L.PROG(2) = UNG1
  1074. C IWST_L.PROG(2) = 0.0D0
  1075. IWST_L.PROG(3) = UTG1
  1076. IWST_L.PROG(IDIM + 2) = PG1
  1077. IWST_L.PROG(IDIM + 3) = 0.0D0
  1078. C
  1079. IWST_R.PROG(1) = ROD2
  1080. IWST_R.PROG(2) = UND2
  1081. C IWST_R.PROG(2) = 0.0D0
  1082. IWST_R.PROG(3) = UTD2
  1083. IWST_R.PROG(IDIM + 2) = PD2
  1084. IWST_R.PROG(IDIM + 3) = 1.0D0
  1085. IF (IDIM .EQ. 3) THEN
  1086. IWST_L.PROG(4) = UVG1
  1087. IWST_R.PROG(4) = UVD2
  1088. ENDIF
  1089. C
  1090. C do i2 = 1 , 4 + NESP + IDIM, 1
  1091. C write(*,*) i2, iwst_l.prog(i2), iwst_r.prog(i2)
  1092. C enddo
  1093. C
  1094. CALL FBECRE(IDIM, NESP, NLHS, NORD,
  1095. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  1096. & TMAX,
  1097. & CNNA, CTNA, CVNA,
  1098. & IWST_L.PROG,
  1099. & IWST_R.PROG,
  1100. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  1101. & ICVRSS.PROG, ICVWOR.PROG,
  1102. & IFLU.PROG, IFLULA.PROG, CELLT,
  1103. & LOGAN)
  1104. C
  1105. C write(*,*) 'Riemann problem 1-2'
  1106. C write(*,*) iflula.prog(idim+1), iflu.prog(idim+1)
  1107. C
  1108. C subroutine fcolre(ndim, nesp, nLHS, nordpo,
  1109. C & reacoe, aprop, Runiv,
  1110. C & Tmaxcv,
  1111. C & wvect_l,
  1112. C & wvect_r,
  1113. C & wwork, y, acv_l, acv_r, acv_rss, acv_work,
  1114. C & flu, flu_lag, cellt,
  1115. C & logan)
  1116. C
  1117. IF (LOGAN) THEN
  1118. WRITE(IOIMP,*) 'SUBROUTINE KODFL1'
  1119. WRITE(IOIMP,*) 'RIEMANN PROBLEM 1-2'
  1120. WRITE(IOIMP,*) 'FACE ', NGCF, ' S12 ', S1_12, S2_12
  1121. WRITE(IOIMP,*) ' ICOMP WVECT_L WVECT_R'
  1122. DO I2 = 1, 2 + IDIM
  1123. WRITE(IOIMP,'(I6,2E16.6)') I2, IWST_L.PROG(I2),
  1124. $ IWST_R.PROG(I2)
  1125. ENDDO
  1126. WRITE(IOIMP,*) 'ANOMALY DETECTED'
  1127. GOTO 9999
  1128. ENDIF
  1129. C
  1130. CELLTM = MAX(CELLT, CELLTM)
  1131. C
  1132. C************* Ecriture du residu
  1133. C
  1134. C FLUX(7) = RO Un RO Un
  1135. C FLUX(8) = RO Un Un + P -> RO Un Ux + P CNX
  1136. C FLUX(9) = RO Un Ut -> RO Un Uy + P CNY
  1137. C FLUX(10)= RO Un Et RO Un Et
  1138. C
  1139. C FLULA(3+IDIM) = - D_resh, with D_resh is the reactive shock
  1140. C speed
  1141. C
  1142. C We update resu (we are dealing with a reactive
  1143. C Riemann problem)
  1144. C
  1145. IF (IFLULA.PROG(IDIM + 3) .LT. 0.0D0) THEN
  1146. C
  1147. C Note that IFLULA.PROG(IDIM + 3) = - D_resh
  1148. C
  1149. C t
  1150. C |F / Flag
  1151. C ---> --->
  1152. C | /
  1153. C 1 | / 2
  1154. C | /
  1155. C |/
  1156. C ------------------------------> x
  1157. C ifac ifac+1
  1158. C
  1159. C D_resh > 0
  1160. C IFLULA.PROG(5) < 0
  1161. C
  1162. C Definition of SCON (conservative surface) and SG and SD
  1163. C (lagrangian surfaces)
  1164. C
  1165. c NB SCON > 0 if, for a positive conservative flux, gives negative
  1166. C contribution in ifac and positive contribution
  1167. C in ifac+1
  1168. C If follows that SCON \ge 0
  1169. C SG and SD > 0 if, for a positive lagrangian flux, gives
  1170. C negative contribution in ifac and negative
  1171. C contributuion in ifac+1
  1172. C
  1173.  
  1174. C In first order case :
  1175. C PHASE 1, conservative contribution in ifac (-F) and ifac+1 (+F)
  1176. C non-conservative contribution in ifac+1 (-Flag)
  1177. C negative contribution => SG and SD > 0
  1178. C
  1179. SCON1 = S1_12E
  1180. SD1 = S1_12E + S1_12R
  1181. SG1 = S1_12L
  1182. C In first order case :
  1183. C PHASE 2, no conservative contribution
  1184. C non-conservative contribution in ifac+1 (Flag)
  1185. C positive contribution => SG and SD < 0
  1186. C
  1187. SCON2 = 0.0D0
  1188. SD2 = -1.0D0 * (S2_12E + S2_12R)
  1189. SG2 = -1.0D0 * S2_12L
  1190. ELSE
  1191. C
  1192. C t
  1193. C \Flag | F
  1194. C ---> --->
  1195. C \ |
  1196. C 1 \ | 2
  1197. C \ |
  1198. C \|
  1199. C ------------------------------> x
  1200. C ifac ifac+1
  1201. C
  1202. C D_resh < 0
  1203. C IFLULA.PROG(IDIM + 3) > 0
  1204. C
  1205. C In first order case :
  1206. C PHASE 1, no conservative contribution in ifac and ifac+1
  1207. C non-conservative contribution in ifac (-Flag)
  1208. C negative contribution => SG and SD > 0
  1209. C
  1210. SCON1 = 0.0D0
  1211. SG1 = S1_12E + S1_12L
  1212. SD1 = S1_12R
  1213. C In first order case :
  1214. C PHASE 2, conservative contribution in ifac and ifac+1
  1215. C non-conservative contribution in ifac (Flag)
  1216. C positive contribution => SG and SD < 0
  1217. C
  1218. SCON2 = S2_12E
  1219. SG2 = -1.0D0 * (S2_12L + S2_12E)
  1220. SD2 = -1.0D0 * S2_12R
  1221. ENDIF
  1222. SURF = SURF0
  1223. CALL RDEMUP(IDIM, 0,
  1224. & SCON1, SG1, SD1,
  1225. & SCON2, SG2, SD2,
  1226. & SURF,VOLG,VOLD,
  1227. & CNX,CNY,CNZ,CTX,CTY,CTZ,CVX,CVY,CVZ,
  1228. & IFLU.PROG,IFLULA.PROG,RESG,RESD)
  1229. C write(*,*) 'RESD'
  1230. DO ICOMP = 1, ((2 * IDIM) + 6)
  1231. MPORES.VPOCHA(NLCED,ICOMP) =
  1232. & MPORES.VPOCHA(NLCED,ICOMP) + RESD(ICOMP)
  1233. C write(*,*) ICOMP, RESD(ICOMP)
  1234. ENDDO
  1235. C write(*,*) 'RESG'
  1236. DO ICOMP = 1, ((2 * IDIM) + 6)
  1237. MPORES.VPOCHA(NLCEG,ICOMP) =
  1238. & MPORES.VPOCHA(NLCEG,ICOMP) + RESG(ICOMP)
  1239. C write(*,*) ICOMP, RESG(ICOMP)
  1240. ENDDO
  1241. ENDIF
  1242. C
  1243. C********** Riemann problem 2-1
  1244. C From a numerical point of view, S2_21 and S2_21 are identical.
  1245. C The volume fraction of 2 is larger in l than in r.
  1246. C
  1247. C rho, u, p for the phase 1 and 2.
  1248. C
  1249. C NB in case of wall-boundary conditions, we cannot be here
  1250. C since ALPD1 = ALPG1, ALPD2 = ALPG2.
  1251. C
  1252. IF ((S1_21 .gt. EPS) .or. (S2_21 .gt. EPS)) THEN
  1253. C
  1254. C
  1255. IWST_L.PROG(1) = ROG2
  1256. IWST_L.PROG(2) = UNG2
  1257. CC IWST_L.PROG(2) = 0.0D0
  1258. IWST_L.PROG(3) = UTG2
  1259. IWST_L.PROG(IDIM + 2) = PG2
  1260. IWST_L.PROG(IDIM + 3) = 1.0D0
  1261. CC
  1262. IWST_R.PROG(1) = ROD1
  1263. IWST_R.PROG(2) = UND1
  1264. C IWST_R.PROG(2) = 0.0D0
  1265. IWST_R.PROG(3) = UTD1
  1266. IWST_R.PROG(IDIM + 2) = PD1
  1267. IWST_R.PROG(IDIM + 3) = 0.0D0
  1268. C
  1269. IF (IDIM .EQ. 3) THEN
  1270. IWST_L.PROG(4) = UVG2
  1271. IWST_R.PROG(4) = UVD1
  1272. ENDIF
  1273. C
  1274. CC
  1275. C do i2 = 1 , 4 + NESP + IDIM, 1
  1276. C write(*,*) i2, iwst_l.prog(i2), iwst_r.prog(i2)
  1277. C enddo
  1278. C
  1279. CALL FBECRE(IDIM, NESP, NLHS, NORD,
  1280. & MLRCHE.PROG, PROPHY.XTAB, RUNIV,
  1281. & TMAX,
  1282. & CNNA, CTNA, CVNA,
  1283. & IWST_L.PROG,
  1284. & IWST_R.PROG,
  1285. & IWWORK.PROG, IY.PROG, ICVL.PROG, ICVR.PROG,
  1286. & ICVRSS.PROG, ICVWOR.PROG,
  1287. & IFLU.PROG, IFLULA.PROG, CELLT,
  1288. & LOGAN)
  1289. C write(*,*) 'Riemann problem 1-2'
  1290. C write(*,*) iflula.prog(idim+1), iflu.prog(idim+1)
  1291. C
  1292. C subroutine fcolre(ndim, nesp, nLHS, nordpo,
  1293. C & reacoe, aprop, Runiv,
  1294. C & Tmaxcv,
  1295. C & wvect_l,
  1296. C & wvect_r,
  1297. C & wwork, y, acv_l, acv_r, acv_rss, acv_work,
  1298. C & flu, flu_lag, cellt,
  1299. C & logan)
  1300. C
  1301. IF (LOGAN) THEN
  1302. WRITE(IOIMP,*) 'SUBROUTINE KODFL1'
  1303. WRITE(IOIMP,*) 'RIEMANN PROBLEM 2-1'
  1304. WRITE(IOIMP,*) 'FACE ', NGCF, ' S21 ', S1_21, S2_21
  1305. WRITE(IOIMP,*) ' ICOMP WVECT_L WVECT_R'
  1306. DO I2 = 1, 2 + IDIM
  1307. WRITE(IOIMP,'(I6,2E16.6)') I2, IWST_L.PROG(I2),
  1308. $ IWST_R.PROG(I2)
  1309. ENDDO
  1310. WRITE(IOIMP,*) 'ANOMALY DETECTED'
  1311. GOTO 9999
  1312. ENDIF
  1313. C
  1314. CELLTM = MAX(CELLT, CELLTM)
  1315. C
  1316. C************* Ecriture du residu
  1317. C
  1318. C FLUX(7) = RO Un RO Un
  1319. C FLUX(8) = RO Un Un + P -> RO Un Ux + P CNX
  1320. C FLUX(9) = RO Un Ut -> RO Un Uy + P CNY
  1321. C FLUX(10)= RO Un Et RO Un Et
  1322. C
  1323. C FLULA(3+IDIM) = - D_resh, with D_resh is the reactive shock
  1324. C speed
  1325. C
  1326. C
  1327. C We update resu (we are dealing with a reactive
  1328. C Riemann problem)
  1329. C
  1330. IF (IFLULA.PROG(IDIM + 3) .LT. 0.0D0) THEN
  1331. C
  1332. C Note that IFLULA.PROG(IDIM + 3) = - D_resh
  1333. C
  1334. C t
  1335. C |F / Flag
  1336. C ---> --->
  1337. C | /
  1338. C 2 | / 1
  1339. C | /
  1340. C |/
  1341. C ------------------------------> x
  1342. C ifac ifac+1
  1343. C
  1344. C D_resh > 0
  1345. C IFLULA.PROG(IDIM + 3) < 0
  1346. C
  1347. C In first order case :
  1348. C PHASE 2, conservative contribution in ifac (-F) and ifac+1 (+F)
  1349. C non-conservative contribution in ifac+1 (-Flag)
  1350. C negative contribution => SG and SD > 0
  1351. C
  1352. SCON2 = S2_21E
  1353. SG2 = S2_21L
  1354. SD2 = S2_21E + S2_21R
  1355. C
  1356. C PHASE 1, non-conservative contribution in ifac+1 (+Flag)
  1357. C positive contribution => SG and SD < 0
  1358. C
  1359. SCON1 = 0.0D0
  1360. SG1 = -1.0D0 * S1_21L
  1361. SD1 = -1.0D0 * (S1_21E + S1_21R)
  1362. C
  1363. ELSE
  1364. C
  1365. C t
  1366. C \Flag | F
  1367. C ---> --->
  1368. C \ |
  1369. C 2 \ | 1
  1370. C \ |
  1371. C \|
  1372. C ------------------------------> x
  1373. C ifac ifac+1
  1374. C
  1375. C D_resh < 0
  1376. C IFLULA.PROG(IDIM + 3) > 0
  1377. C
  1378. C In first order case :
  1379. C PHASE 2, no conservative contribution
  1380. C non-conservative contribution in ifac (-Flag)
  1381. C negative contribution => SG and SD > 0
  1382. C
  1383. SCON2 = 0.0D0
  1384. SG2 = S2_21E + S2_21L
  1385. SD2 = S2_21R
  1386. C
  1387. C In first order case :
  1388. C PHASE 1, conservative contribution in ifac (-F) and
  1389. C ifac+1 (+F)
  1390. C non-conservative contribution in ifac (+Flag)
  1391. C positive contribution => SG and SD > 0
  1392. C
  1393. C ALPHA1
  1394. C
  1395. SCON1 = S1_21E
  1396. SG1 = -1.0D0 * (S1_21E + S1_21L)
  1397. SD1 = -1.0D0 * S1_21R
  1398. ENDIF
  1399. SURF = SURF0
  1400. CALL RDEMUP(IDIM, 0,
  1401. & SCON1, SG1, SD1,
  1402. & SCON2, SG2, SD2,
  1403. & SURF,VOLG,VOLD,
  1404. & CNX,CNY,CNZ,CTX,CTY,CTZ,CVX,CVY,CVZ,
  1405. & IFLU.PROG,IFLULA.PROG,RESG,RESD)
  1406. C write(*,*) 'RESD'
  1407. DO ICOMP = 1, ((2 * IDIM) + 6)
  1408. MPORES.VPOCHA(NLCED,ICOMP) =
  1409. & MPORES.VPOCHA(NLCED,ICOMP) + RESD(ICOMP)
  1410. C write(*,*) ICOMP, RESD(ICOMP)
  1411. ENDDO
  1412. C write(*,*) 'RESG'
  1413. DO ICOMP = 1, ((2 * IDIM) + 6)
  1414. MPORES.VPOCHA(NLCEG,ICOMP) =
  1415. & MPORES.VPOCHA(NLCEG,ICOMP) + RESG(ICOMP)
  1416. C write(*,*) ICOMP, RESG(ICOMP)
  1417. ENDDO
  1418. ENDIF
  1419. C
  1420. C********** Calcul du pas du temps (CFL)
  1421. C
  1422. C********* a) etat a l'interface
  1423. C
  1424. DIAMG = MPOVDI.VPOCHA(NLCEG,1)
  1425. DIAMD = MPOVDI.VPOCHA(NLCED,1)
  1426. DIAM = MIN(DIAMG,DIAMD)
  1427. CELL = CELLTM/DIAM
  1428. IF(CELL .GT. UNSDT)THEN
  1429. UNSDT = CELL
  1430. ENDIF
  1431. ENDIF
  1432. C
  1433. C**** Fin boucle sur FACEL
  1434. C
  1435. ENDDO
  1436. C
  1437. C**** Pas du temps (condition de non interaction en 1D)
  1438. C
  1439. DT = 0.5D0 / UNSDT
  1440. C
  1441. C**** Desactivation des segments
  1442. C
  1443. SEGSUP MLELIM
  1444. SEGSUP MLENT1
  1445. SEGSUP MLENT2
  1446. C
  1447. SEGDES MPOVSU
  1448. SEGDES MPOVDI
  1449. SEGDES MPOVVO
  1450. SEGDES MPORES
  1451. SEGDES IPT2
  1452. C
  1453. C Warning. MLRMFR = PGAS . 'MASSFRA'
  1454. C MLRCHE = PGAS . 'CHEMCOEF'
  1455. C
  1456. SEGDES MLRMFR
  1457. SEGDES MLRCHE
  1458. SEGSUP IY
  1459. C
  1460. SEGSUP IWWORK
  1461. SEGSUP IWST_R
  1462. SEGSUP IWST_L
  1463. SEGSUP ICVL
  1464. SEGSUP ICVR
  1465. SEGSUP ICVRSS
  1466. SEGSUP ICVWOR
  1467. SEGSUP IFLU
  1468. SEGSUP IFLULA
  1469. C
  1470. SEGDES MPALP1
  1471. SEGDES MPALP2
  1472. SEGDES MELAL1
  1473. SEGDES MELRO1
  1474. SEGDES MELP1
  1475. SEGDES MELAL2
  1476. SEGDES MELRO2
  1477. SEGDES MELP2
  1478. SEGDES MELUN2
  1479. SEGDES MELUT2
  1480. IF (IDIM .EQ. 2) THEN
  1481. SEGDES MELUN1
  1482. SEGDES MELUT1
  1483. SEGDES MELVNX
  1484. SEGDES MELVNY
  1485. SEGDES MELT1X
  1486. SEGDES MELT1Y
  1487. SEGDES MELUN2
  1488. SEGDES MELUT2
  1489. ELSE
  1490. SEGDES MELVNX
  1491. SEGDES MELVNY
  1492. SEGDES MELVNZ
  1493. SEGDES MELT1X
  1494. SEGDES MELT1Y
  1495. SEGDES MELT1Z
  1496. SEGDES MELT2X
  1497. SEGDES MELT2Y
  1498. SEGDES MELT2Z
  1499. SEGDES MELUN1
  1500. SEGDES MELUT1
  1501. SEGDES MELUV1
  1502. SEGDES MELUN2
  1503. SEGDES MELUT2
  1504. SEGDES MELUV2
  1505. ENDIF
  1506. C
  1507. SEGDES MPOALP
  1508. IF (INDK0 .EQ. 2) SEGDES MPOK0
  1509. C
  1510. IF(MPUIN2 .NE. 0)THEN
  1511. SEGDES MPUIN2
  1512. SEGDES MPUIN1
  1513. ENDIF
  1514. C
  1515. 9999 CONTINUE
  1516. RETURN
  1517. END
  1518. CC
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  

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