How can I extract the rotational mass of a model using DPF?
I would like to use pyDPF to extract the total Rotational mass from a modal analysis in Mechanical/APDL. This is necessary to check if a sufficient number of mode shapes have been extracted in the analysis.
I can get the total mass as:
data_sources = dpf.DataSources() data_sources.add_file_path(Modefile) mass_op = dpf.operators.result.total_mass(data_sources=data_sources) model_total_mass = mass_op.outputs.mass()
Can I similarly read the rotational masses from the .mode or other (e.g. .rst) file?
Answers
-
Hi @Landon Mitchell Kanner I can't see a way to extract that information with DPF up to 25R1. Also looked at DPF Post without success...
0 -
Thanks @Pierre Thieffry . Would this be reasonable enhancement request for DPF or is the issue that the data is not available in the .mode and/or .rst files?
0 -
Here is a workaround that reads the .out file as seen in the question's screenshot:
def get_rotational_masses(Outfile): if not os.path.exists(Outfile): print("ERROR File does not exist: " + Outfile) return None masses = [0,0,0,0,0,0] with open(Outfile) as f: line = f.readline() while line: if "Rotational mass (inertia)" in line: for i in range(3): line = f.readline() v = line.split() masses[i+3] = float(v[i+1]) line = f.readline() line = f.readline() v = line.split() for i in range(3): masses[i] = float(v[3]) line = f.readline() return masses
0 -
I don't see a way to get it with *get, so they are likely not stored. Your workaround is definitely a good one.
0 -
Hi @Landon Mitchell Kanner
You can *get these right after a solution. Also you can *get the effective mass after the solve. The total mass and the first and second MoI are stored in the mode file if a PyDOF enhancement is a better solution for you.0