Télécharger sigmapr3.eso

Retour à la liste

Numérotation des lignes :

sigmapr3
  1. C SIGMAPR3 SOURCE CB215821 16/04/21 21:18:26 8920
  2. subroutine sigmapr3ETC(sigma,S1,S2,S3,rcossigmapr,lcp)
  3.  
  4. c ******************************************************************
  5. c * *
  6. c * Principal stresses ( Batoz, Vol. 1., 1.2.5. p 51) *
  7. c * ================================================= *
  8. c * *
  9. c ******************************************************************
  10.  
  11. c * sigma : vector of the stresses in the global axis
  12. c : Sxx, Syy, Szz, Sxy, Sxz, Syz
  13. c * S1 : largest principal stress
  14. c * S2 : intermediate principal stress
  15. c * S3 : smallest principal stress
  16. c * rcossigmapr : ( lx ly lz )
  17. c ( mx my mz )
  18. c ( nx ny nz )
  19. c for S1 S2 S3
  20.  
  21. IMPLICIT REAL*8 (A-B,D-H,O-Z)
  22. implicit integer (I-K,M,N)
  23. implicit logical (L)
  24. implicit character*10 (C)
  25.  
  26. character*20 cloc1,cloc2
  27.  
  28. dimension sigma(6)
  29. dimension rcossigmapr(3,3)
  30.  
  31. i1 = 1
  32. i2 = 2
  33. i3 = 3
  34. i4 = 4
  35. i5 = 5
  36. i6 = 6
  37. i7 = 7
  38. i8 = 8
  39. i9 = 9
  40. i10=10
  41. i11=11
  42. i12=12
  43. i13=13
  44. i14=14
  45. i15=15
  46. i16=16
  47. i17=17
  48. i18=18
  49. i19=19
  50. i20=20
  51. i21=21
  52. i22=22
  53. i23=23
  54. i24=24
  55. i25=25
  56. i26=26
  57. i27=27
  58. i28=28
  59. i29=29
  60. i30=30
  61. i31=31
  62. i32=32
  63. i33=33
  64. i34=34
  65. i35=35
  66. i36=36
  67. i37=37
  68. i38=38
  69. i39=39
  70.  
  71. r0 = 0.
  72. r1 = 1.
  73. r2 = 2.
  74. r3 = 3.
  75. r6 = 6.
  76.  
  77. precision = 1.0d-3
  78. precision2 = precision*precision
  79. precision3 = precision2*precision
  80. pi = ACOS(-r1)
  81. racine2 = SQRT(r2)
  82. S1 = r0
  83. S2 = r0
  84. S3 = r0
  85.  
  86. do jloc=i1,i3
  87. do iloc=i1,i3
  88. RCOSSIGMAPR(iloc,jloc) = r0
  89. end do
  90. end do
  91.  
  92. Sxx = sigma(i1)
  93. Syy = sigma(i2)
  94. Szz = sigma(i3)
  95. Sxy = sigma(i4)
  96. Sxz = sigma(i5)
  97. Syz = sigma(i6)
  98.  
  99. if (lcp) then
  100. c PLANE STRESS
  101. sxx = sigma(1)
  102. syy = sigma(2)
  103. sxy = sigma(4)
  104. diff = sxx-syy
  105. rloc = diff*diff+4.*sxy*sxy
  106. cloc1 = 'rloc'
  107. cloc2 = 'sigmapr3ETCtg'
  108. call check_sqrt(rloc,cloc1,cloc2,lerror)
  109. c! **** **********
  110. if (lerror) return
  111. S1 = (SQRT(rloc) + sxx+syy) / r2
  112. S2 = (-SQRT(rloc) + sxx+syy) / r2
  113. S3 = 0.d0
  114. if (S1.lt.S2) then
  115. rloc = S1
  116. S1 = S2
  117. S2 = rloc
  118. endif
  119.  
  120. lfirststress = .true.
  121. Smax = S1
  122. 1 continue
  123. if (.not.lfirststress) Smax = S2
  124.  
  125. c Main direction of Smax
  126. c -----------------
  127. c condition for the case Smax = Sxx = Syy (then deltax=deltay=deltaz=0)
  128. if ( (ABS(Sxx-Smax).le.r1).and.(ABS(Syy-Smax).le.r1).and.
  129. . (ABS(Szz-Smax).gt.r1) ) then
  130. if(lfirststress) then
  131. rnx = (SQRT(r2))/r2
  132. else
  133. rnx = - (SQRT(r2))/r2
  134. endif
  135. rny = (SQRT(r2))/r2
  136. rnz = r0
  137. c condition for the case Smax = Syy = Szz (then deltax=deltay=deltaz=0)
  138. else if ( (ABS(Syy-Smax).le.r1).and.(ABS(Szz-Smax).le.r1)
  139. . .and.(ABS(Sxx-Smax).gt.r1) ) then
  140. if(lfirststress) then
  141. rny = (SQRT(r2))/r2
  142. else
  143. rny = - (SQRT(r2))/r2
  144. endif
  145. rnz = (SQRT(r2))/r2
  146. rnx = r0
  147. c condition for the case Smax = Sxx = Szz (then deltax=deltay=deltaz=0)
  148. else if ( (ABS(Sxx-Smax).le.r1).and.(ABS(Szz-Smax).le.r1)
  149. . .and.(ABS(Syy-Smax).gt.r1) ) then
  150. if(lfirststress) then
  151. rnx = (SQRT(r2))/r2
  152. else
  153. rnx = - (SQRT(r2))/r2
  154. endif
  155. rnz = (SQRT(r2))/r2
  156. rny = r0
  157. c condition for the case Smax = Sxx = Syy = Szz (then deltax=deltay=deltaz=0)
  158. else if ( (ABS(Sxx-Smax).le.r1).and.(ABS(Syy-Smax).le.r1)
  159. . .and.(ABS(Szz-Smax).le.r1).and.(ABS(Sxy).le.r1).and.
  160. . (ABS(Sxz).le.r1).and.(ABS(Syz).le.r1) ) then
  161. rnx = (SQRT(r3))/r3
  162. rny = (SQRT(r3))/r3
  163. rnz = (SQRT(r3))/r3
  164. else
  165. deltax = (Szz-Smax)*(Syy-Smax)-Syz*Syz
  166. deltay = (Sxx-Smax)*(Szz-Smax)-Sxz*Sxz
  167. deltaz = (Sxx-Smax)*(Syy-Smax)-Sxy*Sxy
  168. deltamax = ABS(deltax)
  169. ldeltay = .false.
  170. ldeltaz = .false.
  171. if (ABS(deltay).gt.deltamax) then
  172. deltamax = ABS(deltay)
  173. ldeltay = .true.
  174. endif
  175. if (ABS(deltaz).gt.deltamax) then
  176. deltamax = ABS(deltaz)
  177. ldeltay = .false.
  178. ldeltaz = .true.
  179. endif
  180.  
  181. if (ldeltaz) then
  182. c Main orientation OZ
  183. aa = ( Sxy*Syz - Sxz*(Syy-Smax) ) / deltaz
  184. bb = ( Sxz*Sxy - Syz*(Sxx-Smax) ) / deltaz
  185. rloc = SQRT( aa*aa + bb*bb + r1 )
  186. rnz = r1/rloc
  187. rnx = aa/rloc
  188. rny = bb/rloc
  189. else if (ldeltay) then
  190. c Main orientation OY
  191. aa = ( Sxz*Syz - Sxy*(Szz-Smax) ) / deltay
  192. bb = ( Sxz*Sxy - Syz*(Sxx-Smax) ) / deltay
  193. rloc = SQRT( aa*aa + bb*bb + r1 )
  194. rny = r1/rloc
  195. rnx = aa/rloc
  196. rnz = bb/rloc
  197. else
  198. c Main orientation OX
  199. aa = ( Sxz*Syz - Sxy*(Szz-Smax) ) / deltax
  200. bb = ( Syz*Sxy - Sxz*(Syy-Smax) ) / deltax
  201. rloc = SQRT( aa*aa + bb*bb + r1 )
  202. rnx = r1/rloc
  203. rny = aa/rloc
  204. rnz = bb/rloc
  205. endif
  206. endif
  207.  
  208. c The 3 following lines to try to solve the problem of unsymetry
  209. c in routine STRESS
  210. if (ABS(rnx).lt.precision3) rnx = r0
  211. if (ABS(rny).lt.precision3) rny = r0
  212. if (ABS(rnz).lt.precision3) rnz = r0
  213.  
  214. if(lfirststress) then
  215. c go and calculate for S2
  216. c -----------------------
  217. lfirststress = .false.
  218. rcossigmapr(i1,i1) = rnx
  219. rcossigmapr(i2,i1) = rny
  220. rcossigmapr(i3,i1) = rnz
  221. go to 1
  222. else
  223. c S2 has been calculated
  224. c ----------------------
  225. rcossigmapr(i1,i2) = rnx
  226. rcossigmapr(i2,i2) = rny
  227. rcossigmapr(i3,i2) = rnz
  228. endif
  229. c S1 and S2 have been calculated
  230. c ------------------------------
  231.  
  232. c calculate S3.
  233. c -------------
  234. rcossigmapr(i1,i3) = rcossigmapr(i2,i1)*rcossigmapr(i3,i2)
  235. . - rcossigmapr(i3,i1)*rcossigmapr(i2,i2)
  236. rcossigmapr(i2,i3) = rcossigmapr(i3,i1)*rcossigmapr(i1,i2)
  237. . - rcossigmapr(i1,i1)*rcossigmapr(i3,i2)
  238. rcossigmapr(i3,i3) = rcossigmapr(i1,i1)*rcossigmapr(i2,i2)
  239. . - rcossigmapr(i2,i1)*rcossigmapr(i1,i2)
  240.  
  241. else
  242. c FULL 3D
  243. c Hydrostatic stress
  244. c ------------------
  245. rI1 = Sxx+Syy+Szz
  246. Sh = rI1/r3
  247. SumS = rI1+Sxy+Sxz+Syz
  248.  
  249. c 2nd invariant of the deviator J
  250. c -------------------------------
  251. rJ2 = ( (Sxx-Syy) * (Sxx-Syy)
  252. . + (Sxx-Szz) * (Sxx-Szz)
  253. . + (Syy-Szz) * (Syy-Szz) ) / r6
  254. . + Sxy*Sxy + Sxz*Sxz + Syz*Syz
  255.  
  256. c octahedral shear stress
  257. c -----------------------
  258. toc = r2*rJ2/r3
  259. cloc1 = 'toc'
  260. cloc2 = 'Sigmapr3'
  261. toc = SQRT(toc)
  262.  
  263. smallS = SumS*precision2
  264.  
  265. if (ABS(toc).gt.ABS(smallS)) then
  266.  
  267. c 3th invariant of the deviator J
  268. c -------------------------------
  269. rI2 = Sxx*Syy + Sxx*Szz + Syy*Szz
  270. . - Sxy*Sxy - Sxz*Sxz - Syz*Syz
  271. rI3 = Sxx*Syy*Szz + r2*Sxy*Syz*Sxz
  272. . - Sxx*Syz*Syz - Syy*Sxz*Sxz - Szz*Sxy*Sxy
  273. rJ3 = rI3 - rI1*rI2/r3 + r2*rI1*rI1*rI1/27d0
  274.  
  275. c angle omega
  276. c -----------
  277. rloc = ( racine2*rJ3 / (toc*toc*toc) )
  278. if (rloc.ge.1d0) then
  279. omega = r0
  280. else if (rloc.le.(-1d0)) then
  281. omega = ( ACOS( (-1d0) ) )/r3
  282. else
  283. omega = ( ACOS( racine2*rJ3 / (toc*toc*toc) ) )/r3
  284. if ((omega.lt.r0).or.(omega.gt.pi/r3)) then
  285. print *,'Subroutine sigmapr3 - ERROR in omega'
  286. print *,'omega = ',omega
  287. stop
  288. endif
  289. endif
  290.  
  291. c principal stresses
  292. c ------------------
  293. S1 = racine2*toc*COS(omega-r2*pi/r3)+Sh
  294. S2 = racine2*toc*COS(omega+r2*pi/r3)+Sh
  295. S3 = racine2*toc*COS(omega) +Sh
  296.  
  297. c sort the principal stresses : S1 > S2 > S3
  298. if (S2.lt.S3) then
  299. rloc = S2
  300. S2 = S3
  301. S3 = rloc
  302. endif
  303. if (S1.lt.S2) then
  304. rloc = S1
  305. S1 = S2
  306. S2 = rloc
  307. endif
  308. if (S2.lt.S3) then
  309. rloc = S2
  310. S2 = S3
  311. S3 = rloc
  312. endif
  313.  
  314. lfirststress = .true.
  315. Smax = S1
  316. 2 continue
  317. if (.not.lfirststress) Smax = S2
  318.  
  319. c Main direction of Smax
  320. c -----------------
  321. c condition for the case Smax = Sxx = Syy (then deltax=deltay=deltaz=0)
  322. if ( (ABS(Sxx-Smax).le.r1).and.(ABS(Syy-Smax).le.r1).and.
  323. . (ABS(Szz-Smax).gt.r1) ) then
  324. if(lfirststress) then
  325. rnx = (SQRT(r2))/r2
  326. else
  327. rnx = - (SQRT(r2))/r2
  328. endif
  329. rny = (SQRT(r2))/r2
  330. rnz = r0
  331. c condition for the case Smax = Syy = Szz (then deltax=deltay=deltaz=0)
  332. else if ( (ABS(Syy-Smax).le.r1).and.(ABS(Szz-Smax).le.r1)
  333. . .and.(ABS(Sxx-Smax).gt.r1) ) then
  334. if(lfirststress) then
  335. rny = (SQRT(r2))/r2
  336. else
  337. rny = - (SQRT(r2))/r2
  338. endif
  339. rnz = (SQRT(r2))/r2
  340. rnx = r0
  341. c condition for the case Smax = Sxx = Szz (then deltax=deltay=deltaz=0)
  342. else if ( (ABS(Sxx-Smax).le.r1).and.(ABS(Szz-Smax).le.r1)
  343. . .and.(ABS(Syy-Smax).gt.r1) ) then
  344. if(lfirststress) then
  345. rnx = (SQRT(r2))/r2
  346. else
  347. rnx = - (SQRT(r2))/r2
  348. endif
  349. rnz = (SQRT(r2))/r2
  350. rny = r0
  351. c condition for the case Smax = Sxx = Syy = Szz (then deltax=deltay=deltaz=0)
  352. else if ( (ABS(Sxx-Smax).le.r1).and.(ABS(Syy-Smax).le.r1)
  353. . .and.(ABS(Szz-Smax).le.r1).and.(ABS(Sxy).le.r1).and.
  354. . (ABS(Sxz).le.r1).and.(ABS(Syz).le.r1) ) then
  355. rnx = (SQRT(r3))/r3
  356. rny = (SQRT(r3))/r3
  357. rnz = (SQRT(r3))/r3
  358. else
  359. deltax = (Szz-Smax)*(Syy-Smax)-Syz*Syz
  360. deltay = (Sxx-Smax)*(Szz-Smax)-Sxz*Sxz
  361. deltaz = (Sxx-Smax)*(Syy-Smax)-Sxy*Sxy
  362. deltamax = ABS(deltax)
  363. ldeltay = .false.
  364. ldeltaz = .false.
  365. if (ABS(deltay).gt.deltamax) then
  366. deltamax = ABS(deltay)
  367. ldeltay = .true.
  368. endif
  369. if (ABS(deltaz).gt.deltamax) then
  370. deltamax = ABS(deltaz)
  371. ldeltay = .false.
  372. ldeltaz = .true.
  373. endif
  374.  
  375. if (ldeltaz) then
  376. c Main orientation OZ
  377. aa = ( Sxy*Syz - Sxz*(Syy-Smax) ) / deltaz
  378. bb = ( Sxz*Sxy - Syz*(Sxx-Smax) ) / deltaz
  379. rloc = SQRT( aa*aa + bb*bb + r1 )
  380. rnz = r1/rloc
  381. rnx = aa/rloc
  382. rny = bb/rloc
  383. else if (ldeltay) then
  384. c Main orientation OY
  385. aa = ( Sxz*Syz - Sxy*(Szz-Smax) ) / deltay
  386. bb = ( Sxz*Sxy - Syz*(Sxx-Smax) ) / deltay
  387. rloc = SQRT( aa*aa + bb*bb + r1 )
  388. rny = r1/rloc
  389. rnx = aa/rloc
  390. rnz = bb/rloc
  391. else
  392. c Main orientation OX
  393. aa = ( Sxz*Syz - Sxy*(Szz-Smax) ) / deltax
  394. bb = ( Syz*Sxy - Sxz*(Syy-Smax) ) / deltax
  395. rloc = SQRT( aa*aa + bb*bb + r1 )
  396. rnx = r1/rloc
  397. rny = aa/rloc
  398. rnz = bb/rloc
  399. endif
  400. endif
  401.  
  402. c The 3 following lines to try to solve the problem of unsymetry
  403. c in routine STRESS
  404. if (ABS(rnx).lt.precision3) rnx = r0
  405. if (ABS(rny).lt.precision3) rny = r0
  406. if (ABS(rnz).lt.precision3) rnz = r0
  407.  
  408. if(lfirststress) then
  409. c go and calculate for S2
  410. c -----------------------
  411. lfirststress = .false.
  412. rcossigmapr(i1,i1) = rnx
  413. rcossigmapr(i2,i1) = rny
  414. rcossigmapr(i3,i1) = rnz
  415. go to 2
  416. else
  417. c S2 has been calculated
  418. c ----------------------
  419. rcossigmapr(i1,i2) = rnx
  420. rcossigmapr(i2,i2) = rny
  421. rcossigmapr(i3,i2) = rnz
  422. endif
  423. c S1 and S2 have been calculated
  424. c ------------------------------
  425.  
  426. c calculate S3.
  427. c -------------
  428. rcossigmapr(i1,i3) = rcossigmapr(i2,i1)*rcossigmapr(i3,i2)
  429. . - rcossigmapr(i3,i1)*rcossigmapr(i2,i2)
  430. rcossigmapr(i2,i3) = rcossigmapr(i3,i1)*rcossigmapr(i1,i2)
  431. . - rcossigmapr(i1,i1)*rcossigmapr(i3,i2)
  432. rcossigmapr(i3,i3) = rcossigmapr(i1,i1)*rcossigmapr(i2,i2)
  433. . - rcossigmapr(i2,i1)*rcossigmapr(i1,i2)
  434.  
  435. else
  436. S1 = sigma(i1)
  437. S2 = sigma(i2)
  438. S3 = sigma(i3)
  439. c case where S1 = S2 = S3
  440. rcossigmapr(1,1)=1.0d0
  441. rcossigmapr(2,2)=1.0d0
  442. rcossigmapr(3,3)=1.0d0
  443.  
  444. endif
  445.  
  446. endif
  447.  
  448. return
  449. end
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  

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