feat: add ACI 318-25 support (one-way slab flexure and shear)#347
feat: add ACI 318-25 support (one-way slab flexure and shear)#347joreilly86 wants to merge 18 commits into
Conversation
Design spec for integrating ACI 318-25 into structuralcodes, covering one-way slab flexural and shear design. Approach: thin material adapter classes with the real ACI intelligence in a self-contained code module. No changes to existing base classes, geometry, sections, or integrators. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
12-task implementation plan covering code module, material properties, strength reduction factors, flexure, shear, one-way slab rules, material classes, Whitney block constitutive law, and end-to-end validation. TDD throughout with frequent commits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduces the aci318_25 sub-package with US customary <-> SI unit conversion constants (_units.py) and registers it in the design codes registry so get_design_codes() returns 'aci318_25'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements Es, fy_design, epsyd, and reinforcement_grade_props for ACI 318-25 Chapter 20, with full test coverage and __init__.py exports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements phi_shear, phi_torsion, phi_bearing, phi_flexure, and section_classification per ACI 318-25 Tables 21.2.1 and 21.2.2, with full test coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements 11 flexure functions in _flexure.py covering equilibrium helpers (stress block, neutral axis, strain compatibility), nominal moment strength for singly- and doubly-reinforced rectangular sections, reinforcement limits (slab/beam/max check), and a quadratic design helper. Updates __init__.py exports and adds a comprehensive test suite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement nine shear functions from ACI 318-25 Sec. 22.5 including the size-effect factor lambda_s, detailed and simplified Vc, steel Vs, Vn, cross-section size check, minimum Av/s, reinforcement-required flag, and max stirrup spacing. Add a comprehensive test suite and export all symbols via the package __init__. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements ACI 318-25 Ch. 7 one-way slab functions: min_thickness (Table 7.3.1.1 with fy and lightweight adjustments), As_shrinkage_temperature (Sec. 24.4.3.2), max_bar_spacing_flexure (Sec. 7.7.2.3), max_bar_spacing_shrinkage (Sec. 7.7.6.2.1), and shear_critical_section_offset (Sec. 7.4.3.2). Exports all five from the package __init__ and adds 12 passing tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ress block Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix E501 (line too long) in docstrings across _flexure.py, _one_way_slab.py, _shear.py, _whitneyblock.py, and test files. Fix SIM108 (use ternary operator) in _shear.py. Add noqa suppression for ARG002 in _whitneyblock.py and E402 in test_whitneyblock.py. Shorten long docstring lines in test_shear.py and test_strength_reduction.py. No logic changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix E501 (line too long), D403 (capitalize docstrings), N801 (class naming), D101/D102 (missing docstrings), ARG002 (unused kwargs), E402 (import order with triangle mock), and PLC0415 (imports inside methods) across all ACI 318-25 implementation and test files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sphinx autodoc pages for all ACI 318-25 modules: material properties (Ch. 19, 20), strength reduction factors (Ch. 21), flexural strength (Ch. 22.2-22.3), one-way shear (Ch. 22.5), and one-way slab rules (Ch. 7). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add sys.modules triangle mock to test_concrete_aci318_25.py and test_one_way_slab_example.py so pytest can collect them without the triangle package installed. Fix case-insensitive regex match in test_flexure.py discriminant test. All 206 ACI 318-25 tests now pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove sys.modules triangle mocks and noqa: E402 comments from all 4 test files. Tests now run cleanly on Python 3.13 where triangle installs normally. Full suite: 10,321 passed, 0 failed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hey all, sharing this as a draft to make the work visible and open for discussion. This represents my take on how ACI 318 could be structured within the existing architecture, building on the conversation in #187. The core idea is a "thin adapter, thick code module" approach: minimal material classes that satisfy the existing I don't have a huge amount of bandwidth to continue active development on this, so please feel free to take over, adapt, or cherry-pick from this work as you see fit. I'm happy for someone else to run with it. The goal is just to share what I've done so far in the interest of collaboration rather than letting it sit on a local branch. I will continue to chip away at this as time permits. Open to feedback on the architecture, naming, or any of the design decisions. Happy to answer questions about the approach. |
Summary
Adds ACI 318-25 (Building Code Requirements for Structural Concrete) to the library, starting with one-way slab flexural and shear design. This builds on the discussion in #187 and complements (but is independent of) #343.
Architecture: "Thin Adapter, Thick Code Module" — minimal material classes plug into the existing geometry/section/integrator pipeline unchanged. ACI design intelligence lives in pure functions under
codes/aci318_25/. No changes to existing base classes, geometry, sections, or integrators.What's included
Ec,fr,beta1,eps_cu,alpha1,fct,lambda_factor,Es,fy_design, grade lookupphi_flexurewith strain-based transition zone (Table 21.2.2),phi_shear,phi_torsion,phi_bearing,section_classificationMn_singly_reinforced,Mn_doubly_reinforced,As_required,As_min_slab,As_min_beam, equilibrium helpersVc_detailed(Table 22.5.5.1 with size effect),Vc_simplified,Vs,Vn, spacing limitsmin_thickness(Table 7.3.1.1),As_shrinkage_temperature, bar spacing limitsConcreteACI318_25,ReinforcementACI318_25(withfrom_grade())PSI_TO_MPA,IN_TO_MM, etc.Two design paths
End-to-end validation confirms both paths agree within 5% for the one-way slab example (Whitney: 36.16 kN-m vs parabola-rectangle integrator: 34.52 kN-m).
ACI vs Eurocode safety philosophy
ACI 318 uses LRFD — material strengths are unreduced (
gamma_c=1.0,gamma_s=1.0), and strength reduction factors (φ) are applied to member capacity. The phi logic is centralized in_strength_reduction.py. Design functions return nominal strengths; phi is applied externally by the caller. This is documented in the material class docstrings and follows the approach endorsed in #187.Files changed
codes/__init__.py,materials/concrete/__init__.py,materials/reinforcement/__init__.py,materials/constitutive_laws/__init__.py)Future extensibility
The pattern supports adding more ACI member types (beams Ch. 9, columns Ch. 10, walls Ch. 11, two-way slabs Ch. 8) as thin member-rule modules that reference the shared flexure/shear/phi functions.
Test plan
ruff formatandruff checkcleanRelated
docs/superpowers/specs/2026-04-15-aci318-25-integration-design.md