DPF composite failure workflow#

This example shows how to use the native DPF Python interface to configure and run the composite failure evaluator. It connects the different DPF operators that are needed to evaluate composite failure criteria.

Note

For simple use cases, using the composite failure operator or composite sampling point operator is preferable. For examples, see Composite failure analysis and Sampling point. Additionally, Filter result data by different criteria shows how helper functions can be used to obtain composite result data.

Set up analysis#

Setting up the analysis consists of loading Ansys libraries, configuring the combined failure criterion, connecting to the DPF server, and preparing files.

Load Ansys libraries.

import ansys.dpf.core as dpf

from ansys.dpf.composites.data_sources import get_composites_data_sources
from ansys.dpf.composites.example_helper import get_continuous_fiber_example_files
from ansys.dpf.composites.failure_criteria import (
    CombinedFailureCriterion,
    CoreFailureCriterion,
    CuntzeCriterion,
    HashinCriterion,
    HoffmanCriterion,
    MaxStrainCriterion,
    MaxStressCriterion,
    TsaiHillCriterion,
    TsaiWuCriterion,
    VonMisesCriterion,
)
from ansys.dpf.composites.server_helpers import connect_to_or_start_server, version_older_than

Configure the combined failure criterion.

combined_fc = CombinedFailureCriterion(
    name="My Failure Criteria",
    failure_criteria=[
        MaxStrainCriterion(),
        MaxStressCriterion(),
        TsaiHillCriterion(),
        TsaiWuCriterion(),
        HoffmanCriterion(),
        HashinCriterion(),
        CuntzeCriterion(),
        CoreFailureCriterion(),
        VonMisesCriterion(vme=True, vms=False),
    ],
)

Start a DPF server and prepare files

server = connect_to_or_start_server()
composite_files_on_server = get_continuous_fiber_example_files(server, "shell")

composite_data_sources = get_composites_data_sources(composite_files_on_server)

Initialize DPF model and data sources#

Initialize the DPF model and the data sources.

rst_data_source = composite_data_sources.rst
material_support_data_source = composite_data_sources.material_support
eng_data_source = composite_data_sources.engineering_data

if version_older_than(server, "7.0"):
    # Get datasources of composite definition files for the backend 2023 R2 or before
    composite_definitions_source = composite_data_sources.old_composite_sources["shell"]
else:
    # Get datasources of composite definition files for the backend 2024 R1 or later
    composite_definitions_source = composite_data_sources.composite

model = dpf.Model(rst_data_source)

Set up providers#

Set up the mesh provider.

Set up the material support provider. The material support provider takes care of mapping the materials in the RST file to the materials in the composite definitions. The material support contains all materials from the RST file.

Set up the result information provider, which gets the unit system from the RST file.

Set up the material provider The material provider combines the material support in the engineering data XML file and the unit system. Its output can be used to evaluate material properties.

Set up the lay-up provider, which reads the composite definition file and enriches the mesh with the composite lay-up information.

Set up result operators#

Set up result operators for strains and stresses. rotate_to_global is False because the postprocessing engine expects the results to be in the element coordinate system (material coordinate system).

Set up failure evaluator#

Set up the failure evaluator, which combines the results and evaluates all failure criteria. The output contains the maximum failure criteria for each integration point.

Compute and plot failure criteria#

Use the output of the multiple failure criteria operator to compute the minimum and maximum failure criteria for each element.

Plot the maximum and minimum values.

099 dpf composite failure workflow

Total running time of the script: (0 minutes 4.796 seconds)

Gallery generated by Sphinx-Gallery