-
-
December 9, 2024 at 6:26 pmdc3g20Subscriber
I have a Workbench system as shown:Â
A Fluent file provides a CFD pressure load to a wing model. To import this manually, I go to Mechanical > Static Structural > Imported Load (B3) and Insert Pressure. In the settings dropdown I then select which CFD surface I want as shown below, then apply that to the skin of my wing.
I wish to automate this process for many wing models. However, I cannot find the function in Mechanical scripting to call a given 'CFD Surface' and import the associated pressure as a load. I tried using the 'Record' function and setting it up manually, which gives this code, but it gives an error 'AttributeError: 'NoneType' object has no attribute 'AddImportedPressure'':
#region Context Menu Action
imported_load_group_140 = DataModel.GetObjectById(140)
imported_pressure_141 = imported_load_group_140.AddImportedPressure()
#endregion#region Details View Action
selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
selection.Ids = [30]
imported_pressure_141.Location = selection
#endregionimported_load = DataModel.GetObjectById(141)
imported_load.ImportLoad()
#ÂÂ
Can anyone help me debug this code??
-
December 10, 2024 at 8:25 amErik KostsonAnsys Employee
Â
Â
Â
Hi
Do not think that (choose cfd surface) is exposed .
I believe the imported pressure load picks up the first cfd surface (in alphabetic order) from your named selections (ns) in the cfd simulation so if you call it acfdsurface it should pick it up automatic (the rest would be wall, inlet, and outlet ns so it will be first in that order and will be asigned to the imported pressue load added and under cfd surface).
All the best
Erik
Â
Â
Â
Â
Â
Â
-
- You must be logged in to reply to this topic.
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- How to apply Compression-only Support?
- Geometric stiffness matrix for solid elements
- Frictional No separation contact
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
-
1421
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.