Skip to content

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

171 Commits

Folders and files

Repository files navigation

FreeCAD Composite Workbench

This is a workbench for FreeCAD to support design and structural analysis of thin composite laminate structures.

This is very much a work in progress. A lot is subject to change or refactoring. Lots of code needs unit testing and handling input errors.

This requires a modified version of FreeCAD, mainly to support FEM analysis. https://github.com/jwharington/FreeCAD/tree/fem-orthotropic

Composite material composition

FibreCompositeLamina

  • Element for fibre composite
  • Classical theory for fibre reinforced material properties
  • Various material fabrics (uni, bidirectional etc)

HomogeneousLamina

  • Element for homogeneous (one part) core material
  • May be orthotropic or isotropic

Laminate

  • Element for homogeneous (single part) layered composites
  • Classical Laminate Theory merging of laminates
  • Symmetric (odd, even) and non-symmetric layups

CompositeLaminate

  • Elements for fibre reinforced composites

Composite structure

CompositeShell

  • Construction of shells in laminate materials
  • LCS varies across the laminate shell by draping material
  • Visualisation of fibre orientation across the part
  • Visualisation of fabric draping strains across the part

Seam

  • Tool for creating seam/overlap/transition regions

Stiffener

  • Tool for constructing stiffeners with custom profiles

Fibre orientation

AlignFibreLCS

  • Tool for aligning zero fibres

TransferLCS

  • Tool for managing fibre orientations across cut lines like seams

WrapLCS

  • Tool for managing fibre orientations around edges with matching fibre orientation

Manufacturing

TexturePlan

  • Construction of aligned texture plans for layup

PartPlane

  • Some preliminary work on constructing part lines/planes

Mould

  • Some preliminary work on constructing moulds

Works in progress

Dart

  • Tool for cutting darts and creating seam/overlap/transition regions

Analysis tools:

  • Analysis tools such as average fibre length, % of plies in each orientation

Finite element analysis:

  • Local coordinate system with orthotropic materials in FreeCAD FEM solver
  • Composite material support in FreeCAD FEM using Calculix solver
  • Computation of FEM stress exposure factor calculations including stress/strain/Tsai-hill

TODO, notes

  • Refactoring to allow use of lower-level code without FeaturePython objects/gui
  • Design rules
  • Hybrid (2 fibre material) fabrics
  • Failure modes implement as plug in to FEM
  • CompositeShell should have code sensitive to whether laminate is Fibre
  • Seam detection and splitting when unwrap fails or high strain
    • Mesh_PolyCut
  • Scale expand drape if positive linear strain .scale
  • TexturePlan
    • add easement
    • add overlaps at darts?

Terminology:

  • splice
  • butt joint
  • joint

https://compositematerialshub.com/bonded-joints/

use CreateLabels.py from FEM for displaying layers?

Composite examples framework

The workbench now includes a lightweight compositeexamples framework for scriptable, reproducible model build examples.

Current examples include:

  • ud_plate_basic
  • quasi_iso_laminate_plate
  • tubular_shell (full 360° shell midsurface)
  • cylindrical_panel_segment (open shell segment)
  • conical_panel_segment (open shell segment, gentle taper)

Run from the GUI

  • Open the Composites workbench.
  • Use Composites → Run Composite Example (or the matching toolbar button).
  • The command runs the default example (ud_plate_basic) via: runner.run("ud_plate_basic", run_solver=False)

This intentionally builds model state without requiring a hard solver run.

Run from the CLI (script/API)

Inside Python (or from FreeCADCmd -c style scripting), call:

from freecad.Composites.compositeexamples import runner

print(runner.list_examples())
result = runner.run("ud_plate_basic", run_solver=False)
print(result)

run_solver defaults to False and examples are expected to keep solver steps optional.

For shell-segment examples (tubular_shell, cylindrical_panel_segment, conical_panel_segment), setting run_solver=True now attempts a full FEM job: analysis + solver + mesh generation + constraints + CalculiX run.

After solve, shell examples also attempt a failure-criteria postprocess using Composites Tsai-Wu and Hashin evaluators and return a failure_report (max index + hotspot elements) when stress components are available.

Add a new example

  1. Create a module in freecad/Composites/compositeexamples/examples/, for example my_example.py.
  2. Implement:
def build(doc=None, run_solver=False):
    # Build model entities, optionally using doc.
    # Keep run_solver optional.
    return {"doc": doc, "laminate": some_laminate}
  1. Register it in freecad/Composites/compositeexamples/registry.py by adding an EXAMPLES entry:
"my_example": {
    "module": ".examples.my_example",
    "name": "My example",
}
  1. Verify with unit/smoke tests under freecad/Composites/compositestests/test_compositeexamples.py.

Testing with real FreeCAD

Most tests under freecad/Composites/compositestests use mocks and can run without a FreeCAD runtime. For integration testing inside a real FreeCAD process, run:

~/opt/FreeCAD-build/bin/FreeCADCmd -P /home/jmw/opt/FreeCAD-CompositesWB \
  freecad/Composites/compositestests/run_freecad_integration_tests.py

This runs test_integration_freecad.py and exits non-zero if a test fails.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages