gtengine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.rspec +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Guardfile +24 -0
- data/LICENSE.md +22 -0
- data/Rakefile +1 -0
- data/Readme.md +14 -0
- data/gtengine.gemspec +25 -0
- data/lib/gtengine.rb +7 -0
- data/lib/gtengine/gas.rb +55 -0
- data/lib/gtengine/simple/burner.rb +50 -0
- data/lib/gtengine/simple/compressor.rb +65 -0
- data/lib/gtengine/simple/pik_optimizer.rb +35 -0
- data/lib/gtengine/simple/turbine.rb +77 -0
- data/lib/gtengine/simple_cycle.rb +29 -0
- data/lib/gtengine/version.rb +3 -0
- data/spec/models/simple/burner_spec.rb +15 -0
- data/spec/models/simple/compressor_spec.rb +22 -0
- data/spec/models/simple/gas_spec.rb +39 -0
- data/spec/models/simple/turbine_spec.rb +25 -0
- data/spec/spec_helper.rb +6 -0
- metadata +128 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d7a6124fbc51b2021b795bdaeeddf672e29bbc1f
|
4
|
+
data.tar.gz: 0e3e1fc6b8a5e2ce233fb83aeb16b319252abe99
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ae805ae344231992d2974dccd6724bfaa38905048d129b2eb49d811ee0e1eaa36ec0a073f1c4f941a9104c953da6c11126f0faf3c3c76895f7c1ceaece386a9b
|
7
|
+
data.tar.gz: 030452f07c07cbf8878c756739b9f0e610c492c575443ab75b56af22baf4169afb4a5e0b5b794fde417b3ad280b4700cd5134b224195b59311f23aa5091b5fa6
|
data/.gitignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
|
19
|
+
# Custom ignores
|
20
|
+
/.rvmrc
|
21
|
+
/gogo.rb
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :rspec do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
+
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
+
watch('config/routes.rb') { "spec/routing" }
|
15
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
16
|
+
|
17
|
+
# Capybara features specs
|
18
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
19
|
+
|
20
|
+
# Turnip features and steps
|
21
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
22
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
23
|
+
end
|
24
|
+
|
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Oleg Bovykin
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/Readme.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/arrowcircle/engine.png?branch=master)](https://travis-ci.org/arrowcircle/engine)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/arrowcircle/engine.png)](https://codeclimate.com/github/arrowcircle/engine)
|
3
|
+
|
4
|
+
# GTEngine
|
5
|
+
|
6
|
+
Math models of gas turbine engine and its parts made with ruby language
|
7
|
+
|
8
|
+
## Requirements
|
9
|
+
|
10
|
+
* Ruby 2.0.0 or newer
|
11
|
+
|
12
|
+
### Copyright
|
13
|
+
|
14
|
+
Copyright © __2014__ __Oleg Bovykin__. See [LICENSE]() for details.
|
data/gtengine.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gtengine/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gtengine"
|
8
|
+
spec.version = Gtengine::VERSION
|
9
|
+
spec.authors = ["Oleg Bovykin"]
|
10
|
+
spec.email = ["oleg.bovykin@gmail.com"]
|
11
|
+
spec.description = %q{Gas Turbine engine and its components math models written in ruby}
|
12
|
+
spec.summary = %q{Gas Turbine engine and its components math models written in ruby}
|
13
|
+
spec.homepage = "https://github.com/arrowcircle/engine"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "guard-rspec"
|
25
|
+
end
|
data/lib/gtengine.rb
ADDED
data/lib/gtengine/gas.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
class Gtengine::Gas
|
2
|
+
|
3
|
+
R = 287.4
|
4
|
+
attr_accessor :t, :p, :alfa
|
5
|
+
|
6
|
+
def initialize t = 280.0, p = 101325.0, alfa = 99999999.0
|
7
|
+
@t = t.to_f
|
8
|
+
@p = p.to_f
|
9
|
+
@alfa = alfa
|
10
|
+
end
|
11
|
+
|
12
|
+
def density
|
13
|
+
p / (t * R)
|
14
|
+
end
|
15
|
+
|
16
|
+
def k
|
17
|
+
k_from_cp cp
|
18
|
+
end
|
19
|
+
|
20
|
+
def average_k
|
21
|
+
k_from_cp average_cp
|
22
|
+
end
|
23
|
+
|
24
|
+
def cp
|
25
|
+
return low_temperature_cp if t < 750.0
|
26
|
+
high_temperature_cp
|
27
|
+
end
|
28
|
+
|
29
|
+
def average_cp
|
30
|
+
return low_temperature_average_cp if t < 700.0
|
31
|
+
high_temperature_average_cp
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def k_from_cp c_p
|
37
|
+
c_p / (c_p - R)
|
38
|
+
end
|
39
|
+
|
40
|
+
def high_temperature_cp
|
41
|
+
(0.0267 / alfa + 0.26 + (0.032 + 0.0133 / alfa) * (0.001 * 1.176 * t - 0.88235) - (0.374 * 0.01 + 0.0094 / (alfa ** 2.0 + 10.0)) * (5.5556 * 0.000001 * t ** 2.0 - 1.3056 * 0.01 * t + 6.67)) * 4187.0
|
42
|
+
end
|
43
|
+
|
44
|
+
def low_temperature_cp
|
45
|
+
(0.0174 / alfa + 0.2407 + (0.0193 + 0.0093 / alfa) * (0.001 * 2.5 * t - 0.875) + (0.002 - 0.001 * 1.056 / (alfa - 0.2)) * (2.5 * 0.00001 * t ** 2.0 - 0.0275 * t + 6.5625)) * 4187.0
|
46
|
+
end
|
47
|
+
|
48
|
+
def high_temperature_average_cp
|
49
|
+
(((1.25 + 2.2 * alfa) / (alfa * 100000.0)) * (t + 450.0) + 0.218) * 4187.0
|
50
|
+
end
|
51
|
+
|
52
|
+
def low_temperature_average_cp
|
53
|
+
(((2.25 + 1.2 * alfa) / (alfa * 100000.0)) * (t - 70.0) + 0.236) * 4187.0
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
class Gtengine::Simple::Burner
|
2
|
+
|
3
|
+
attr_accessor :input, :q_t, :output, :t_g
|
4
|
+
|
5
|
+
T0 = 288.3
|
6
|
+
QN = 43000000.0
|
7
|
+
ETA_G = 0.985
|
8
|
+
L0 = 14.7
|
9
|
+
|
10
|
+
def initialize input, t_g
|
11
|
+
@input = input
|
12
|
+
@t_g = t_g
|
13
|
+
@output = Gtengine::Gas.new(t_g, @input.p, @input.alfa)
|
14
|
+
cycle
|
15
|
+
end
|
16
|
+
|
17
|
+
def cp_vh
|
18
|
+
@input.cp
|
19
|
+
end
|
20
|
+
|
21
|
+
def cp_vyh
|
22
|
+
@output.cp
|
23
|
+
end
|
24
|
+
|
25
|
+
def t_vh
|
26
|
+
@input.t
|
27
|
+
end
|
28
|
+
|
29
|
+
def q_ks
|
30
|
+
(cp_vyh * t_g - cp_vh * t_vh - (cp_vyh - cp_vh) * T0) / (QN * ETA_G - (cp_vyh * t_g - cp_mult_t_0))
|
31
|
+
end
|
32
|
+
|
33
|
+
def cp_mult_t_0
|
34
|
+
Gtengine::Gas.new(T0, 101325.0, 1.0).cp * T0
|
35
|
+
end
|
36
|
+
|
37
|
+
def alfa
|
38
|
+
begin
|
39
|
+
1.0 / (q_ks * L0)
|
40
|
+
rescue
|
41
|
+
999999999.0
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def cycle
|
46
|
+
5.times do
|
47
|
+
@output.alfa = alfa
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
class Gtengine::Simple::Compressor
|
2
|
+
attr_accessor :input, :output, :g, :pi_k, :kpd, :average
|
3
|
+
|
4
|
+
def initialize input, pi_k, kpd
|
5
|
+
@input = input
|
6
|
+
@pi_k = pi_k.to_f
|
7
|
+
@kpd = kpd.to_f
|
8
|
+
@average = Gtengine::Gas.new input.t.to_f, input.p.to_f
|
9
|
+
cycle
|
10
|
+
end
|
11
|
+
|
12
|
+
def t_vyh
|
13
|
+
@input.t * (1.0 + ((pi_k ** ((k - 1.0) / k) - 1.0) / kpd))
|
14
|
+
end
|
15
|
+
|
16
|
+
def p_vyh
|
17
|
+
@input.p * @pi_k
|
18
|
+
end
|
19
|
+
|
20
|
+
def l_k
|
21
|
+
@average.cp * t_vyh * (@pi_k ** ((k - 1.0) / k) - 1.0) / @kpd
|
22
|
+
end
|
23
|
+
|
24
|
+
def k
|
25
|
+
@average.average_k
|
26
|
+
end
|
27
|
+
|
28
|
+
def cp
|
29
|
+
@average.average_cp
|
30
|
+
end
|
31
|
+
|
32
|
+
def alfa
|
33
|
+
1.577 * 0.0000001 * t_vyh ** 2.383 + 1.774
|
34
|
+
end
|
35
|
+
|
36
|
+
def update_average
|
37
|
+
@average.t = (t_vh + t_vyh) / 2.0
|
38
|
+
@average.p = (p_vh + p_vyh) / 2.0
|
39
|
+
end
|
40
|
+
|
41
|
+
def t_vh
|
42
|
+
@input.t
|
43
|
+
end
|
44
|
+
|
45
|
+
def p_vh
|
46
|
+
@input.p
|
47
|
+
end
|
48
|
+
|
49
|
+
def cycle
|
50
|
+
5.times do
|
51
|
+
update_average
|
52
|
+
end
|
53
|
+
@output = Gtengine::Gas.new t_vyh, p_vyh
|
54
|
+
end
|
55
|
+
|
56
|
+
def info
|
57
|
+
puts "== Compressor"
|
58
|
+
puts "==== Pi_k: #{@pi_k}, КДП: #{@kpd}"
|
59
|
+
puts "==== Вход T: #{@input.t.to_i} K, P: #{@input.p.to_i} Па"
|
60
|
+
puts "====== Cp_sr: #{cp}, K: #{k}"
|
61
|
+
puts "==== Выход T: #{@output.t.to_i} K, P: #{@output.p.to_i} Па, ALFA: #{alfa}"
|
62
|
+
puts
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Gtengine::Simple::PikOptimizer
|
2
|
+
attr_accessor :start_pik, :end_pik, :t_g, :step, :optimum, :cycles, :air
|
3
|
+
|
4
|
+
def initialize air, start_pik, end_pik, t_g, step=1
|
5
|
+
@air = air
|
6
|
+
@start_pik = start_pik
|
7
|
+
@end_pik = end_pik
|
8
|
+
@t_g = t_g
|
9
|
+
@step = step
|
10
|
+
optimize
|
11
|
+
end
|
12
|
+
|
13
|
+
def optimize
|
14
|
+
@cycles = []
|
15
|
+
Range.new(start_pik, end_pik).step(step).each do |pik|
|
16
|
+
begin
|
17
|
+
c = Cycle.new(air, pik, t_g)
|
18
|
+
@cycles << c if c.burner.q_ks
|
19
|
+
rescue
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def optimal
|
26
|
+
@cycles.sort {|a, b| a.burner.q_ks <=> b.burner.q_ks}.first
|
27
|
+
end
|
28
|
+
|
29
|
+
def info
|
30
|
+
@cycles.each do |c|
|
31
|
+
puts "pi_k: #{c.pi_k}, q_ks: #{c.q_ks}"
|
32
|
+
end
|
33
|
+
puts "Optimal pi_k: #{optimal.pi_k}, q_ks: #{optimal.q_ks}"
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
class Gtengine::Simple::Turbine
|
2
|
+
|
3
|
+
attr_accessor :burner, :l_k, :kpd, :average, :output
|
4
|
+
|
5
|
+
ETA = 0.9
|
6
|
+
ETA_M = 0.985
|
7
|
+
G_OHL = 0.001
|
8
|
+
|
9
|
+
def initialize burner, l_k, kpd = 0.9
|
10
|
+
@burner = burner
|
11
|
+
@l_k = l_k
|
12
|
+
@kpd = kpd.to_f
|
13
|
+
@average = Gtengine::Gas.new t_vh, p_vh
|
14
|
+
cycle
|
15
|
+
end
|
16
|
+
|
17
|
+
def input
|
18
|
+
@burner.output
|
19
|
+
end
|
20
|
+
|
21
|
+
def t_vh
|
22
|
+
burner.output.t
|
23
|
+
end
|
24
|
+
|
25
|
+
def p_vh
|
26
|
+
burner.output.p
|
27
|
+
end
|
28
|
+
|
29
|
+
def pi_t
|
30
|
+
pit = l_k / (1.0 + burner.q_ks)
|
31
|
+
pit /= (t_vh * cp * ETA * ETA_M * (1.0 - G_OHL))
|
32
|
+
pit = (1.0 / (1.0 - pit)) ** ((k - 1.0) / k)
|
33
|
+
pit
|
34
|
+
end
|
35
|
+
|
36
|
+
def cycle
|
37
|
+
5.times do
|
38
|
+
update_average
|
39
|
+
end
|
40
|
+
@output = Gtengine::Gas.new t_vyh, p_vyh
|
41
|
+
end
|
42
|
+
|
43
|
+
def update_average
|
44
|
+
@average.t = (t_vh + t_vyh) / 2.0
|
45
|
+
@average.p = (p_vh + p_vyh) / 2.0
|
46
|
+
end
|
47
|
+
|
48
|
+
def t_vyh
|
49
|
+
t_vh * (1.0 - ((1.0 - (pi_t ** ((1.0 - k) / k))) * kpd))
|
50
|
+
end
|
51
|
+
|
52
|
+
def p_vyh
|
53
|
+
p_vh / pi_t
|
54
|
+
end
|
55
|
+
|
56
|
+
def l_t
|
57
|
+
cp * t_vh * ((1.0 - (pi_t ** ((1.0 - k) / k))) * kpd)
|
58
|
+
end
|
59
|
+
|
60
|
+
def k
|
61
|
+
@average.average_k
|
62
|
+
end
|
63
|
+
|
64
|
+
def cp
|
65
|
+
@average.average_cp
|
66
|
+
end
|
67
|
+
|
68
|
+
def info
|
69
|
+
puts "== Turbine"
|
70
|
+
puts "==== Pi_t: #{pi_t}, КДП: #{ETA}"
|
71
|
+
puts "==== Вход T: #{t_vh.to_i} K, P: #{p_vh.to_i} Па, ALFA: #{input.alfa}, Cp: #{input.cp}"
|
72
|
+
puts "====== Cp_sr: #{cp}, K: #{k}"
|
73
|
+
puts "==== Выход T: #{@output.t.to_i} K, P: #{@output.p.to_i} Па, , Cp: #{@output.cp}"
|
74
|
+
puts
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Gtengine
|
2
|
+
module Simple
|
3
|
+
class Cycle
|
4
|
+
require_relative 'simple/turbine'
|
5
|
+
require_relative 'simple/compressor'
|
6
|
+
require_relative 'simple/burner'
|
7
|
+
require_relative 'simple/pik_optimizer'
|
8
|
+
|
9
|
+
attr_accessor :air, :pi_k, :t_g, :compressor, :turbine, :burner
|
10
|
+
|
11
|
+
def initialize air=Gas.new(300, 101325), pi_k, t_g
|
12
|
+
@air = air
|
13
|
+
@pi_k = pi_k
|
14
|
+
@compressor = Compressor.new air, pi_k, 0.85
|
15
|
+
@burner = Burner.new @compressor.output, t_g
|
16
|
+
@turbine = Turbine.new @burner, @compressor.l_k, 0.9
|
17
|
+
end
|
18
|
+
|
19
|
+
def q_ks
|
20
|
+
@burner.q_ks
|
21
|
+
end
|
22
|
+
|
23
|
+
def info
|
24
|
+
puts "== Cycle info"
|
25
|
+
puts "pi_k: #{@compressor.pi_k}, q_ks: #{q_ks}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gtengine::Simple::Burner do
|
4
|
+
let(:gas) { Gtengine::Gas.new }
|
5
|
+
let(:compressor) { Gtengine::Simple::Compressor.new gas, 10, 0.87 }
|
6
|
+
let(:burner) { Gtengine::Simple::Burner.new compressor.output, 1400 }
|
7
|
+
|
8
|
+
it "считает расход топлива" do
|
9
|
+
expect(burner.q_ks).to eq 0.026948712923834613
|
10
|
+
end
|
11
|
+
|
12
|
+
it "считает альфа" do
|
13
|
+
expect(burner.alfa).to eq 2.524321331286569
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gtengine::Simple::Compressor do
|
4
|
+
let(:gas) { Gtengine::Gas.new }
|
5
|
+
let(:compressor) { Gtengine::Simple::Compressor.new gas, 10, 0.87 }
|
6
|
+
|
7
|
+
it "считает давление выхода" do
|
8
|
+
expect(compressor.p_vyh).to eq 1013250.0
|
9
|
+
end
|
10
|
+
|
11
|
+
it "считает температуру выхода" do
|
12
|
+
expect(compressor.t_vyh).to eq 579.410983909093
|
13
|
+
end
|
14
|
+
|
15
|
+
it "считает работу компрессора" do
|
16
|
+
expect(compressor.l_k).to eq 631083.3734847266
|
17
|
+
end
|
18
|
+
|
19
|
+
it "считает альфа" do
|
20
|
+
expect(compressor.alfa).to eq 2.37938137624045
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gtengine::Gas do
|
4
|
+
let(:gas) { Gtengine::Gas.new }
|
5
|
+
|
6
|
+
it "Считает плотность" do
|
7
|
+
expect(gas.density).to eq 1.259133611691023
|
8
|
+
end
|
9
|
+
|
10
|
+
it "Считает k" do
|
11
|
+
expect(gas.k).to eq 1.4029968590096924
|
12
|
+
end
|
13
|
+
|
14
|
+
it "Считает k за процесс" do
|
15
|
+
expect(gas.average_k).to eq 1.404058445015607
|
16
|
+
end
|
17
|
+
|
18
|
+
context "LOW TEMPERATURE" do
|
19
|
+
it "Считает теплоемкость" do
|
20
|
+
expect(gas.cp).to eq 1000.556923124028
|
21
|
+
end
|
22
|
+
|
23
|
+
it "Считает теплоемкость за процесс" do
|
24
|
+
expect(gas.average_cp).to eq 998.6832401978357
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "HIGH TEMPERATURE" do
|
29
|
+
let(:gas) { Gtengine::Gas.new 900, 1013251 }
|
30
|
+
|
31
|
+
it "Считает теплоемкость" do
|
32
|
+
expect(gas.cp).to eq 1121.2960248302861
|
33
|
+
end
|
34
|
+
|
35
|
+
it "Считает теплоемкость за процесс" do
|
36
|
+
expect(gas.average_cp).to eq 1037.119900706556
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gtengine::Simple::Turbine do
|
4
|
+
let(:gas) { Gtengine::Gas.new }
|
5
|
+
let(:compressor) { Gtengine::Simple::Compressor.new gas, 10, 0.87 }
|
6
|
+
let(:burner) { Gtengine::Simple::Burner.new compressor.output, 900 }
|
7
|
+
let(:turbine) { Gtengine::Simple::Turbine.new burner, compressor.l_k }
|
8
|
+
|
9
|
+
it "считает степень понижения давления" do
|
10
|
+
expect(turbine.pi_t).to eq 1.4858595860294537
|
11
|
+
end
|
12
|
+
|
13
|
+
it "считает температуру выхода" do
|
14
|
+
expect(turbine.t_vyh).to eq 815.5179703599931
|
15
|
+
end
|
16
|
+
|
17
|
+
it "считает давление выхода" do
|
18
|
+
expect(turbine.p_vyh).to eq 681928.5008670494
|
19
|
+
end
|
20
|
+
|
21
|
+
it "считает работу турбины l_t" do
|
22
|
+
expect(turbine.l_t).to eq 87289.27555567237
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gtengine
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Oleg Bovykin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: guard-rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Gas Turbine engine and its components math models written in ruby
|
70
|
+
email:
|
71
|
+
- oleg.bovykin@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
79
|
+
- Gemfile
|
80
|
+
- Gemfile.lock
|
81
|
+
- Guardfile
|
82
|
+
- LICENSE.md
|
83
|
+
- Rakefile
|
84
|
+
- Readme.md
|
85
|
+
- gtengine.gemspec
|
86
|
+
- lib/gtengine.rb
|
87
|
+
- lib/gtengine/gas.rb
|
88
|
+
- lib/gtengine/simple/burner.rb
|
89
|
+
- lib/gtengine/simple/compressor.rb
|
90
|
+
- lib/gtengine/simple/pik_optimizer.rb
|
91
|
+
- lib/gtengine/simple/turbine.rb
|
92
|
+
- lib/gtengine/simple_cycle.rb
|
93
|
+
- lib/gtengine/version.rb
|
94
|
+
- spec/models/simple/burner_spec.rb
|
95
|
+
- spec/models/simple/compressor_spec.rb
|
96
|
+
- spec/models/simple/gas_spec.rb
|
97
|
+
- spec/models/simple/turbine_spec.rb
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
homepage: https://github.com/arrowcircle/engine
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata: {}
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.2.0.rc.1
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Gas Turbine engine and its components math models written in ruby
|
123
|
+
test_files:
|
124
|
+
- spec/models/simple/burner_spec.rb
|
125
|
+
- spec/models/simple/compressor_spec.rb
|
126
|
+
- spec/models/simple/gas_spec.rb
|
127
|
+
- spec/models/simple/turbine_spec.rb
|
128
|
+
- spec/spec_helper.rb
|