Export contact pressure of every time step
Hello,
I have a motionsolve simulation of a piston in a cylinder, I need to export contact pressures and node coordinates in a csv to do some calculation in matlab. I tried to export with a query but it only gets the current time step and I need all of them. How can i do it?
Thanks
FB
Answers
-
Hi Federico,
First of all, please use the newest version of HyperView with new interface to get the best results and performance.
Here are some ways you can accomplish your goal:
Common step, apply contour of the result (contact pressure)
1) Using HV Measures and HyperGraph. This will be the easiest way out of GUI. I have attached a picture of final scene on screen before you export data from HyperGraph into csv.
2) Using query panel (efficient if you have very few simulations steps to go over)
3) Hotspot finder API (aka advancedquery API) which can give you the csv but with a bunch of tcl lines. You could substitute the following lines with your data and run as tcl script:
# Create a set of nodes for which you want to query
hwc sset create node Set8
hwc attribute sset visibility true Set8
hwc color sset Red Set8
hwc sset remove Set8 all
hwc sset add Set8 77,220,983,996,1373 # list node ids here
hwc kpi hotspot create "Hotspot Query 1" 3 created hotspot query
hwc kpi hotspot "Hotspot Query 1" criteria loadcase=current filtertype=greaterthan lowervalue=1.06e+03 minimumdistance=75.000000 numberofhotspottype=top numberofhotpottopvalue=5 # this line had to exist but ignorehwc kpi hotspot "Hotspot Query 1" criteria advancedsimulationlist = "1 1\\,1 2\\,1 3\\,1 4\\,1 5\\,1 6\\,1 7" #select list of simulation/ time steps; you can do this in hotspot finder GUI and copy paste the HWC line part here
hwc kpi hotspot "Hotspot Query 1" criteria nodeselect=77,220,983,996,1373 filtertype=none minimumdistance=0.000000 numberofhotspottype=disabled # setting up a search criteria by disabling all filters; # list of nodes ids passed via set in GUI but you can list manually too
hwc kpi hotspot "Hotspot Query 1" criteria outputpersimulation=true
hwc kpi hotspot "Hotspot Query 1" findhotspotshwi OpenStack
hwi GetActiveClientHandle client
client GetAdvancedQueryList
client GetAdvancedQueryHandle advancedQuery_handle 1 # assuming your hotspot query id is 1
advancedQuery_handle SetQuery "entity.id entity.valueentity.coords" # set query criteria; read more about this API on HM reference documentation
advancedQuery_handle WriteData "advQueryResult.csv" # set csv path and namehwi CloseStack
0