Time scoping issue in Mechanical Scripting when trying to access transient thermal solution

Options
Anon
Anon Member Posts: 4
First Comment
edited July 8 in Structures

I have generated a transient thermal solution in Mechanical and I'm trying to use scripting to analyse the solution at each time point. However,I can't seem to retrieve the entire range through my code. I get this error:

TEMP:149<-mapdl::rth::TEMP:150<-failed to read nodal results from the rst file

The following code is I think the minimal code that reproduces the error on my end:

analysis = model.Analyses[0]
dataSources = dpf.DataSources(analysis.ResultFileName)

scoping_op = dpf.operators.scoping.on_named_selection()
scoping_op.inputs.data_sources.Connect(dataSources)
scoping_op.inputs.requested_location.Connect('Nodal')
scoping_op.inputs.named_selection_name.Connect('SELECTION_3')
scoping = scoping_op.outputs.getmesh_scoping()

time_provider = dpf.operators.metadata.time_freq_provider()
time_provider.inputs.data_sources.Connect(dataSources)
timeList = time_provider.outputs.time_freq_support.GetData().TimeFreqs.Data

time_scoping = dpf.Scoping()
time_scoping.Location = dpf.locations.time_freq_sets
time_scoping.Ids = range(1, len(timeList) +1)

u = dpf.operators.result.temperature()
u.inputs.data_sources.Connect(dataSources)
u.inputs.mesh_scoping.Connect(scoping)
u.inputs.time_scoping.Connect(time_scoping)

myRes_fields = u.outputs.fields_container.GetData()

Everything works fine if I limit the time scoping range to (time coord. are correct too):
time_scoping.Ids = range(1, 123)

In my case the full range is 292 time points (len(timeList) == 292), which is reflected in the tabular data of the Solution.

Note that both of these fail in the same way too:
time_scoping.Ids = range(1, 124)
time_scoping.Ids = range(10, 133)

Any insight as to why this is happening?

Answers

  • Rajesh Meena
    Rajesh Meena Moderator, Employee Posts: 78
    First Anniversary Solution Developer Community of Practice Member Ansys Employee 5 Likes
    Options

    @Anon are you storing results at all time points?

    Are you using outres commands to control frequency of result storage?

    @Ramdane any idea?

  • Anon
    Anon Member Posts: 4
    First Comment
    Options

    Yes, I'm storing at all time points.

    I don't know what you mean by outres commads so I think that is a no.

    Here are my analysis settings