Skip to content

Commit ee22871

Browse files
committed
refactor: move SIGMA_SB constant from solver.py to constants.py
Follow project convention "No magic numbers: Physical constants live in constants.py". The Stefan-Boltzmann constant was defined locally in solver.py — now centralized alongside other physical constants. https://claude.ai/code/session_018WB9yHTAM3NZVpids3fo8m
1 parent c340bb0 commit ee22871

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/venting/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020

2121
PI_C = (2.0 / (GAMMA + 1.0)) ** (GAMMA / (GAMMA - 1.0))
2222
C_CHOKED = math.sqrt(GAMMA * (2.0 / (GAMMA + 1.0)) ** ((GAMMA + 1.0) / (GAMMA - 1.0)))
23+
24+
# Stefan-Boltzmann constant [W/(m^2 K^4)]
25+
SIGMA_SB = 5.670374419e-8

src/venting/solver.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@
44
from scipy.integrate import solve_ivp
55

66
from .cases import CaseConfig
7-
from .constants import C_CHOKED, C_P, C_V, GAMMA, M_SAFE, P0, R_GAS, T0, T_SAFE
7+
from .constants import (
8+
C_CHOKED,
9+
C_P,
10+
C_V,
11+
GAMMA,
12+
M_SAFE,
13+
P0,
14+
R_GAS,
15+
SIGMA_SB,
16+
T0,
17+
T_SAFE,
18+
)
819
from .flow import (
920
mdot_fanno_tube,
1021
mdot_orifice_pos_props,
@@ -21,8 +32,6 @@
2132
)
2233
from .thermo import cp_air, cv_air, gamma_air, h_air, u_air
2334

24-
SIGMA_SB = 5.670374419e-8
25-
2635

2736
def _mdot_short_edge(
2837
edge: ShortTubeEdge,

0 commit comments

Comments
 (0)