Retune reactivity for withdrawn and partially inserted rods

This commit is contained in:
Codex Agent
2025-11-22 19:41:34 +01:00
parent 287a8e186a
commit e7d8a34818
3 changed files with 25 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ COOLANT_DENSITY = 700.0 # kg/m^3 averaged between phases
MAX_CORE_TEMPERATURE = 1_800.0 # K MAX_CORE_TEMPERATURE = 1_800.0 # K
MAX_PRESSURE = 15.0 # MPa typical PWR primary loop limit MAX_PRESSURE = 15.0 # MPa typical PWR primary loop limit
CONTROL_ROD_SPEED = 0.03 # fraction insertion per second CONTROL_ROD_SPEED = 0.03 # fraction insertion per second
CONTROL_ROD_WORTH = 0.03 # delta rho contribution when fully withdrawn CONTROL_ROD_WORTH = 0.042 # delta rho contribution when fully withdrawn
STEAM_TURBINE_EFFICIENCY = 0.34 STEAM_TURBINE_EFFICIENCY = 0.34
GENERATOR_EFFICIENCY = 0.96 GENERATOR_EFFICIENCY = 0.96
ENVIRONMENT_TEMPERATURE = 295.0 # K ENVIRONMENT_TEMPERATURE = 295.0 # K

View File

@@ -15,7 +15,7 @@ LOGGER = logging.getLogger(__name__)
def temperature_feedback(temp: float) -> float: def temperature_feedback(temp: float) -> float:
"""Negative coefficient: higher temperature lowers reactivity.""" """Negative coefficient: higher temperature lowers reactivity."""
reference = 900.0 reference = 900.0
coefficient = -1.5e-5 coefficient = -1.7e-5
return coefficient * (temp - reference) return coefficient * (temp - reference)
@@ -28,7 +28,7 @@ class NeutronDynamics:
beta_effective: float = 0.0065 beta_effective: float = 0.0065
delayed_neutron_fraction: float = 0.0008 delayed_neutron_fraction: float = 0.0008
external_source_coupling: float = 1e-6 external_source_coupling: float = 1e-6
shutdown_bias: float = -0.02 shutdown_bias: float = -0.014
def reactivity(self, state: CoreState, control_fraction: float) -> float: def reactivity(self, state: CoreState, control_fraction: float) -> float:
rho = ( rho = (
@@ -50,6 +50,7 @@ class NeutronDynamics:
def step(self, state: CoreState, control_fraction: float, dt: float, external_source_rate: float = 0.0) -> None: def step(self, state: CoreState, control_fraction: float, dt: float, external_source_rate: float = 0.0) -> None:
rho = self.reactivity(state, control_fraction) rho = self.reactivity(state, control_fraction)
rho = min(rho, 0.02)
shutdown = control_fraction >= 0.95 shutdown = control_fraction >= 0.95
if shutdown: if shutdown:
rho = min(rho, -0.04) rho = min(rho, -0.04)

View File

@@ -155,8 +155,26 @@ def test_full_rod_withdrawal_reaches_gigawatt_power():
reactor.primary_pump_active = True reactor.primary_pump_active = True
reactor.secondary_pump_active = True reactor.secondary_pump_active = True
for _ in range(60): early_power = 0.0
for step in range(60):
reactor.step(state, dt=1.0)
if step == 10:
early_power = state.core.power_output_mw
assert state.core.power_output_mw > max(2_000.0, early_power * 2)
assert state.core.fuel_temperature > 600.0
def test_partially_inserted_rods_hold_near_three_gw():
reactor = Reactor.default()
state = reactor.initial_state()
reactor.shutdown = False
reactor.control.manual_control = True
reactor.control.rod_fraction = 0.4
reactor.primary_pump_active = True
reactor.secondary_pump_active = True
for _ in range(120):
reactor.step(state, dt=1.0) reactor.step(state, dt=1.0)
assert state.core.power_output_mw > 2_000.0 assert 2_000.0 < state.core.power_output_mw < 4_000.0
assert state.core.fuel_temperature > 400.0 assert 500.0 < state.core.fuel_temperature < 800.0