Skip to content

feat: add ACI 318-25 support (one-way slab flexure and shear)#347

Open
joreilly86 wants to merge 18 commits into
fib-international:devfrom
joreilly86:feat/aci318-25
Open

feat: add ACI 318-25 support (one-way slab flexure and shear)#347
joreilly86 wants to merge 18 commits into
fib-international:devfrom
joreilly86:feat/aci318-25

Conversation

@joreilly86

@joreilly86 joreilly86 commented Apr 15, 2026

Copy link
Copy Markdown

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

  • Material property functions (Ch. 19, 20): Ec, fr, beta1, eps_cu, alpha1, fct, lambda_factor, Es, fy_design, grade lookup
  • Strength reduction factors (Ch. 21): phi_flexure with strain-based transition zone (Table 21.2.2), phi_shear, phi_torsion, phi_bearing, section_classification
  • Flexural strength (Ch. 22.2-22.3): Mn_singly_reinforced, Mn_doubly_reinforced, As_required, As_min_slab, As_min_beam, equilibrium helpers
  • One-way shear strength (Ch. 22.5): Vc_detailed (Table 22.5.5.1 with size effect), Vc_simplified, Vs, Vn, spacing limits
  • One-way slab rules (Ch. 7): min_thickness (Table 7.3.1.1), As_shrinkage_temperature, bar spacing limits
  • Material classes: ConcreteACI318_25, ReinforcementACI318_25 (with from_grade())
  • WhitneyBlock constitutive law: equivalent rectangular stress block for section integration, with Marin integration support
  • Unit conversion utility: PSI_TO_MPA, IN_TO_MM, etc.

Two design paths

  1. Closed-form ACI equations — Whitney stress block hand-calc functions for standard design
  2. Section-integrator-driven analysis — existing Marin/Fiber integrators with ACI-appropriate constitutive laws

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

  • 4 existing files modified (registration only — adding imports and dict entries to codes/__init__.py, materials/concrete/__init__.py, materials/reinforcement/__init__.py, materials/constitutive_laws/__init__.py)
  • 22 new files created (implementation + tests)
  • Zero changes to geometry, sections, integrators, or base classes

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

  • All new ACI 318-25 unit tests pass
  • All existing tests pass (zero regressions)
  • End-to-end: closed-form and integrator paths cross-checked
  • ruff format and ruff check clean

Related

joreilly86 and others added 18 commits April 15, 2026 12:35
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>
@joreilly86 joreilly86 marked this pull request as ready for review April 15, 2026 22:13
@joreilly86

joreilly86 commented Apr 15, 2026

Copy link
Copy Markdown
Author

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 Concrete/Reinforcement interfaces (with gamma_c=1.0 to neutralize the partial factor machinery), while the real ACI design intelligence lives as pure functions in the code module. The existing geometry, section integrators, and constitutive laws are reused unchanged.

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.

@mortenengen mortenengen added the enhancement New feature or request label Apr 16, 2026
@mortenengen mortenengen moved this to New ✨ in PR tracker Apr 16, 2026
@mortenengen mortenengen changed the base branch from main to dev April 16, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: New ✨

Development

Successfully merging this pull request may close these issues.

2 participants