Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by <a mailto:nvv@emsd.ysn.ru>Vladimir N.</a> on 20.02.2017.
- */
- class Layer {
- double depthVal
- double velocityVal
- double densityVal
- double travelTime() {
- return depthVal / velocityVal
- }
- double massPerAria() {
- return depthVal * densityVal
- }
- void глубина(double depth) {
- this.depthVal = depth
- }
- void velocity(double velocity) {
- this.velocityVal = velocity
- }
- void плотность(double density) {
- this.densityVal = density
- }
- /**
- * Вычисляет значение поперечной скорости волны в данном слое
- * @param deformation Модуль деформации по ИГЭ
- * @param poissonsRatio Коэффициент Пуассона для грунта
- * @return Значение поперечной скорости волны в данном слое
- */
- void вычислить_скорость(double deformation, double poissonsRatio) {
- velocityVal = Math.sqrt(10 * deformation/ (densityVal * (1 + poissonsRatio)))
- }
- }
- class Borehole {
- double depthVal
- List<Layer> layers = []
- double averageVelocity() {
- return depthVal / layers.collect{ it.travelTime() }.sum()
- }
- double averageDensity() {
- return layers.collect{ it.massPerAria() }.sum() / depthVal
- }
- void глубина(double depth) {
- this.depthVal = depth
- }
- void слой(@DelegatesTo(strategy=Closure.DELEGATE_ONLY, value=Layer) Closure cl) {
- def layer = new Layer()
- def code = cl.rehydrate(layer, this, this)
- code.resolveStrategy = Closure.DELEGATE_ONLY
- code()
- this.layers << layer
- }
- }
- class StiffnessMethod {
- List<Borehole> boreholes = []
- double standardDensity
- double standardVelocity
- void скважина(@DelegatesTo(strategy=Closure.DELEGATE_ONLY, value=Borehole) Closure cl) {
- def borehole = new Borehole()
- def code = cl.rehydrate(borehole, this, this)
- code.resolveStrategy = Closure.DELEGATE_ONLY
- code()
- this.boreholes << borehole
- }
- void эталонная_плотность(double standardDensity) {
- this.standardDensity = standardDensity
- }
- void эталонная_скорость(double standardVelocity) {
- this.standardVelocity = standardVelocity
- }
- /**
- * Вычисляется приращение балльности по формуле Медведева. Грунтовые воды не учитываются, если используется скорость
- * поперечных волн
- * @param borehole Объект скважины
- * @return Приращение балльности по методу жесткостей
- */
- def getНапечатать_приращение_балльности() {
- if (standardDensity == 0.0d || standardVelocity == 0.0d) {
- throw new IllegalArgumentException("Standart плотность and standart velocity must be set")
- }
- print boreholes.collect{
- 1.67 * Math.log10(standardVelocity * standardDensity / (it.averageDensity() * it.averageVelocity()))
- }
- }
- }
- def метод_жесткостей(@DelegatesTo(strategy=Closure.DELEGATE_ONLY, value=StiffnessMethod) Closure cl) {
- def stiffness = new StiffnessMethod()
- def code = cl.rehydrate(stiffness, this, this)
- code.resolveStrategy = Closure.DELEGATE_ONLY
- code()
- }
- //-------------------------------------------ПРИМЕР--------------------------------------------------------
- метод_жесткостей {
- эталонная_плотность 1700.0
- эталонная_скорость 350.0
- скважина {
- глубина 9.8
- слой {
- глубина 2.5
- плотность 1860
- вычислить_скорость 24516625, 0.3
- }
- слой {
- глубина 1.8
- плотность 1880
- вычислить_скорость 24516625, 0.3
- }
- }
- напечатать_приращение_балльности
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement