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_mass_flow_start: bool = False, heat_transfer_coefficient: float = nan, is_fluid: bool = False, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>, **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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (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_mass_flow_start: bool = False, heat_transfer_coefficient: float = nan, is_fluid: bool = False, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>, **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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (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 the is 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
- calculate_static(tau, temp_vector, _input_vector, *args, **kwargs)#
- Parameters:
tau
temp_vector
_input_vector
args
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.
- 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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorBoundaryCondition(*args, temperature_delta=None, middle_temperature=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>, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>, **kwargs: bool | float | int)#
Bases:
FluidBoundaryCondition,ExteriorTemperatureInputMixinBoundary 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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- calculate_dynamic(tau, temp_vector, _input_vector, *args, **kwargs)#
Should be overwritten for all time-dependent inputs.
Is used, when self.static = False to calculate time-dependent inputs.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Parameters:
tau (float) – The current time of the solving process.
temp_vector (np.ndarray) – The temperature vector of the last solution during iteration. In the first iteration it is the initial one.
_input_vector – The input vector used for the last solution during iteration. In the first iteration it is the initial one.
kwargs (dict, optional) – Further values that can be used for just some calculations.
- Returns:
A new input value for the input vector
- Return type:
float | int | np.number
- calculate_static(*args, **kwargs)#
- Parameters:
tau
temp_vector
_input_vector
args
kwargs
- get_kwargs_functions() dict#
Used to calculate keyword arguments for calculate_static/dynamic that only need to be calculated once for all objects.
The main reason for this method is speed up during calculation/iteration/solving, because some/most of the boundary conditions only need to be calculated once per time step. So these BCs should be calculated in here and passed to each Input object so that they can use the value for their calculation.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Returns:
The names of the values that must be passed to calculate_static/dynamic and the function to calculate this values. If for example the exterior temperature is needed for calculate_dynamic, the dict looks like this: {“exterior_temperature”: lambda tau: my_fancy_algorithm_to_calculate/get_the_exterior_temperature(tau)} To use it, this dict must be passed to calculate_dynamic like this: my_obj.calculate_dynamic(tau, temp_vector, _input_vector, **the_get_kwargs_dict)
- Return type:
dict
- class ExteriorBoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
ExteriorBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
ExteriorBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorInletFlow(*args, volume_flow=None, temperature_delta=None, middle_temperature=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>, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>, **kwargs: ~numpy.ndarray | bool | float | int)#
Bases:
FlowBoundaryCondition,ExteriorTemperatureInputMixinA boundary condition with constant mass flow and the temperature of
ExteriorTemperatureInput.This is the start of a mass flow.
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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- calculate_dynamic(tau, temp_vector, _input_vector, *args, **kwargs)#
Should be overwritten for all time-dependent inputs.
Is used, when self.static = False to calculate time-dependent inputs.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Parameters:
tau (float) – The current time of the solving process.
temp_vector (np.ndarray) – The temperature vector of the last solution during iteration. In the first iteration it is the initial one.
_input_vector – The input vector used for the last solution during iteration. In the first iteration it is the initial one.
kwargs (dict, optional) – Further values that can be used for just some calculations.
- Returns:
A new input value for the input vector
- Return type:
float | int | np.number
- calculate_static(*args, **kwargs)#
- Parameters:
tau
temp_vector
_input_vector
args
kwargs
- get_kwargs_functions() dict#
Used to calculate keyword arguments for calculate_static/dynamic that only need to be calculated once for all objects.
The main reason for this method is speed up during calculation/iteration/solving, because some/most of the boundary conditions only need to be calculated once per time step. So these BCs should be calculated in here and passed to each Input object so that they can use the value for their calculation.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Returns:
The names of the values that must be passed to calculate_static/dynamic and the function to calculate this values. If for example the exterior temperature is needed for calculate_dynamic, the dict looks like this: {“exterior_temperature”: lambda tau: my_fancy_algorithm_to_calculate/get_the_exterior_temperature(tau)} To use it, this dict must be passed to calculate_dynamic like this: my_obj.calculate_dynamic(tau, temp_vector, _input_vector, **the_get_kwargs_dict)
- Return type:
dict
- class ExteriorInletFlowCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
ExteriorInletFlow,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorInletFlowGeometric(*args, position, **kwargs)#
Bases:
ExteriorInletFlow,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorOutletFlow(*args, temperature_delta=None, middle_temperature=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>, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>, **kwargs: ~numpy.ndarray | bool | float | int)#
Bases:
FlowBoundaryCondition,ExteriorTemperatureInputMixinA boundary condition serving as the end of a mass flow. The
volume_flowvalue has no effect.The temperature is set as
ExteriorTemperatureInputto easily calculate the heat flux between the connectedMassFlowNodeand the exterior Temperature. You could redefine this if you want to calculate another difference. It has no effect for solving the RC network because onlyMassTransportResistors are allowed as neighbours and their are always just passing energy INTO this ExteriorOutletFlow boundary condition and never out of it.This is the end of a mass flow.
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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- calculate_dynamic(tau, temp_vector, _input_vector, *args, **kwargs)#
Should be overwritten for all time-dependent inputs.
Is used, when self.static = False to calculate time-dependent inputs.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Parameters:
tau (float) – The current time of the solving process.
temp_vector (np.ndarray) – The temperature vector of the last solution during iteration. In the first iteration it is the initial one.
_input_vector – The input vector used for the last solution during iteration. In the first iteration it is the initial one.
kwargs (dict, optional) – Further values that can be used for just some calculations.
- Returns:
A new input value for the input vector
- Return type:
float | int | np.number
- calculate_static(*args, **kwargs)#
- Parameters:
tau
temp_vector
_input_vector
args
kwargs
- get_kwargs_functions() dict#
Used to calculate keyword arguments for calculate_static/dynamic that only need to be calculated once for all objects.
The main reason for this method is speed up during calculation/iteration/solving, because some/most of the boundary conditions only need to be calculated once per time step. So these BCs should be calculated in here and passed to each Input object so that they can use the value for their calculation.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Returns:
The names of the values that must be passed to calculate_static/dynamic and the function to calculate this values. If for example the exterior temperature is needed for calculate_dynamic, the dict looks like this: {“exterior_temperature”: lambda tau: my_fancy_algorithm_to_calculate/get_the_exterior_temperature(tau)} To use it, this dict must be passed to calculate_dynamic like this: my_obj.calculate_dynamic(tau, temp_vector, _input_vector, **the_get_kwargs_dict)
- Return type:
dict
- class ExteriorOutletFlowCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
ExteriorOutletFlow,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorOutletFlowGeometric(*args, position, **kwargs)#
Bases:
ExteriorOutletFlow,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class ExteriorTemperatureInputMixin(temperature_delta=None, middle_temperature=None, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>)#
Bases:
objectClass to calculate the exterior temperature.
The temperature can be returned: 1. static 2. dynamic: sinus curve using
temperature_deltaandmiddle_temperature3. dynamic: weather data. The information is in thesettingsobject.- Parameters:
temperature_delta (float | int, optional) – The amplitude of the sinus curve. Not used if
self.settings.use_weather_data is Truemiddle_temperature (float | int, optional) – The middle temperature of the sinus curve. Not used if
self.settings.use_weather_data is Truesettings (Settings, optional) – A settings object with all important settings. If not given the initial Settings object is used.
- __init__(temperature_delta=None, middle_temperature=None, settings: ~pyrc.core.settings.Settings = <pyrc.core.settings.Settings object>)#
Class to calculate the exterior temperature.
The temperature can be returned: 1. static 2. dynamic: sinus curve using
temperature_deltaandmiddle_temperature3. dynamic: weather data. The information is in thesettingsobject.- Parameters:
temperature_delta (float | int, optional) – The amplitude of the sinus curve. Not used if
self.settings.use_weather_data is Truemiddle_temperature (float | int, optional) – The middle temperature of the sinus curve. Not used if
self.settings.use_weather_data is Truesettings (Settings, optional) – A settings object with all important settings. If not given the initial Settings object is used.
- calculate_dynamic(*args, exterior_temperature=None, **kwargs)#
- calculate_dynamic_fun() Callable#
- calculate_static_fun() Callable#
- get_kwargs_functions() dict#
See Input.get_kwargs()
- Returns:
The names of the values that must be passed to calculate_static/dynamic and the function to calculate this values. If for example the exterior temperature is needed for calculate_dynamic, the dict looks like this: {“exterior_temperature”: lambda tau: my_fancy_algorithm_to_calculate/get_the_exterior_temperature(tau)} To use it, this dict must be passed to calculate_dynamic like this: my_obj.calculate_dynamic(tau, temp_vector, _input_vector, **the_get_kwargs_dict)
- Return type:
dict
- class FlowBoundaryCondition(*args, 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,ConnectedFlowObjectBoundary 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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- 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,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class FlowBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
FlowBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- 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: ~pyrc.core.settings.Settings | float | int | ~numpy.ndarray)#
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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class FluidBoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
FluidBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class FluidBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
FluidBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class InteriorBoundaryCondition(*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: ~pyrc.core.settings.Settings | float | int | ~numpy.ndarray)#
Bases:
FluidBoundaryConditionBoundary 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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class InteriorBoundaryConditionCell(*args, position, delta: ndarray | tuple = None, **kwargs)#
Bases:
InteriorBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class InteriorBoundaryConditionGeometric(*args, position, **kwargs)#
Bases:
InteriorBoundaryCondition,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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- class InternalHeatSource(node: Node, specific_power_in_w_per_cubic_meter=None, specific_power_in_w_per_meter_squared=None, area_direction: np.ndarray = None, settings: Settings = <pyrc.core.settings.Settings object>)#
Bases:
EquationItem,Input- property area#
- property area_specific_power#
- calculate_static(tau, temp_vector, _input_vector, **kwargs)#
Calculate static values.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Parameters:
tau
temp_vector
_input_vector
kwargs
- 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#
- property power#
- set_area_specific_power(area_specific_power_in_w_per_square_meter, direction: 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) – 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:
InternalHeatSource- property bc_temp_input_index#
- calculate_dynamic(tau, temp_vector, _input_vector, incoming_area_specific_power_short=nan, incoming_area_specific_power_long=nan, sky_temp_4_diff=nan, **kwargs)#
Should be overwritten for all time-dependent inputs.
Is used, when self.static = False to calculate time-dependent inputs.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Parameters:
tau (float) – The current time of the solving process.
temp_vector (np.ndarray) – The temperature vector of the last solution during iteration. In the first iteration it is the initial one.
_input_vector – The input vector used for the last solution during iteration. In the first iteration it is the initial one.
kwargs (dict, optional) – Further values that can be used for just some calculations.
- Returns:
A new input value for the input vector
- Return type:
float | int | np.number
- calculate_dynamic_functions() dict#
This function is used to pre-calculate some values during solving that are node independent.
This way calculation time can be decreased.
- Returns:
A dictionary where the key stands for the parameter that is passed to the function calculating node dependent stuff and the value is its value (crazy, I know).
- Return type:
dict
- calculate_static(tau, temp_vector, _input_vector, **kwargs)#
Calculate static values.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Parameters:
tau
temp_vector
_input_vector
kwargs
- calculate_static_functions() dict#
- get_kwargs_functions() dict#
Used to calculate keyword arguments for calculate_static/dynamic that only need to be calculated once for all objects.
The main reason for this method is speed up during calculation/iteration/solving, because some/most of the boundary conditions only need to be calculated once per time step. So these BCs should be calculated in here and passed to each Input object so that they can use the value for their calculation.
Each function in the dict must have the possibility to get along with *args and **kwargs.
- Returns:
The names of the values that must be passed to calculate_static/dynamic and the function to calculate this values. If for example the exterior temperature is needed for calculate_dynamic, the dict looks like this: {“exterior_temperature”: lambda tau: my_fancy_algorithm_to_calculate/get_the_exterior_temperature(tau)} To use it, this dict must be passed to calculate_dynamic like this: my_obj.calculate_dynamic(tau, temp_vector, _input_vector, **the_get_kwargs_dict)
- Return type:
dict
- 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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (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.
is_mass_flow_start (bool) –
- If True, the
BoundaryConditionis a start of a mass flow. If so, it must be connected to a
MassTransportresistor.
- If True, the
heat_transfer_coefficient (float) – The heat transfer coefficient used to calculate free convection to the surrounding solid nodes.
is_fluid (bool, optional) – If True, the BC is considered as fluid, otherwise as solid Material.
settings (Settings, optional) – A
Settingsobject with general settings, includingSolveSettingskwargs (dict) – Optional arguments passed to
TemperatureNode.
- sin_function(tau, shift_start_time)#
- sky_temp_according_to_swinbank(air_temperature: float)#