ThermalElement Class

class solarhouse.thermal_element.ThermalElement(name, temp0=None, density=None, heat_capacity=None, volume=None, **kwargs)

Implements thermal element for thermal computation. Represents a point with heat capacity. Change of temperature of this point depends on sum of input and output energy and heat capacity (output energy is negative). Several elements can be connected into a chain of elements. Output energy depends on temperature of current element, temperature of next element in chain, and thermal resistance between each other. An element can have several elements of output enegry. Second and further elements must have area of input face (square meters) and input coefficient of transcalency on input face.

Also element may be represented as a wall with a variable area and with variable thermal resistance on each increment of thickness, dx. Computation is implemented in single dimension, dx (meters). All computations are performed for increments of time, dt. Example: compute temperature of 1 cubic meter of water in 1 hour with

1 kW of power applied:
>>> e = ThermalElement(        name='cube_water',        temp0=0,        density=997,        heat_capacity=4180,        volume=1    )
>>> e.count_layers
1
>>> e.compute(q_enter=1000, dt=3600)
>>> round(e.temp, 3)
0.864
>>>
Example: calculate temperature of inside face of wall of birch
with dx = 0.01 m and external power of 1 kW.
Result of test calculated manually.
>>> e = ThermalElement(        name='birch_wall',        temp0=20.0,        density=700.0,        heat_capacity=1250.0,        dx=0.01,        thickness=0.20,        kappa=0.15,        area_inside=1.0,        area_outside=1.1    )
>>> e.count_layers
20
>>> e.dTx_list
[20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0]
>>> e.get_loss_dx(0)
0.0
>>> e.compute(q_enter=1000, dt=1)
>>> round(e.dTx_list[0], 3)
20.109
>>> round(e.dTx_list[1], 3)
20.0
>>> round(e.get_loss_dx(0),3)
1.714
>>> e.compute(q_enter=1000, dt=1)
>>> round(e.dTx_list[0], 3)
20.218
>>> round(e.dTx_list[1], 4)
20.0002
>>>
Example element which implementing  thin layer between two areas
>>> e = ThermalElement(        name='glass',        temp0=20.0,        area_inside=1.0,        input_alpha=23,    )
>>> e.calc_loss_input_q(25.0)
115.0
calc_loss_input_q(t_in: float) → float

Calculates loss energy between current and previous elements

calc_temp(q_enter: float, q_loss: float, iterator: int, dt: float) → None

Calculates the dT on dt of current point (dx) of element. If element represent as a point then calculates. Tdx = Tdx0 + (q_enter - q_loss)/cmdx

Parameters:
  • q_enter – enter power from previouse element or source of power
  • q_loss – total power loss from current point dx
  • iterator – number of current dx
  • dt – range of time for calculate
Returns:

Nothing returns but change temperature in list of temperatures by dx in the current point

compute(q_enter: float, dt: float) → None

Start of calculate temperature of element if it represent as a point or calculate of all temperatures by dx if element has the dx parameter

Parameters:
  • q_enter – input power
  • dt – range of time
Returns:

change self.temp parameter in the end of calculation

get_loss_dx(iterator)

Defines loss energy from current element on dx or from all element if it represent in calculation as a point. q_loss = alpha*area_branch*(T_current - T_branch)

Parameters:iterator – number of dx, 0 if element as a point
Returns:Float value of all loss power
init_conditions(val)

Reduction to initial conditions