thermal
SteadyIntensityResults
SteadyIntensityResults(input_data: dict | DataFrame)
Bases: ThermalSteadyResults
Parser for thermal steady-state intensity computation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw steady-state thermal results data. |
required |
Source code in src/mechaphlowers/core/models/cable/thermal.py
106 107 108 109 110 111 112 | |
parse_results
staticmethod
Parse steady-state thermal results into a DataFrame.
Converts raw steady-state thermal output into standardized DataFrame format. If input is already a DataFrame, returns it as-is. Otherwise converts dict to DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw steady-state results as dictionary or DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Parsed results as a pandas DataFrame. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
SteadyTemperatureResults
SteadyTemperatureResults(input_data: dict | DataFrame)
Bases: ThermalSteadyResults
Parser for thermal steady-state temperature computation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw steady-state thermal results data. |
required |
Source code in src/mechaphlowers/core/models/cable/thermal.py
106 107 108 109 110 111 112 | |
parse_results
staticmethod
Parse steady-state thermal results into a DataFrame.
Converts raw steady-state thermal output into standardized DataFrame format. If input is already a DataFrame, returns it as-is. Otherwise converts dict to DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw steady-state results as dictionary or DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Parsed results as a pandas DataFrame. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
ThermalEngine
ThermalEngine()
Thermal engine is a wrapper for cable thermal modeling.
Attributes:
| Name | Type | Description |
|---|---|---|
power_model |
The power model used for thermal calculations. |
|
heateq |
The heat equation model used. |
|
dict_input |
Dictionary to store input parameters. |
|
forecast |
An instance of ThermalForecastArray for time series data. |
|
target_temperature |
Target temperature for steady-state calculations in celsius. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
normal_wind_mode
property
writable
normal_wind_mode
Get normal wind mode status.
Triggers normal_wind mode in models. Not implemented yet.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This feature is not yet implemented. |
wind_cable_angle
property
wind_cable_angle: ndarray
Compute the angle between wind and cable direction.
Triggers ambient_wind_speed mode in models.
Returns:
| Type | Description |
|---|---|
ndarray
|
Angle in degrees between wind direction and cable azimuth. |
compute_wind_attack_angle
staticmethod
compute_wind_attack_angle(
cable_azimuth: ndarray, wind_azimuth: ndarray
) -> ndarray
Compute the angle between wind and cable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
azimuth of the cable, in degrees |
required |
|
ndarray
|
azimuth of the wind, in degrees |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Angle in degrees between wind direction and cable azimuth. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | |
load
load()
Load or reload the thermal model, and checks the shape of the input parameters. Can be used if the input parameters are modified without using set().
Source code in src/mechaphlowers/core/models/cable/thermal.py
531 532 533 534 535 | |
set
set(
cable_array: CableArray,
latitude: ndarray,
longitude: ndarray,
altitude: ndarray,
azimuth: ndarray,
month: ndarray,
day: ndarray,
hour: ndarray,
intensity: ndarray,
ambient_temp: ndarray,
wind_speed: ndarray,
wind_angle: ndarray,
nebulosity: ndarray,
solar_irradiance: ndarray | None = None,
)
Set input parameters for thermal calculations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CableArray
|
An instance of CableArray containing cable properties. |
required |
|
ndarray
|
Latitude values. |
required |
|
ndarray
|
Longitude values. |
required |
|
ndarray
|
Altitude values. |
required |
|
ndarray
|
Azimuth values. |
required |
|
ndarray
|
Month values. |
required |
|
ndarray
|
Day values. |
required |
|
ndarray
|
Hour values. |
required |
|
ndarray
|
Current intensity values. |
required |
|
ndarray
|
Ambient temperature values. |
required |
|
ndarray
|
Wind speed values in m/s |
required |
|
ndarray
|
Wind angle values in degrees, clockwise from North. |
required |
|
ndarray
|
Nebulosity level (int from 0 to 8). |
required |
|
ndarray | None
|
Solar irradiance values (optional). Defaults to None. |
None
|
Source code in src/mechaphlowers/core/models/cable/thermal.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
steady_intensity
steady_intensity(
target_temperature: ndarray | None = None,
) -> SteadyIntensityResults
Compute steady-state intensity results.
Returns:
| Name | Type | Description |
|---|---|---|
SteadyIntensityResults |
SteadyIntensityResults
|
An instance containing steady-state intensity data. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
565 566 567 568 569 570 571 572 573 574 575 576 577 578 | |
steady_temperature
steady_temperature(
intensity: ndarray | None = None,
return_uncertainty: bool = False,
) -> SteadyTemperatureResults
Compute steady-state temperature results.
Returns:
| Name | Type | Description |
|---|---|---|
SteadyTemperatureResults |
SteadyTemperatureResults
|
An instance containing steady-state temperature data. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | |
transient_temperature
transient_temperature(
forecast_control: ThermalForecastArray | None = None,
) -> ThermalTransientResults
Compute transient temperature results.
Returns:
| Name | Type | Description |
|---|---|---|
ThermalTransientResults |
ThermalTransientResults
|
An instance containing time-varying temperature data. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
ThermalForecastArray
Array for input thermal forecast parameters.
ThermalResults
ThermalResults(input_data: dict | DataFrame)
Bases: ABC
Thermal results base class.
Source code in src/mechaphlowers/core/models/cable/thermal.py
27 28 | |
parse_results
abstractmethod
staticmethod
Parse raw thermal results into a standardized DataFrame format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw thermal results as dictionary or DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: Parsed results as a pandas DataFrame. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
30 31 32 33 34 35 36 37 38 39 40 41 | |
ThermalSteadyResults
ThermalSteadyResults(input_data: dict | DataFrame)
Bases: ThermalResults
Thermal steady-state results parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw steady-state thermal results data. |
required |
Source code in src/mechaphlowers/core/models/cable/thermal.py
106 107 108 109 110 111 112 | |
parse_results
staticmethod
Parse steady-state thermal results into a DataFrame.
Converts raw steady-state thermal output into standardized DataFrame format. If input is already a DataFrame, returns it as-is. Otherwise converts dict to DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw steady-state results as dictionary or DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Parsed results as a pandas DataFrame. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
ThermalTransientResults
ThermalTransientResults(input_data: dict | DataFrame)
Bases: ThermalResults
Thermal transient results class for transient temperature calculations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw transient thermal results data. |
required |
Source code in src/mechaphlowers/core/models/cable/thermal.py
60 61 62 63 64 65 66 | |
parse_results
staticmethod
Parse transient thermal results into a time-series DataFrame.
Converts raw transient thermal output into a DataFrame with columns for time, cable ID, average temperature, surface temperature, and core temperature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | DataFrame
|
Raw transient results dictionary or DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: DataFrame with columns: time, id, average_temperature, surface_temperature, core_temperature. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If input is a DataFrame (only dict format is supported). |
Source code in src/mechaphlowers/core/models/cable/thermal.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
check_inputs
check_inputs(
month: ndarray[Any, dtype[integer]] | None = None,
day: ndarray[Any, dtype[integer]] | None = None,
hour: ndarray[Any, dtype[integer] | dtype[floating]]
| None = None,
datetime_utc: list[datetime] | None = None,
nebulosity: ndarray[
Any, dtype[integer] | dtype[floating]
]
| None = None,
**kwargs: ndarray[Any, Any] | list[datetime],
) -> tuple[
dict[str, ndarray[Any, Any] | list[datetime]], int
]
Validate input parameters.
Ensures all inputs are numpy arrays with the same size and that datetime-related inputs have the right type. Also ensures that month, day and hour, if given, are in the right range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray[Any, Any] | list[datetime]
|
Input parameters as numpy arrays. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[dict[str, ndarray[Any, Any] | list[datetime]], int]
|
A tuple containing: - dict: Dictionary with the input numpy arrays. - int: The common length of all arrays. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If array inputs have incompatible sizes. |
TypeError
|
If any input is not a numpy array. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
to_datetime
Convert month, day, hour to a datetime object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
integer
|
Month value ([1-12]). |
required |
|
integer
|
Day value ([1-31]). |
required |
|
floating
|
Hour value ([0-24[). Can include non-integer hours (e.g. 14.5 for 2:30 PM). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
datetime |
datetime
|
A datetime object representing the given month, day, and hour. |
Source code in src/mechaphlowers/core/models/cable/thermal.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |