Skip to content

2. Classes

Henry Nachman edited this page Jul 28, 2025 · 1 revision

ThermalModel - class

init

__init__(self, stages):
    self.components = stages["components"]
    self.stage_temps = stages["stage_details"]
    self.total_power = stages["total_power"]
    self.stages = list(self.components.keys())

get_stage

get_stage(self, name)

Description:

Returns a Stage object for the specified stage name.

Arguments:

  • name (str): The name of the stage to search for.

Returns:

  • Stage: An object containing the stage's properties and methods.

get_component

get_component(self, name, stage=None)

Description:

Returns a Component_Inspect object for the specified component name and stage. If stage is None, it searches all stages for the component and returns the first one found.

Arguments:

  • name (str): The name of the component to search for.
  • stage (str, optional): The name of the stage to search in. Defaults to None.

Returns: Component_Inspect: An object containing the component's properties and methods.

update_all_powers

update_all_powers(self)

Description:

Updates the power for all components in the thermal model. This method iterates through all components in each stage and calculates their power based on the current stage temperatures.

optimize

optimize(self, optimization_points: int = 10)

Description:

Optimizes a VCS cooled thermal model.

Arguments:

  • components_input (dict): The input component details.
  • stage_details_input (dict): The input stage details.
  • num_points (int): The number of points to sample for VCS temperatures.

Returns:

  • details (dict): The updated component details with power calculations.
  • output_data (dict): The output data containing stage details and total power.
  • grids (list): A list containing the VCS2 grid, VCS1 grid, and SumVarArr.

plot_stage

plot_stage(self, stage_name, streamlit=False)

Description:

Plot the thermal model for a specific stage.

Arguments:

  • stage_name (str): The name of the stage to plot.
  • streamlit (bool, optional): Whether to use Streamlit for plotting. Defaults to False.

Returns:

  • Figure: The plotted figure.

Component_Inspect - class

init

__init__(self, model, component, stage)

calculate_power

calculate_power(self)

Description:

Calculate the power function for the given component.

Arguments:

  • self (Component_Inspect): The component object for which to calculate power. Returns:
  • power (float): The calculated power per unit.

plot

Description:

Plot the thermal conductivity of the component. This method uses the component's properties to determine the appropriate plotting method. Returns:

  • integral_plot (fig): The plotted figure.

Clone this wiki locally