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:
TemperatureNodeCapacitor 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
MassFlowNodes.- Returns:
The list of connected
MassFlowNodes.- Return type:
list
- get_connected_mass_transport_resistors(except_this: MassTransport | list = None) list#
Returns a list of connected
MassTransportresistors except the given ones.- Parameters:
except_this (MassTransport | list) – The given
MassTransportresistors to exclude from the result.- Returns:
The list of connected
MassTransportresistors without all given ones.- Return type:
list
- get_connected_nodes(variant: type = None) list#
Returns a list of by
Resistors connectedTemperatureNodes.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. IfNone, all connected nodes are returned.- Returns:
The list of connected
TemperatureNodes.- 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
selfto the asking node.- Return type:
np.ndarray
- get_mass_transport_to_node(target_node: ConnectedFlowObject)#
Returns the
ConnectedFlowObjectResistorlying inbetween self and target_node.- Parameters:
target_node (ConnectedFlowObject) – The
ConnectedFlowObjectto which the MassTransport Resistor is requested for.- Returns:
The MassTransport Resistor inbetween self and target_node.
- Return type:
- 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=MassTransportonly returns allMassTransportresistors.- 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
MassFlowNodes.- Returns:
The connected
MassFlowNodes of self but withoutasking_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
MassFlowNodes connected toself.- Returns:
The number of connected
MassFlowNodes.- Return type:
int
- reset_properties()#
- resistors_in_direction(direction: np.ndarray | str, except_resistor_types: list[type] = None) list[Resistor]#
Returns all
Resistors connected to nodes in the given direction.- Parameters:
direction (np.ndarray | str) – The direction to get the
Resistors 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,zexcept_resistor_types (list, optional) – If not None, these
Resistortypes will not be added to the result.
- Returns:
The
Resistors 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
Resistors 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,zexcept_resistor_types (list, optional) – If not None, these
Resistortypes will not be added to the result.
- Returns:
The
Resistors 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
sympyexpression 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