Toolkit for the Analysis of Composite Structures (TACS)

repository·master·Indexed 41 days ago

https://github.com/smdogroup/tacs

A parallel finite-element code for the analysis and gradient-based design optimization of advanced structures, including shell structures and large 3D topologies. It features a Python interface, integration with ESP/CAPS via the caps2tacs module for aerostructural optimization, and support for nonlinear strain and rotation formulations.

Tokens
44.9K
Snippets
103
Records
196
Agent score
46%

What's inside TACS

  1. Overview of the caps2tacs module

    master

    The caps2tacs module is a Python interface designed to run TACS analysis on geometries created in ESP/CAPS (Engineering Sketch Pad). It acts as a bridge between ESP/CAPS and TACS by building upon the pytacs interface and the tacsAIM (Analysis Interface Module) from ESP/CAPS.

    Key Use Cases:

    • Optimization: Used in FUNtoFEM for sizing and shape optimization of aerodynamic structures under one-way coupled or fully-coupled aerostructural optimizations.
    • Thermoelasticity: Provides thermoelastic properties through the integration of ESP/CAPS and TACS.

    File Management: For each structural design, caps2tacs + tacsAIM generates Nastran files (e.g., *.bdf, *.dat) for the mesh. These are typically located in the ESP/CAPS work directory, specifically under capsStruct/Scratch/tacs. Output files, such as *.f5 files, are also stored in this directory.

  2. TACS Overview

    master

    The Toolkit for the Analysis of Composite Structures (TACS) is a parallel finite-element code designed for the analysis and gradient-based design of advanced structures.

    Key capabilities include:

    • Shell Structure Analysis: Originally designed for analyzing shell structures (e.g., wing-boxes).
    • Topology Optimization: Extended to perform topology optimization of large three-dimensional structures using gradient-based methods.
  3. Use constitutive classes to define element behaviors

    master

    Constitutive classes in tacs.constitutive are used during the setup procedure of TACS.Element classes. These objects define the physical characteristics of the elements, specifically:

    • Mass
    • Stiffness
    • Failure behaviors
    • Buckling behaviors

    To use them, you must instantiate a constitutive class and associate it with your elements.

  4. Use the TacsBuilder class for MPhys integration

    master

    The TACS MPhys interface is centered around the TacsBuilder class. This builder class is used to bridge TACS problems with the MPhys framework, allowing for coupled analysis with optimizers and other disciplinary solvers.

    For general information on the MPhys interface itself, refer to the official MPhys documentation.

    from tacs.mphys.builder import TacsBuilder
    # Use TacsBuilder to connect TACS problems to MPhys
  5. Understand Director Parametrization for Beam and Shell Elements

    master

    In TACS, beam and shell elements use a director to capture changes in orientation (rotational parametrization). A director is a vector that defines the orientation and length of the reference shell normal in the deformed configuration.

    Key concepts:

    • Vector field $\mathbf{d}$: Defines the rate of change of displacement in a reference direction $\mathbf{t}$ induced by rotation. It is calculated as $\mathbf{d} = \mathbf{Q}(\mathbf{q}) \mathbf{t}$, where $\mathbf{Q}(\mathbf{q})$ is a rotation matrix.
    • Kinetic Energy: The spatial and temporal derivatives of $\mathbf{d}$ at each node are used to compute kinetic energy. TACS requires both the first and second time derivatives ($\dot{\mathbf{d}}$ and $\ddot{\mathbf{d}}$).
    • Lagrangian derivation: The equations of motion are derived from Lagrange's equations, accounting for both displacement $\mathbf{u}_0$ and the rotational parameters $\mathbf{q}$.
  6. Use StructProblem to link static problems with geometric DVs

    master

    The tacs.mach.struct_problem.StructProblem wrapper is used to bridge a TACS static problem with a pyGeo DVGeometry object. When you pass a DVGeo instance to the StructProblem constructor, it registers the structural node coordinates with the FFD volume. This allows the mesh to be automatically updated before each solve whenever the geometric design variables change.

    # Example pattern for wrapping a static problem
    struct_prob = StructProblem(static_prob, dv_geo)
  7. Transform displacements to a local shell-attached frame

    master

    TACS uses a transformation matrix $\mathbf{T}$ to map displacements from a local shell-attached reference frame to the global reference frame. The transformation is constructed using tangent directions $\mathbf{t}{1}$ and $\mathbf{t}{2}$ such that $\mathbf{T} = [\mathbf{t}{1} , \mathbf{t}{2} , \hat{\mathbf{n}}]$, where $\hat{\mathbf{n}}$ is the surface normal.

    There are two implementation methods:

    1. Reference axis projection transform

    This method uses a unit reference direction $\mathbf{e}_{ref}$ (which cannot be normal to the shell surface).

    • The local 1-direction $\mathbf{t}{1}$ is the projection of $\mathbf{e}{ref}$ onto the surface.
    • The 2-direction $\mathbf{t}{2}$ is computed as $\hat{\mathbf{n}} \times \mathbf{t}{1}$.
    • Use Case: This is the recommended method when dealing with orthotropic shell materials.

    2. Natural transform

    This method uses the first tangent direction derived from the shell's parametrization: $\mathbf{t}{1} = \mathbf{X}{0,\xi_{1}} / || \mathbf{X}{0,\xi{1}} ||{2}$. The 2-direction is then $\mathbf{t}{2} = \hat{\mathbf{n}} \times \mathbf{t}_{1}$.

    • Caution: This method varies between shell elements depending on their orientation. Use with care if material properties are direction-dependent.
  8. Implementation components of a Shell Element

    master

    A complete shell element implementation in TACS consists of four primary functional parts:

    1. Shell Element Basis: Defines shape functions, quadrature points, and the mixed interpolation functions required for strain interpolation.
    2. Director Parametrization: Computes the director field as a function of the element variables.
    3. Transformation: Computes the local shell element coordinates.
    4. Constitutive Object: Computes stress resultants as a function of the strains.
  9. Use the direct Python interface for TACS

    master

    The direct Python interface provides low-level access to TACS objects, allowing for high visibility into the C++ source code. However, the user is responsible for manual bookkeeping of objects such as MeshLoader, Assembler, state vectors, and FE matrices.

    If you prefer a simplified interface where setup and bookkeeping are automated, use pyTACS instead.

  10. Configure Element Basis classes

    master

    Certain TACS.Element classes require an ElementBasis class during setup to define parameterizations such as the number of nodes or connectivity. Use the following available ElementBasis classes in the tacs.elements module:

    • Tetrahedral: LinearTetrahedralBasis, QuadraticTetrahedralBasis
    • Hexahedral: LinearHexaBasis, QuadraticHexaBasis, CubicHexaBasis
    • Quadrilateral: LinearQuadBasis, QuadraticQuadBasis, CubicQuadBasis, QuarticQuadBasis, QuinticQuadBasis
    • Triangular: LinearTriangleBasis, QuadraticTriangleBasis, CubicTriangleBasis
  11. Define geometry in CSM files

    master

    Differentiable CAD geometry is defined using Computational Solid Model (CSM) files. To ensure compatibility with TACS, your CSM file should include specific attributes:

    • Configuration parameters: Use cfgpmtr <name> <value> for integer variables (e.g., cfgpmtr nribs 10).
    • Design parameters: Use despmtr <name> <value> for real number variables that can be tied to TACS shape variables (e.g., despmtr span 10).
    • capsGroup: Defines regions with identical properties (e.g., capsGroup $rib1).
    • capsConstraint: Defines regions with specific structural constraints (e.g., capsConstraint fix). Supports Temperature and elastic constraints.
    • capsLoad: Defines regions with fixed loads (e.g., capsLoad my_load). Note: Aerodynamic loads must be set up via external coupling like FUNtoFEM.
    • capsAIM: Specifies analysis tools for the body. For structural analysis, include tacsAIM and egadsTessAIM (e.g., capsAIM tacsAIM, egadsTessAIM).
    • capsMesh: (Optional) Sets alternative auto-mesh settings for specific geometry sections.
  12. Understand shell displacement parametrization

    master

    In TACS, shell displacement is parameterized using a combination of mid-plane deflections ($\mathbf{u}_{0i}$) and a through-thickness rate of deformation ($\mathbf{d}$).

    Key concepts:

    • Through-thickness rate of deformation ($\mathbf{d}$): At each node $i$, $\mathbf{d}$ is computed based on rotational variables $\mathbf{q}{i}$ using the formula $\mathbf{d}{i}(\mathbf{q}{i}) = (\mathbf{Q}^{T}(\mathbf{q}{i}) - \mathbf{I})\mathbf{n}_{i}$, where $\mathbf{Q}$ is an exact or approximate rotation matrix.
    • Interpolation: The rotation matrix $\mathbf{Q}$ is only evaluated at nodes and is never interpolated directly; instead, the $\mathbf{d}$ field itself is interpolated using shape functions $N_{i}(\xi)$.
    • Displacement Field: The total displacement $\mathbf{u}(\eta)$ is the sum of mid-surface displacements and the thickness-dependent component: $\mathbf{u}(\eta) = \sum_{i} N_{i}(\xi) ( \mathbf{u}{0i} + \zeta \mathbf{d}{i}(\mathbf{q}_{i}) )$.