Skip to content

Commit

Permalink
Resilience tweaks and tweak final circuit cable rating method
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Mar 7, 2024
1 parent 9414142 commit f7803f2
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
24 changes: 24 additions & 0 deletions powerplan/cable_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
(630, None, None, 861),
]

# CSA, two-core DC, two-core AC, multi-core AC, touching AC, touching DC
cable_data["4F1A"]["voltage_drop"] = [
(4, 12, 12, 10, None, None),
(6, 7.8, 7.8, 6.7, None, None),
Expand All @@ -46,6 +47,29 @@
(630, None, None, None, 0.068, (0.079, 0.170, 0.185)),
]

# Flexible cables, non-armoured
cable_data["4F3A"] = {}
# Note that there are derating factors based on temperature.
cable_data["4F3A"]["ratings"] = [
(0.5, 3, 3, None),
(0.75, 6, 6, None),
(1, 10, 10, None),
(1.25, 13, None, None),
(1.5, 16, 16, None),
(2.5, 25, 20, None),
(4, 32, 25, None),
]

cable_data["4F3A"]["voltage_drop"] = [
(0.5, None, 93, 80, None, None),
(0.75, None, 62, 54, None, None),
(1, None, 46, 40, None, None),
(1.25, None, 37, None, None, None),
(1.5, None, 32, 27, None, None),
(2.5, None, 19, 16, None, None),
(4, None, 12, 10, None, None),
]


# Eland Cables H07RN-F Cable Datasheet
cable_data["Eland"] = {}
Expand Down
5 changes: 4 additions & 1 deletion powerplan/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def select_cable_size(current: int, methodology: str, configuration: CableConfig
return None


def get_cable_ratings(csa: float, methodology: str, configuration: CableConfiguration) -> Dict:
def get_cable_ratings(csa: float, methodology: str, configuration: CableConfiguration) -> Optional[Dict]:
data = cable_data[methodology]

voltage_drop = None
Expand All @@ -41,6 +41,9 @@ def get_cable_ratings(csa: float, methodology: str, configuration: CableConfigur
if csa == row[0]:
voltage_drop = row[col]

if rating is None or voltage_drop is None:
return None

return {"rating": rating, "voltage_drop": voltage_drop}


Expand Down
29 changes: 21 additions & 8 deletions powerplan/diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,20 @@ def _render_port(current, phases, count=1):
return txt


def calculate_max_length(V, Z_s, I_n: float, csa: float):
def calculate_max_length(
V,
Z_s,
I_n: float,
csa: float,
methodology: str = "Eland",
cable_config: CableConfiguration = CableConfiguration.TWO_CORE,
):
"""Calculate maximum length of a cable which will still satisfy the fault current requirement."""
ratings = get_cable_ratings(csa, "Eland", CableConfiguration.TWO_CORE)
ratings = get_cable_ratings(csa, methodology, cable_config)
if ratings is None:
raise ValueError(
f"No ratings found for CSA: {csa}mm², methodology {methodology}, configuration {cable_config}"
)
cable_r1 = (ratings["voltage_drop"] / 1000) * (ureg.ohm / ureg.meter)
max_z_s = (V / (5.5 * I_n)).to(ureg.ohm)

Expand Down Expand Up @@ -85,18 +96,20 @@ def _node_additional(node: PowerNode) -> dict:

circuit_length_params: list[Tuple[int, float]] = []
for i_n in sorted(output_ratings, reverse=True):
csa = select_cable_size(i_n.magnitude, "Eland", CableConfiguration.TWO_CORE)
csa = select_cable_size(i_n.magnitude, "4F3A", CableConfiguration.TWO_CORE)
if csa is None:
continue
circuit_length_params.append((i_n, float(csa)))

if i_n <= 16 * ureg.A:
# For circuits 16A and lower also include a worst-case 1.25 mm^2 CSA
circuit_length_params.append((i_n, 1.5))
if i_n == 16 * ureg.A:
# For 16A also include a worst-case 1.25 mm^2 CSA as these
# cables are sometimes seen.
circuit_length_params.append((i_n, 1.25))

final_circuit_lengths = []
for (i_n, c_csa) in circuit_length_params:
max_length = calculate_max_length(node.voltage_ln, z_s, i_n, c_csa)
for i_n, c_csa in circuit_length_params:
# Calculate final circuit lengths using BS7671 table 4F3A (flexible, non-armoured)
max_length = calculate_max_length(node.voltage_ln, z_s, i_n, c_csa, methodology="4F3A")
final_circuit_lengths.append(
"{:.4~H} @ {:~H} ({:} mm<sup>2</sup>)".format(max_length, i_n, c_csa)
)
Expand Down
2 changes: 1 addition & 1 deletion powerplan/test_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def generate_schedule(plan: Plan):

for c, c_data in b.outputs():
# Test each adjustable RCD
if c_data["rcd"] in ADJUSTABLE:
if "rcd" in c_data and c_data["rcd"] in ADJUSTABLE:
tests[grid.name][c.name] = {
"source": b,
"node": c,
Expand Down

0 comments on commit f7803f2

Please sign in to comment.