gtengine 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Readme.md +8 -1
- data/lib/gtengine/gas.rb +43 -22
- data/lib/gtengine/simple/burner.rb +42 -14
- data/lib/gtengine/simple/compressor.rb +30 -22
- data/lib/gtengine/simple/pik_optimizer.rb +8 -9
- data/lib/gtengine/simple/turbine.rb +40 -19
- data/lib/gtengine/simple_cycle.rb +7 -9
- data/lib/gtengine/version.rb +1 -1
- data/spec/models/{simple/gas_spec.rb → gas_spec.rb} +5 -5
- data/spec/models/simple/burner_spec.rb +4 -4
- data/spec/models/simple/compressor_spec.rb +4 -4
- data/spec/models/simple/turbine_spec.rb +8 -8
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfce175060b2ea4ef910bfb47e3c33c55668945a
|
4
|
+
data.tar.gz: 084fd7277b4bc64a8621329e09d7ce543dfa614e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 071a5a798f8547c11cd9eeec5e5b6157c48771cb4bc7d25b17da6828d397486e534b1bb8e7c18b3af608dec4bd4ac7ffbe9a3f350f1b0a9437d64a988823ae61
|
7
|
+
data.tar.gz: a542b14b7845f268c9846f393b7256955573d4860715330553f4b8d00d2ff61639673bc3dfdf01a6410d3da71e098df6a3dad13681168d3a0ec43b9ee3385549
|
data/Readme.md
CHANGED
@@ -6,11 +6,18 @@ Math models of gas turbine engine and its parts made with ruby language
|
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
|
+
Add gem to your gemfile
|
10
|
+
|
11
|
+
gem 'gtengine'
|
12
|
+
|
13
|
+
and run
|
14
|
+
|
15
|
+
bundle
|
16
|
+
|
9
17
|
### Simple
|
10
18
|
|
11
19
|
For simple parts calculation:
|
12
20
|
|
13
|
-
require_relative 'lib/gtengine'
|
14
21
|
gas = Gtengine::Gas.new 300, 101325
|
15
22
|
|
16
23
|
k = Gtengine::Simple::Compressor.new gas, 4.5, 0.85
|
data/lib/gtengine/gas.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
class Gtengine::Gas
|
2
|
-
|
3
2
|
R = 287.4
|
4
3
|
attr_accessor :t, :p, :alfa
|
5
4
|
|
6
|
-
def initialize
|
7
|
-
@t = t.to_f
|
8
|
-
@p = p.to_f
|
9
|
-
@alfa = alfa
|
5
|
+
def initialize(t = 300.0, p = 101325.0, alfa = 99999999.0)
|
6
|
+
@t, @p, @alfa = t.to_f, p.to_f, alfa.to_f
|
10
7
|
end
|
11
8
|
|
12
9
|
def density
|
@@ -14,11 +11,11 @@ class Gtengine::Gas
|
|
14
11
|
end
|
15
12
|
|
16
13
|
def k
|
17
|
-
|
14
|
+
k_from(cp)
|
18
15
|
end
|
19
16
|
|
20
17
|
def average_k
|
21
|
-
|
18
|
+
k_from(average_cp)
|
22
19
|
end
|
23
20
|
|
24
21
|
def cp
|
@@ -33,23 +30,47 @@ class Gtengine::Gas
|
|
33
30
|
|
34
31
|
private
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
def k_from(c_p)
|
34
|
+
c_p / (c_p - R)
|
35
|
+
end
|
36
|
+
|
37
|
+
def high_temperature_cp
|
38
|
+
(first_high_cp - second_high_cp * third_high_cp) * 4187.0
|
39
|
+
end
|
40
|
+
|
41
|
+
def first_high_cp
|
42
|
+
0.0267 / alfa + 0.26 + (0.032 + 0.0133 / alfa) * (0.001 * 1.176 * t - 0.88235)
|
43
|
+
end
|
44
|
+
|
45
|
+
def second_high_cp
|
46
|
+
0.374 * 0.01 + 0.0094 / (alfa ** 2.0 + 10.0)
|
47
|
+
end
|
48
|
+
|
49
|
+
def third_high_cp
|
50
|
+
5.5556 * 0.000001 * t ** 2.0 - 1.3056 * 0.01 * t + 6.67
|
51
|
+
end
|
39
52
|
|
40
|
-
|
41
|
-
|
42
|
-
|
53
|
+
def low_temperature_cp
|
54
|
+
(first_low_cp + second_low_cp * third_low_cp) * 4187.0
|
55
|
+
end
|
43
56
|
|
44
|
-
|
45
|
-
|
46
|
-
|
57
|
+
def first_low_cp
|
58
|
+
0.0174 / alfa + 0.2407 + (0.0193 + 0.0093 / alfa) * (0.001 * 2.5 * t - 0.875)
|
59
|
+
end
|
47
60
|
|
48
|
-
|
49
|
-
|
50
|
-
|
61
|
+
def second_low_cp
|
62
|
+
0.002 - 0.001 * 1.056 / (alfa - 0.2)
|
63
|
+
end
|
51
64
|
|
52
|
-
|
53
|
-
|
54
|
-
|
65
|
+
def third_low_cp
|
66
|
+
2.5 * 0.00001 * t ** 2.0 - 0.0275 * t + 6.5625
|
67
|
+
end
|
68
|
+
|
69
|
+
def high_temperature_average_cp
|
70
|
+
(((1.25 + 2.2 * alfa) / (alfa * 100000.0)) * (t + 450.0) + 0.218) * 4187.0
|
71
|
+
end
|
72
|
+
|
73
|
+
def low_temperature_average_cp
|
74
|
+
(((2.25 + 1.2 * alfa) / (alfa * 100000.0)) * (t - 70.0) + 0.236) * 4187.0
|
75
|
+
end
|
55
76
|
end
|
@@ -1,44 +1,46 @@
|
|
1
1
|
class Gtengine::Simple::Burner
|
2
|
+
attr_accessor :input, :q_t, :output, :t_g, :options
|
2
3
|
|
3
|
-
|
4
|
+
DEFAULTS = {
|
5
|
+
t_0: 288.3,
|
6
|
+
q_n: 43000000.0,
|
7
|
+
eta_g: 0.985,
|
8
|
+
l_0: 14.7
|
9
|
+
}
|
4
10
|
|
5
|
-
|
6
|
-
QN = 43000000.0
|
7
|
-
ETA_G = 0.985
|
8
|
-
L0 = 14.7
|
9
|
-
|
10
|
-
def initialize input, t_g
|
11
|
+
def initialize(input, t_g, options = {})
|
11
12
|
@input, @t_g = input, t_g
|
13
|
+
@options = DEFAULTS.merge(options)
|
12
14
|
cycle
|
13
15
|
end
|
14
16
|
|
15
17
|
def cp_vh
|
16
|
-
|
18
|
+
input.cp
|
17
19
|
end
|
18
20
|
|
19
21
|
def cp_vyh
|
20
|
-
|
22
|
+
output.cp
|
21
23
|
end
|
22
24
|
|
23
25
|
def t_vh
|
24
|
-
|
26
|
+
input.t
|
25
27
|
end
|
26
28
|
|
27
29
|
def p_vh
|
28
|
-
|
30
|
+
input.p
|
29
31
|
end
|
30
32
|
|
31
33
|
def q_ks
|
32
|
-
|
34
|
+
upper_q_ks / lower_q_ks
|
33
35
|
end
|
34
36
|
|
35
37
|
def cp_mult_t_0
|
36
|
-
Gtengine::Gas.new(
|
38
|
+
Gtengine::Gas.new(t_0, 101325.0, 1.0).cp * t_0
|
37
39
|
end
|
38
40
|
|
39
41
|
def alfa
|
40
42
|
begin
|
41
|
-
1.0 / (q_ks *
|
43
|
+
1.0 / (q_ks * l_0)
|
42
44
|
rescue
|
43
45
|
999999999.0
|
44
46
|
end
|
@@ -49,9 +51,35 @@ class Gtengine::Simple::Burner
|
|
49
51
|
5.times { @output.alfa = alfa }
|
50
52
|
end
|
51
53
|
|
54
|
+
def t_0
|
55
|
+
options[:t_0]
|
56
|
+
end
|
57
|
+
|
58
|
+
def l_0
|
59
|
+
options[:l_0]
|
60
|
+
end
|
61
|
+
|
62
|
+
def eta_g
|
63
|
+
options[:eta_g]
|
64
|
+
end
|
65
|
+
|
66
|
+
def q_n
|
67
|
+
options[:q_n]
|
68
|
+
end
|
69
|
+
|
52
70
|
def info
|
53
71
|
puts "== Burner q_ks: #{q_ks}, ALFA: #{alfa}"
|
54
72
|
puts "==== Вход T: #{@input.t.to_i} K, P: #{@input.p.to_i} Па"
|
55
73
|
puts "==== Выход T: #{@output.t.to_i} K, P: #{@output.p.to_i} Па\n\n"
|
56
74
|
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def upper_q_ks
|
79
|
+
(cp_vyh * t_g - cp_vh * t_vh - (cp_vyh - cp_vh) * t_0)
|
80
|
+
end
|
81
|
+
|
82
|
+
def lower_q_ks
|
83
|
+
(q_n * eta_g - (cp_vyh * t_g - cp_mult_t_0))
|
84
|
+
end
|
57
85
|
end
|
@@ -1,58 +1,66 @@
|
|
1
1
|
class Gtengine::Simple::Compressor
|
2
|
-
attr_accessor :input, :output, :g, :pi_k, :
|
2
|
+
attr_accessor :input, :output, :g, :pi_k, :average, :options
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
DEFAULTS = {
|
5
|
+
kpd: 0.85
|
6
|
+
}
|
7
|
+
|
8
|
+
def initialize(input, pi_k, options = {})
|
9
|
+
@input, @pi_k = input, pi_k.to_f
|
10
|
+
@options = DEFAULTS.merge(options)
|
6
11
|
cycle
|
7
12
|
end
|
8
13
|
|
14
|
+
def kpd
|
15
|
+
options[:kpd]
|
16
|
+
end
|
17
|
+
|
9
18
|
def t_vyh
|
10
|
-
|
19
|
+
input.t * (1.0 + ((pi_k ** ((k - 1.0) / k) - 1.0) / kpd))
|
11
20
|
end
|
12
21
|
|
13
22
|
def p_vyh
|
14
|
-
|
23
|
+
input.p * pi_k
|
15
24
|
end
|
16
25
|
|
17
26
|
def l_k
|
18
|
-
|
27
|
+
average.cp * t_vyh * (pi_k ** ((k - 1.0) / k) - 1.0) / kpd
|
19
28
|
end
|
20
29
|
|
21
30
|
def k
|
22
|
-
|
31
|
+
average.average_k
|
23
32
|
end
|
24
33
|
|
25
34
|
def cp
|
26
|
-
|
35
|
+
average.average_cp
|
27
36
|
end
|
28
37
|
|
29
38
|
def alfa
|
30
39
|
1.577 * 0.0000001 * t_vyh ** 2.383 + 1.774
|
31
40
|
end
|
32
41
|
|
33
|
-
def update_average
|
34
|
-
@average.t = (t_vh + t_vyh) / 2.0
|
35
|
-
@average.p = (p_vh + p_vyh) / 2.0
|
36
|
-
end
|
37
|
-
|
38
42
|
def t_vh
|
39
|
-
|
43
|
+
input.t
|
40
44
|
end
|
41
45
|
|
42
46
|
def p_vh
|
43
|
-
|
47
|
+
input.p
|
48
|
+
end
|
49
|
+
|
50
|
+
def update_average
|
51
|
+
@average.t = (t_vh + t_vyh) / 2.0
|
52
|
+
@average.p = (p_vh + p_vyh) / 2.0
|
44
53
|
end
|
45
54
|
|
46
55
|
def cycle
|
47
|
-
@average = Gtengine::Gas.new
|
56
|
+
@average = Gtengine::Gas.new(input.t.to_f, input.p.to_f)
|
48
57
|
5.times { update_average }
|
49
|
-
@output = Gtengine::Gas.new
|
58
|
+
@output = Gtengine::Gas.new(t_vyh, p_vyh)
|
50
59
|
end
|
51
60
|
|
52
61
|
def info
|
53
|
-
puts "== Compressor Pi_k: #{@pi_k}, КДП: #{
|
54
|
-
puts "==== Вход T: #{
|
55
|
-
puts "==== Выход T: #{
|
62
|
+
puts "== Compressor Pi_k: #{@pi_k}, КДП: #{kpd}, Cp_sr: #{cp}, K: #{k}"
|
63
|
+
puts "==== Вход T: #{input.t.to_i} K, P: #{input.p.to_i} Па"
|
64
|
+
puts "==== Выход T: #{output.t.to_i} K, P: #{output.p.to_i} Па, ALFA: #{alfa}\n\n"
|
56
65
|
end
|
57
|
-
|
58
|
-
end
|
66
|
+
end
|
@@ -1,32 +1,31 @@
|
|
1
1
|
class Gtengine::Simple::PikOptimizer
|
2
2
|
attr_accessor :start_pik, :end_pik, :t_g, :step, :optimum, :cycles, :air
|
3
3
|
|
4
|
-
def initialize
|
4
|
+
def initialize(air, start_pik, end_pik, t_g, step = 1)
|
5
5
|
@air, @start_pik, @end_pik, @t_g, @step = air, start_pik, end_pik, t_g, step
|
6
|
+
@cycles = []
|
6
7
|
optimize
|
7
8
|
end
|
8
9
|
|
9
10
|
def optimize
|
10
|
-
@cycles = []
|
11
11
|
Range.new(start_pik, end_pik).step(step).each do |pik|
|
12
12
|
calc_result(pik)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
def calc_result(pik)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
17
|
+
c = Gtengine::Simple::Cycle.new(air, pik, t_g)
|
18
|
+
@cycles << c if c.burner.q_ks
|
19
|
+
rescue
|
20
|
+
false
|
22
21
|
end
|
23
22
|
|
24
23
|
def optimal
|
25
|
-
|
24
|
+
cycles.sort { |a, b| a.burner.q_ks <=> b.burner.q_ks }.first
|
26
25
|
end
|
27
26
|
|
28
27
|
def info
|
29
|
-
|
28
|
+
cycles.each { |c| c.info }
|
30
29
|
puts "Optimal pi_k: #{optimal.pi_k}, q_ks: #{optimal.q_ks}"
|
31
30
|
end
|
32
31
|
end
|
@@ -1,18 +1,37 @@
|
|
1
1
|
class Gtengine::Simple::Turbine
|
2
|
+
attr_accessor :burner, :l_k, :average, :output, :options
|
3
|
+
|
4
|
+
DEFAULTS = {
|
5
|
+
eta: 0.9,
|
6
|
+
eta_m: 0.985,
|
7
|
+
g_ohl: 0.001,
|
8
|
+
kpd: 0.9
|
9
|
+
}
|
10
|
+
|
11
|
+
def initialize(burner, l_k, options = {})
|
12
|
+
@burner, @l_k = burner, l_k
|
13
|
+
@options = DEFAULTS.merge(options)
|
14
|
+
cycle
|
15
|
+
end
|
2
16
|
|
3
|
-
|
17
|
+
def input
|
18
|
+
burner.output
|
19
|
+
end
|
4
20
|
|
5
|
-
|
6
|
-
|
7
|
-
|
21
|
+
def kpd
|
22
|
+
options[:kpd]
|
23
|
+
end
|
8
24
|
|
9
|
-
def
|
10
|
-
|
11
|
-
cycle
|
25
|
+
def g_ohl
|
26
|
+
options[:g_ohl]
|
12
27
|
end
|
13
28
|
|
14
|
-
def
|
15
|
-
|
29
|
+
def eta_m
|
30
|
+
options[:eta_m]
|
31
|
+
end
|
32
|
+
|
33
|
+
def eta
|
34
|
+
options[:eta]
|
16
35
|
end
|
17
36
|
|
18
37
|
def t_vh
|
@@ -24,16 +43,13 @@ class Gtengine::Simple::Turbine
|
|
24
43
|
end
|
25
44
|
|
26
45
|
def pi_t
|
27
|
-
|
28
|
-
pit /= (t_vh * cp * ETA * ETA_M * (1.0 - G_OHL))
|
29
|
-
pit = (1.0 / (1.0 - pit)) ** ((k - 1.0) / k)
|
30
|
-
pit
|
46
|
+
(1.0 / (1.0 - temp_pi_t)) ** ((k - 1.0) / k)
|
31
47
|
end
|
32
48
|
|
33
49
|
def cycle
|
34
|
-
@average = Gtengine::Gas.new
|
50
|
+
@average = Gtengine::Gas.new(t_vh, p_vh)
|
35
51
|
5.times { update_average }
|
36
|
-
@output = Gtengine::Gas.new
|
52
|
+
@output = Gtengine::Gas.new(t_vyh, p_vyh)
|
37
53
|
end
|
38
54
|
|
39
55
|
def update_average
|
@@ -54,17 +70,22 @@ class Gtengine::Simple::Turbine
|
|
54
70
|
end
|
55
71
|
|
56
72
|
def k
|
57
|
-
|
73
|
+
average.average_k
|
58
74
|
end
|
59
75
|
|
60
76
|
def cp
|
61
|
-
|
77
|
+
average.average_cp
|
62
78
|
end
|
63
79
|
|
64
80
|
def info
|
65
81
|
puts "== Turbine Cp_sr: #{cp}, K: #{k}, Pi_t: #{pi_t}, КДП: #{ETA}"
|
66
82
|
puts "==== Вход T: #{t_vh.to_i} K, P: #{p_vh.to_i} Па, ALFA: #{input.alfa}, Cp: #{input.cp}"
|
67
|
-
puts "==== Выход T: #{
|
83
|
+
puts "==== Выход T: #{output.t.to_i} K, P: #{output.p.to_i} Па, , Cp: #{output.cp}\n\n"
|
68
84
|
end
|
69
85
|
|
70
|
-
|
86
|
+
private
|
87
|
+
|
88
|
+
def temp_pi_t
|
89
|
+
(l_k / (1.0 + burner.q_ks)) / (t_vh * cp * eta * eta_m * (1.0 - g_ohl))
|
90
|
+
end
|
91
|
+
end
|
@@ -8,25 +8,23 @@ module Gtengine
|
|
8
8
|
|
9
9
|
attr_accessor :air, :pi_k, :t_g, :compressor, :turbine, :burner
|
10
10
|
|
11
|
-
def initialize
|
12
|
-
@air = air
|
13
|
-
@t_g = t_g
|
14
|
-
@pi_k = pi_k
|
11
|
+
def initialize(air = Gas.new, pi_k, t_g)
|
12
|
+
@air, @t_g, @pi_k = air, t_g, pi_k
|
15
13
|
init_cycle
|
16
14
|
end
|
17
15
|
|
18
16
|
def init_cycle
|
19
|
-
@compressor = Compressor.new
|
20
|
-
@burner = Burner.new
|
21
|
-
@turbine = Turbine.new
|
17
|
+
@compressor = Compressor.new(air, pi_k)
|
18
|
+
@burner = Burner.new(@compressor.output, t_g)
|
19
|
+
@turbine = Turbine.new(burner, compressor.l_k)
|
22
20
|
end
|
23
21
|
|
24
22
|
def q_ks
|
25
|
-
|
23
|
+
burner.q_ks
|
26
24
|
end
|
27
25
|
|
28
26
|
def info
|
29
|
-
puts "== Cycle info: pi_k: #{
|
27
|
+
puts "== Cycle info: pi_k: #{compressor.pi_k}, q_ks: #{q_ks}"
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
data/lib/gtengine/version.rb
CHANGED
@@ -4,24 +4,24 @@ describe Gtengine::Gas do
|
|
4
4
|
let(:gas) { Gtengine::Gas.new }
|
5
5
|
|
6
6
|
it "Считает плотность" do
|
7
|
-
expect(gas.density).to eq 1.
|
7
|
+
expect(gas.density).to eq 1.1751913709116215
|
8
8
|
end
|
9
9
|
|
10
10
|
it "Считает k" do
|
11
|
-
expect(gas.k).to eq 1.
|
11
|
+
expect(gas.k).to eq 1.4019467210274585
|
12
12
|
end
|
13
13
|
|
14
14
|
it "Считает k за процесс" do
|
15
|
-
expect(gas.average_k).to eq 1.
|
15
|
+
expect(gas.average_k).to eq 1.4034884084723653
|
16
16
|
end
|
17
17
|
|
18
18
|
context "LOW TEMPERATURE" do
|
19
19
|
it "Считает теплоемкость" do
|
20
|
-
expect(gas.cp).to eq
|
20
|
+
expect(gas.cp).to eq 1002.4201381549933
|
21
21
|
end
|
22
22
|
|
23
23
|
it "Считает теплоемкость за процесс" do
|
24
|
-
expect(gas.average_cp).to eq
|
24
|
+
expect(gas.average_cp).to eq 999.6881202166772
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -2,14 +2,14 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Gtengine::Simple::Burner do
|
4
4
|
let(:gas) { Gtengine::Gas.new }
|
5
|
-
let(:compressor) { Gtengine::Simple::Compressor.new
|
6
|
-
let(:burner) { Gtengine::Simple::Burner.new
|
5
|
+
let(:compressor) { Gtengine::Simple::Compressor.new(gas, 10) }
|
6
|
+
let(:burner) { Gtengine::Simple::Burner.new(compressor.output, 1400) }
|
7
7
|
|
8
8
|
it "считает расход топлива" do
|
9
|
-
expect(burner.q_ks).to eq 0.
|
9
|
+
expect(burner.q_ks).to eq 0.0255346596182821
|
10
10
|
end
|
11
11
|
|
12
12
|
it "считает альфа" do
|
13
|
-
expect(burner.alfa).to eq 2.
|
13
|
+
expect(burner.alfa).to eq 2.664112696283923
|
14
14
|
end
|
15
15
|
end
|
@@ -2,21 +2,21 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Gtengine::Simple::Compressor do
|
4
4
|
let(:gas) { Gtengine::Gas.new }
|
5
|
-
let(:compressor) { Gtengine::Simple::Compressor.new
|
5
|
+
let(:compressor) { Gtengine::Simple::Compressor.new(gas, 10) }
|
6
6
|
|
7
7
|
it "считает давление выхода" do
|
8
8
|
expect(compressor.p_vyh).to eq 1013250.0
|
9
9
|
end
|
10
10
|
|
11
11
|
it "считает температуру выхода" do
|
12
|
-
expect(compressor.t_vyh).to eq
|
12
|
+
expect(compressor.t_vyh).to eq 627.5847203290919
|
13
13
|
end
|
14
14
|
|
15
15
|
it "считает работу компрессора" do
|
16
|
-
expect(compressor.l_k).to eq
|
16
|
+
expect(compressor.l_k).to eq 701724.7666737017
|
17
17
|
end
|
18
18
|
|
19
19
|
it "считает альфа" do
|
20
|
-
expect(compressor.alfa).to eq 2.
|
20
|
+
expect(compressor.alfa).to eq 2.5062930805003583
|
21
21
|
end
|
22
22
|
end
|
@@ -2,24 +2,24 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Gtengine::Simple::Turbine do
|
4
4
|
let(:gas) { Gtengine::Gas.new }
|
5
|
-
let(:compressor) { Gtengine::Simple::Compressor.new
|
6
|
-
let(:burner) { Gtengine::Simple::Burner.new
|
7
|
-
let(:turbine) { Gtengine::Simple::Turbine.new
|
5
|
+
let(:compressor) { Gtengine::Simple::Compressor.new(gas, 10) }
|
6
|
+
let(:burner) { Gtengine::Simple::Burner.new(compressor.output, 900) }
|
7
|
+
let(:turbine) { Gtengine::Simple::Turbine.new(burner, compressor.l_k) }
|
8
8
|
|
9
9
|
it "считает степень понижения давления" do
|
10
|
-
expect(turbine.pi_t).to eq 1.
|
10
|
+
expect(turbine.pi_t).to eq 1.6842480477100261
|
11
11
|
end
|
12
12
|
|
13
13
|
it "считает температуру выхода" do
|
14
|
-
expect(turbine.t_vyh).to eq
|
14
|
+
expect(turbine.t_vyh).to eq 790.5487885221904
|
15
15
|
end
|
16
16
|
|
17
17
|
it "считает давление выхода" do
|
18
|
-
expect(turbine.p_vyh).to eq
|
18
|
+
expect(turbine.p_vyh).to eq 601603.7847736602
|
19
19
|
end
|
20
20
|
|
21
21
|
it "считает работу турбины l_t" do
|
22
|
-
expect(turbine.l_t).to eq
|
22
|
+
expect(turbine.l_t).to eq 112962.28663065929
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Bovykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,9 +91,9 @@ files:
|
|
91
91
|
- lib/gtengine/simple/turbine.rb
|
92
92
|
- lib/gtengine/simple_cycle.rb
|
93
93
|
- lib/gtengine/version.rb
|
94
|
+
- spec/models/gas_spec.rb
|
94
95
|
- spec/models/simple/burner_spec.rb
|
95
96
|
- spec/models/simple/compressor_spec.rb
|
96
|
-
- spec/models/simple/gas_spec.rb
|
97
97
|
- spec/models/simple/turbine_spec.rb
|
98
98
|
- spec/spec_helper.rb
|
99
99
|
homepage: https://github.com/arrowcircle/engine
|
@@ -116,13 +116,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.2.
|
119
|
+
rubygems_version: 2.2.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Gas Turbine engine and its components math models written in ruby
|
123
123
|
test_files:
|
124
|
+
- spec/models/gas_spec.rb
|
124
125
|
- spec/models/simple/burner_spec.rb
|
125
126
|
- spec/models/simple/compressor_spec.rb
|
126
|
-
- spec/models/simple/gas_spec.rb
|
127
127
|
- spec/models/simple/turbine_spec.rb
|
128
128
|
- spec/spec_helper.rb
|