Python Result - Pressure Plot
Is there a way to use a python result object to create a contour plot of all applied pressures in Ansys Mechanical?
It seems like the result file does not contain pressure information.
How can I access the applied pressure to generate a plot showing the pressure in each time step?
Answers
-
I don't think this is stored in the results file. You could parse the model and if the pressures were from Mechanical you can look at the values in the loads themselves and create a plot. Would you need element-by-element for something like an imported pressure with spatial variation, or just a simple pressure?
If you want to go by the results file, you could also look at the nodal forces and determine loads. If pressure is the only external load on that element, then you can isolate it.
0 -
I am using a script in Mechanical to apply a spatial varying pressure load to my model, where a distinct pressure is applied to each element surface. Now I would like to visualize the applied pressure loads as a contour plot. If you have an idea of how to access the applied load values to create a contour plot that would be very helpful.
0 -
Hi Jaaroon & Michael
Pressures are stored in the MAPDL result file. But it is not easy to get to them. They are stored in SMISC items of the element type.1 If you use the option to apply pressure to a surface effect element the SMISC items are very straight-forward. But Mech DPF does not yet support surface effect elements. Nor does PyDPF. So maybe you can request as an enhancement. See the MAPDL Element help on Surf154.
2 The typical solid elements have a different SMISC ID number (for pressure) for each node on each face. This requires some pretty fancy programming to extract out the data...well fancy to me. See the MAPDL element help for whichever element type the model uses.
3 Perhaps an better option would be to create a DPF Field at the same time in your existing script. Then map the field onto the Mechanical mesh and plot.
Mike
0 -
Thanks for the insight.
I am indeed using surface elements. But accessing the elemental pressure values from the result seems to not be an option at this stage if I understand you correctly.
Would there be any way to access the pressure values from the analysis definition rather than the result file?
Otherwise, the option to create a DPF field manually based on the import data might be an option worth exploring.0 -
@Mike Rife are the values stored any differently if they are applied via APD table vs a simple number?
0 -
@Mike.Thompson said:
@Mike Rife are the values stored any differently if they are applied via APD table vs a simple number?@Mike.Thompson no as they are result values.
0 -
Just to keep you updated. I was successful generating a pressure plot reading the pressure data from the external file.
But I would still really appreciate a solution to extract the applied pressure loads directly from the analysis or result object, to get a pressure plot that is not dependent on the external file.
0 -
Jaroon
Does the plot have to be done via a Mech DPF script? Why not just a WB Mechanical commands object? If that is a linear shell model with the pressure applied to the top face (and not with a surface effect elements), then the following Solution CO will give the result pressure plot:set,last
etable,smisc22,smisc,22
etable,smisc23,smisc,23
etable,smisc24,smisc,24
etable,smisc25,smisc,25sadd,sij,smisc22,smisc23,.25,.25,0
sadd,skl,smisc24,smisc25,.25,.25,0
sadd,shellpress,sij,skl,1,1,0/show,png
pletab,shellpress,noav
/showMike
0 -
Using the MechDPF is just a preference, and I would also like to be able to visualize the pressure over multiple timesteps at best.
But thanks for that example. I was not aware of this option. Generally, I use the surface effect elements when I assign pressure loads, but I am not sure that it really makes a difference when the pressure is defined for each element anyways.
0