Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions process/data_structure/vacuum_variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from dataclasses import dataclass
from enum import IntEnum


class VacuumPumpType(IntEnum):
"""Enum for vacuum pump types. Controlled via `i_vacuum_pump_type` in `VacuumData`."""

TURBOMOLECULAR = 0
COMPOUND_CRYOPUMP = 1


@dataclass(slots=True)
Expand Down
14 changes: 11 additions & 3 deletions process/models/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from process.core import constants, process_output
from process.core import process_output as po
from process.core.model import Model
from process.data_structure.vacuum_variables import VacuumPumpType
from process.models.build import FwBlktVVShape
from process.models.engineering.ivc_functions import dshellvol, eshellvol

Expand Down Expand Up @@ -312,7 +313,8 @@ def vacuum(
# nitrogen, DT, helium, DT again
sp = (
[1.95, 1.8, 1.8, 1.8]
if self.data.vacuum.i_vacuum_pump_type == 0
if VacuumPumpType(self.data.vacuum.i_vacuum_pump_type)
== VacuumPumpType.TURBOMOLECULAR
else [9.0, 25.0, 5.0, 25.0]
)

Expand Down Expand Up @@ -512,7 +514,10 @@ def vacuum(
# If cryopumps are used then an additional pump is required
# for continuous operation with regeneration.

if self.data.vacuum.i_vacuum_pump_type == 1:
if (
VacuumPumpType(self.data.vacuum.i_vacuum_pump_type)
== VacuumPumpType.COMPOUND_CRYOPUMP
):
pumpn *= 2.0e0

# Information for costing routine
Expand Down Expand Up @@ -658,7 +663,10 @@ def vacuum(
process_output.oblnkl(self.outfile)

i_fw_blkt_shared_coolant = (
"cryo " if self.data.vacuum.i_vacuum_pump_type == 1 else "turbo"
"cryo "
if VacuumPumpType(self.data.vacuum.i_vacuum_pump_type)
== VacuumPumpType.COMPOUND_CRYOPUMP
else "turbo"
)

process_output.oblnkl(self.outfile)
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/models/test_costs_1990.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest

from process.data_structure.pfcoil_variables import PFConductorModel
from process.data_structure.vacuum_variables import VacuumPumpType
from process.models.engineering.pumping import CoolantType
from process.models.superconductors import (
SuperconductorModel,
Expand Down Expand Up @@ -2936,7 +2937,7 @@ class Acc224Param(NamedTuple):
m_vv_vacuum_duct_shield=0,
n_vac_pumps_high=46,
dia_vv_vacuum_ducts=0.57081858183821432,
i_vacuum_pump_type=1,
i_vacuum_pump_type=VacuumPumpType.COMPOUND_CRYOPUMP,
n_vv_vacuum_ducts=16,
c22=0,
c2245=0,
Expand All @@ -2953,7 +2954,7 @@ class Acc224Param(NamedTuple):
m_vv_vacuum_duct_shield=0,
n_vac_pumps_high=46,
dia_vv_vacuum_ducts=0.57072331228476758,
i_vacuum_pump_type=1,
i_vacuum_pump_type=VacuumPumpType.COMPOUND_CRYOPUMP,
n_vv_vacuum_ducts=16,
c22=3474.7391916096453,
c2245=0,
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/models/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import pytest

from process.data_structure.vacuum_variables import VacuumPumpType


@pytest.fixture
def vacuum(process_models):
Expand Down Expand Up @@ -70,7 +72,9 @@ def test_old_model(monkeypatch, vacuum):
)
monkeypatch.setattr(vacuum.data.times, "t_plant_pulse_coil_precharge", 30)
monkeypatch.setattr(vacuum.data.vacuum, "i_vac_pump_dwell", 0)
monkeypatch.setattr(vacuum.data.vacuum, "i_vacuum_pump_type", 1)
monkeypatch.setattr(
vacuum.data.vacuum, "i_vacuum_pump_type", VacuumPumpType.COMPOUND_CRYOPUMP
)
monkeypatch.setattr(
vacuum.data.vacuum, "pres_vv_chamber_base", 0.00050000000000000001
)
Expand Down
Loading