Improve reactor controls, reactions, and maintenance UI
This commit is contained in:
@@ -15,18 +15,19 @@ LOGGER = logging.getLogger(__name__)
|
||||
def temperature_feedback(temp: float) -> float:
|
||||
"""Negative coefficient: higher temperature lowers reactivity."""
|
||||
reference = 900.0
|
||||
coefficient = -2.5e-5
|
||||
coefficient = -1.5e-5
|
||||
return coefficient * (temp - reference)
|
||||
|
||||
|
||||
def xenon_poisoning(flux: float) -> float:
|
||||
return min(0.015, 2e-9 * flux)
|
||||
return min(0.01, 5e-10 * flux)
|
||||
|
||||
|
||||
@dataclass
|
||||
class NeutronDynamics:
|
||||
beta_effective: float = 0.0065
|
||||
delayed_neutron_fraction: float = 0.0008
|
||||
external_source_coupling: float = 1e-6
|
||||
|
||||
def reactivity(self, state: CoreState, control_fraction: float) -> float:
|
||||
rho = (
|
||||
@@ -37,14 +38,15 @@ class NeutronDynamics:
|
||||
)
|
||||
return rho
|
||||
|
||||
def flux_derivative(self, state: CoreState, rho: float) -> float:
|
||||
def flux_derivative(self, state: CoreState, rho: float, external_source_rate: float = 0.0) -> float:
|
||||
generation_time = constants.NEUTRON_LIFETIME
|
||||
beta = self.beta_effective
|
||||
return ((rho - beta) / generation_time) * state.neutron_flux + 1e5
|
||||
source_term = self.external_source_coupling * external_source_rate
|
||||
return ((rho - beta) / generation_time) * state.neutron_flux + 1e5 + source_term
|
||||
|
||||
def step(self, state: CoreState, control_fraction: float, dt: float) -> None:
|
||||
def step(self, state: CoreState, control_fraction: float, dt: float, external_source_rate: float = 0.0) -> None:
|
||||
rho = self.reactivity(state, control_fraction)
|
||||
d_flux = self.flux_derivative(state, rho)
|
||||
d_flux = self.flux_derivative(state, rho, external_source_rate)
|
||||
state.neutron_flux = max(0.0, state.neutron_flux + d_flux * dt)
|
||||
state.reactivity_margin = rho
|
||||
LOGGER.debug(
|
||||
|
||||
Reference in New Issue
Block a user