Télécharger conthe.eso

Retour à la liste

Numérotation des lignes :

conthe
  1. C CONTHE SOURCE BECC 09/11/18 21:15:01 6542
  2. subroutine conthe(nesp, nordpo, acv, w, h0, runiv,
  3. & tmaxcv, uvec, y,
  4. & tguess,
  5. & acvtot, ux, uy, uz, p, t,
  6. & logipg, lognc, logneg, valer, meserr)
  7. C
  8. C See PRIDE1.ESO
  9. C
  10. C This subroutine creates some thermodynamical variables and
  11. C properties starting from the conservative variables.
  12. C
  13. C INPUT:
  14. C nesp, nordpo,
  15. C acv(0:nordpo,nesp)
  16. C w
  17. C h0
  18. C runiv = universal constant of gas
  19. C tmaxcv = upper limit for cv expansion
  20. C uvec(1,*) = rho
  21. C uvec(2,*) = rhou
  22. C uvec(3,*) = rhov
  23. C uvec(4,*) = rhow
  24. C uvec(5,*) = rhoet
  25. C y
  26. C tguess = guess value for the temperature in the Newton method
  27. C
  28. C OUTPUT:
  29. C acvtot = coefficients such that
  30. C cv = \sum_{i=1,nordpo+1} acvtot(i) T^{i-1}
  31. C ether = \sum_{i=1,nordpo+1} acvtot(i) T^{i} / (i)
  32. C rho = density
  33. C ux,uy,uz = velocity
  34. C p = pressure
  35. C t = temperature
  36. C
  37. C ERROR
  38. C logipg, lognc, logneg, valer, meserr
  39. C
  40. integer nesp, nordpo
  41. & , iesp, icoef
  42. real*8 acv(0:nordpo,nesp), w(nesp), h0(nesp), runiv, tmaxcv
  43. & , uvec(1:5), y(1:nesp)
  44. & , tguess, acvtot(1:(nordpo+1))
  45. & , rho, ux, uy, uz, p, t
  46. & , valer(2)
  47. & , hftot, rgas, un2, ether
  48. character*(40) meserr(2)
  49. logical lognc, logneg, logipg
  50. C
  51. C Initialisation of some variables
  52. C
  53. hftot = 0.0d0
  54. do icoef = 1 ,(nordpo+1), 1
  55. acvtot(icoef) = 0.0d0
  56. enddo
  57. rgas = 0.0d0
  58. C
  59. C Density, velocity, internal energy
  60. C
  61. rho = uvec(1)
  62. ux = uvec(2) / rho
  63. uy = uvec(3) / rho
  64. uz = uvec(4) / rho
  65. un2 = (ux * ux) + (uy * uy) + (uz * uz)
  66. C do iesp = 1, 5
  67. C write(*,*) uvec(iesp)
  68. C enddo
  69. C
  70. C rgas, hftot, acvtot
  71. C In order to avoid one more loop, this could have be done before
  72. C
  73. do iesp = 1, nesp, 1
  74. C Rgas = y(iesp) / W_iesp
  75. Rgas = Rgas + (y(iesp)/w(iesp))
  76. C hftot = hftot + (y_i * hf0i)
  77. hftot = hftot + (y(iesp) * h0(iesp))
  78. do icoef = 0, nordpo, 1
  79. acvtot(icoef+1) = acvtot(icoef+1) +
  80. & (y(iesp) * acv(icoef,iesp))
  81. enddo
  82. enddo
  83. rgas = rgas * runiv
  84. C
  85. C Computation of temperature T
  86. C if (T > Tmax) => cv = cv(Tmax)
  87. C if (T < Tmin) => cv = cv(Tmin)
  88. C
  89. ether = (uvec(5) / rho) - (0.5d0 * un2)
  90. ether = ether - hftot
  91. C write(*,*) hftot, ether
  92. if(ether .lt. 0.0D0)then
  93. logneg = .true.
  94. meserr(1) = 'internal sensible energy '
  95. valer(1) = ether
  96. goto 9999
  97. endif
  98. call prite1(nordpo,Tmaxcv,acvtot,ether,tguess,T,lognc,logipg)
  99. if(logipg)then
  100. goto 9999
  101. endif
  102. if(lognc)then
  103. goto 9999
  104. endif
  105. C
  106. p = rgas * rho * T
  107. 9999 continue
  108. return
  109. end
  110.  
  111.  
  112.  

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