Skip to main content

Professional concrete section analysis - Structural concrete design according to Eurocodes

Project description

opensection - Professional Concrete Section Analysis

A Python library for structural concrete section analysis according to Eurocodes

PyPI version Python versions License: MIT Build Status codecov Documentation Status

English | Français


✨ Features

  • Eurocode-compliant: Full support for EN 1992 (Eurocode 2) for concrete structures
  • Fiber-based analysis: Advanced section analysis using fiber discretization
  • Material models: Comprehensive constitutive laws for concrete and reinforcing steel
  • Interaction diagrams: Generate N-M interaction diagrams for sections
  • Flexible geometry: Support for rectangular, circular, T-sections, and custom polygons
  • Visualization: Built-in tools for plotting sections and results
  • Fast: Optimized NumPy-based computations
  • Extensible: Clean API for advanced users and researchers

📦 Installation

From PyPI (recommended)

pip install opensection

From source

git clone https://github.com/Pavlishenku/opensection.git
cd opensection
pip install -e .

Development installation

git clone https://github.com/Pavlishenku/opensection.git
cd opensection
pip install -e ".[dev]"

🚀 Quick Start

import opensection as ops

# Define a rectangular concrete section
section = ops.RectangularSection(width=0.3, height=0.5)

# Define materials (Eurocode 2)
concrete = ops.ConcreteEC2(fck=30)  # C30/37
steel = ops.SteelEC2(fyk=500)       # B500B

# Add reinforcement
rebars = ops.RebarGroup()
rebars.add_rebar(y=0.0, z=-0.20, diameter=0.020, n=3)  # 3Ø20 bottom
rebars.add_rebar(y=0.0, z=0.20, diameter=0.016, n=2)   # 2Ø16 top

# Create solver and analyze
solver = ops.SectionSolver(section, concrete, steel, rebars)
result = solver.solve(N=500, My=0, Mz=100)  # N in kN, M in kN·m

# Check results
print(f"Converged: {result.converged}")
print(f"Max concrete stress: {result.sigma_c_max:.2f} MPa")
print(f"Max steel stress: {result.sigma_s_max:.2f} MPa")

# Verify according to EC2
checks = ops.EC2Verification.check_ULS(result, concrete.fcd, steel.fyd)
print(f"Concrete check: {'OK' if checks['concrete_stress']['ok'] else 'FAIL'}")
print(f"Steel check: {'OK' if checks['steel_stress']['ok'] else 'FAIL'}")

📚 Documentation

Full documentation is available at opensection.readthedocs.io

💡 Examples

Check out the examples directory for more detailed use cases:

🛠️ Development

Setting up development environment

# Clone the repository
git clone https://github.com/Pavlishenku/opensection.git
cd opensection

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

Running tests

# Run all tests
pytest

# Run with coverage
pytest --cov=opensection --cov-report=html

# Run specific test file
pytest tests/test_geometry.py

Code quality

# Format code
black src/ tests/

# Sort imports
isort src/ tests/

# Lint
flake8 src/ tests/

# Type checking
mypy src/

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details on:

  • Code of conduct
  • Development process
  • Submitting pull requests
  • Coding standards
  • Testing requirements

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by the need for open-source structural design tools
  • Based on Eurocode 2 (EN 1992-1-1) specifications
  • Built with NumPy and Matplotlib

📞 Contact & Support

🗺️ Roadmap

  • Basic section analysis (EC2)
  • Interaction diagrams
  • Support for ACI 318 (US code)
  • Support for GB 50010 (Chinese code)
  • Time-dependent effects (creep, shrinkage)
  • Crack width calculations
  • Deflection analysis
  • Web interface
  • CAD integration (DXF import/export)

📖 Citation

If you use opensection in academic work, please cite:

@software{opensection2025,
  author = {opensection Contributors},
  title = {opensection: Professional Concrete Section Analysis},
  year = {2025},
  url = {https://github.com/Pavlishenku/opensection},
  version = {1.0.0}
}

Made with ❤️ by the opensection community

⭐ Star us on GitHub | 📖 Read the docs | 💬 Join the discussion

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opensection-1.0.0.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opensection-1.0.0-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file opensection-1.0.0.tar.gz.

File metadata

  • Download URL: opensection-1.0.0.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for opensection-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a167d260de5c39ccd5430e48b31d574e000654aaa069e286c73696a80e93e3a0
MD5 43c1fddcd46a18e0c38117476d41c220
BLAKE2b-256 5fa854d639b4e9b7284eac193d88b056d84ff30c6dbe98be9ba74fb547398645

See more details on using hashes here.

File details

Details for the file opensection-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: opensection-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for opensection-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c878ac3846d5ba546e6b8a5fbe59b81dd50bc5b418c1b2c63d9c41577b92867
MD5 b2604d34ae4153a47d09a8bbe5ba03b4
BLAKE2b-256 5d5515eb8a7ff0878d2c0e8c6a2e68ffeb27cf57d2b3b5de376a61927aa7c4f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page