Open mjc865 opened 2 years ago
@mjc865, I was away from this repo over can you please upload again (ideally here in the issue)?
I was actually looking into this yesterday - it looks like the signs of the harmonic indices aren't stored in the actual RST file, just interpreted from the code:
(rst.py line 220)
# ansys 15 doesn't track negative harmonic indices
if not np.any(hindex < -1):
# check if duplicate frequencies
tvalues = resultheader['time_values']
for i in range(tvalues.size - 1):
# adjust tolarance(?)
if np.isclose(tvalues[i], tvalues[i + 1]):
hindex[i + 1] *= -1
I guess you'd have to find matching low/high side nodes and calculate the direction from that, since the direction in ANSYS is inconsistent (first mode of each pair is not always in the positive direction). Workbench automatically creates components for the low/high side nodes but I'm not sure if this is true if the analysis is not run through Workbench.
Also, you may want to check the harmonic index of the result set and exclude the N/2 modes, as these frequencies do not occur in pairs so even if they're close in frequency, they are distinct modes.
it looks like the signs of the harmonic indices aren't stored in the actual RST file, just interpreted from the code
That's my understanding as well, and it forced me to "guess" within rst.py
.
Components are now written to rst files, so we can check if they exist as MAPDL will store these components when running CYCLIC
.
For a cyclic analysis, it looks like there's some inconsistency between the harmonic index of the result set, and the harmonic index as calculated from the sector boundary. Sometimes they match, and sometimes they don't.
Here's an uploaded results file (file_cyclic_test.rst) generated from Mechanical 2020R2: http://filedropper.com/325u3Hvx (simple model with 36 base sector nodes, 8 sectors, with results calculated at 1 ND)
And some code to calculate the harmonic index from two nodes on the sector boundary, and compare with the value from the result set:
This gives the following result:
In the first two mode pairs (0,1 and 2,3), the direction matches between the result set and the boundary calculation, but for the third mode pair (4,5) the direction doesn't.