Hi,
I'm doing a Static structural simulation in Workbench of an assembly containing metal and composite parts. The composite part is preprocessed in ACP. In the static structural system I apply a pre-meshed cyclic symmetry object, which is prohibiting me from inserting a Composite Failure Tool (version 2025R2). As a workaround, I thought of calculating the Hashin failure criteria in a Python Result object. Based on this forum post and this DPF Framework documentation I got to this point:
def post_started(sender, analysis):# Do not edit this line
define_dpf_workflow(analysis)
def define_dpf_workflow(analysis):
import os
import mech_dpf
import Ans.DataProcessing as dpf
mech_dpf.setExtAPI(ExtAPI)
dataSource = dpf.DataSources(analysis.ResultFileName)
_load_plugins()
analysis = ExtAPI.DataModel.Project.Model.Analyses[0]
working_directory = analysis.WorkingDir
engd_path = os.path.join(working_directory, "MatML.xml")
rst_path = os.path.join(working_directory, "file.rst")
dat_path = os.path.join(working_directory, "ds.dat")
data_sources = dpf.DataSources()
data_sources.AddFilePath(engd_path, "EngineeringData")
data_sources.AddFilePath(dat_path, "dat")
rst_data_source = dpf.DataSources()
rst_data_source.SetResultFilePath(rst_path)
hashin_op = dpf.Operator("composite:evaluate_failure_criterion_per_scope")
# define dpf workflow
dpf_workflow = dpf.Workflow()
dpf_workflow.Add()
dpf_workflow.SetOutputContour()
dpf_workflow.Record('wf_id', False)
this.WorkflowId = dpf_workflow.GetRecordedId()
def _load_plugins():
# utility function to load the dpf composites plugins
import os
import mech_dpf
import Ans.DataProcessing as dpf
version = Ansys.Utilities.ApplicationConfiguration.DefaultConfiguration.VersionInfo.VersionString
dpf_root = os.path.join(os.environ["AWP_ROOT"+version], "dpf")
composites_root = os.path.join(dpf_root, "plugins", "dpf_composites")
dpf.DataProcessingCore.LoadLibrary('EngineeringData', os.path.join(dpf_root, 'bin', 'winx64', 'Ans.Dpf.EngineeringData.dll'), 'LoadOperators')
dpf.DataProcessingCore.LoadLibrary('composites', os.path.join(composites_root, 'composite_operators.dll'), 'LoadOperators')
Unfortunately, I cannot figure out how to set up the failure operator hashin_op properly. I would also like to scope the results to only the composite part and to different time points. Could someone help me with this, please?