Skip to content

static_env_air

StaticEnvAir

StaticEnvAir()

Bases: StaticEnv[FDCableInAir, CircuitInAirFromCableInputSchema, CircuitInAirFromCableConstructionalInputSchema, CircuitInAirFromCableIdInputSchema]

Class that builds a static environment for circuits in air.

Source code in cable_thermal_model/environment/static_env.py
60
61
62
63
64
65
66
67
68
69
def __init__(self) -> None:
    """Initialize the static environment with empty circuit and cable containers."""
    self.circuits: dict[str, CableCircuit] = {}
    self.circuit_cable_indices: dict[str, list[int]] = {}
    self.cables: dict[CableKey, PosCable] = {}
    self.number_of_cables: int = 0

    self.crossing_cables: bool = False

    self.n_phases: int = 3

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
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
62
def add_circuit_from_cable(
    self,
    circuit_input: CircuitInAirFromCableInputSchema,
):
    """Add the circuit to the environment based on a cable instance.

    Convection parameters are added to the circuit.

    Args:
        circuit_input: CircuitInputSchema containing the input parameters
            for the circuit in air, including a Cable instance.

    References:
        - NEN-IEC 60287-2-1 (2023) - [table 3]

    """
    if self.circuits:
        raise ValueError(
            "Environment already contains circuit(s). Cannot add multiple circuits to an air environment"
        )

    self.set_environment_convection_parameters(
        circuit_type=circuit_input.circuit_type,
        dist=circuit_input.dist,
        cable=circuit_input.cable,
        clipped_to_wall=circuit_input.clipped_to_wall,
    )

    return super().add_circuit_from_cable(circuit_input)

set_environment_convection_parameters

set_environment_convection_parameters(
    circuit_type: CircuitType | None,
    dist: float | None,
    cable: FDCableInAir,
    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 FDCableInAir

FDCable 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
def set_environment_convection_parameters(
    self,
    circuit_type: CircuitType | None,
    dist: float | None,
    cable: FDCableInAir,
    clipped_to_wall: bool,
):
    """Adds convection parameters to the cables.

    Args:
        circuit_type: Type of circuit, one of 'single', 'trefoil', 'linear'
        dist: Distance between cables, relevant for 'linear' circuits
        cable: FDCable instance
        clipped_to_wall: Indicator if the circuit is clipped to a wall

    References:
        - NEN-IEC 60287-2-1 (2023) - [table 3]

    """
    Z, E, Cg = self._get_convection_parameters(circuit_type, dist, cable, clipped_to_wall)

    cable.set_convection_parameters(Z=Z, E=E, Cg=Cg)