RCAIDE-GUI 1.0.0__py3-none-any.whl

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.
Files changed (170) hide show
  1. common_widgets/__init__.py +6 -0
  2. common_widgets/animated_toggle.py +141 -0
  3. common_widgets/color.py +17 -0
  4. common_widgets/data_entry_widget.py +337 -0
  5. common_widgets/image_widget.py +21 -0
  6. common_widgets/unit_picker_widget.py +48 -0
  7. main.py +168 -0
  8. rcaide_gui-1.0.0.dist-info/METADATA +96 -0
  9. rcaide_gui-1.0.0.dist-info/RECORD +170 -0
  10. rcaide_gui-1.0.0.dist-info/WHEEL +5 -0
  11. rcaide_gui-1.0.0.dist-info/entry_points.txt +2 -0
  12. rcaide_gui-1.0.0.dist-info/top_level.txt +5 -0
  13. rcaide_io.py +818 -0
  14. tabs/__init__.py +10 -0
  15. tabs/aircraft_configs/__init__.py +3 -0
  16. tabs/aircraft_configs/aircraft_configs.py +301 -0
  17. tabs/analysis/__init__.py +4 -0
  18. tabs/analysis/analysis.py +92 -0
  19. tabs/analysis/widgets/__init__.py +13 -0
  20. tabs/analysis/widgets/aeroacoustics_widget.py +158 -0
  21. tabs/analysis/widgets/aerodynamics_widget.py +108 -0
  22. tabs/analysis/widgets/analysis_data_widget.py +29 -0
  23. tabs/analysis/widgets/atmosphere_widget.py +49 -0
  24. tabs/analysis/widgets/costs_widget.py +35 -0
  25. tabs/analysis/widgets/energy_widget.py +32 -0
  26. tabs/analysis/widgets/geometry_widget.py +55 -0
  27. tabs/analysis/widgets/planets_widget.py +34 -0
  28. tabs/analysis/widgets/propulsion_widget.py +53 -0
  29. tabs/analysis/widgets/stability_widget.py +34 -0
  30. tabs/analysis/widgets/weights_widget.py +94 -0
  31. tabs/geometry/__init__.py +6 -0
  32. tabs/geometry/aircraft_configs.py +232 -0
  33. tabs/geometry/frames/__init__.py +15 -0
  34. tabs/geometry/frames/booms/__init__.py +5 -0
  35. tabs/geometry/frames/booms/boom_frame.py +238 -0
  36. tabs/geometry/frames/cargo_bays/__init__.py +5 -0
  37. tabs/geometry/frames/cargo_bays/cargo_bay_frame.py +159 -0
  38. tabs/geometry/frames/default_frame.py +23 -0
  39. tabs/geometry/frames/energy_network/__init__.py +2 -0
  40. tabs/geometry/frames/energy_network/turbofan_network/__init__.py +3 -0
  41. tabs/geometry/frames/energy_network/turbofan_network/frames/__init__.py +1 -0
  42. tabs/geometry/frames/energy_network/turbofan_network/widgets/__init__.py +1 -0
  43. tabs/geometry/frames/fuselages/__init__.py +5 -0
  44. tabs/geometry/frames/fuselages/fuselage_frame.py +294 -0
  45. tabs/geometry/frames/geometry_frame.py +91 -0
  46. tabs/geometry/frames/landing_gears/__init__.py +5 -0
  47. tabs/geometry/frames/landing_gears/landing_gear_frame.py +189 -0
  48. tabs/geometry/frames/nacelles/__init__.py +1 -0
  49. tabs/geometry/frames/powertrain/__init__.py +6 -0
  50. tabs/geometry/frames/powertrain/converters/__init__.py +5 -0
  51. tabs/geometry/frames/powertrain/converters/converter_frame.py +137 -0
  52. tabs/geometry/frames/powertrain/distributors/__init__.py +5 -0
  53. tabs/geometry/frames/powertrain/distributors/distributor_frame.py +143 -0
  54. tabs/geometry/frames/powertrain/nacelles/__init__.py +5 -0
  55. tabs/geometry/frames/powertrain/nacelles/nacelle_frame.py +283 -0
  56. tabs/geometry/frames/powertrain/powertrain_frame.py +259 -0
  57. tabs/geometry/frames/powertrain/propulsors/__init__.py +5 -0
  58. tabs/geometry/frames/powertrain/propulsors/propulsor_frame.py +146 -0
  59. tabs/geometry/frames/powertrain/sources/__init__.py +6 -0
  60. tabs/geometry/frames/powertrain/sources/energy_source_frame.py +147 -0
  61. tabs/geometry/frames/vehicle_frame.py +171 -0
  62. tabs/geometry/frames/wings/__init__.py +5 -0
  63. tabs/geometry/frames/wings/wings_frame.py +457 -0
  64. tabs/geometry/geometry.py +513 -0
  65. tabs/geometry/widgets/__init__.py +12 -0
  66. tabs/geometry/widgets/booms/__init__.py +6 -0
  67. tabs/geometry/widgets/booms/boom_section_widget.py +109 -0
  68. tabs/geometry/widgets/cargo_bays/__init__.py +1 -0
  69. tabs/geometry/widgets/fuselages/__init__.py +8 -0
  70. tabs/geometry/widgets/fuselages/cabin_class_widget.py +188 -0
  71. tabs/geometry/widgets/fuselages/cabin_widget.py +217 -0
  72. tabs/geometry/widgets/fuselages/fuselage_section_widget.py +190 -0
  73. tabs/geometry/widgets/geometry_data_widget.py +25 -0
  74. tabs/geometry/widgets/landing_gears/__init__.py +6 -0
  75. tabs/geometry/widgets/nacelles/__init__.py +1 -0
  76. tabs/geometry/widgets/powertrain/__init__.py +9 -0
  77. tabs/geometry/widgets/powertrain/converters/__init__.py +5 -0
  78. tabs/geometry/widgets/powertrain/converters/turboelectric_generator_widget.py +74 -0
  79. tabs/geometry/widgets/powertrain/distributors/__init__.py +5 -0
  80. tabs/geometry/widgets/powertrain/distributors/fuel_line_widget.py +81 -0
  81. tabs/geometry/widgets/powertrain/modulators/__init__.py +5 -0
  82. tabs/geometry/widgets/powertrain/modulators/esc_widget.py +58 -0
  83. tabs/geometry/widgets/powertrain/nacelles/__init__.py +5 -0
  84. tabs/geometry/widgets/powertrain/nacelles/nacelle_section_widget.py +115 -0
  85. tabs/geometry/widgets/powertrain/powertrain_connector_widget.py +136 -0
  86. tabs/geometry/widgets/powertrain/powertrain_widget.py +206 -0
  87. tabs/geometry/widgets/powertrain/propulsors/__init__.py +5 -0
  88. tabs/geometry/widgets/powertrain/propulsors/turbofan_widget.py +462 -0
  89. tabs/geometry/widgets/powertrain/sources/__init__.py +6 -0
  90. tabs/geometry/widgets/powertrain/sources/fuel_tank_widget.py +103 -0
  91. tabs/geometry/widgets/powertrain/sources/source_selector_widget.py +35 -0
  92. tabs/geometry/widgets/wings/__init__.py +7 -0
  93. tabs/geometry/widgets/wings/wing_cs_widget.py +198 -0
  94. tabs/geometry/widgets/wings/wing_section_widget.py +298 -0
  95. tabs/home/__init__.py +3 -0
  96. tabs/home/home.py +585 -0
  97. tabs/mission/__init__.py +4 -0
  98. tabs/mission/mission.py +1124 -0
  99. tabs/mission/widgets/__init__.py +3 -0
  100. tabs/mission/widgets/flight_controls_widget.py +186 -0
  101. tabs/mission/widgets/mission_analysis_widget.py +166 -0
  102. tabs/mission/widgets/mission_segment_helper.py +358 -0
  103. tabs/mission/widgets/mission_segment_widget.py +358 -0
  104. tabs/solve/__init__.py +4 -0
  105. tabs/solve/plots/__init__.py +12 -0
  106. tabs/solve/plots/aeroacoustics/__init__.py +6 -0
  107. tabs/solve/plots/aeroacoustics/plot_2D_noise_contour.py +184 -0
  108. tabs/solve/plots/aeroacoustics/plot_3D_noise_contour.py +219 -0
  109. tabs/solve/plots/aeroacoustics/plot_noise_certification_contour.py +115 -0
  110. tabs/solve/plots/aeroacoustics/plot_noise_level.py +118 -0
  111. tabs/solve/plots/aerodynamics/__init__.py +10 -0
  112. tabs/solve/plots/aerodynamics/plot_aerodynamic_coefficients.py +156 -0
  113. tabs/solve/plots/aerodynamics/plot_aerodynamic_forces.py +155 -0
  114. tabs/solve/plots/aerodynamics/plot_aircraft_aerodynamics.py +136 -0
  115. tabs/solve/plots/aerodynamics/plot_drag_components.py +157 -0
  116. tabs/solve/plots/aerodynamics/plot_lift_distribution.py +107 -0
  117. tabs/solve/plots/aerodynamics/plot_rotor_conditions.py +255 -0
  118. tabs/solve/plots/aerodynamics/plot_rotor_disc_performance.py +144 -0
  119. tabs/solve/plots/aerodynamics/plot_rotor_performance.py +124 -0
  120. tabs/solve/plots/common/__init__.py +4 -0
  121. tabs/solve/plots/common/plot_style.py +71 -0
  122. tabs/solve/plots/common/set_axes.py +55 -0
  123. tabs/solve/plots/create_plot_widgets.py +34 -0
  124. tabs/solve/plots/emissions/__init__.py +3 -0
  125. tabs/solve/plots/emissions/plot_emissions.py +167 -0
  126. tabs/solve/plots/energy/__init__.py +12 -0
  127. tabs/solve/plots/energy/plot_altitude_sfc_weight.py +134 -0
  128. tabs/solve/plots/energy/plot_battery_cell_conditions.py +154 -0
  129. tabs/solve/plots/energy/plot_battery_degradation.py +157 -0
  130. tabs/solve/plots/energy/plot_battery_module_C_rates.py +139 -0
  131. tabs/solve/plots/energy/plot_battery_module_conditions.py +157 -0
  132. tabs/solve/plots/energy/plot_battery_pack_conditions.py +164 -0
  133. tabs/solve/plots/energy/plot_battery_ragone_diagram.py +97 -0
  134. tabs/solve/plots/energy/plot_battery_temperature.py +136 -0
  135. tabs/solve/plots/energy/plot_electric_propulsor_efficiencies.py +136 -0
  136. tabs/solve/plots/energy/plot_propulsor_throttles.py +119 -0
  137. tabs/solve/plots/mission/__init__.py +5 -0
  138. tabs/solve/plots/mission/plot_aircraft_velocities.py +145 -0
  139. tabs/solve/plots/mission/plot_flight_conditions.py +236 -0
  140. tabs/solve/plots/mission/plot_flight_trajectory.py +172 -0
  141. tabs/solve/plots/stability/__init__.py +5 -0
  142. tabs/solve/plots/stability/plot_flight_forces_and_moments.py +163 -0
  143. tabs/solve/plots/stability/plot_lateral_stability.py +151 -0
  144. tabs/solve/plots/stability/plot_longitudinal_stability.py +173 -0
  145. tabs/solve/plots/thermal_management/__init__.py +7 -0
  146. tabs/solve/plots/thermal_management/plot_air_cooled_conditions.py +152 -0
  147. tabs/solve/plots/thermal_management/plot_cross_flow_heat_exchanger_conditions.py +185 -0
  148. tabs/solve/plots/thermal_management/plot_reservoir_conditions.py +141 -0
  149. tabs/solve/plots/thermal_management/plot_thermal_management_performance.py +105 -0
  150. tabs/solve/plots/thermal_management/plot_wavy_channel_conditions.py +161 -0
  151. tabs/solve/plots/weights/__init__.py +4 -0
  152. tabs/solve/plots/weights/plot_load_diagram.py +163 -0
  153. tabs/solve/plots/weights/plot_weight_breakdown.py +164 -0
  154. tabs/solve/solve.py +1498 -0
  155. tabs/style_sheet.py +114 -0
  156. tabs/tab_widget.py +14 -0
  157. tabs/visualize_geometry/__init__.py +4 -0
  158. tabs/visualize_geometry/core_3d_viewer.py +253 -0
  159. tabs/visualize_geometry/features/__init__.py +10 -0
  160. tabs/visualize_geometry/features/axes_gizmo.py +173 -0
  161. tabs/visualize_geometry/features/background.py +161 -0
  162. tabs/visualize_geometry/features/blueprint.py +685 -0
  163. tabs/visualize_geometry/features/camera.py +364 -0
  164. tabs/visualize_geometry/features/drag_aircraft.py +219 -0
  165. tabs/visualize_geometry/features/grid.py +194 -0
  166. tabs/visualize_geometry/features/measurement.py +367 -0
  167. tabs/visualize_geometry/features/screenshot.py +91 -0
  168. tabs/visualize_geometry/geometry_helper_functions.py +3 -0
  169. tabs/visualize_geometry/visualize_geometry.py +731 -0
  170. utilities.py +257 -0
@@ -0,0 +1,152 @@
1
+ # RCAIDE/Library/Plots/Thermal_Management/plot_air_cooled_conditions.py
2
+ #
3
+ #
4
+ # Created: Sep 2024, S. Shekar
5
+
6
+ # ----------------------------------------------------------------------------------------------------------------------
7
+ # IMPORT
8
+ # ----------------------------------------------------------------------------------------------------------------------
9
+
10
+ from RCAIDE.Framework.Core import Units
11
+ from RCAIDE.Library.Plots.Common import set_axes, plot_style
12
+ import matplotlib.pyplot as plt
13
+ import matplotlib.cm as cm
14
+ import numpy as np
15
+
16
+ # ----------------------------------------------------------------------------------------------------------------------
17
+ # plot_air_cooled_conditions
18
+ # ----------------------------------------------------------------------------------------------------------------------
19
+ def plot_air_cooled_conditions(air_cooled, results, coolant_line,
20
+ save_figure = False,
21
+ show_legend = True,
22
+ save_filename = "Air_Cooled_Conditions",
23
+ file_type = ".png",
24
+ width = 11, height = 7):
25
+ """
26
+ Creates a multi-panel visualization of air-cooled heat exchanger performance.
27
+
28
+ Parameters
29
+ ----------
30
+ air_cooled : Component
31
+ Air-cooled heat exchanger component containing:
32
+ * tag : str
33
+ Unique identifier for the heat exchanger
34
+
35
+ results : Results
36
+ RCAIDE results data structure containing:
37
+ * segments[i].conditions.frames.inertial.time[:,0]
38
+ Time history for each segment
39
+ * segments[i].conditions.energy.coolant_lines[coolant_line.tag][air_cooled.tag]
40
+ Heat exchanger performance data containing:
41
+ * effectiveness[:,0]
42
+ Heat exchanger effectiveness
43
+ * total_heat_removed[:,0]
44
+ Total heat transfer rate
45
+
46
+ coolant_line : Component
47
+ Coolant line component containing:
48
+ * tag : str
49
+ Unique identifier for the coolant circuit
50
+
51
+ save_figure : bool, optional
52
+ Flag for saving the figure (default: False)
53
+
54
+ show_legend : bool, optional
55
+ Flag to display segment legend (default: True)
56
+
57
+ save_filename : str, optional
58
+ Name of file for saved figure (default: "Air_Cooled_Conditions")
59
+
60
+ file_type : str, optional
61
+ File extension for saved figure (default: ".png")
62
+
63
+ width : float, optional
64
+ Figure width in inches (default: 11)
65
+
66
+ height : float, optional
67
+ Figure height in inches (default: 7)
68
+
69
+ Returns
70
+ -------
71
+ fig : matplotlib.figure.Figure
72
+ Handle to the generated figure
73
+
74
+ Notes
75
+ -----
76
+ Creates visualization showing:
77
+ * Heat exchanger performance metrics
78
+ * Thermal effectiveness evolution
79
+ * Heat transfer rate history
80
+ * Time history for each segment
81
+
82
+ **Definitions**
83
+
84
+ 'Effectiveness'
85
+ Ratio of actual to maximum possible heat transfer
86
+ 'Heat Transfer Rate'
87
+ Rate of thermal energy transfer between fluids
88
+ 'Heat Capacity Rate'
89
+ Product of mass flow rate and specific heat
90
+
91
+ See Also
92
+ --------
93
+ RCAIDE.Library.Plots.Thermal_Management.plot_thermal_management_performance : Overall system performance
94
+ RCAIDE.Library.Plots.Thermal_Management.plot_cross_flow_heat_exchanger_conditions : Cross-flow heat exchanger analysis
95
+ """
96
+
97
+ # get plotting style
98
+ ps = plot_style()
99
+
100
+ parameters = {'axes.labelsize': ps.axis_font_size,
101
+ 'xtick.labelsize': ps.axis_font_size,
102
+ 'ytick.labelsize': ps.axis_font_size,
103
+ 'axes.titlesize': ps.title_font_size}
104
+ plt.rcParams.update(parameters)
105
+
106
+ # get line colors for plots
107
+ line_colors = cm.inferno(np.linspace(0,0.9,len(results.segments)))
108
+
109
+ fig = plt.figure(save_filename)
110
+ fig.set_size_inches(width,height)
111
+ axis_1 = plt.subplot(2,1,1)
112
+ axis_2 = plt.subplot(2,1,2)
113
+
114
+
115
+
116
+ for network in results.segments[0].analyses.vehicle.networks:
117
+ busses = network.busses
118
+ for bus in busses:
119
+ for b_i, battery in enumerate(bus.battery_modules):
120
+ if b_i == 0 or bus.identical_battery_modules == False:
121
+ for i in range(len(results.segments)):
122
+ time = results.segments[i].conditions.frames.inertial.time[:,0] / Units.min
123
+ air_cooled_conditions = results.segments[i].conditions.energy.coolant_lines[coolant_line.tag][air_cooled.tag]
124
+ effectiveness = air_cooled_conditions.effectiveness[:,0]
125
+ total_heat_removed = air_cooled_conditions.total_heat_removed[:,0]
126
+
127
+ if i == 0:
128
+ axis_1.plot(time, effectiveness, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width, label = battery.tag)
129
+ else:
130
+ axis_1.plot(time, effectiveness, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
131
+ axis_1.set_ylabel(r'Effectiveness')
132
+ set_axes(axis_1)
133
+
134
+ axis_2.plot(time, total_heat_removed, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
135
+ axis_2.set_ylabel(r'Total Heat Removed (W)')
136
+ set_axes(axis_2)
137
+
138
+ if show_legend:
139
+ leg = fig.legend(bbox_to_anchor=(0.5, 0.95), loc='upper center', ncol = 4)
140
+ leg.set_title('Flight Segment', prop={'size': ps.legend_font_size, 'weight': 'heavy'})
141
+
142
+ # Adjusting the sub-plots for legend
143
+ fig.tight_layout()
144
+ fig.subplots_adjust(top=0.8)
145
+
146
+ # set title of plot
147
+ title_text = 'Air_Cooled_Properties'
148
+ fig.suptitle(title_text)
149
+
150
+ if save_figure:
151
+ plt.savefig(save_filename + air_cooled.tag + file_type)
152
+ return fig
@@ -0,0 +1,185 @@
1
+ # RCAIDE/Library/Plots/Thermal_Management/plot_cross_flow_heat_exchanger_conditions.py
2
+ #
3
+ #
4
+ # Created: Sep 2024, S. Shekar
5
+
6
+ # ----------------------------------------------------------------------------------------------------------------------
7
+ # IMPORT
8
+ # ----------------------------------------------------------------------------------------------------------------------
9
+
10
+ from RCAIDE.Framework.Core import Units
11
+ from RCAIDE.Library.Plots.Common import set_axes, plot_style
12
+ import matplotlib.pyplot as plt
13
+ import matplotlib.cm as cm
14
+ import numpy as np
15
+
16
+ # ----------------------------------------------------------------------------------------------------------------------
17
+ # plot_heat_exchanger_system_conditions
18
+ # ----------------------------------------------------------------------------------------------------------------------
19
+ def plot_cross_flow_heat_exchanger_conditions(cross_flow_hex, results, coolant_line,
20
+ save_figure = False,
21
+ show_legend = True,
22
+ save_filename = "Cross_Flow_HEX_Conditions",
23
+ file_type = ".png",
24
+ width = 11, height = 7):
25
+ """
26
+ Creates a multi-panel visualization of cross-flow heat exchanger operating conditions.
27
+
28
+ Parameters
29
+ ----------
30
+ cross_flow_hex : Component
31
+ Cross-flow heat exchanger component containing:
32
+ - tag : str
33
+ Unique identifier for the heat exchanger
34
+
35
+ results : Results
36
+ RCAIDE results data structure containing:
37
+ - segments[i].conditions.energy.coolant_lines[coolant_line.tag][cross_flow_hex.tag]
38
+ Heat exchanger data containing:
39
+ - coolant_mass_flow_rate[:,0]
40
+ Coolant flow rate in kg/s
41
+ - effectiveness_HEX[:,0]
42
+ Heat exchanger effectiveness
43
+ - power[:,0]
44
+ Heat transfer rate in watts
45
+ - air_inlet_pressure[:,0]
46
+ Air-side inlet pressure in Pa
47
+ - inlet_air_temperature[:,0]
48
+ Air inlet temperature in K
49
+ - air_mass_flow_rate[:,0]
50
+ Air flow rate in kg/s
51
+
52
+ coolant_line : Component
53
+ Coolant line component containing:
54
+ - tag : str
55
+ Unique identifier for the coolant circuit
56
+
57
+ save_figure : bool, optional
58
+ Flag for saving the figure (default: False)
59
+
60
+ show_legend : bool, optional
61
+ Flag to display segment legend (default: True)
62
+
63
+ save_filename : str, optional
64
+ Name of file for saved figure (default: "Cross_Flow_HEX_Conditions")
65
+
66
+ file_type : str, optional
67
+ File extension for saved figure (default: ".png")
68
+
69
+ width : float, optional
70
+ Figure width in inches (default: 11)
71
+
72
+ height : float, optional
73
+ Figure height in inches (default: 7)
74
+
75
+ Returns
76
+ -------
77
+ fig : matplotlib.figure.Figure
78
+ Handle to the generated figure containing six subplots arranged in a 3x2 grid:
79
+
80
+ Notes
81
+ -----
82
+ Creates visualization showing:
83
+ * Thermal performance metrics
84
+ * Flow conditions for both fluids
85
+ * Heat transfer characteristics
86
+ * Operating pressures and temperatures
87
+
88
+ **Definitions**
89
+
90
+ 'Effectiveness'
91
+ Ratio of actual to maximum possible heat transfer
92
+ 'NTU'
93
+ Dimensionless measure of heat exchanger size
94
+ 'Capacity Ratio'
95
+ Ratio of minimum to maximum heat capacity rates
96
+ 'Mass Flow Rate'
97
+ Mass of fluid flowing per unit time
98
+
99
+ See Also
100
+ --------
101
+ RCAIDE.Library.Plots.Thermal_Management.plot_thermal_management_performance : Overall system performance
102
+ RCAIDE.Library.Plots.Thermal_Management.plot_air_cooled_conditions : Air-cooled heat exchanger analysis
103
+ """
104
+
105
+ # get plotting style
106
+ ps = plot_style()
107
+
108
+ parameters = {'axes.labelsize': ps.axis_font_size,
109
+ 'xtick.labelsize': ps.axis_font_size,
110
+ 'ytick.labelsize': ps.axis_font_size,
111
+ 'axes.titlesize': ps.title_font_size}
112
+ plt.rcParams.update(parameters)
113
+
114
+ # get line colors for plots
115
+ line_colors = cm.inferno(np.linspace(0,0.9,len(results.segments)))
116
+
117
+ fig = plt.figure(save_filename)
118
+ fig.set_size_inches(width,height)
119
+ axis_1 = plt.subplot(3,2,1)
120
+ axis_2 = plt.subplot(3,2,2)
121
+ axis_3 = plt.subplot(3,2,3)
122
+ axis_4 = plt.subplot(3,2,4)
123
+ axis_5 = plt.subplot(3,2,5)
124
+ axis_6 = plt.subplot(3,2,6)
125
+
126
+ for network in results.segments[0].analyses.vehicle.networks:
127
+ busses = network.busses
128
+ for bus in busses:
129
+ for b_i, battery in enumerate(bus.battery_modules):
130
+ if b_i == 0 or bus.identical_battery_modules == False:
131
+ for i in range(len(results.segments)):
132
+ time = results.segments[i].conditions.frames.inertial.time[:,0] / Units.min
133
+ cross_flow_hex_conditions = results.segments[i].conditions.energy.coolant_lines[coolant_line.tag][cross_flow_hex.tag]
134
+
135
+ coolant_mass_flow_rate = cross_flow_hex_conditions.coolant_mass_flow_rate[:,0]
136
+ effectiveness_HEX = cross_flow_hex_conditions.effectiveness_HEX[:,0]
137
+ power = cross_flow_hex_conditions.power[:,0]
138
+ inlet_air_pressure = cross_flow_hex_conditions.air_inlet_pressure[:,0]
139
+ inlet_air_temperature = cross_flow_hex_conditions.inlet_air_temperature[:,0]
140
+ air_mass_flow_rate = cross_flow_hex_conditions.air_mass_flow_rate[:,0]
141
+
142
+ if i == 0:
143
+ axis_1.plot(time, effectiveness_HEX, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width, label = cross_flow_hex.tag)
144
+ else:
145
+ axis_1.plot(time, effectiveness_HEX, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
146
+ axis_1.set_ylabel(r'Effectiveness')
147
+ set_axes(axis_1)
148
+
149
+ axis_2.plot(time, inlet_air_temperature, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
150
+ axis_2.set_ylabel(r'Air Temp. (K)')
151
+ set_axes(axis_2)
152
+
153
+ axis_3.plot(time, coolant_mass_flow_rate, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
154
+ axis_3.set_ylabel(r'Coolant $\dot{m}$ (kg/s)')
155
+ set_axes(axis_3)
156
+
157
+ axis_4.plot(time, air_mass_flow_rate, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
158
+ axis_4.set_ylabel(r'Air $\dot{m}$ (kg/s)')
159
+ set_axes(axis_4)
160
+
161
+ axis_5.plot(time, power/1000, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
162
+ axis_5.set_ylabel(r'HEX Power (KW)')
163
+ axis_5.set_xlabel(r'Time (mins)')
164
+ set_axes(axis_5)
165
+
166
+ axis_6.plot(time, inlet_air_pressure/10e6 , color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
167
+ axis_6.set_ylabel(r'Air Pres. (MPa)')
168
+ axis_6.set_xlabel(r'Time (mins)')
169
+ set_axes(axis_6)
170
+
171
+ if show_legend:
172
+ leg = fig.legend(bbox_to_anchor=(0.5, 0.95), loc='upper center', ncol = 4)
173
+ leg.set_title('Flight Segment', prop={'size': ps.legend_font_size, 'weight': 'heavy'})
174
+
175
+ # Adjusting the sub-plots for legend
176
+ fig.tight_layout()
177
+ fig.subplots_adjust(top=0.8)
178
+
179
+ # set title of plot
180
+ title_text = 'Heat_Exchanger_System'
181
+ fig.suptitle(title_text)
182
+
183
+ if save_figure:
184
+ plt.savefig(save_filename + cross_flow_hex.tag + file_type)
185
+ return fig
@@ -0,0 +1,141 @@
1
+ # RCAIDE/Library/Plots/Thermal_Management/plot_reservoir_conditions.py
2
+ #
3
+ #
4
+ # Created: Sep 2024, S. Shekar
5
+
6
+
7
+ # ----------------------------------------------------------------------------------------------------------------------
8
+ # IMPORT
9
+ # ----------------------------------------------------------------------------------------------------------------------
10
+
11
+ from RCAIDE.Framework.Core import Units
12
+ from RCAIDE.Library.Plots.Common import set_axes, plot_style
13
+ import matplotlib.pyplot as plt
14
+ import matplotlib.cm as cm
15
+ import numpy as np
16
+
17
+ # ----------------------------------------------------------------------------------------------------------------------
18
+ # plot_heat_exchanger_system_conditions
19
+ # ----------------------------------------------------------------------------------------------------------------------
20
+ def plot_reservoir_conditions(reservoir, results, coolant_line,
21
+ save_figure = False,
22
+ show_legend = True,
23
+ save_filename = "Reservoir_Conditions",
24
+ file_type = ".png",
25
+ width = 11, height = 7):
26
+ """
27
+ Creates visualization of thermal reservoir temperature conditions throughout flight.
28
+
29
+ Parameters
30
+ ----------
31
+ reservoir : Component
32
+ Thermal reservoir component containing:
33
+ - tag : str
34
+ Unique identifier for the reservoir
35
+
36
+ results : Results
37
+ RCAIDE results data structure containing:
38
+ - segments[i].conditions.frames.inertial.time[:,0]
39
+ Time history for each segment
40
+ - segments[i].conditions.energy.coolant_lines[coolant_line.tag][reservoir.tag]
41
+ Reservoir data containing:
42
+ - coolant_temperature[:,0]
43
+ Coolant temperature in K
44
+
45
+ coolant_line : Component
46
+ Coolant line component containing:
47
+ - tag : str
48
+ Unique identifier for the coolant circuit
49
+
50
+ save_figure : bool, optional
51
+ Flag for saving the figure (default: False)
52
+
53
+ show_legend : bool, optional
54
+ Flag to display segment legend (default: True)
55
+
56
+ save_filename : str, optional
57
+ Name of file for saved figure (default: "Reservoir_Conditions")
58
+
59
+ file_type : str, optional
60
+ File extension for saved figure (default: ".png")
61
+
62
+ width : float, optional
63
+ Figure width in inches (default: 11)
64
+
65
+ height : float, optional
66
+ Figure height in inches (default: 7)
67
+
68
+ Returns
69
+ -------
70
+ fig : matplotlib.figure.Figure
71
+ Handle to the generated figure containing single plot:
72
+
73
+ Notes
74
+ -----
75
+ Creates visualization showing:
76
+ * Reservoir thermal state
77
+ * Temperature evolution
78
+ * Time history for each segment
79
+
80
+ **Definitions**
81
+
82
+ 'Thermal Reservoir'
83
+ Component storing thermal energy in coolant
84
+ 'Well-Mixed'
85
+ Uniform temperature throughout volume
86
+ 'Thermal Mass'
87
+ Product of mass and specific heat
88
+
89
+ See Also
90
+ --------
91
+ RCAIDE.Library.Plots.Thermal_Management.plot_thermal_management_performance : Overall system performance
92
+ RCAIDE.Library.Plots.Thermal_Management.plot_cross_flow_heat_exchanger_conditions : Heat exchanger analysis
93
+ """
94
+ # get plotting style
95
+ ps = plot_style()
96
+
97
+ parameters = {'axes.labelsize': ps.axis_font_size,
98
+ 'xtick.labelsize': ps.axis_font_size,
99
+ 'ytick.labelsize': ps.axis_font_size,
100
+ 'axes.titlesize': ps.title_font_size}
101
+ plt.rcParams.update(parameters)
102
+
103
+ # get line colors for plots
104
+ line_colors = cm.inferno(np.linspace(0,0.9,len(results.segments)))
105
+
106
+ fig = plt.figure(save_filename)
107
+ fig.set_size_inches(width,height)
108
+ axis_1 = plt.subplot(1,1,1)
109
+ set_axes(axis_1)
110
+
111
+ for network in results.segments[0].analyses.vehicle.networks:
112
+ busses = network.busses
113
+ for bus in busses:
114
+ for b_i, battery in enumerate(bus.battery_modules):
115
+ if b_i == 0 or bus.identical_battery_modules == False:
116
+ for i in range(len(results.segments)):
117
+ time = results.segments[i].conditions.frames.inertial.time[:,0] / Units.min
118
+ reservoir_conditions = results.segments[i].conditions.energy.coolant_lines[coolant_line.tag][reservoir.tag]
119
+ reservoir_temperature = reservoir_conditions.coolant_temperature[:,0]
120
+
121
+ if i == 0:
122
+ axis_1.plot(time, reservoir_temperature, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width, label = battery.tag)
123
+ else:
124
+ axis_1.plot(time, reservoir_temperature, color = line_colors[i], marker = ps.markers[b_i], linewidth = ps.line_width)
125
+ axis_1.set_ylabel(r'Coolant Temp. (K)')
126
+
127
+ if show_legend:
128
+ leg = fig.legend(bbox_to_anchor=(0.5, 0.95), loc='upper center', ncol = 4)
129
+ leg.set_title('Flight Segment', prop={'size': ps.legend_font_size, 'weight': 'heavy'})
130
+
131
+ # Adjusting the sub-plots for legend
132
+ fig.tight_layout()
133
+ fig.subplots_adjust(top=0.8)
134
+
135
+ # set title of plot
136
+ title_text = 'Reservoir Temperature'
137
+ fig.suptitle(title_text)
138
+
139
+ if save_figure:
140
+ plt.savefig(save_filename + reservoir.tag + file_type)
141
+ return fig
@@ -0,0 +1,105 @@
1
+ # RCAIDE/Library/Plots/Thermal_Management/plot_thermal_management_performance.py
2
+ #
3
+ #
4
+ # Created: Sep 2024, S. Shekar
5
+ # ----------------------------------------------------------------------------------------------------------------------
6
+ # plot_thermal_management_performance
7
+ # ----------------------------------------------------------------------------------------------------------------------
8
+ def plot_thermal_management_performance(results,
9
+ save_figure = False,
10
+ show_legend = True,
11
+ file_type =".png",
12
+ width = 12,
13
+ height = 7):
14
+ """
15
+ Checks and plots all components of a thermal management system.
16
+
17
+ Parameters
18
+ ----------
19
+ results : Results
20
+ RCAIDE results data structure containing:
21
+ - segments[i].analyses.vehicle.networks
22
+ Network data containing:
23
+ - coolant_lines
24
+ List of coolant circuits with:
25
+ - battery_modules
26
+ List of battery thermal management systems
27
+ - heat_exchangers
28
+ List of heat exchanger components
29
+ - reservoirs
30
+ List of thermal reservoir components
31
+ - identical_battery_modules : bool
32
+ Flag indicating if batteries are identical
33
+
34
+ save_figure : bool, optional
35
+ Flag for saving the figure (default: False)
36
+
37
+ show_legend : bool, optional
38
+ Flag to display component legends (default: True)
39
+
40
+ file_type : str, optional
41
+ File extension for saved figures (default: ".png")
42
+
43
+ width : float, optional
44
+ Figure width in inches (default: 12)
45
+
46
+ height : float, optional
47
+ Figure height in inches (default: 7)
48
+
49
+ Returns
50
+ -------
51
+ None
52
+ Function generates and displays/saves plots for each component
53
+
54
+ Notes
55
+ -----
56
+ Creates visualizations showing:
57
+ * Battery thermal management system performance
58
+ * Heat exchanger operating conditions
59
+ * Reservoir thermal states
60
+ * Overall system behavior
61
+
62
+ For each component type:
63
+ * Calls appropriate plotting function
64
+ * Passes component-specific data
65
+ * Maintains consistent formatting
66
+ * Handles identical/unique components
67
+
68
+ **Definitions**
69
+
70
+ 'Thermal Management System'
71
+ Network of components managing heat transfer
72
+ 'Battery Module'
73
+ Battery with thermal management system
74
+ 'Heat Exchanger'
75
+ Component transferring heat between fluids
76
+ 'Reservoir'
77
+ Component storing thermal energy
78
+
79
+ See Also
80
+ --------
81
+ RCAIDE.Library.Plots.Thermal_Management.plot_air_cooled_conditions : Air-cooled system analysis
82
+ RCAIDE.Library.Plots.Thermal_Management.plot_cross_flow_heat_exchanger_conditions : Heat exchanger analysis
83
+ RCAIDE.Library.Plots.Thermal_Management.plot_reservoir_conditions : Reservoir analysis
84
+ """
85
+
86
+ for network in results.segments[0].analyses.vehicle.networks:
87
+ for coolant_line in network.coolant_lines:
88
+ for tag, item in coolant_line.items():
89
+ if coolant_line.identical_battery_modules:
90
+ if tag == 'battery_modules':
91
+ for i, battery in enumerate(item):
92
+ for btms in (battery):
93
+ if i == 0:
94
+ btms.plot_operating_conditions(results,coolant_line,save_figure,show_legend,btms.tag,file_type,width, height)
95
+ else:
96
+ for _, battery in enumerate(item):
97
+ for btms in (battery):
98
+ btms.plot_operating_conditions(results,coolant_line,save_figure,show_legend,btms.tag,file_type,width, height)
99
+ if tag == 'heat_exchangers':
100
+ for heat_exchanger in item:
101
+ heat_exchanger.plot_operating_conditions(results,coolant_line,save_figure,show_legend,heat_exchanger.tag,file_type,width, height)
102
+ if tag == 'reservoirs':
103
+ for reservoir in item:
104
+ reservoir.plot_operating_conditions(results,coolant_line,save_figure,show_legend,reservoir.tag,file_type,width, height)
105
+ return