tespy 0.0.2__tar.gz → 0.0.2.post1__tar.gz
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.
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/PKG-INFO +3 -2
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/TESPy.egg-info/PKG-INFO +3 -2
- TESPy-0.0.2.post1/TESPy.egg-info/requires.txt +5 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/setup.cfg +0 -1
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/setup.py +1 -1
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/components/components.py +133 -64
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/helpers.py +1 -2
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/networks.py +15 -13
- TESPy-0.0.2/TESPy.egg-info/requires.txt +0 -5
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/README.rst +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/TESPy.egg-info/SOURCES.txt +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/TESPy.egg-info/dependency_links.txt +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/TESPy.egg-info/top_level.txt +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/__init__.py +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/components/__init__.py +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/components/characteristics.py +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/components/subsystems.py +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/connections.py +0 -0
- {TESPy-0.0.2 → TESPy-0.0.2.post1}/tespy/csv_reader.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 1.
|
|
1
|
+
Metadata-Version: 1.2
|
|
2
2
|
Name: TESPy
|
|
3
|
-
Version: 0.0.2
|
|
3
|
+
Version: 0.0.2.post1
|
|
4
4
|
Summary: Thermal Engineering Systems in Python (TESPy)
|
|
5
5
|
Home-page: http://github.com/oemof/tespy
|
|
6
6
|
Author: Francesco Witte
|
|
@@ -54,3 +54,4 @@ Description: TESPy stands for "Thermal Engineering Systems in Python" and provid
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
Platform: UNKNOWN
|
|
57
|
+
Requires-Python: >=3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 1.
|
|
1
|
+
Metadata-Version: 1.2
|
|
2
2
|
Name: TESPy
|
|
3
|
-
Version: 0.0.2
|
|
3
|
+
Version: 0.0.2.post1
|
|
4
4
|
Summary: Thermal Engineering Systems in Python (TESPy)
|
|
5
5
|
Home-page: http://github.com/oemof/tespy
|
|
6
6
|
Author: Francesco Witte
|
|
@@ -54,3 +54,4 @@ Description: TESPy stands for "Thermal Engineering Systems in Python" and provid
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
Platform: UNKNOWN
|
|
57
|
+
Requires-Python: >=3
|
|
@@ -655,13 +655,13 @@ class component:
|
|
|
655
655
|
|
|
656
656
|
dm, dp, dh, df = 0, 0, 0, 0
|
|
657
657
|
if dx == 'm':
|
|
658
|
-
dm = 1e-
|
|
658
|
+
dm = 1e-4
|
|
659
659
|
elif dx == 'p':
|
|
660
660
|
dp = 1
|
|
661
661
|
elif dx == 'h':
|
|
662
662
|
dh = 1
|
|
663
663
|
else:
|
|
664
|
-
df = 1e-
|
|
664
|
+
df = 1e-5
|
|
665
665
|
|
|
666
666
|
if dx == 'fluid':
|
|
667
667
|
deriv = []
|
|
@@ -781,6 +781,10 @@ class turbomachine(component):
|
|
|
781
781
|
- char: characteristic curve to use, characteristics are generated in
|
|
782
782
|
preprocessing of offdesign calculations
|
|
783
783
|
|
|
784
|
+
**equations**
|
|
785
|
+
|
|
786
|
+
see tespy.components.components.turbomachine.equations
|
|
787
|
+
|
|
784
788
|
**default design parameters**
|
|
785
789
|
|
|
786
790
|
- pr, eta_s
|
|
@@ -1075,6 +1079,10 @@ class pump(turbomachine):
|
|
|
1075
1079
|
- char: characteristic curve to use, characteristics are generated in
|
|
1076
1080
|
preprocessing of offdesign calculations
|
|
1077
1081
|
|
|
1082
|
+
**equations**
|
|
1083
|
+
|
|
1084
|
+
see tespy.components.components.turbomachine.equations
|
|
1085
|
+
|
|
1078
1086
|
**default design parameters**
|
|
1079
1087
|
|
|
1080
1088
|
- pr, eta_s
|
|
@@ -1388,6 +1396,10 @@ class compressor(turbomachine):
|
|
|
1388
1396
|
|
|
1389
1397
|
- vigv: variable inlet guide vane angle
|
|
1390
1398
|
|
|
1399
|
+
**equations**
|
|
1400
|
+
|
|
1401
|
+
see tespy.components.components.turbomachine.equations
|
|
1402
|
+
|
|
1391
1403
|
**default design parameters**
|
|
1392
1404
|
|
|
1393
1405
|
- pr, eta_s
|
|
@@ -1817,6 +1829,10 @@ class turbine(turbomachine):
|
|
|
1817
1829
|
|
|
1818
1830
|
- cone: cone law to apply in offdesign calculation
|
|
1819
1831
|
|
|
1832
|
+
**equations**
|
|
1833
|
+
|
|
1834
|
+
see tespy.components.components.turbomachine.equations
|
|
1835
|
+
|
|
1820
1836
|
**default design parameters**
|
|
1821
1837
|
|
|
1822
1838
|
- pr, eta_s
|
|
@@ -2183,6 +2199,10 @@ class split(component):
|
|
|
2183
2199
|
|
|
2184
2200
|
- num_out: number of outlets (default value: 2)
|
|
2185
2201
|
|
|
2202
|
+
**equations**
|
|
2203
|
+
|
|
2204
|
+
see tespy.components.components.split.equations
|
|
2205
|
+
|
|
2186
2206
|
**inlets and outlets**
|
|
2187
2207
|
|
|
2188
2208
|
- in1
|
|
@@ -2414,6 +2434,10 @@ class splitter(split):
|
|
|
2414
2434
|
|
|
2415
2435
|
- num_out: number of outlets (default value: 2)
|
|
2416
2436
|
|
|
2437
|
+
**equations**
|
|
2438
|
+
|
|
2439
|
+
see tespy.components.components.split.equations
|
|
2440
|
+
|
|
2417
2441
|
**inlets and outlets**
|
|
2418
2442
|
|
|
2419
2443
|
- in1
|
|
@@ -2435,6 +2459,10 @@ class separator(split):
|
|
|
2435
2459
|
|
|
2436
2460
|
- num_out: number of outlets (default value: 2)
|
|
2437
2461
|
|
|
2462
|
+
**equations**
|
|
2463
|
+
|
|
2464
|
+
see tespy.components.components.split.equations
|
|
2465
|
+
|
|
2438
2466
|
**inlets and outlets**
|
|
2439
2467
|
|
|
2440
2468
|
- in1
|
|
@@ -2458,6 +2486,10 @@ class merge(component):
|
|
|
2458
2486
|
|
|
2459
2487
|
- num_in: number of inlets (default value: 2)
|
|
2460
2488
|
|
|
2489
|
+
**equations**
|
|
2490
|
+
|
|
2491
|
+
see tespy.components.components.merge.equations
|
|
2492
|
+
|
|
2461
2493
|
**inlets and outlets**
|
|
2462
2494
|
|
|
2463
2495
|
- specify number of inlets with :code:`num_in`
|
|
@@ -2635,7 +2667,7 @@ class merge(component):
|
|
|
2635
2667
|
print('##### ', self.label, ' #####')
|
|
2636
2668
|
j = 1
|
|
2637
2669
|
for i in inl:
|
|
2638
|
-
print('m_in' + str(j) + ' = ', i.m, 'kg / s; ')
|
|
2670
|
+
print('m_in' + str(j) + ' = ', i.m.val_SI, 'kg / s; ')
|
|
2639
2671
|
j += 1
|
|
2640
2672
|
print('m_out = ', outl[0].m.val_SI, 'kg / s; ')
|
|
2641
2673
|
|
|
@@ -2650,6 +2682,10 @@ class combustion_chamber(component):
|
|
|
2650
2682
|
- lamb: air to stoichiometric air ratio
|
|
2651
2683
|
- ti: thermal input (:math:`{LHV \cdot \dot{m}_f}`)
|
|
2652
2684
|
|
|
2685
|
+
**equations**
|
|
2686
|
+
|
|
2687
|
+
see tespy.components.components.combustion_chamber.equations
|
|
2688
|
+
|
|
2653
2689
|
**available fuels**
|
|
2654
2690
|
|
|
2655
2691
|
- methane
|
|
@@ -2849,6 +2885,12 @@ class combustion_chamber(component):
|
|
|
2849
2885
|
ti_deriv[0, i, 3:] = (
|
|
2850
2886
|
self.ddx_func(inl, outl, self.ti_func,
|
|
2851
2887
|
'fluid', i))
|
|
2888
|
+
for o in range(num_o):
|
|
2889
|
+
ti_deriv[0, o + i, 0] = (
|
|
2890
|
+
self.ddx_func(inl, outl, self.ti_func, 'm', o + i))
|
|
2891
|
+
ti_deriv[0, o + i, 3:] = (
|
|
2892
|
+
self.ddx_func(inl, outl, self.ti_func,
|
|
2893
|
+
'fluid', o + i))
|
|
2852
2894
|
mat_deriv += ti_deriv.tolist()
|
|
2853
2895
|
|
|
2854
2896
|
return np.asarray(mat_deriv)
|
|
@@ -3104,7 +3146,7 @@ class combustion_chamber(component):
|
|
|
3104
3146
|
m_fuel += (i.m.val_SI * i.fluid.val[self.fuel.val])
|
|
3105
3147
|
|
|
3106
3148
|
for o in outl:
|
|
3107
|
-
m_fuel -= (
|
|
3149
|
+
m_fuel -= (o.m.val_SI * o.fluid.val[self.fuel.val])
|
|
3108
3150
|
|
|
3109
3151
|
return (self.ti.val - m_fuel * self.hi)
|
|
3110
3152
|
|
|
@@ -3135,7 +3177,7 @@ class combustion_chamber(component):
|
|
|
3135
3177
|
|
|
3136
3178
|
dm, dp, dh, df = 0, 0, 0, 0
|
|
3137
3179
|
if dx == 'm':
|
|
3138
|
-
dm = 1e-
|
|
3180
|
+
dm = 1e-4
|
|
3139
3181
|
elif dx == 'p':
|
|
3140
3182
|
dp = 1
|
|
3141
3183
|
elif dx == 'h':
|
|
@@ -3195,17 +3237,17 @@ class combustion_chamber(component):
|
|
|
3195
3237
|
:type nw: tespy.networks.network
|
|
3196
3238
|
:returns: no return value
|
|
3197
3239
|
"""
|
|
3198
|
-
|
|
3199
|
-
|
|
3240
|
+
N_2 = 0.7655
|
|
3241
|
+
O_2 = 0.2345
|
|
3200
3242
|
|
|
3201
3243
|
n_fuel = 1
|
|
3202
|
-
lamb =
|
|
3244
|
+
lamb = 3
|
|
3203
3245
|
m_o2 = (n_fuel * (self.n['C'] + self.n['H'] / 4) *
|
|
3204
3246
|
molar_masses[self.o2] * lamb)
|
|
3205
3247
|
m_co2 = n_fuel * self.n['C'] * molar_masses[self.co2]
|
|
3206
3248
|
m_h2o = n_fuel * self.n['H'] / 2 * molar_masses[self.h2o]
|
|
3207
|
-
m_n2 = m_o2 /
|
|
3208
|
-
|
|
3249
|
+
m_n2 = m_o2 / O_2 * N_2
|
|
3250
|
+
|
|
3209
3251
|
m = m_n2 + m_h2o + m_co2 + m_o2
|
|
3210
3252
|
|
|
3211
3253
|
fg = {
|
|
@@ -3232,33 +3274,27 @@ class combustion_chamber(component):
|
|
|
3232
3274
|
:type nw: tespy.networks.network
|
|
3233
3275
|
:returns: no return value
|
|
3234
3276
|
"""
|
|
3277
|
+
|
|
3278
|
+
self.initialise_fluids(nw)
|
|
3279
|
+
|
|
3235
3280
|
for o in nw.comps.loc[self].o:
|
|
3236
3281
|
fluids = [f for f in o.fluid.val.keys() if not o.fluid.val_set[f]]
|
|
3237
3282
|
for f in fluids:
|
|
3238
|
-
if f
|
|
3239
|
-
if o.fluid.val[f] > 0.22:
|
|
3240
|
-
o.fluid.val[f] = 0.22
|
|
3241
|
-
elif f == self.n2:
|
|
3242
|
-
if o.fluid.val[f] < 0.6 or o.fluid.val[f] > 0.8:
|
|
3243
|
-
o.fluid.val[f] = 0.7
|
|
3244
|
-
elif f == self.co2:
|
|
3245
|
-
if o.fluid.val[f] > 0.15:
|
|
3246
|
-
o.fluid.val[f] = 0.15
|
|
3247
|
-
elif f == self.h2o:
|
|
3248
|
-
if o.fluid.val[f] > 0.15:
|
|
3249
|
-
o.fluid.val[f] = 0.15
|
|
3250
|
-
elif f == self.fuel:
|
|
3251
|
-
if o.fluid.val[f] > 0.05:
|
|
3252
|
-
o.fluid.val[f] = 0.05
|
|
3253
|
-
else:
|
|
3283
|
+
if f not in [self.o2, self.n2, self.co2, self.h2o, self.fuel]:
|
|
3254
3284
|
if o.fluid.val[f] > 0.03:
|
|
3255
3285
|
o.fluid.val[f] = 0.03
|
|
3256
3286
|
|
|
3287
|
+
for i in nw.comps.loc[self].i:
|
|
3288
|
+
if i.m.val_SI < 0 and not i.m.val_set:
|
|
3289
|
+
i.m.val_SI = 0.01
|
|
3290
|
+
|
|
3257
3291
|
for c in nw.comps.loc[self].o:
|
|
3292
|
+
if o.m.val_SI < 0 and not o.m.val_set:
|
|
3293
|
+
o.m.val_SI = 10
|
|
3258
3294
|
init_target(nw, c, c.t)
|
|
3259
3295
|
|
|
3260
|
-
if c.h.val_SI <
|
|
3261
|
-
c.h.val_SI =
|
|
3296
|
+
if c.h.val_SI < 7.5e5 and not c.h.val_set:
|
|
3297
|
+
c.h.val_SI = 1e6
|
|
3262
3298
|
|
|
3263
3299
|
if self.lamb.val < 1 and not self.lamb.is_set:
|
|
3264
3300
|
self.lamb.val = 3
|
|
@@ -3569,6 +3605,10 @@ class vessel(component):
|
|
|
3569
3605
|
:math:`[\zeta]=\frac{\text{Pa}}{\text{m}^4}`, also see
|
|
3570
3606
|
:func:`tespy.components.components.component.zeta_func`
|
|
3571
3607
|
|
|
3608
|
+
**equations**
|
|
3609
|
+
|
|
3610
|
+
see tespy.components.components.vessel.equations
|
|
3611
|
+
|
|
3572
3612
|
**default design parameters**
|
|
3573
3613
|
|
|
3574
3614
|
- pr
|
|
@@ -3803,13 +3843,18 @@ class heat_exchanger_simple(component):
|
|
|
3803
3843
|
- kA and t_a, if you want to calculate the heat flux on basis of the
|
|
3804
3844
|
ambient conditions
|
|
3805
3845
|
|
|
3846
|
+
**equations**
|
|
3847
|
+
|
|
3848
|
+
see tespy.components.components.heat_exchager_simple.equations
|
|
3849
|
+
|
|
3806
3850
|
**default design parameters**
|
|
3807
3851
|
|
|
3808
3852
|
- pr
|
|
3809
3853
|
|
|
3810
3854
|
**default offdesign parameters**
|
|
3811
3855
|
|
|
3812
|
-
- kA (method: HE_COLD, param: m)
|
|
3856
|
+
- kA (method: HE_COLD, param: m): *be aware that you must provide t_a and
|
|
3857
|
+
t_a_design, if you want the heat flux calculated by this method*
|
|
3813
3858
|
|
|
3814
3859
|
**inlets and outlets**
|
|
3815
3860
|
|
|
@@ -3834,6 +3879,11 @@ class heat_exchanger_simple(component):
|
|
|
3834
3879
|
y = self.kA_char.y
|
|
3835
3880
|
self.kA_char.func = cmp_char.heat_ex(method=method, x=x, y=y)
|
|
3836
3881
|
|
|
3882
|
+
self.t_a.val_SI = ((self.t_a.val + nw.T[nw.T_unit][0]) *
|
|
3883
|
+
nw.T[nw.T_unit][1])
|
|
3884
|
+
self.t_a_design.val_SI = ((self.t_a_design.val + nw.T[nw.T_unit][0]) *
|
|
3885
|
+
nw.T[nw.T_unit][1])
|
|
3886
|
+
|
|
3837
3887
|
def attr(self):
|
|
3838
3888
|
return ['Q', 'pr', 'zeta', 'D', 'L', 'ks',
|
|
3839
3889
|
'kA', 't_a', 't_a_design', 'kA_char']
|
|
@@ -4053,12 +4103,12 @@ class heat_exchanger_simple(component):
|
|
|
4053
4103
|
T_i = T_mix_ph(i.to_flow())
|
|
4054
4104
|
T_o = T_mix_ph(o.to_flow())
|
|
4055
4105
|
|
|
4056
|
-
if self.t_a.
|
|
4057
|
-
ttd_u = self.t_a.
|
|
4058
|
-
ttd_l = self.t_a.
|
|
4106
|
+
if self.t_a.val_SI > T_i:
|
|
4107
|
+
ttd_u = self.t_a.val_SI - T_o
|
|
4108
|
+
ttd_l = self.t_a.val_SI - T_i
|
|
4059
4109
|
else:
|
|
4060
|
-
ttd_u = T_i - self.t_a.
|
|
4061
|
-
ttd_l = T_o - self.t_a.
|
|
4110
|
+
ttd_u = T_i - self.t_a.val_SI
|
|
4111
|
+
ttd_l = T_o - self.t_a.val_SI
|
|
4062
4112
|
|
|
4063
4113
|
if self.kA_char.param == 'm':
|
|
4064
4114
|
expr = i.m.val_SI / self.i0[0]
|
|
@@ -4161,12 +4211,12 @@ class heat_exchanger_simple(component):
|
|
|
4161
4211
|
if nw.mode == 'offdesign':
|
|
4162
4212
|
if mode == 'pre':
|
|
4163
4213
|
if self.t_a_design.is_set:
|
|
4164
|
-
t_a = self.t_a_design.
|
|
4214
|
+
t_a = self.t_a_design.val_SI
|
|
4165
4215
|
else:
|
|
4166
4216
|
t_a = np.nan
|
|
4167
4217
|
else:
|
|
4168
4218
|
if self.t_a.is_set:
|
|
4169
|
-
t_a = self.t_a.
|
|
4219
|
+
t_a = self.t_a.val_SI
|
|
4170
4220
|
else:
|
|
4171
4221
|
t_a = np.nan
|
|
4172
4222
|
|
|
@@ -4174,6 +4224,7 @@ class heat_exchanger_simple(component):
|
|
|
4174
4224
|
|
|
4175
4225
|
T_i = T_mix_ph(inl[0].to_flow())
|
|
4176
4226
|
T_o = T_mix_ph(outl[0].to_flow())
|
|
4227
|
+
|
|
4177
4228
|
if t_a > T_i:
|
|
4178
4229
|
ttd_u = t_a - T_o
|
|
4179
4230
|
ttd_l = t_a - T_i
|
|
@@ -4251,7 +4302,13 @@ class pipe(heat_exchanger_simple):
|
|
|
4251
4302
|
- ks: pipes roughness
|
|
4252
4303
|
- kA: area independent heat transition coefficient,
|
|
4253
4304
|
:math:`kA=\frac{\text{W}}{\text{K}}`
|
|
4254
|
-
- t_a: ambient temperature, provide parameter in
|
|
4305
|
+
- t_a: ambient temperature, provide parameter in network's temperature unit
|
|
4306
|
+
- t_a_design: ambient temperature design case, provide parameter in
|
|
4307
|
+
network's temperature unit
|
|
4308
|
+
|
|
4309
|
+
**equations**
|
|
4310
|
+
|
|
4311
|
+
see tespy.components.components.heat_exchager_simple.equations
|
|
4255
4312
|
|
|
4256
4313
|
**default design parameters**
|
|
4257
4314
|
|
|
@@ -4259,7 +4316,8 @@ class pipe(heat_exchanger_simple):
|
|
|
4259
4316
|
|
|
4260
4317
|
**default offdesign parameters**
|
|
4261
4318
|
|
|
4262
|
-
- kA
|
|
4319
|
+
- kA (method: HE_COLD, param: m): *be aware that you must provide t_a and
|
|
4320
|
+
t_a_design, if you want the heat flux calculated by this method*
|
|
4263
4321
|
|
|
4264
4322
|
**inlets and outlets**
|
|
4265
4323
|
|
|
@@ -4301,6 +4359,10 @@ class heat_exchanger(component):
|
|
|
4301
4359
|
:math:`[\zeta]=\frac{\text{Pa}}{\text{m}^4}`, also see
|
|
4302
4360
|
:func:`tespy.components.components.heat_exchanger.zeta2_func`
|
|
4303
4361
|
|
|
4362
|
+
**equations**
|
|
4363
|
+
|
|
4364
|
+
see tespy.components.components.heat_exchager.equations
|
|
4365
|
+
|
|
4304
4366
|
**default design parameters**
|
|
4305
4367
|
|
|
4306
4368
|
- pr1, pr2, ttd_u, ttd_l
|
|
@@ -4324,7 +4386,6 @@ class heat_exchanger(component):
|
|
|
4324
4386
|
|
|
4325
4387
|
- add the partial derivatives for specified logarithmic temperature
|
|
4326
4388
|
difference
|
|
4327
|
-
- add characteristics for given kA-values
|
|
4328
4389
|
- add direct current heat exchangers
|
|
4329
4390
|
"""
|
|
4330
4391
|
|
|
@@ -4659,7 +4720,7 @@ class heat_exchanger(component):
|
|
|
4659
4720
|
T_o2 = T_mix_ph(o2)
|
|
4660
4721
|
|
|
4661
4722
|
if T_i1 <= T_o2 and not inl[0].T.val_set:
|
|
4662
|
-
T_i1 = T_o2 +
|
|
4723
|
+
T_i1 = T_o2 + 2
|
|
4663
4724
|
if T_i1 <= T_o2 and not outl[1].T.val_set:
|
|
4664
4725
|
T_o2 = T_i1 - 1
|
|
4665
4726
|
if T_i1 <= T_o2 and inl[0].T.val_set and outl[1].T.val_set:
|
|
@@ -4849,30 +4910,13 @@ class heat_exchanger(component):
|
|
|
4849
4910
|
if i[1].h.val_SI > o[1].h.val_SI and not i[1].h.val_set:
|
|
4850
4911
|
i[1].h.val_SI = o[1].h.val_SI / 2
|
|
4851
4912
|
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
# except:
|
|
4860
|
-
# if not i[0].h.val_set:
|
|
4861
|
-
# i[0].h.val_SI *= 1.05
|
|
4862
|
-
# if not o[1].h.val_set:
|
|
4863
|
-
# o[1].h.val_SI *= 0.95
|
|
4864
|
-
#
|
|
4865
|
-
# if self.ttd_l_set:
|
|
4866
|
-
# expr = False
|
|
4867
|
-
# while not expr:
|
|
4868
|
-
# try:
|
|
4869
|
-
# self.ttd_l_func(i, o)
|
|
4870
|
-
# expr = True
|
|
4871
|
-
# except:
|
|
4872
|
-
# if not i[1].h.val_set:
|
|
4873
|
-
# i[1].h.val_SI *= 1.05
|
|
4874
|
-
# if not o[0].h.val_set:
|
|
4875
|
-
# o[0].h.val_SI *= 0.95
|
|
4913
|
+
if self.ttd_l.is_set:
|
|
4914
|
+
h_min_o1 = h_mix_pT(o[0].to_flow(), nw.T_range_SI[0])
|
|
4915
|
+
h_min_i2 = h_mix_pT(i[1].to_flow(), nw.T_range_SI[0])
|
|
4916
|
+
if not o[0].h.val_set and o[0].h.val_SI < h_min_o1 * 2:
|
|
4917
|
+
o[0].h.val_SI = h_min_o1 * 2
|
|
4918
|
+
if not i[1].h.val_set and i[1].h.val_SI < h_min_i2:
|
|
4919
|
+
i[1].h.val_SI = h_min_i2 * 1.1
|
|
4876
4920
|
|
|
4877
4921
|
def initialise_source(self, c, key):
|
|
4878
4922
|
r"""
|
|
@@ -5085,6 +5129,10 @@ class condenser(heat_exchanger):
|
|
|
5085
5129
|
:math:`[\zeta]=\frac{\text{Pa}}{\text{m}^4}`, also see
|
|
5086
5130
|
:func:`tespy.components.components.heat_exchanger.zeta2_func`
|
|
5087
5131
|
|
|
5132
|
+
**equations**
|
|
5133
|
+
|
|
5134
|
+
see tespy.components.components.heat_exchager.equations
|
|
5135
|
+
|
|
5088
5136
|
**default design parameters**
|
|
5089
5137
|
|
|
5090
5138
|
- pr2, ttd_u, ttd_l
|
|
@@ -5326,6 +5374,10 @@ class desuperheater(heat_exchanger):
|
|
|
5326
5374
|
:math:`[\zeta]=\frac{\text{Pa}}{\text{m}^4}`, also see
|
|
5327
5375
|
:func:`tespy.components.components.heat_exchanger.zeta2_func`
|
|
5328
5376
|
|
|
5377
|
+
**equations**
|
|
5378
|
+
|
|
5379
|
+
see tespy.components.components.heat_exchager.equations
|
|
5380
|
+
|
|
5329
5381
|
**default design parameters**
|
|
5330
5382
|
|
|
5331
5383
|
- pr1, pr2, ttd_u, ttd_l
|
|
@@ -5413,6 +5465,16 @@ class desuperheater(heat_exchanger):
|
|
|
5413
5465
|
|
|
5414
5466
|
class drum(component):
|
|
5415
5467
|
r"""
|
|
5468
|
+
|
|
5469
|
+
- assumes, that the fluid composition between outlet 1 and inlet 2 does
|
|
5470
|
+
not change!
|
|
5471
|
+
|
|
5472
|
+
**no specification parameters available**
|
|
5473
|
+
|
|
5474
|
+
**equations**
|
|
5475
|
+
|
|
5476
|
+
see tespy.components.components.drum.equations
|
|
5477
|
+
|
|
5416
5478
|
**inlets and outlets**
|
|
5417
5479
|
|
|
5418
5480
|
- in1, in2 (index 1: from economiser, index 2: from evaporator)
|
|
@@ -5598,6 +5660,13 @@ class subsys_interface(component):
|
|
|
5598
5660
|
- passes fluid properties/flow information at inlet i to outlet i
|
|
5599
5661
|
- no transformation of any fluid properties
|
|
5600
5662
|
|
|
5663
|
+
**available parameters**
|
|
5664
|
+
|
|
5665
|
+
- num_inter: number of connections for the interface
|
|
5666
|
+
|
|
5667
|
+
**equations**
|
|
5668
|
+
|
|
5669
|
+
see tespy.components.components.subsys_interface.equations
|
|
5601
5670
|
|
|
5602
5671
|
**inlets and outlets**
|
|
5603
5672
|
|
|
@@ -372,7 +372,7 @@ class dc_cp(data_container):
|
|
|
372
372
|
val will be used as starting value
|
|
373
373
|
"""
|
|
374
374
|
def attr(self):
|
|
375
|
-
return {'val': 0, 'is_set': False, 'is_var': False}
|
|
375
|
+
return {'val': 0, 'val_SI': 0, 'is_set': False, 'is_var': False}
|
|
376
376
|
|
|
377
377
|
|
|
378
378
|
class dc_cc(data_container):
|
|
@@ -509,7 +509,6 @@ def newton(func, deriv, params, k, **kwargs):
|
|
|
509
509
|
print('Newton algorithm was not able to find a feasible'
|
|
510
510
|
'value for function '+str(func)+'.')
|
|
511
511
|
|
|
512
|
-
val = np.array([np.nan])
|
|
513
512
|
break
|
|
514
513
|
|
|
515
514
|
return val
|
|
@@ -983,7 +983,7 @@ class network:
|
|
|
983
983
|
|
|
984
984
|
self.vec_res = []
|
|
985
985
|
self.iter = 0
|
|
986
|
-
self.relax =
|
|
986
|
+
self.relax = 1
|
|
987
987
|
self.num_restart = 0
|
|
988
988
|
# number of variables
|
|
989
989
|
self.num_vars = len(self.fluids) + 3
|
|
@@ -1076,8 +1076,7 @@ class network:
|
|
|
1076
1076
|
|
|
1077
1077
|
# stop calculation after rediculous amount of iterations
|
|
1078
1078
|
if self.iter > 3:
|
|
1079
|
-
if
|
|
1080
|
-
hlp.err ** (1 / 2))):
|
|
1079
|
+
if self.res[-1] < hlp.err ** (1 / 2):
|
|
1081
1080
|
if self.num_restart > 0:
|
|
1082
1081
|
self.convergence[0] = np.column_stack((
|
|
1083
1082
|
self.convergence[0], [0] * len(self.conns)))
|
|
@@ -1089,10 +1088,10 @@ class network:
|
|
|
1089
1088
|
len(self.conns),))
|
|
1090
1089
|
break
|
|
1091
1090
|
|
|
1092
|
-
if self.iter >
|
|
1093
|
-
if (all(self.res[(self.iter -
|
|
1094
|
-
self.res[-1]
|
|
1095
|
-
print('Convergence is making no progress, '
|
|
1091
|
+
if self.iter > 15:
|
|
1092
|
+
if (all(self.res[(self.iter - 3):] >= self.res[-2]) and
|
|
1093
|
+
self.res[-1] >= self.res[-2]):
|
|
1094
|
+
print('ERROR: Convergence is making no progress, '
|
|
1096
1095
|
'calculation stopped.')
|
|
1097
1096
|
if self.num_restart > 0:
|
|
1098
1097
|
self.convergence[0] = np.column_stack((
|
|
@@ -1194,12 +1193,15 @@ class network:
|
|
|
1194
1193
|
j += 1
|
|
1195
1194
|
i += 1
|
|
1196
1195
|
|
|
1197
|
-
self.solve_check_properties(c)
|
|
1198
|
-
|
|
1199
1196
|
# check properties for consistency
|
|
1200
1197
|
if self.iter < 3:
|
|
1201
1198
|
for cp in self.comps.index:
|
|
1202
|
-
|
|
1199
|
+
if (self.init_file is None or
|
|
1200
|
+
isinstance(cp, cmp.combustion_chamber)):
|
|
1201
|
+
cp.convergence_check(self)
|
|
1202
|
+
|
|
1203
|
+
for c in self.conns.index:
|
|
1204
|
+
self.solve_check_properties(c)
|
|
1203
1205
|
|
|
1204
1206
|
def solve_check_properties(self, c):
|
|
1205
1207
|
"""
|
|
@@ -1232,7 +1234,7 @@ class network:
|
|
|
1232
1234
|
# acutal value
|
|
1233
1235
|
# for pure fluids:
|
|
1234
1236
|
# obtain maximum temperature from fluid properties directly
|
|
1235
|
-
if c.T.val_set and not c.h.val_set and self.iter <
|
|
1237
|
+
if c.T.val_set and not c.h.val_set and self.iter < 0:
|
|
1236
1238
|
self.solve_check_temperature(c, 'min')
|
|
1237
1239
|
self.solve_check_temperature(c, 'max')
|
|
1238
1240
|
|
|
@@ -1253,10 +1255,10 @@ class network:
|
|
|
1253
1255
|
|
|
1254
1256
|
val = 'T' + pos
|
|
1255
1257
|
if pos == 'min':
|
|
1256
|
-
fac = 1.
|
|
1258
|
+
fac = 1.1
|
|
1257
1259
|
idx = 0
|
|
1258
1260
|
else:
|
|
1259
|
-
fac = 0.
|
|
1261
|
+
fac = 0.9
|
|
1260
1262
|
idx = 1
|
|
1261
1263
|
|
|
1262
1264
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|