pyrc.core.inputs#
- class BoundaryCondition(temperature, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, is_fluid: bool = False, heat_transfer_coefficient: float = nan, **kwargs)#
Bases:
TemperatureNode,InputBoundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.
- __init__(temperature, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, is_fluid: bool = False, heat_transfer_coefficient: float = nan, **kwargs)#
Boundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.
- classmethod __init_subclass__(**kwargs)#
Warns if no subclass of this class was found in this module (py-file) that inherits from
Cell.Every BoundaryCondition class should have a counterpart that also is a
Celland one that’s aGeometric. This way, the boundary condition can be used in algorithms like Capacitors that also are cells (in meshes). The classes should be named like the non-Cell/Geometric-classes extended with “Cell”/”Geometric”.This class is only useful during development, when new
BoundaryConditionsare added.- Parameters:
kwargs
- property heat_transfer_coefficient#
- property index: int#
The index of
selfwithin the input vector (row in input matrix).The value is cached to improve performance.
- Returns:
The index of self within the input vector.
- Return type:
int
- property initial_value#
- property is_fluid#
- property is_solid#
- property temperature: float | int | number#
The temperature of
self.If no solution is saved yet, the initial temperature is returned.
- Return type:
float | int | np.number
- property temperature_vector#
The vector with all temperature values of
selfof all (currently existing) time steps.If no solution is saved (yet), the initial temperature is returned as vector with
time_steplength.- Return type:
np.ndarray | np.number
- class BoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
BoundaryCondition,CellBoundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.
- class BoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
BoundaryCondition,GeometricBoundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.
- class FlowBoundaryCondition(*args, is_mass_flow_start: bool = False, volume_flow=None, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, **kwargs)#
Bases:
FluidBoundaryCondition,ConnectedFlowObject- Parameters:
args
is_mass_flow_start (bool, default=False) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
volume_flow (float, optional) – The volume flow in m^3/s
rc_objects
rc_solution
kwargs
- __init__(*args, is_mass_flow_start: bool = False, volume_flow=None, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, **kwargs)#
- Parameters:
args
is_mass_flow_start (bool, default=False) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
volume_flow (float, optional) – The volume flow in m^3/s
rc_objects
rc_solution
kwargs
- property balance#
- check_balance() bool#
If the sum of all sinks and sources of
selfis 0 this method returns True, False otherwise.- Return type:
bool
- connect(*args, **kwargs)#
Add the given object/neighbour to the
self.neighbourslist.The neighbour itself will connect
selfto its neighbours list. E.g.: If node2 should be connected to node1, node2’s neighbours list appends self.The direction is a possibility to set the direction between two connected nodes manually. It is used for connected
BoundaryConditions andNodes. The direction is set for the neighbour. The- Parameters:
neighbour (ObjectWithPorts) – The neighbour to connect to. It will connect
selfto itself. This is the Node the manual direction is set on!direction (tuple | list | np.ndarray, optional) – If not None, a direction is set manually to node_direction_points_at. Either none or both node_direction_points_at and direction must be passed.
node_direction_points_to (TemperatureNode, optional) – If not None, this is the node to which the direction points at (looking from neighbour). Either none or both node_direction_points_at and direction must be passed. Must be a TemperatureNode.
- property sinks: list[MassFlowNode]#
A list with all
MassFlowNodes that are sinks of mass flow forself.- Return type:
list[MassFlowNode]
- property sources: list[MassFlowNode]#
A list with all
MassFlowNodes that are sources of mass flow forself.- Return type:
list[MassFlowNode]
- property volume_flow#
- class FlowBoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
FlowBoundaryCondition,Cell- Parameters:
args
is_mass_flow_start (bool, default=False) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
volume_flow (float, optional) – The volume flow in m^3/s
rc_objects
rc_solution
kwargs
- class FlowBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
FlowBoundaryCondition,Geometric- Parameters:
args
is_mass_flow_start (bool, default=False) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
volume_flow (float, optional) – The volume flow in m^3/s
rc_objects
rc_solution
kwargs
- class FluidBoundaryCondition(*args, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, **kwargs: float | int | ~numpy.ndarray)#
Bases:
BoundaryCondition- Parameters:
args
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
rc_objects
rc_solution
kwargs
- __init__(*args, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, **kwargs: float | int | ~numpy.ndarray)#
- Parameters:
args
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
rc_objects
rc_solution
kwargs
- class FluidBoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
FluidBoundaryCondition,Cell- Parameters:
args
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
rc_objects
rc_solution
kwargs
- class FluidBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
FluidBoundaryCondition,Geometric- Parameters:
args
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
rc_objects
rc_solution
kwargs
- class InternalHeatSource(node: Capacitor, power: float | int | Expr = None, specific_power_in_w_per_cubic_meter: float | int | Expr = None, specific_power_in_w_per_meter_squared: float | int | Expr = None, area_direction: np.ndarray = None)#
Bases:
EquationItem,InputInternal heat source (energy source or sink).
- Parameters:
node (Capacitor) – The Capacitor it belongs to.
power (float | int | Expr, optional) – The power of the heat source. Negative values act as sink.
specific_power_in_w_per_cubic_meter (float | int | Expr, optional) – The volume specific power of the heat source. Negative values act as sink.
specific_power_in_w_per_meter_squared (float | int | Expr, optional) – The area specific power of the heat source. Negative values act as sink. The area used to calculate the actual value is determined by area_direction vector. It points to the surface that should be used. Works only for Nodes, not for Capacitors that are no Cells.
area_direction (np.ndarray, optional) – The direction to the area that should be used to calculate the area specific power.
- __init__(node: Capacitor, power: float | int | Expr = None, specific_power_in_w_per_cubic_meter: float | int | Expr = None, specific_power_in_w_per_meter_squared: float | int | Expr = None, area_direction: np.ndarray = None)#
Internal heat source (energy source or sink).
- Parameters:
node (Capacitor) – The Capacitor it belongs to.
power (float | int | Expr, optional) – The power of the heat source. Negative values act as sink.
specific_power_in_w_per_cubic_meter (float | int | Expr, optional) – The volume specific power of the heat source. Negative values act as sink.
specific_power_in_w_per_meter_squared (float | int | Expr, optional) – The area specific power of the heat source. Negative values act as sink. The area used to calculate the actual value is determined by area_direction vector. It points to the surface that should be used. Works only for Nodes, not for Capacitors that are no Cells.
area_direction (np.ndarray, optional) – The direction to the area that should be used to calculate the area specific power.
- property area#
- property area_specific_power#
- property index: int#
Returns the index of self in the input vector/matrix.
- Returns:
The index of self in the input vector/matrix.
- Return type:
int
- property initial_value: float | int | Expr#
- no_node()#
Checks, if self.node is not of class Node and warns if so.
- Returns:
False if self.node is of class Node.
- Return type:
bool
- property power: float | int | Expr#
- set_area_specific_power(area_specific_power_in_w_per_square_meter: float | int | Expr, direction: np.ndarray = None)#
Sets the volume specific power by calculating it with the area specific power and a direction/normal of the effective surface.
- Parameters:
area_specific_power_in_w_per_square_meter (float | int | Expr) – The area specific power in W/m^2.
direction (np.ndarray, optional) – The normal of the surface where the power is applied to. Should be (1,0,0) with any order and sign. Is used to get the area of the node using
self.node.area(direction).
- 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
- 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
- class Radiation(*args, epsilon_short=0.7, epsilon_long=0.93, **kwargs)#
Bases:
InternalHeatSourceInternal heat source (energy source or sink).
- Parameters:
node (Capacitor) – The Capacitor it belongs to.
power (float | int | Expr, optional) – The power of the heat source. Negative values act as sink.
specific_power_in_w_per_cubic_meter (float | int | Expr, optional) – The volume specific power of the heat source. Negative values act as sink.
specific_power_in_w_per_meter_squared (float | int | Expr, optional) – The area specific power of the heat source. Negative values act as sink. The area used to calculate the actual value is determined by area_direction vector. It points to the surface that should be used. Works only for Nodes, not for Capacitors that are no Cells.
area_direction (np.ndarray, optional) – The direction to the area that should be used to calculate the area specific power.
- property bc_temp_input_index#
- class SolidBoundaryCondition(*args, rc_objects: ~pyrc.core.components.templates.RCObjects = <pyrc.core.components.templates.RCObjects object>, rc_solution: ~pyrc.core.components.templates.RCSolution = <pyrc.core.components.templates.RCSolution object>, **kwargs)#
Bases:
BoundaryConditionBoundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.
- class SolidBoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
SolidBoundaryCondition,CellBoundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.
- class SolidBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
SolidBoundaryCondition,GeometricBoundary condition of the RC network. Only sets a temperature without having a capacity.
- Parameters:
temperature (float | int | np.number) – The temperature of the node. It is recommended to use the SI unit Kelvin instead of degrees Celsius.
position (np.ndarray) – The position of the node in 2D/3D space. If 2D, a zero is added for the z coordinate.
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, default=False) – If True, the BC is considered as fluid, otherwise as solid Material.
kwargs (dict) – Optional arguments passed to
TemperatureNode.