Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. /**
  2. * Created by <a mailto:nvv@emsd.ysn.ru>Vladimir N.</a> on 20.02.2017.
  3. */
  4. class Layer {
  5. double depthVal
  6. double velocityVal
  7. double densityVal
  8.  
  9. double travelTime() {
  10. return depthVal / velocityVal
  11. }
  12.  
  13. double massPerAria() {
  14. return depthVal * densityVal
  15. }
  16.  
  17. void глубина(double depth) {
  18. this.depthVal = depth
  19. }
  20.  
  21. void velocity(double velocity) {
  22. this.velocityVal = velocity
  23. }
  24.  
  25. void плотность(double density) {
  26. this.densityVal = density
  27. }
  28. /**
  29. * Вычисляет значение поперечной скорости волны в данном слое
  30. * @param deformation Модуль деформации по ИГЭ
  31. * @param poissonsRatio Коэффициент Пуассона для грунта
  32. * @return Значение поперечной скорости волны в данном слое
  33. */
  34. void вычислить_скорость(double deformation, double poissonsRatio) {
  35. velocityVal = Math.sqrt(10 * deformation/ (densityVal * (1 + poissonsRatio)))
  36. }
  37. }
  38.  
  39. class Borehole {
  40. double depthVal
  41. List<Layer> layers = []
  42.  
  43. double averageVelocity() {
  44. return depthVal / layers.collect{ it.travelTime() }.sum()
  45. }
  46.  
  47. double averageDensity() {
  48. return layers.collect{ it.massPerAria() }.sum() / depthVal
  49. }
  50.  
  51. void глубина(double depth) {
  52. this.depthVal = depth
  53. }
  54.  
  55. void слой(@DelegatesTo(strategy=Closure.DELEGATE_ONLY, value=Layer) Closure cl) {
  56. def layer = new Layer()
  57. def code = cl.rehydrate(layer, this, this)
  58. code.resolveStrategy = Closure.DELEGATE_ONLY
  59. code()
  60. this.layers << layer
  61. }
  62. }
  63.  
  64. class StiffnessMethod {
  65. List<Borehole> boreholes = []
  66. double standardDensity
  67. double standardVelocity
  68.  
  69. void скважина(@DelegatesTo(strategy=Closure.DELEGATE_ONLY, value=Borehole) Closure cl) {
  70. def borehole = new Borehole()
  71. def code = cl.rehydrate(borehole, this, this)
  72. code.resolveStrategy = Closure.DELEGATE_ONLY
  73. code()
  74. this.boreholes << borehole
  75. }
  76.  
  77. void эталонная_плотность(double standardDensity) {
  78. this.standardDensity = standardDensity
  79. }
  80.  
  81. void эталонная_скорость(double standardVelocity) {
  82. this.standardVelocity = standardVelocity
  83. }
  84.  
  85. /**
  86. * Вычисляется приращение балльности по формуле Медведева. Грунтовые воды не учитываются, если используется скорость
  87. * поперечных волн
  88. * @param borehole Объект скважины
  89. * @return Приращение балльности по методу жесткостей
  90. */
  91. def getНапечатать_приращение_балльности() {
  92. if (standardDensity == 0.0d || standardVelocity == 0.0d) {
  93. throw new IllegalArgumentException("Standart плотность and standart velocity must be set")
  94. }
  95. print boreholes.collect{
  96. 1.67 * Math.log10(standardVelocity * standardDensity / (it.averageDensity() * it.averageVelocity()))
  97. }
  98. }
  99. }
  100.  
  101. def метод_жесткостей(@DelegatesTo(strategy=Closure.DELEGATE_ONLY, value=StiffnessMethod) Closure cl) {
  102. def stiffness = new StiffnessMethod()
  103. def code = cl.rehydrate(stiffness, this, this)
  104. code.resolveStrategy = Closure.DELEGATE_ONLY
  105. code()
  106. }
  107.  
  108. //-------------------------------------------ПРИМЕР--------------------------------------------------------
  109.  
  110. метод_жесткостей {
  111. эталонная_плотность 1700.0
  112. эталонная_скорость 350.0
  113. скважина {
  114. глубина 9.8
  115. слой {
  116. глубина 2.5
  117. плотность 1860
  118. вычислить_скорость 24516625, 0.3
  119. }
  120. слой {
  121. глубина 1.8
  122. плотность 1880
  123. вычислить_скорость 24516625, 0.3
  124. }
  125. }
  126. напечатать_приращение_балльности
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement