How do I retrieve NMISC results for APDL hydrostatic elements (HSFLD242) with DPF?
Ayush Kumar
Member, Moderator, Employee Posts: 452
✭✭✭✭
Tagged:
0
Answers
-
You can use the following code.
Note
This code uses all the HSFLD242 elements in the named selection "HFL". As HSFLD242 are created by the solver, one needs to create APDL component name "HFL" using APDL Snippet (not via Mechanical).
This code uses time-scoping for 4 time-steps, please adjust as per your model.
import mech_dpf mech_dpf.setExtAPI(ExtAPI) import Ans.DataProcessing as dpf dpf.DataProcessingCore.LoadLibrary("math", r"C:\Program Files\ANSYS Inc\v211\aisol\bin\winx64\Ans.Dpf.Math.dll") ds = mech_dpf.GetDataSources(0) time_freq = dpf.operators.metadata.time_freq_provider() time_freq.inputs.data_sources.Connect(ds) hfl_elements = dpf.Operator("scoping_provider_by_ns") hfl_elements.Connect(0, "Elemental") hfl_elements.Connect(1, "HFL") hfl_elements.Connect(4, ds) # Time Scoping time_scoping = dpf.data.Scoping() time_scoping.Ids = [1, 2, 3, 4] # Density NMISC1 density = dpf.Operator("mapdl::nmisc") density.Connect(0, time_scoping) density.Connect(1, hfl_elements.GetOutputAsScoping(0)) density.Connect(4, ds) # Please use the NMISC number as a second argument here density.Connect(10, 1) # TVOL NMISC3 tvol = dpf.Operator("mapdl::nmisc") tvol.Connect(0, time_scoping) tvol.Connect(1, hfl_elements.GetOutputAsScoping(0)) tvol.Connect(4, ds) # Please use the NMISC number as a second argument here tvol.Connect(10, 3) # Density Results for 1st time step print density.GetOutputAsFieldsContainer(0)[0].Data # TVOL Results for 4th time step print tvol.GetOutputAsFieldsContainer(0)[3].Data
0