Subpackage dimension_1
heatrapy.dimension_1.objects.single module
Contains the class single_object.
Used to compute single thermal objects.
- class heatrapy.dimension_1.objects.single.SingleObject(amb_temperature: int | float, materials: tuple[str] = ('Cu',), borders: tuple[int] = (1, 11), materials_order: tuple[int] = (0,), dx: float = 0.01, dt: float = 0.1, file_name: str | None = None, boundaries: tuple[int] = (0, 0), initial_state: bool = False, materials_path: str | bool = False, draw: list[str] = ['temperature'], draw_scale: str | None = None)[source]
Bases:
objectSingle_object class.
This class solves numerically the heat conduction equation for 1 dimension of a single material(s). The class has 6 methods.
- activate(initial_point: int, final_point: int)[source]
Activation.
Activates the thermal object between initial_point to final_point.
- change_boundaries(boundaries: tuple[int | float])[source]
Boundary change.
Changes the boundaries variable.
- change_power(power_type: str, power: int | float, initial_point: int, final_point: int)[source]
Heat power source change.
Changes the coeficients for the heat power sources by a value of power from initial_point to final_point. power_type is a string that represents the type of coefficient, i.e. ‘Q’ or ‘Q0’.
- compute(time_interval: int | float, write_interval: int, solver: str = 'explicit_k(x)', verbose: bool = True)[source]
Compute the thermal process.
Computes the system for time_interval seconds, and writes into the file_name file every write_interval time steps. Four different solvers can be used: ‘explicit_general’, ‘explicit_k(x)’, ‘implicit_general’, and ‘implicit_k(x)’. If verbose = True, then the progress of the computation progress is shown.
- deactivate(initial_point: int, final_point: int)[source]
Deactivation.
Deactivates the thermal object between initial_point to final_point.
- show_figure(figure_type: str, draw_scale: str | None = None)[source]
Plotting.
Initializes a specific live plotting. figure_type is a string identifying the plotting. This version only allows the plotting of the ‘temperature’. draw_scale defines the range of temperatures. If None, this range is found automatically for every frame.
heatrapy.dimension_1.objects.system module
Contains the class system_objects.
Used to compute systems of thermal objects.
- class heatrapy.dimension_1.objects.system.SystemObjects(number_objects: int = 2, materials: tuple[str] = ('Cu', 'Cu'), objects_length: tuple[int] = (10, 10), amb_temperature: int | float = 293, dx: float = 0.01, dt: float = 0.1, file_name: str | None = None, initial_state: bool = False, boundaries: tuple[tuple[int | float]] = ((2, 0), (3, 0)), materials_path: str | bool = False)[source]
Bases:
objectSystem_objects class.
This class creates a system of unidimensional thermal objects, establishes contact between them and computes the respective thermal processes.
- change_boundaries(object_id: int, boundaries: tuple)[source]
Change boundaries.
Changes the boundaries of object_id.
- compute(time_interval: int | float, write_interval: int, solver: str = 'implicit_k(x)', verbose: bool = True)[source]
Compute the thermal process.
Computes the system for time_interval, and writes into the file_name file every write_interval time steps. Four different solvers can be used: ‘explicit_general’, ‘explicit_k(x)’, ‘implicit_general’, and ‘implicit_k(x)’. If verbose = True, then the progress of the computation is shown.
- contact_add(contact: tuple | list)[source]
Add contact to self.contacts.
The contact parameter is a tuple of length 3 (one element for thermal object A, one for thermal object B, and one for the heat transfer coefficient). Each thermal object element is a tuple of length 2 where the first element is the index of the thermal object and the second is the spatial point index.