-
-
April 16, 2023 at 3:52 am
Emirhan Yiğit
SubscriberHello,
I'm trying to conduct a transient structural analysis which I use external data for the pressure values on each node on the model and I have one csv file for each time step. After I imported every csv file, I need to define the time of every csv file in Transient Sturctural module. But since I have 10000 csv files and time steps, I couldn't find a way to define it in a proper way in Transient Structural Module -> Imported Load -> Imported Pressure -> Data View.
In previous cases, when I had only 300 files, I was able to create the table in excel and just copy/paste was working. But now since there are 10000 rows to copy and paste, the program crashes.
How can I achieve this? I would appreciate any help.
Thanks!
-
April 18, 2023 at 2:02 am
mjmiddle
Ansys EmployeeWhere do these pressure values come from? If you have run an Ansys CFD solver, such as Fluent or CFX, you should be able to transfer all time points by linking the fluid Solution cell to the structural Setup cell:
Are the locations the same for each file or are you applying by "direct assignment" which is by node/element ID (requires same mesh as in structural as well as fluid module)? If so, you can make one file in Excel by making the pressure data in each file as a new column in the singular file. I guess this still doesn't help with setting the rows in the imported load though.
I'm not sure if there is a limit to the GUI, but you could try a Mechanical python script to create the rows, If the GUI has a limit, it would have to be done by APDL commands.
-
April 18, 2023 at 2:27 am
Emirhan Yiğit
SubscriberHello, thank you for the reply.
I'm using External Data module to import the pressure values since I use another program to generate these pressure values other than an Ansys CFD solver. But since I use the same mesh, I don't have any problem with the direct assignment of node IDs.
I agree with the idea about the limitation of GUI, so I tried to use python script, however, I couldn't find any proper information document that I can use to develop a script to achieve this objective.
I found a post on Reddit that contains a similar script which seems like a thing that I can use but I couldn't edit it for my goal.
Thank you again!
-
-
April 18, 2023 at 6:54 am
mjmiddle
Ansys EmployeeThis will fill in the rows in Mechanical but would be limited by any row limits the application may have. If that is the problem, the entire imported load would need to be done in APDL.
impLoadGroup = ExtAPI.DataModel.GetObjectsByType(Ansys.ACT.Automation.Mechanical.ImportedLoads.ImportedLoadGroup) # Submodeling folder is also this type
impLoadFolder = impLoadGroup[0] # first Imported Load folder
impLoad = impLoadFolder.Children[0] # to get first load under Imported Load folder if load already exists
table = impLoad.GetTableByName("Data View")
for i in range(1,11):
row = Ansys.ACT.Automation.Mechanical.WorksheetRow()
row.Item['Magnitude'] = 'File' + str(i) + ':Pressure1'
row.Item['Analysis Time'] = 0.00005*i
#row.Item['Scale'] = 1.0
#row.Item['Offset'] = 0.0
table.Add(row)
ExtAPI.DataModel.Tree.Refresh()
#impLoadFolder.ImportLoad() # To generate load-
April 18, 2023 at 2:50 pm
Emirhan Yiğit
SubscriberThank you for the script!
Overall, it is working. However I have a minor problem with it. The script skips the first fillable row and starts to fill the table on the second row. So if I run the script as "for i in range(2,11)", everything fits well and I can adjust the first row by clicking. But I couldn't understand what causes this.
Also, when I run the script in the range of 11200 rows, the program doesn't respond again but meanwhile I'm trying to do it in parts by automatizing. I would appreciate if you can inform me how can I do the entire imported load in APDL.
Thank you so much!
-
-
April 19, 2023 at 2:20 am
mjmiddle
Ansys EmployeeMechanical aleady has a first row, and the script only adds rows. That would be why it skips the first row.
To do this in APDL would be quite complicated. You would have to handle the mapping with *MOPER for each load step, and apply the mapped values to each element/node with SFE.
-
April 19, 2023 at 10:08 am
Erik Kostson
Ansys EmployeeTry also the with Transaction to see if it speeds it up and does not hang/block mechanical:
with Transaction():
code/loop….
See here for an example:
https://forum.ansys.com/forums/topic/act-script-assign-items-to-a-named-selection/
All the best
Erik
-
April 23, 2023 at 9:09 pm
Emirhan Yiğit
SubscriberThank you so much for the reply.
I tried to use "with Transaction", yet I don't know if I used it in the correct way and if it did a difference. I was able to import the table for 2000 rows without a problem but when I tried 3000 rows, it didn't work.
I also want to share this link about Workbench scripting to automate imported load sets, so that it may be useful for those who face similar problems.
Thank you again for your help! I'll be checking this thread in case any improvement happens.
Emirhan
-
-
April 24, 2023 at 6:48 am
Erik Kostson
Ansys EmployeeHi
Yes, it get's stuck with too many rows.
Perhaps try to create 6 imported load objects each having max rows of 2000.
All the best
Erik
-
April 25, 2023 at 6:53 am
mjmiddle
Ansys EmployeeThe Transaction pauses update of the Outline objects, so it’s good for operations that create/edit the Outline many iterative times. Just place the repetitive code in an indented block under it. I also adjusted it to fill the first line:
impLoadGroup = ExtAPI.DataModel.GetObjectsByType(Ansys.ACT.Automation.Mechanical.ImportedLoads.ImportedLoadGroup) # Submodeling folder is also this type
impLoadFolder = impLoadGroup[0] # first Imported Load folder
impLoad = impLoadFolder.Children[0] # to get first load under Imported Load folder if load already exists
table = impLoad.GetTableByName("Data View")
with Transaction():
row1 = table.Item[0]
row1.Item[‘Magnitude’] = ‘File1:Pressure1′
row1.Item[‘Analysis Time’] = 0.00005
for i in range(2,11):
row = Ansys.ACT.Automation.Mechanical.WorksheetRow()
row.Item['Magnitude'] = 'File' + str(i) + ':Pressure1'
row.Item['Analysis Time'] = 0.00005*i
#row.Item['Scale'] = 1.0
#row.Item['Offset'] = 0.0
table.Add(row)
ExtAPI.DataModel.Tree.Refresh()
#impLoadFolder.ImportLoad() # To generate load
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

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.

Ansys Blog
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.
- Solver Pivot Warning in Beam Element Model
- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- User manual
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- whether have the difference between using contact and target bodies
- material damping and modal analysis
- Colors and Mesh Display
-
5242
-
3299
-
2469
-
1308
-
988
© 2023 Copyright ANSYS, Inc. All rights reserved.