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 (#190)
  • Loading branch information
olelod authored Sep 19, 2023
1 parent 623a1cf commit 74fcfd8
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 383 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 @@ -1659,12 +1659,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
1000000.0,
1000000.0,
1000000.0,
1000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -1847,12 +1842,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
5000000.0,
5000000.0,
5000000.0,
5000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2035,12 +2025,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
5000000.0,
5000000.0,
5000000.0,
5000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2225,12 +2210,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
2000000.0,
2000000.0,
2000000.0,
6000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2413,12 +2393,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0,
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2601,12 +2576,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0,
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2791,12 +2761,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
3000000.0,
3000000.0,
3000000.0,
3000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -2979,12 +2944,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0,
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -3167,12 +3127,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0,
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -3402,12 +3357,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
2000000.0,
2000000.0,
2000000.0,
3000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -3590,12 +3540,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0,
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down Expand Up @@ -3778,12 +3723,7 @@
],
"inlet_stream_condition": {
"actual_rate_before_asv_m3_per_hr": null,
"actual_rate_m3_per_hr": [
4000000.0,
4000000.0,
4000000.0,
4000000.0
],
"actual_rate_m3_per_hr": null,
"density_kg_per_m3": null,
"kappa": null,
"pressure": [
Expand Down
Loading

0 comments on commit 74fcfd8

Please sign in to comment.