cable_soil
CableSoil
CableSoil(conductor: CableConductorProperties, layer_properties: dict[CableLayer, CableLayerProperties], layer_metrics: CableLayerMetrics, cable_type: CableType, grid_counts: dict[CableLayer, int])
Bases: Cable
Finite difference cable model with soil discretization.
Source code in cable_thermal_model/model/cables/cable.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
integrate_timestep
integrate_timestep(previous_solution: ndarray, time_step: float, solution_at_boundary: float) -> ndarray
This method solves the finite difference approximation to the heat equation using the implicit Euler method.
For optimization purposes, the method uses the scipy.linalg.solve_banded method to solve the linear system. This means the three diagonals of finite difference matrix A are instead stored in a (3, N) array, where N is the length of the diagonal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
previous_solution
|
ndarray
|
The solution of the heat equation [°C] at the previous timestep (t). |
required |
time_step
|
float
|
The size of the time steps [s] in the linearized time grid. |
required |
solution_at_boundary
|
float
|
The solution at the boundary grid point [°C] used as a boundary condition. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The solution [°C] to the heat equation at the next timestep (t+1) for all grid points except the final grid point, at which a boundary condition is enforced. |
Source code in cable_thermal_model/model/cables/cable_soil.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
update_soil_properties
update_soil_properties(soil_rho: float, soil_c: float, temperature_grid: ndarray, soil_drying: bool = False) -> None
This method updates the soil properties around a cable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
soil_rho
|
float
|
The thermal resistivity of the soil that is not dried out |
required |
soil_c
|
float
|
The thermal capacity of the soil that is not dried out |
required |
temperature_grid
|
ndarray
|
The temperature grid for the cable, as calculated for a given timestep. |
required |
soil_drying
|
bool
|
Whether the scenario takes soil drying into account. |
False
|
Source code in cable_thermal_model/model/cables/cable_soil.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
get_cable_copy_without_soil
get_cable_copy_without_soil() -> Self
This method returns a new CableSoil object with the soil layer removed.
Source code in cable_thermal_model/model/cables/cable_soil.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
from_cable_with_added_soil_layer
classmethod
from_cable_with_added_soil_layer(cable: Cable, soil_rho: float, soil_capacity: float, soil_radius: float, logarithmic_soil_gridpoint_density: float) -> Self
Create a fresh copy of the current cable object this was run from, but with an extra added soil layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cable
|
Cable
|
|
required |
soil_rho
|
float
|
|
required |
soil_capacity
|
float
|
|
required |
soil_radius
|
float
|
|
required |
logarithmic_soil_gridpoint_density
|
float
|
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
CableSoil |
Self
|
|
Source code in cable_thermal_model/model/cables/cable_soil.py
167 168 169 170 171 172 173 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 | |