Skip to main content

MechForge: Next-Generation Mechanical Engineering Python Platform

Project description

MechForge ๐Ÿ”งโš™๏ธ

Next-Generation Mechanical Engineering Python Platform

Structural Analysis โ€ข Thermodynamics โ€ข Fluid Mechanics โ€ข Machine Design โ€ข Dynamics โ€ข Controls โ€ข Materials โ€ข Manufacturing โ€ข AI/ML โ€ข Industry 4.0


Vision

To become the NumPy/SciPy of mechanical engineering โ€” the foundational, trusted computational layer that every mechanical engineer, researcher, and industrial developer reaches for by default.

Features

Phase 1 โ€” Foundation (Current)

  • โœ… Unit System โ€” Pint-based, every value carries units (SI, Imperial, mixed)
  • โœ… Materials Database โ€” 500+ engineering materials with full property sets
  • โœ… Structural Analysis โ€” Beam analysis, stress transformation, fatigue, fracture mechanics
  • โœ… Machine Design โ€” Shafts, gears, bearings, bolted joints, springs
  • โœ… Fluids โ€” Pipe flow, pump systems, compressible flow
  • โœ… Thermal โ€” Thermodynamic cycles, heat transfer, heat exchangers
  • โœ… Reports โ€” Auto-generated PDF/Word engineering reports

Upcoming

  • ๐Ÿ”œ Dynamics & Vibration
  • ๐Ÿ”œ Controls (PID, state-space)
  • ๐Ÿ”œ AI/ML (Predictive maintenance, optimization, anomaly detection)
  • ๐Ÿ”œ Industry 4.0 (IoT, OPC-UA, MQTT, Digital Twins)
  • ๐Ÿ”œ FEM Solver & Simplified CFD
  • ๐Ÿ”œ Manufacturing (GD&T, DFM)

Quick Start

pip install mechforge
import mechforge as mf

# Every value carries units โ€” no ambiguity
shaft = mf.machine.Shaft(
    length=mf.Q(500, 'mm'),
    torque=mf.Q(200, 'N*m'),
    material=mf.materials.get('AISI 4140'),
)

result = shaft.analyze()
print(result.max_shear_stress.to('MPa'))
print(result.safety_factor)

Fatigue Analysis

from mechforge.structural import FatigueAnalysis
from mechforge.materials import get_material

analysis = FatigueAnalysis(
    material=get_material('AISI 4340'),
    surface_finish='ground',
    loading_type='bending',
    reliability=0.99,
)
life = analysis.predict_life(sigma_max=450, sigma_min=-200)
print(f'Fatigue life: {life.cycles:.2e} cycles')
analysis.plot_goodman_diagram(save='goodman.pdf')

Heat Exchanger

from mechforge.thermal import HeatExchanger

hx = HeatExchanger(
    method='LMTD',
    hot_inlet=mf.Q(150, 'degC'), hot_outlet=mf.Q(90, 'degC'),
    cold_inlet=mf.Q(25, 'degC'), cold_outlet=mf.Q(70, 'degC'),
    U=mf.Q(500, 'W/(m**2*K)'),
    flow_type='counterflow',
)
result = hx.analyze()
print(f'Required area: {result.area.to("m**2"):.2f}')

Standards Compliance

MechForge implements and references major engineering standards:

Domain Standards
Shafts ASME B106, DIN 743
Gears AGMA 2101-D04, ISO 6336
Fasteners VDI 2230, ASME B1.1
Fatigue ASME FFS-1, BS 7910
Pressure Vessels ASME BPVC VIII
Piping ASME B31.1, B31.3

Architecture

mechforge/
โ”œโ”€โ”€ core/          # Units, constants, materials DB, exceptions
โ”œโ”€โ”€ structural/    # FEA, beam analysis, stress/strain, fatigue
โ”œโ”€โ”€ thermal/       # Heat transfer, thermodynamic cycles
โ”œโ”€โ”€ fluids/        # Pipe networks, pump systems, compressible flow
โ”œโ”€โ”€ machine/       # Gears, shafts, bearings, springs, bolts
โ”œโ”€โ”€ dynamics/      # Vibration, modal analysis, rotor dynamics
โ”œโ”€โ”€ manufacturing/ # GD&T, tolerance stack-up, DFM
โ”œโ”€โ”€ materials/     # Material DB, selection, composites
โ”œโ”€โ”€ controls/      # PID, state-space, transfer functions
โ”œโ”€โ”€ pressure/      # ASME VIII vessels, B31.3 piping
โ”œโ”€โ”€ energy/        # Turbomachinery, renewables
โ”œโ”€โ”€ ai/            # Predictive, optimization, anomaly, NLP, vision
โ”œโ”€โ”€ industry40/    # IoT, OPC-UA, MQTT, digital twins
โ”œโ”€โ”€ simulation/    # FEM, CFD, MBD, Monte Carlo
โ”œโ”€โ”€ solvers/       # Shared numerical solvers
โ”œโ”€โ”€ viz/           # 2D/3D visualization
โ”œโ”€โ”€ standards/     # Code lookups & compliance
โ”œโ”€โ”€ reports/       # PDF, Word, HTML, Excel reports
โ”œโ”€โ”€ database/      # SQLite, PostgreSQL, InfluxDB
โ”œโ”€โ”€ api/           # FastAPI REST layer
โ””โ”€โ”€ cli/           # Command-line interface

Development

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

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT License โ€” Free for everyone.


MechForge โ€” Built by Engineers, for Engineers ๐Ÿ—๏ธ

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

mechforge-0.1.0.tar.gz (85.9 kB view details)

Uploaded Source

Built Distribution

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

mechforge-0.1.0-py3-none-any.whl (96.0 kB view details)

Uploaded Python 3

File details

Details for the file mechforge-0.1.0.tar.gz.

File metadata

  • Download URL: mechforge-0.1.0.tar.gz
  • Upload date:
  • Size: 85.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for mechforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8539e0502c5b0b05e6552dfde930863854a65b642f7929794a1fd85316338e11
MD5 d862377ce387fc879aac4fdc1acb60c8
BLAKE2b-256 df959bd8e67dc8c4a88622e89310666964464649889f246dc1c5a67bca7328ae

See more details on using hashes here.

File details

Details for the file mechforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mechforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 96.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for mechforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11671226ab08afa3dc4de25f6580afe5585a96cd7810e461815f18a36cc8753c
MD5 9de9f8076a60e82e35b603553b581a1e
BLAKE2b-256 435faeda64f0ffa4f12ff7a092bdcba8f8671ed7eb201f7c1e7010d4c03c986b

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