November 3, 2020 at 4:22 pmjulius.langenhorstSubscriberHello,nThe model I'm working on consists of a composite fabric that is placed in 0? and 90? direction in a stackup. The ModelingPly uses this stackup as ply material and 'Internal Draping' is activated.nI would like to run a parameter study in which one of the parameters is supposed to be the drape angle (a.k.a. shear angle a.k.a. the value that is shown in the legend after creating a Draping Mesh Plot). If I try to create a parameter in ACP I do not find the option for using this specific value. I tried using 'Expression Output' with this code:nmodel = db.active_modelnresult=model.mesh_query(name='draped_fiber_directions',position='nodal',selection='all',simulate=True)nreturn_value = resultnNeedless to say, it did not work. Do you have a better idea on how to extract the drape angle? Or at least why my solution is not working? Let me know if you need further information.nThank you!n
November 5, 2020 at 2:36 pmjulius.langenhorstSubscriberI found a solution to get the shear angle in a specific area. I changed the example code found in the Parameters' section of the ACP User Guide:n# Get active modelnmodel = db.active_modeln# Create new selection of all elements attached to a specific plynmodeling_ply = model.modeling_groups['ModelingGroup.1'].plies['ModelingPly.1']nmodel.select_elements(selection='sel10',op='new',attached_to=[modeling_ply])n# Get total shear angle of the first entity of selection sel0nshear_angles = list(model.mesh_query(name='angles',position='centroid',selection='sel10',entities=[modeling_ply],component='shear'))n# Get maximum shear anglenmax_shear_angle = max(shear_angles)n# Pass the found maximum shear angle as the script's result.nreturn_value = max_shear_anglenWhile it's great that I solved this problem, I don't quite understand what is happening as I'm not familiar with Python. nWhat does selection='sel10' stand for? Why can't it be changed to e.g. selection='all' (following error message:Failed to convert all to selection set enum. Must be of type 'selX'.) nWhy is the returned max shear angle not the same as shown in the legend of my draping mesh plot (38.93 and 44.83)?nIs it possible to create a list of all shear angles in the model?nBest Regards!n
November 12, 2020 at 2:06 pmGovindan NagappanAnsys EmployeenThe selection parameter is an object which is used in the backend to create and store the selection. selection='sel10' means that the current selection is stored as sel10. If you query some data, then you need to pass the name of the selection. If selection is `all`, then the backend selects all elements. So if selection is`all`, then you can skip the first command model.select_elements and directly execute the mesh_query command. The select_elements is needed to ensure that the mesh query only returns the values for the elements which are covered by the ply.n nIn your case:n#select all element of modeling_ply and store it under selection `sel10`nmodel.select_elements(selection='sel10',op='new',attached_to=[modeling_ply])n#query data from a certain selection (here shear angles of a modeling ply using selection object `sel10`)n model.mesh_query(name='angles',position='centroid',selection='sel10',entities=[modeling_ply],component='shear')n nAlternative (and easier to understand)nInstead of using model.select_elements and model.mesh_query, you can use plot objects and use their get_data methodn n#create angle plotnplot=db.active_model.layup_plots.create_angle_plot() nplot.component = 'shear' # set the componentnplot.color_table.auto_upper_value = Truenplot.color_table.upper_value = 90.0nplot.color_table.auto_lower_value = Truenplot.update()nplot.get_data(selected=modeling_ply) # returns the shear angles of a certain plynn n n
November 14, 2020 at 8:11 pmjulius.langenhorstSubscriberThanks for Your answer! nBut since get_data returns a n-dimensional array I can not use it as a parameter, right? Besides, everytime I change something in the code it creates a new layup plot called angle.X, that is supposed to happen?nIn any case, I found a different solution by writing a small python script that stores the angle in a .txt file. It is not an automated process but better than nothing.n
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- How to calculate the residual stress on a coating by Vickers indentation?
- An Unknown error occurred during solution. Check the Solver Output…..
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- Colors and Mesh Display
- whether have the difference between using contact and target bodies
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- What is the difference between bonded contact region and fixed joint
- Massive amount of memory (RAM) required for solve
© 2022 Copyright ANSYS, Inc. All rights reserved.