Télécharger cli262.eso

Retour à la liste

Numérotation des lignes :

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

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