gtengine 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +73 -14
- data/lib/gtengine/simple/turbine.rb +1 -1
- data/lib/gtengine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 812393432858ce5b184ba076ad81c26620f86216
|
4
|
+
data.tar.gz: 0ff53a296340df7dc49578d9314cc0f026704955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15696ebb89a0a426f0d706f6bb23a1cb5ba53d6b1eafa183f5ee5e50c3d56e93cc8a60d0b855e17bd5b2ee644d39488b2ff532adef1f6f9dc9830613494e8299
|
7
|
+
data.tar.gz: 801cd4f46a8ef3408eccc73bae01599ea99c764dde275e1717a251501610acee359341978bf8eee88d211f8b39dbc460c0e8b3ba9d9b680b74de8af1c42bdef0
|
data/Readme.md
CHANGED
@@ -18,43 +18,102 @@ and run
|
|
18
18
|
|
19
19
|
For simple parts calculation:
|
20
20
|
|
21
|
-
gas = Gtengine::Gas.new
|
21
|
+
gas = Gtengine::Gas.new(300, 101325)
|
22
22
|
|
23
|
-
k = Gtengine::Simple::Compressor.new
|
24
|
-
b = Gtengine::Simple::Burner.new
|
25
|
-
t = Gtengine::Simple::Turbine.new
|
23
|
+
k = Gtengine::Simple::Compressor.new(gas, 4.5)
|
24
|
+
b = Gtengine::Simple::Burner.new(k.output, 1500)
|
25
|
+
t = Gtengine::Simple::Turbine.new(b, k.l_k)
|
26
26
|
|
27
27
|
k.info; b.info; t.info
|
28
28
|
|
29
29
|
To play with cycle (compressor -> burner -> turbine)
|
30
30
|
|
31
31
|
require_relative 'lib/gtengine'
|
32
|
-
gas = Gtengine::Gas.new
|
32
|
+
gas = Gtengine::Gas.new(300, 101325)
|
33
|
+
|
34
|
+
c = Gtengine::Simple::Cycle.new(gas, 20, 1500.0)
|
33
35
|
|
34
|
-
c = Gtengine::Simple::Cycle.new gas, 20, 1500.0
|
35
|
-
|
36
36
|
c.compressor.info; c.burner.info; c.turbine.info; c.info
|
37
37
|
|
38
38
|
To play with pi_k optimization
|
39
39
|
|
40
40
|
require_relative 'lib/gtengine'
|
41
|
-
gas = Gtengine::Gas.new
|
42
|
-
|
43
|
-
opt = Gtengine::Simple::PikOptimizer.new
|
41
|
+
gas = Gtengine::Gas.new(300, 101325)
|
42
|
+
|
43
|
+
opt = Gtengine::Simple::PikOptimizer.new(gas, 3, 40, 1500, 1)
|
44
44
|
opt.info
|
45
45
|
|
46
46
|
Cycle research with T_g and pik
|
47
47
|
|
48
48
|
require_relative 'lib/gtengine'
|
49
|
-
gas = Gtengine::Gas.new
|
49
|
+
gas = Gtengine::Gas.new(300, 101325)
|
50
50
|
|
51
|
-
res = {}
|
52
|
-
[900, 1000, 1100, 1200, 1300, 1400, 1500].each do |t_g|
|
51
|
+
res = [900, 1000, 1100, 1200, 1300, 1400, 1500].inject({}) do |memo, t_g|
|
53
52
|
opt = Gtengine::Simple::PikOptimizer.new(gas, 3, 40, t_g, 1)
|
54
|
-
|
53
|
+
memo.merge(t_g.to_s => opt.optimal.pi_k)
|
55
54
|
end
|
56
55
|
puts res
|
57
56
|
|
57
|
+
## Compressor
|
58
|
+
|
59
|
+
Compressor initializer gets 3 arguments as input:
|
60
|
+
|
61
|
+
Gtengine::Simple::Compressor.new(gas, pi_k, options)
|
62
|
+
|
63
|
+
where:
|
64
|
+
|
65
|
+
* gas - is gas state, as `Gtengine::Gas` class
|
66
|
+
* pi_k - is pi_k
|
67
|
+
* options - is a hash of options, defaults are:
|
68
|
+
|
69
|
+
```
|
70
|
+
DEFAULTS = {
|
71
|
+
kpd: 0.85
|
72
|
+
}
|
73
|
+
```
|
74
|
+
|
75
|
+
## Burner
|
76
|
+
|
77
|
+
Burner initializer gets 3 arguments as input:
|
78
|
+
|
79
|
+
Gtengine::Simple::Burner.new(gas, t_g, options)
|
80
|
+
|
81
|
+
where:
|
82
|
+
|
83
|
+
* gas - is gas state, as `Gtengine::Gas` class
|
84
|
+
* t_g - is t_g
|
85
|
+
* options - is a hash of options, defaults are:
|
86
|
+
|
87
|
+
```
|
88
|
+
DEFAULTS = {
|
89
|
+
t_0: 288.3,
|
90
|
+
q_n: 43000000.0,
|
91
|
+
eta_g: 0.985,
|
92
|
+
l_0: 14.7
|
93
|
+
}
|
94
|
+
```
|
95
|
+
|
96
|
+
## Turbine
|
97
|
+
|
98
|
+
Turbine initializer gets 3 arguments as input:
|
99
|
+
|
100
|
+
Gtengine::Simple::Turbine.new(burner, l_k, options)
|
101
|
+
|
102
|
+
where:
|
103
|
+
|
104
|
+
* burner - is burner, as `Gtengine::Simple::Burner` class
|
105
|
+
* l_k - is l_k
|
106
|
+
* options - is a hash of options, defaults are:
|
107
|
+
|
108
|
+
```
|
109
|
+
DEFAULTS = {
|
110
|
+
eta: 0.9,
|
111
|
+
eta_m: 0.985,
|
112
|
+
g_ohl: 0.001,
|
113
|
+
kpd: 0.9
|
114
|
+
}
|
115
|
+
```
|
116
|
+
|
58
117
|
## Requirements
|
59
118
|
|
60
119
|
* Ruby 2.0.0 or newer
|
@@ -78,7 +78,7 @@ class Gtengine::Simple::Turbine
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def info
|
81
|
-
puts "== Turbine Cp_sr: #{cp}, K: #{k}, Pi_t: #{pi_t}, КДП: #{
|
81
|
+
puts "== Turbine Cp_sr: #{cp}, K: #{k}, Pi_t: #{pi_t}, КДП: #{eta}"
|
82
82
|
puts "==== Вход T: #{t_vh.to_i} K, P: #{p_vh.to_i} Па, ALFA: #{input.alfa}, Cp: #{input.cp}"
|
83
83
|
puts "==== Выход T: #{output.t.to_i} K, P: #{output.p.to_i} Па, , Cp: #{output.cp}\n\n"
|
84
84
|
end
|
data/lib/gtengine/version.rb
CHANGED