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

Anon
Anon Member Posts: 5
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: 105
    Second Anniversary 10 Comments 5 Answers Solution Developer Community of Practice Member
    ✭✭✭✭

    @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: 5
    First Comment
    **

    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

  • Ramdane
    Ramdane Member, Employee Posts: 13
    10 Comments First Anniversary Ansys Employee Name Dropper
    ✭✭✭

    Hi @Anon , is this a small rth file that you can share with us? your code looks correct, maybe an issue in our side, but hard to reproduce without this rht file.
    @Rajesh Meena

  • Anon
    Anon Member Posts: 5
    First Comment
    **

    The .rth file is massive ~20GB. Could this have something to do with it, that the entire thing is not being able to load?
    But I would assume that since my "SELECTION_3" is a fraction of the entire thing that that shouldn't be an issue and that the entire thing doesn't need to load.