Skip to content

Commit

Permalink
fix: do not return actual rate in results for compressor sampled sinc…
Browse files Browse the repository at this point in the history
…e it can not be calculated
  • Loading branch information
olelod committed Sep 19, 2023
1 parent 9428979 commit 4c96b09
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 143 deletions.
34 changes: 2 additions & 32 deletions src/ecalc/cli/tests/snapshots/test_app/test_json_true/test_v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -909,22 +909,7 @@
false,
false
],
"inlet_stream_condition": {
"actual_rate_m3_per_hr": [
3500000.0,
3600000.0,
3700000.0,
3800000.0,
3900000.0,
4000000.0,
4100000.0,
4500000.0,
3500000.0,
2500000.0,
2000000.0,
3000000.0
]
},
"inlet_stream_condition": {},
"is_valid": [
true,
true,
Expand Down Expand Up @@ -1342,22 +1327,7 @@
false,
false
],
"inlet_stream_condition": {
"actual_rate_m3_per_hr": [
233000000.0,
237000000.0,
241000000.0,
254000000.0,
258000000.0,
271000000.0,
275000000.0,
279000000.0,
283000000.0,
286000000.0,
290000000.0,
293000000.0
]
},
"inlet_stream_condition": {},
"is_valid": [
true,
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,22 +909,7 @@
false,
false
],
"inlet_stream_condition": {
"actual_rate_m3_per_hr": [
3500000.0,
3600000.0,
3700000.0,
3800000.0,
3900000.0,
4000000.0,
4100000.0,
4500000.0,
3500000.0,
2500000.0,
2000000.0,
3000000.0
]
},
"inlet_stream_condition": {},
"is_valid": [
true,
true,
Expand Down Expand Up @@ -1342,22 +1327,7 @@
false,
false
],
"inlet_stream_condition": {
"actual_rate_m3_per_hr": [
233000000.0,
237000000.0,
241000000.0,
254000000.0,
258000000.0,
271000000.0,
275000000.0,
279000000.0,
283000000.0,
286000000.0,
290000000.0,
293000000.0
]
},
"inlet_stream_condition": {},
"is_valid": [
true,
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def evaluate_rate_ps_pd(
energy_usage = turbine_result.energy_usage if turbine_result is not None else list(interpolated_consumer_values)

# Returning a result as if the sampled compressor is a train with a single stage.
# Note that actual rates are not available since it is not possible to convert from standard rates to
# actual rates when information about fluid composition (density in particular) is not available
result = CompressorTrainResult(
energy_usage=energy_usage,
energy_usage_unit=Unit.MEGA_WATT if self.function_values_are_power else Unit.STANDARD_CUBIC_METER_PER_DAY,
Expand All @@ -226,7 +228,6 @@ def evaluate_rate_ps_pd(
power_unit=Unit.MEGA_WATT,
inlet_stream_condition=CompressorStreamCondition(
pressure=list(suction_pressure) if suction_pressure is not None else None,
actual_rate_m3_per_hr=list(rate) if rate is not None else None,
),
outlet_stream_condition=CompressorStreamCondition(
pressure=list(discharge_pressure) if discharge_pressure is not None else None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8359,12 +8359,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3035242.5,
2372352.0,
2667349.5,
0.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -19502,12 +19497,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3035242.5,
2372352.0,
2667349.5,
0.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -19690,12 +19680,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3035242.5,
2372352.0,
2667349.5,
0.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -19925,12 +19910,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3035242.5,
2372352.0,
2667349.5,
0.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -20113,12 +20093,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3035242.5,
2372352.0,
2667349.5,
0.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1211,10 +1211,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
1000000.0,
1000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -1353,10 +1350,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
5000000.0,
5000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -1495,10 +1489,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
5000000.0,
5000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -1639,10 +1630,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
2000000.0,
6000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -1781,10 +1769,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -1923,10 +1908,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2067,10 +2049,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3000000.0,
3000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2209,10 +2188,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2351,10 +2327,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2528,10 +2501,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
2000000.0,
3000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2670,10 +2640,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2812,10 +2779,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down

0 comments on commit 4c96b09

Please sign in to comment.