Télécharger cli272.eso

Retour à la liste

Numérotation des lignes :

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

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