pyrc.core.components.capacitor#

class Capacitor(capacity: float, temperature, rc_objects: RCObjects = <pyrc.core.components.templates.RCObjects object>, temperature_derivative=0, internal_heat_source: InternalHeatSource = None, rc_solution: RCSolution = <pyrc.core.components.templates.RCSolution object>)#

Bases: TemperatureNode

Capacitor building part, currently designed as thermal capacitor.

Parameters:
  • capacity (float) – The capacity of the capacitor.

  • temperature (float | int) – The temperature of the node.

  • temperature_derivative (float | int) – The temperature derivative of the node.

__init__(capacity: float, temperature, rc_objects: RCObjects = <pyrc.core.components.templates.RCObjects object>, temperature_derivative=0, internal_heat_source: InternalHeatSource = None, rc_solution: RCSolution = <pyrc.core.components.templates.RCSolution object>)#

Capacitor building part, currently designed as thermal capacitor.

Parameters:
  • capacity (float) – The capacity of the capacitor.

  • temperature (float | int) – The temperature of the node.

  • temperature_derivative (float | int) – The temperature derivative of the node.

add_internal_heat_source(heat_source: InternalHeatSource)#
property connected_mass_flow_nodes: list[MassFlowNode]#
property connected_mass_transport_resistors: list#
get_connected_mass_flow_nodes() list[MassFlowNode]#

Returns a list of connected MassFlowNode s.

Returns:

The list of connected MassFlowNode s.

Return type:

list

get_connected_mass_transport_resistors(except_this: MassTransport | list = None) list#

Returns a list of connected MassTransport resistors except the given ones.

Parameters:

except_this (MassTransport | list) – The given MassTransport resistors to exclude from the result.

Returns:

The list of connected MassTransport resistors without all given ones.

Return type:

list

get_connected_nodes(variant: type = None) list#

Returns a list of by Resistor s connected TemperatureNode s.

Duplicates of connected nodes (due to multiple resistors between two unique nodes) are not returned twice.

Parameters:

variant (None | type) – The type (of TemperatureNode) to return. If None, all connected nodes are returned.

Returns:

The list of connected TemperatureNode s.

Return type:

list

get_direction(asking_node: Cell | Capacitor) array#

Returns the direction (x,y,z direction) to the asking node. Is returned as normalized vector.

Parameters:

asking_node (Cell) – The Node asking for the direction to it.

Returns:

The direction from self to the asking node.

Return type:

np.ndarray

get_mass_transport_to_node(target_node: ConnectedFlowObject)#

Returns the ConnectedFlowObject Resistor lying inbetween self and target_node.

Parameters:

target_node (ConnectedFlowObject) – The ConnectedFlowObject to which the MassTransport Resistor is requested for.

Returns:

The MassTransport Resistor inbetween self and target_node.

Return type:

MassTransport

get_neighbours(variant: type = None) list#

Returns a list of connected objects with given variant.

If variant is None, all objects are returned.

Parameters:

variant (None | type) – The type (of Resistors) to return. Example: variant=MassTransport only returns all MassTransport resistors.

Returns:

A list with all requested objects.

Return type:

list

get_next_air_nodes(asking_node: Capacitor) list[MassFlowNode]#

Returns the next air nodes as a list.

Parameters:

asking_node (Capacitor) – The Node that asks for the connected MassFlowNode s.

Returns:

The connected MassFlowNode s of self but without asking_node.

Return type:

list[MassFlowNode]

property index#

Returns the position of self within the vector where the temperature is stored in.

Is currently defined by its subclasses using the result object.

Returns:

The index of the vector.

Return type:

int

property internal_heat_source: InternalHeatSource#
make_internal_heat_source(heat_source_type, **kwargs)#
property mass_flow_connections: int#

Returns the number of MassFlowNode s connected to self.

Returns:

The number of connected MassFlowNode s.

Return type:

int

reset_properties()#
resistors_in_direction(direction: np.ndarray | str, except_resistor_types: list[type] = None) list[Resistor]#

Returns all Resistor s connected to nodes in the given direction.

Parameters:
  • direction (np.ndarray | str) – The direction to get the Resistor s from. If an array, it has to be parallel to the coordinate axes. If a string, it should be of the following: +x,+y,+z,-x,-y,-z,x,y,z

  • except_resistor_types (list, optional) – If not None, these Resistor types will not be added to the result.

Returns:

The Resistor s in the requested direction.

Return type:

list[Resistor]

resistors_in_direction_filtered(direction: np.ndarray | str, except_resistor_types: list = None) list[Resistor]#

Like resistors_in_direction but only one resistor is returned for parallel resistors.

Parameters:
  • direction (np.ndarray | str) – The direction to get the Resistor s from. If an array, it has to be parallel to the coordinate axes. If a string, it should be of the following: +x,+y,+z,-x,-y,-z,x,y,z

  • except_resistor_types (list, optional) – If not None, these Resistor types will not be added to the result.

Returns:

The Resistor s in the requested direction.

Return type:

list[Resistor]

property resistors_without_parallel#

Returns every resistor on the node that isn’t connected to the same as another.

If multiple resistors are in self.neighbours and are connected to the same node the first one is taken (more or less random).

property symbols: list#

Returns a list of all sympy.symbols of the object, except time dependent symbols.

Must be in the same order as self.values.

Returns:

The list of sympy.symbols.

Return type:

list

temperature_derivative_term() tuple#

Create the sympy expression for the temperature derivative (right side of heat flux balance equation).

The sign convention is:

Heat flux pointing into the node is positive.

Returns:

The term and a set with all involved temperature symbols.

Return type:

tuple[sympy expression, set]

property values: list#

Returns a list of all values of all object symbols, except of time dependent symbols.

Must be in the same order as self.symbols.

Returns:

The list of sympy.symbols.

Return type:

list

property values_without_capacity: list#

Returns a list of all values of all object symbols expect the capacity and the time dependent symbols.

This is used in some subclasses that calculate their capacity on their own.

Must be in the same order as self.symbols.

Returns:

The list of sympy.symbols.

Return type:

list