cable_thermal_model
CableKey
Bases: BaseModel
Immutable identifier for a cable within a named circuit.
CablePosition
Bases: StrEnum
Enumeration of cable positions within a circuit.
BondingType
Bases: StrEnum
Bonding type of a cable circuit.
CircuitType
Bases: StrEnum
Circuit type of cable configuration.
CircuitYReference
Bases: StrEnum
Y-axis reference position for circuit placement.
PipeInputSchema
Bases: BaseModel
Input schema defining pipe geometry and fill material.
StaticEnvAir
StaticEnvAir()
Bases: StaticEnv[CableAir, CircuitInAirFromCableInputSchema, CircuitInAirFromCableConstructionalInputSchema, CircuitInAirFromCableIdInputSchema, CircuitInAirFromCableSpecsInputSchema]
Class that builds a static environment for circuits in air.
Source code in cable_thermal_model/environment/static_env.py
62 63 64 65 66 67 68 69 70 71 | |
add_circuit_from_cable
add_circuit_from_cable(circuit_input: CircuitInAirFromCableInputSchema)
Add the circuit to the environment based on a cable instance.
Convection parameters are added to the circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit_input
|
CircuitInAirFromCableInputSchema
|
CircuitInputSchema containing the input parameters for the circuit in air, including a Cable instance. |
required |
References
- NEN-IEC 60287-2-1 (2023) - [table 3]
Source code in cable_thermal_model/environment/static_env_air.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
set_environment_convection_parameters
set_environment_convection_parameters(circuit_type: CircuitType | None, dist: float | None, cable: CableAir, clipped_to_wall: bool)
Adds convection parameters to the cables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit_type
|
CircuitType | None
|
Type of circuit, one of 'single', 'trefoil', 'linear' |
required |
dist
|
float | None
|
Distance between cables, relevant for 'linear' circuits |
required |
cable
|
CableAir
|
CableAir instance |
required |
clipped_to_wall
|
bool
|
Indicator if the circuit is clipped to a wall |
required |
References
- NEN-IEC 60287-2-1 (2023) - [table 3]
Source code in cable_thermal_model/environment/static_env_air.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
StaticEnvSoil
StaticEnvSoil()
Bases: StaticEnv[CableSoil, CircuitInSoilFromCableInputSchema, CircuitInSoilFromCableConstructionalInputSchema, CircuitInSoilFromCableIdInputSchema, CircuitInSoilFromCableSpecsInputSchema]
Class that builds a static environment for circuits in soil.
Source code in cable_thermal_model/environment/static_env_soil.py
40 41 42 43 | |
add_measurement_point
add_measurement_point(x: float, y: float, ndigits: int = 3) -> MeasurementPointKey
Add a measurement point to the environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
x-coordinate of the measurement point. |
required |
y
|
float
|
y-coordinate of the measurement point. |
required |
ndigits
|
int
|
Number of decimal places to round the coordinates for key generation. |
3
|
Returns:
| Name | Type | Description |
|---|---|---|
MeasurementPointKey |
MeasurementPointKey
|
The identifier of the added measurement point. |
Source code in cable_thermal_model/environment/static_env_soil.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
CableLayer
Bases: StrEnum
Enum class for possible cable layer types. Values derived from those used in the old Cable init.
soil_layers
classmethod
soil_layers() -> list[CableLayer]
Return a list of all soil layers.
Source code in cable_thermal_model/model/cables/enum_classes_cable.py
210 211 212 213 | |
PipeFillType
Bases: StrEnum
Enum class for possible types of material filling the pipe surrounding a cable.
StateAir
Bases: State
StateAir has no added attributes on top of State.
However, we want to make sure there is only one circuit (check for a unique circuit_name).
validate_single_circuit
validate_single_circuit()
Ensure that all cable keys in StateAir belong to the same circuit.
Source code in cable_thermal_model/model/schemas/state_schemas.py
94 95 96 97 98 99 100 101 | |
ModelFactory
Factory class for creating model instances based on the environment.
create_model
staticmethod
create_model(static_env: StaticEnvAir) -> ModelAir
create_model(static_env: StaticEnvSoil) -> ModelSoil
create_model(static_env: StaticEnvT) -> Model
Create a model instance based on the environment type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
static_env
|
StaticEnvT
|
Static environment configuration for the model. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Model |
Model
|
An instance of ModelAir or ModelSoil, depending on the type of static_env. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If static_env is not a supported environment type. |
Source code in cable_thermal_model/model/model_factory.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
StateSoil
Bases: State
Extends upon the base State class. Includes additional attribute mutual_heating_contribution and its validation.
Attributes:
| Name | Type | Description |
|---|---|---|
mutual_heating_contribution |
dict[CableKey, ndarray]
|
dict[CableKey, np.ndarray]: A dictionary containing the temperature increase inside a cable due to mutual heating from other cables in the environment. This is stored as a dict with CableKey as key and an array of temperature increases per grid point as value. |
validate_mutual_heating_contribution
validate_mutual_heating_contribution()
Validate that mutual_heating_contribution keys match cable keys.
Source code in cable_thermal_model/model/schemas/state_schemas.py
75 76 77 78 79 80 81 82 83 84 85 | |