Subpackage dimension_2

heatrapy.dimension_2.objects.single module

Contains the class single_object.

Used to compute single two-dimensional system models.

class heatrapy.dimension_2.objects.single.SingleObject(amb_temperature, material='Cu', dx=0.01, dy=0.01, dt=0.1, size=(10, 10), file_name=None, boundaries=(0, 0, 0, 0), Q=[], Q0=[], initial_state=False, materials_path=False, draw=['temperature', 'materials'], draw_scale=None)[source]

Bases: object

Single_object class.

This class solves numerically the two-dimensional heat conduction equation.

activate(initial_point, final_point, shape='square')[source]

Activation of the material.

Activates a given piece of material. If shape is ‘square’, then the initial_point is the tuple (x,y) of the bottom left point and the final_point is the tuple (x,y) of the top right point. If the shape is ‘circle’, the initial_point is the tuple (x,y) of the center of the circle and final_point is its radius.

change_boundaries(boundaries)[source]

Boundary change.

Changes the boundaries variable.

change_material(shape, material, initial_point, length, state=False)[source]

Material change.

Changes the material of a given piece of the background material. If shape is ‘square’, then the initial_point is the tuple (x,y) of the bottom left point and the length is the tuple (x,y) of the length. If the shape is ‘circle’, the initial_point is the tuple (x,y) of the center of the circle and length is its radius.

change_power(shape, power_type, initial_point, final_point, power)[source]

Power change.

Changes the power matrix of the thermal object. If shape is ‘square’, then the initial_point is the tuple (x,y) of the bottom left point and the final_point is the tuple (x,y) of the top right point. If the shape is ‘circle’, the initial_point is the tuple (x,y) of the center of the circle and final_point is its radius. power is the value of the power to add, and power_type is the type of power to be introduced, which has the value ‘Q’ if it is temperature dependent and ‘Q0’ if it is temperature independent.

compute(time_interval, write_interval, solver='explicit_k(x)', verbose=True)[source]

Compute the thermal process.

Computes the system for time_interval, and writes into the file_name file every write_interval time steps. Two different solvers can be used: ‘explicit_general’ and ‘explicit_k(x)’. If verbose = True, then the progress of the computation is shown.

deactivate(initial_point, final_point, shape='square')[source]

Deactivation of the material.

Deactivates a given piece of material. If shape is ‘square’, then the initial_point is the tuple (x,y) of the bottom left point and the final_point is the tuple (x,y) of the top right point. If the shape is ‘circle’, the initial_point is the tuple (x,y) of the center of the circle and final_point is its radius.

show_figure(figure_type)[source]

Plotting.

Initializes a specific plotting. figure_type is a string identifying the plotting. In this version live plotting can be performed for temperature, materials, state, Q and Q0.

heatrapy.dimension_2.objects.system module

Contains the classes system_objects and single_object.

Used to compute two-dimensional thermal objects

class heatrapy.dimension_2.objects.system.SystemObjects(number_objects=2, materials=('Cu', 'Cu'), objects_length=((10, 10), (10, 10)), amb_temperature=293, dx=0.01, dy=0.01, dt=0.1, file_name=None, initial_state=False, boundaries=((0, 0, 0, 0), (0, 0, 0, 0)), materials_path=False)[source]

Bases: object

System_objects class.

This class creates a system of 2D thermal objects, establishes contact between them and computes the respective thermal processes.

change_boundaries(object_id, boundaries)[source]

Change boundaries.

Changes the boundaries variable of object_id.

compute(time_interval, write_interval, solver='explicit_k(x)', verbose=True)[source]

Compute the thermal process.

Computes the system for time_interval, and writes into the file_name file every write_interval time steps. Two different solvers can be used: ‘explicit_general’ and ‘explicit_k(x)’. If verbose = True, then the progress of the computation is shown.

contact_add(contact)[source]

Add contact to self.contacts.

contact is a thermal contact tuple of length 3, where the first and second entries correspond to tuples of the thermal objects and points (object_id, (x,y)), and the third entry is the heat transfer coefficient.

contact_filter(object_id)[source]

Filter thermal contacts.

Filter thermal contacts by object_id.

contact_remove(object_one, object_two)[source]

Contact removal.

Removes all contacts between object_one id and object_two id.