Télécharger cli272.eso

Retour à la liste

Numérotation des lignes :

cli272
  1. C CLI272 SOURCE CB215821 20/11/25 13:20:53 10792
  2. SUBROUTINE CLI272(NSP,MELEMF,MELEMC,MELECB,MELEFC,MELRES,INORM,
  3. & ICHPVO,ICHPSU,LRECP,LRECV,
  4. & IROC,IVITC,IPC,IYC,ICHLIM,ILIINC,ILIINP,IJAC,IJACO)
  5. C************************************************************************
  6. C
  7. C PROJET : CASTEM 2000
  8. C
  9. C NOM : CLI112
  10. C
  11. C DESCRIPTION : Subroutine appellée par CLIM22
  12. C OPTION: 'INJE' -- Jacobian
  13. C
  14. C LANGAGE : FORTRAN 77 + ESOPE 2000 (avec estensions CISI)
  15. C
  16. C AUTEUR : S. Kudriakov, DEN/DM2S/SFME/LTMF
  17. C
  18. C************************************************************************
  19. C
  20. C APPELES (Calcul) :
  21. C
  22. C************************************************************************
  23. C
  24. C HISTORIQUE (Anomalies et modifications éventuelles)
  25. C
  26. C HISTORIQUE :
  27. C
  28. C************************************************************************
  29. C
  30. C----------------------------------------------------
  31. C**** Variables de COOPTIO
  32. C----------------------------------------------------
  33. C INTEGER IPLLB, IERPER, IERMAX, IERR, INTERR
  34. C & ,IOTER, IOLEC, IOIMP, IOCAR, IOACQ
  35. C & ,IOPER, IOSGB, IOGRA, IOSAU, IORES
  36. C & ,IECHO, IIMPI, IOSPI
  37. C & ,IDIM, IFICLE, IPREFI
  38. C & ,MCOORD
  39. C & ,IFOMOD, NIFOUR, IFOUR, NSDPGE, IONIVE
  40. C & ,NGMAXY, IZROSF, ISOTYP, IOSCR,LTEXLU
  41. C & ,NORINC,NORVAL,NORIND,NORVAD
  42. C & ,NUCROU, IPSAUV
  43. C
  44. IMPLICIT INTEGER(I-N)
  45. INTEGER MELEMF,MELEMC,MELECB,INORM,ICHPVO,ICHPSU, IROC,IVITC,IPC
  46. & ,IGAMC,ICHLIM,ICEL,NFAC,IFAC,MELRES,IJACO
  47. & ,NGF,NGC,NLF,NLC,NLCB
  48. & ,ILIINC,ILIINP,IJAC,II,JJ,K
  49. & ,MP, NBEL, NBME, NBSOUS, NKID, NKMT, NMATRI, NP, NRIGE
  50. & ,NSP,I, IYC,J, LRECP,LRECV,KV
  51. REAL*8 VOLU,SURF,RC,PC,UXC,UYC,GAMC,CNX,CNY
  52. & ,PSRF,RHOUF,DECIDP,DUNDPC,DUXDPC,DUYDPC
  53. & ,UN,RHO,P,COEF
  54. & ,BR1,BOT,TOP
  55.  
  56. CHARACTER*(8) TYPE
  57.  
  58. -INC PPARAM
  59. -INC CCOPTIO
  60. -INC SMLMOTS
  61. -INC SMELEME
  62. POINTEUR MELEFC.MELEME
  63. -INC SMLENTI
  64. POINTEUR MLEMC.MLENTI, MLEMCB.MLENTI,MLEMF.MLENTI
  65. -INC SMCHPOI
  66. POINTEUR MPNORM.MPOVAL, MPVOL.MPOVAL, MPSURF.MPOVAL, MPRC.MPOVAL,
  67. & MPVC.MPOVAL, MPPC.MPOVAL, MPLIM.MPOVAL, MPYC.MPOVAL
  68. POINTEUR CELL.IZAFM
  69. C-------------------------------------------------------
  70. -INC SMLREEL
  71. POINTEUR MLRECP.MLREEL, MLRECV.MLREEL
  72. C-------------------------------------------------------
  73. C********* Les Jacobians ******************************
  74. C-------------------------------------------------------
  75. SEGMENT JACEL
  76. REAL*8 JAC(3+NSP,3+NSP)
  77. ENDSEGMENT
  78. POINTEUR JTL.JACEL, WL.JACEL, JTT.JACEL
  79. C-------------------------------------------------------------
  80. C******* Les fractionines massiques **************************
  81. C-------------------------------------------------------------
  82. SEGMENT FRAMAS
  83. REAL*8 YET(NSP)
  84. ENDSEGMENT
  85. POINTEUR YC.FRAMAS, YF.FRAMAS
  86. C-------------------------------------------------------
  87. C********** Les CP's and CV's ***********************
  88. C-------------------------------------------------------
  89. SEGMENT GCONST
  90. REAL*8 GC(NSP)
  91. ENDSEGMENT
  92. POINTEUR CP.GCONST, CV.GCONST
  93. C-------------------------------------------------------------
  94. C********** Segments for the vectors ***********************
  95. C-------------------------------------------------------------
  96. SEGMENT VECEL
  97. REAL*8 VV(NSP)
  98. ENDSEGMENT
  99. POINTEUR DGDYC.VECEL
  100. C--------------------------------------------------
  101. SEGINI JTL
  102. SEGINI JTT
  103. SEGINI WL
  104. C----------------------------------------------------
  105. C**** KRIPAD pour la correspondance global/local
  106. C----------------------------------------------------
  107. CALL KRIPAD(MELEMC,MLEMC)
  108. CALL KRIPAD(MELECB,MLEMCB)
  109. CALL KRIPAD(MELEMF,MLEMF)
  110. C----------------------------------------------------
  111. C**** CHPOINTs de la table DOMAINE
  112. C----------------------------------------------------
  113. CALL LICHT(INORM,MPNORM,TYPE,ICEL)
  114. CALL LICHT(ICHPVO,MPVOL,TYPE,ICEL)
  115. CALL LICHT(ICHPSU,MPSURF,TYPE,ICEL)
  116. C----------------------------------------------------
  117. C**** CHPOINTs des variables
  118. C----------------------------------------------------
  119. CALL LICHT(IROC,MPRC,TYPE,ICEL)
  120. CALL LICHT(IVITC,MPVC,TYPE,ICEL)
  121. CALL LICHT(IPC,MPPC,TYPE,ICEL)
  122. CALL LICHT(IYC,MPYC,TYPE,ICEL)
  123. CALL LICHT(ICHLIM,MPLIM,TYPE,ICEL)
  124. C--------------------------------------------------------
  125. C**** Boucle sur le face pour le calcul des invariants de
  126. C Riemann et du flux
  127. C--------------------------------------------------------
  128. SEGACT MELEFC
  129. NFAC=MELEFC.NUM(/2)
  130. C---------------------------------
  131. C**** Objet MATRIK
  132. C---------------------------------
  133. NRIGE = 7
  134. NMATRI = 1
  135. NKID = 9
  136. NKMT = 7
  137. C---------------------------------
  138. SEGINI MATRIK
  139. IJACO = MATRIK
  140. MATRIK.IRIGEL(1,1) = MELRES
  141. MATRIK.IRIGEL(2,1) = MELRES
  142. C---------------------------------
  143. C**** Matrice non symetrique
  144. C---------------------------------
  145. MATRIK.IRIGEL(7,1) = 2
  146. C---------------------------------
  147. NBME = (3+NSP)*(3+NSP)
  148. NBSOUS = 1
  149. SEGINI IMATRI
  150. IF(IJAC.EQ.1)THEN
  151. MLMOTS=ILIINC
  152. ELSEIF(IJAC.EQ.2)THEN
  153. MLMOTS=ILIINP
  154. ENDIF
  155. SEGACT MLMOTS
  156. MATRIK.IRIGEL(4,1) = IMATRI
  157. C-------------------------------------------
  158. DO 1 J=1,(NSP+3)
  159. KV=(J-1)*(3+NSP)
  160. IMATRI.LISPRI(KV+1) = MLMOTS.MOTS(1)
  161. IMATRI.LISPRI(KV+2) = MLMOTS.MOTS(2)
  162. IMATRI.LISPRI(KV+3) = MLMOTS.MOTS(3)
  163. IMATRI.LISPRI(KV+4) = MLMOTS.MOTS(4)
  164. DO 2 I=1,(NSP-1)
  165. IMATRI.LISPRI(KV+4+I) = MLMOTS.MOTS(4+I)
  166. 2 CONTINUE
  167. 1 CONTINUE
  168. C-----------------------------------------------
  169. SEGDES MLMOTS
  170. MLMOTS=ILIINC
  171. SEGACT MLMOTS
  172. C-----------------------------------------------
  173. DO 3 J=1,(NSP+3)
  174. KV=(J-1)*(3+NSP)
  175. IMATRI.LISDUA(KV+1) = MLMOTS.MOTS(j)
  176. IMATRI.LISDUA(KV+2) = MLMOTS.MOTS(j)
  177. IMATRI.LISDUA(KV+3) = MLMOTS.MOTS(j)
  178. IMATRI.LISDUA(KV+4) = MLMOTS.MOTS(j)
  179. DO 4 I=1,(NSP-1)
  180. IMATRI.LISDUA(KV+4+I) = MLMOTS.MOTS(j)
  181. 4 CONTINUE
  182. 3 CONTINUE
  183. C-----------------------------------------------
  184. C-----------------------------------------------
  185. SEGDES MLMOTS
  186. NBEL = NFAC
  187. NBSOUS = 1
  188. NP = 1
  189. MP = 1
  190. C-----------------------------------------------------------
  191. C-----------------------------------------------------------
  192. DO 5 I=1,NBME
  193. SEGINI CELL
  194. IMATRI.LIZAFM(1,I) = CELL
  195. 5 CONTINUE
  196. C---------------------------------
  197. C---------------------------------
  198. C**** Fin definition MATRIK
  199. C---------------------------------
  200. DO IFAC=1,NFAC,1
  201. NGF=MELEFC.NUM(1,IFAC)
  202. NGC=MELEFC.NUM(2,IFAC)
  203. NLF=MLEMF.LECT(NGF)
  204. NLC=MLEMC.LECT(NGC)
  205. NLCB=MLEMCB.LECT(NGF)
  206. VOLU=MPVOL.VPOCHA(NLC,1)
  207. SURF=MPSURF.VPOCHA(NLF,1)
  208. C In CASTEM les normales sont sortantes
  209. CNX=-1*MPNORM.VPOCHA(NLF,1)
  210. CNY=-1*MPNORM.VPOCHA(NLF,2)
  211. C----------------------------------------------
  212. SEGINI CP, CV
  213. MLRECP = LRECP
  214. MLRECV = LRECV
  215. SEGACT MLRECP, MLRECV
  216. DO 10 I=1,(NSP-1)
  217. CP.GC(I)=MLRECP.PROG(I)
  218. CV.GC(I)=MLRECV.PROG(I)
  219. 10 CONTINUE
  220. CP.GC(NSP)=MLRECP.PROG(NSP)
  221. CV.GC(NSP)=MLRECV.PROG(NSP)
  222. C---------------------------------
  223. C Variables au centre
  224. C---------------------------------
  225. RC=MPRC.VPOCHA(NLC,1)
  226. PC=MPPC.VPOCHA(NLC,1)
  227. UXC=MPVC.VPOCHA(NLC,1)
  228. UYC=MPVC.VPOCHA(NLC,2)
  229. SEGINI YC
  230. SEGACT MPYC
  231. DO 100 I=1,(NSP-1)
  232. YC.YET(I)=MPYC.VPOCHA(NLC,I)
  233. 100 CONTINUE
  234. C---------------------------------
  235. C Variables à la face
  236. C---------------------------------
  237. RHOUF=MPLIM.VPOCHA(NLCB,1)
  238. PSRF=MPLIM.VPOCHA(NLCB,2)
  239. SEGINI YF
  240. SEGACT MPLIM
  241. DO 101 I=1,(NSP-1)
  242. YF.YET(I)=MPLIM.VPOCHA(NLCB,2+I)
  243. 101 CONTINUE
  244. c-------------------------------------------------------------
  245. c Computing GAMMA at the cell-center
  246. c-------------------------------------------------------------
  247. top=0.0D0
  248. bot=0.0D0
  249. do 102 i=1,(nsp-1)
  250. top=top+yc.yet(i)*(cp.gc(i)-cp.gc(nsp))
  251. bot=bot+yc.yet(i)*(cv.gc(i)-cv.gc(nsp))
  252. 102 continue
  253. top=cp.gc(nsp)+top
  254. bot=cv.gc(nsp)+bot
  255. GAMC=top/bot
  256. C-------------------------------------------------------------
  257. SEGINI DGDYC
  258. do 41 i=1,(nsp-1)
  259. dgdyc.vv(i)=(cp.gc(i)-cp.gc(nsp)-
  260. & GAMC*(cv.gc(i)-cv.gc(nsp)))/bot
  261. 41 continue
  262. c-------------------------------------------------------------
  263. C------------------------------------------------
  264. C******* Densite, vitesse, pression sur le bord
  265. C------------------------------------------------
  266. P=PC
  267. RHO=P/PSRF
  268. UN=RHOUF/RHO
  269. C------------------------------
  270. C******* Derivatives w.r.t. PC
  271. C------------------------------
  272. DUNDPC=-1*RHOUF/(RHO*RHO*PSRF)
  273. DUXDPC=CNX*DUNDPC
  274. DUYDPC=CNY*DUNDPC
  275. DECIDP=UN*DUNDPC
  276. C--------------------------------------------------------------
  277. COEF=SURF/VOLU
  278. C-------------------------------------------------------------
  279. JTL.JAC(1,1) = 0.0D0
  280. JTL.JAC(1,2) = 0.0D0
  281. JTL.JAC(1,3) = 0.0D0
  282. JTL.JAC(1,4) = 0.0D0
  283. DO 107 I=1,(NSP-1)
  284. JTL.JAC(1,4+I) = 0.0D0
  285. 107 CONTINUE
  286. C----------------------------------------
  287. JTL.JAC(2,1) = 0.0D0
  288. JTL.JAC(2,2) = 0.0D0
  289. JTL.JAC(2,3) = 0.0D0
  290. JTL.JAC(2,4) = (RHOUF*DUXDPC+CNX)*COEF
  291. DO 108 I=1,(NSP-1)
  292. JTL.JAC(2,4+I) = 0.0D0
  293. 108 CONTINUE
  294. C----------------------------------------
  295. JTL.JAC(3,1) = 0.0D0
  296. JTL.JAC(3,2) = 0.0D0
  297. JTL.JAC(3,3) = 0.0D0
  298. JTL.JAC(3,4) = (RHOUF*DUYDPC+CNY)*COEF
  299. DO 109 I=1,(NSP-1)
  300. JTL.JAC(3,4+I) = 0.0D0
  301. 109 CONTINUE
  302. C----------------------------------------
  303. JTL.JAC(4,1) = 0.0D0
  304. JTL.JAC(4,2) = 0.0D0
  305. JTL.JAC(4,3) = 0.0D0
  306. JTL.JAC(4,4) = (RHOUF*DECIDP)*COEF
  307. DO 110 I=1,(NSP-1)
  308. JTL.JAC(4,4+I) = 0.0D0
  309. 110 CONTINUE
  310. C----------------------------------------
  311. DO 111 I=1,(NSP-1)
  312. JTL.JAC(4+I,1) = 0.0D0
  313. JTL.JAC(4+I,2) = 0.0D0
  314. JTL.JAC(4+I,3) = 0.0D0
  315. JTL.JAC(4+I,4) = 0.0D0
  316. DO 112 J=1,(NSP-1)
  317. JTL.JAC(4+I,4+J) = 0.0D0
  318. 112 CONTINUE
  319. 111 CONTINUE
  320. C---------------------------------------------------------
  321. c matrix wl(i,j) represents the derivative of the i-component
  322. c of the vector of primitive variables of the left state with
  323. c respect to the j-component of the vector of the conservative
  324. c variables of the left state.
  325. c
  326. c Here: (rho, ux, uy, p, Y_1,...,Y_(nsp-1)) -
  327. c vector of primitive variables;
  328. c (rho, rho ux, rho uy, rho e, rho Y_1,..., rho Y_(nsp-1)) -
  329. c vector of conservative variables.
  330. c-------------------------------------------------------------
  331. wl.jac(1,1)=1.0d0
  332. wl.jac(1,2)=0.0d0
  333. wl.jac(1,3)=0.0d0
  334. wl.jac(1,4)=0.0d0
  335. do 83 i=1,(nsp-1)
  336. wl.jac(1,4+i)=0.0d0
  337. 83 continue
  338. c------------------------------
  339. wl.jac(2,1)=-UXC/RC
  340. wl.jac(2,2)=1.0d0/RC
  341. wl.jac(2,3)=0.0d0
  342. wl.jac(2,4)=0.0d0
  343. do 84 i=1,(nsp-1)
  344. wl.jac(2,4+i)=0.0d0
  345. 84 continue
  346. c------------------------------
  347. wl.jac(3,1)=-UYC/RC
  348. wl.jac(3,2)=0.0d0
  349. wl.jac(3,3)=1.0d0/RC
  350. wl.jac(3,4)=0.0d0
  351. do 85 i=1,(nsp-1)
  352. wl.jac(3,4+i)=0.0d0
  353. 85 continue
  354. c------------------------------
  355. br1=0.0d0
  356. do 86 i=1,(nsp-1)
  357. br1=br1+dgdyc.vv(i)*yc.yet(i)
  358. 86 continue
  359. br1=br1*PC/(RC*(GAMC-1.0D0))
  360. wl.jac(4,1)=(GAMC-1.0D0)*(UXC*UXC+UYC*UYC)/2.0d0-br1
  361. wl.jac(4,2)=-UXC*(GAMC-1.0D0)
  362. wl.jac(4,3)=-UYC*(GAMC-1.0D0)
  363. wl.jac(4,4)=(GAMC-1.0D0)
  364. do 87 i=1,(nsp-1)
  365. wl.jac(4,4+i)=dgdyc.vv(i)*PC/(RC*(GAMC-1.0D0))
  366. 87 continue
  367. c------------------------------
  368. do 88 i=1,(nsp-1)
  369. do 89 j=1,4
  370. wl.jac(4+i,j)=0.0d0
  371. if(j.eq.1) wl.jac(4+i,j)=-yc.yet(i)/RC
  372. 89 continue
  373. c------------
  374. do 890 j=5,(4+nsp-1)
  375. wl.jac(4+i,j)=0.0d0
  376. if(4+i.eq.j) then
  377. wl.jac(4+i,j)=1.0d0/RC
  378. endif
  379. 890 continue
  380. 88 continue
  381. c------------------------------------------------
  382. C------------------------------------------------
  383. do 114 i=1,(3+nsp)
  384. do 115 j=1,(3+nsp)
  385. jtt.jac(i,j)=0.0d0
  386. do 116 k=1,(3+nsp)
  387. jtt.jac(i,j)=jtt.jac(i,j)+jtl.jac(i,k)*wl.jac(k,j)
  388. 116 continue
  389. 115 continue
  390. 114 continue
  391. C----------------------------------------------------------------
  392. C******* Jacobian with respect to conservative variables
  393. C----------------------------------------------------------------
  394. IF(IJAC.EQ.1)THEN
  395. DO 9 II = 1,(3+NSP)
  396. DO 15 JJ = 1,(3+NSP)
  397. KV = (II-1)*(3+NSP)
  398. C----------------------------------
  399. CELL = IMATRI.LIZAFM(1,KV+JJ)
  400. CELL.AM(IFAC,1,1) = JTT.JAC(II,JJ)
  401. 15 CONTINUE
  402. 9 CONTINUE
  403. ELSEIF(IJAC.EQ.2)THEN
  404. DO 20 II = 1,(3+NSP)
  405. DO 25 JJ = 1,(3+NSP)
  406. KV = (II-1)*(3+NSP)
  407. C----------------------------------
  408. CELL = IMATRI.LIZAFM(1,KV+JJ)
  409. CELL.AM(IFAC,1,1) = JTL.JAC(II,JJ)
  410. 25 CONTINUE
  411. 20 CONTINUE
  412. ENDIF
  413. c--------------------------------------------------
  414. ENDDO
  415. C
  416. SEGDES MELEFC
  417. C
  418. SEGSUP MLEMC
  419. SEGSUP MLEMCB
  420. SEGSUP MLEMF
  421. C
  422. SEGDES MPNORM
  423. SEGDES MPVOL
  424. SEGDES MPSURF
  425. SEGDES MPRC
  426. SEGDES MPPC
  427. SEGDES MPVC
  428. SEGDES MPYC
  429. SEGDES MPLIM
  430. SEGDES YC
  431. SEGDES YF
  432. SEGDES CP
  433. SEGDES CV
  434. SEGDES JTL
  435. SEGDES JTT
  436. SEGDES WL
  437. SEGDES DGDYC
  438. SEGDES MATRIK
  439. DO 80 II=1,NBME
  440. CELL = IMATRI.LIZAFM(1,II)
  441. SEGDES CELL
  442. 80 CONTINUE
  443. SEGDES IMATRI
  444. C---------------------------------------------
  445. 9999 CONTINUE
  446. RETURN
  447. END
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  

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