Télécharger cli262.eso

Retour à la liste

Numérotation des lignes :

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

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