Solver
entities
CableType
HeatEquationType
Bases: Enum
Defines all the possible heat equation types and their string values. * WITH_ONE_TEMPERATURE: computes a single temperature for the cable * WITH_THREE_TEMPERATURES: computes three temperatures for the cable (core, surface and average) * WITH_THREE_TEMPERATURES_LEGACY: computes three temperatures for the cable (core, surface and average), with specifications
ModelType
Bases: Enum
All the models available in thermohl. * cigre : model published by CIGRE * ieee : model published by IEEE * olla : model developed by RTE's R&D team * rte : model developed by RTE
PowerType
Bases: Enum
All the powers involved in the cable heating and cooling. * Joule heating : the way the electricity heats the cable (+ magnetic effect for core-metal cables) * Solar heating : the way the sun heats the cable * Convective cooling : the way the air cools the cable * Radiative cooling : the way the cable is cooled down by the radiations it emits * Precipitation : the way the rain cools the cable
TargetType
Bases: Enum
Defines the locations in the cable of the reference temperature * SURFACE: the reference temperature is at the surface of the cable * AVERAGE: the reference temperature is at an average thickness of the cable * CORE: the reference temperature is at the core of the cable
TemperatureType
Bases: Enum
Defines all the possible temperature locations for the cable. * SURFACE: the temperature at the surface of the cable * AVERAGE: the average temperature of the cable * CORE: the temperature at the core of the cable
VariableType
Bases: Enum
Defines the different types of variables that can be used in a solver. * ERROR: used to retrieve the error of the solver * TIME: the moment associated with TRANSIT and TEMPERATURE predictions * TRANSIT: the electric transit used in the solver * TEMPERATURE: the temperature used in the solver
solver
Base class to build a solver for heat equation.
Solver
Solver(
dic: Optional[dict[str, Any]] = None,
joule: Type[PowerTerm] = PowerTerm,
solar: Type[PowerTerm] = PowerTerm,
convective: Type[PowerTerm] = PowerTerm,
radiative: Type[PowerTerm] = PowerTerm,
precipitation: Type[PowerTerm] = PowerTerm,
)
Bases: ABC
Object to solve a temperature problem.
The temperature of a conductor is driven by four power terms, two heating terms (joule and solar heating) and three cooling terms (convective, radiative and precipitation cooling). This class is used to solve a temperature problem with the heating and cooling terms passed to its init function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, Any] | None
|
Input values used in power terms. If there is a missing value, a default is used. |
None
|
|
Type[PowerTerm]
|
Joule heating term class. |
PowerTerm
|
|
Type[PowerTerm]
|
Solar heating term class. |
PowerTerm
|
|
Type[PowerTerm]
|
Convective cooling term class. |
PowerTerm
|
|
Type[PowerTerm]
|
Radiative cooling term class. |
PowerTerm
|
|
Type[PowerTerm]
|
Precipitation cooling term class. |
PowerTerm
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in src/thermohl/solver/solver.py
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 67 68 69 70 | |
reshape
reshape(
input_array: numberArrayLike,
nb_row: int,
nb_columns: int,
) -> numberArray
Reshape the input array to the specified dimensions (nr, nc) if possible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
numberArrayLike
|
Input array to be reshaped. |
required |
|
int
|
Desired number of rows for the reshaped array. |
required |
|
int
|
Desired number of columns for the reshaped array. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
numberArray |
numberArray
|
Reshaped array of size (nb_row, nb_columns). If reshaping is not possible, returns an array filled with the input_value repeated to fill the dimension (nb_row, nb_columns). |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the input_array has an invalid shape that cannot be reshaped. |
Source code in src/thermohl/solver/solver.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
parameters
Parameters
Parameters(input_dict: Optional[dict[str, Any]] = None)
Object to store Solver args in a dict-like manner.
Source code in src/thermohl/solver/parameters.py
24 25 26 27 28 29 30 31 32 33 | |
compress
compress() -> None
Compress the elements in the Args dictionary by replacing lists containing a unique value with this value.
Source code in src/thermohl/solver/parameters.py
115 116 117 118 119 120 121 122 123 | |
extend
extend() -> None
Extend all compressed elements in the Args dictionary to the right length, ie the number of computations. If the element is a list, it already has the right length. If the element is a scalar, it is replaced with a list of the right length filled with the scalar value.
Source code in src/thermohl/solver/parameters.py
104 105 106 107 108 109 110 111 112 113 | |
keys
keys() -> KeysView[str]
Get list of members as dict keys.
Source code in src/thermohl/solver/parameters.py
88 89 90 | |