How to automate pressure load on FSI faces in vibro-acoustics?

Member, Moderator, Employee Posts: 323
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited March 26 in Structures

So say we have 2 named selections (NS), called fs1 and fs2. How can we loop through them and apply a pressure load and find the correct structural body only associated with that face/NS using scripting?

Best Answers

  • Member, Moderator, Employee Posts: 323
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited March 26 Answer ✓

    Below is one way of doing this (it uses and assumes that on the shared FSI face, we need to get the structural body and not the Fluid/Acoustic body with Water Liquid material, for the shared reference body):

    1. model=ExtAPI.DataModel.Project.Model # refer to Model
    2. analysis = model.Analyses[0]
    3. solution = analysis.Solution
    4. impLoadGrp = ExtAPI.DataModel.GetObjectsByName('Imported Load (A2) ')[0] # change as needed
    5. geodata = ExtAPI.DataModel.GeoData
    6.  
    7. ans=model.NamedSelections.Children
    8. for ns in ans:
    9. presload=impLoadGrp.AddImportedPressure()
    10. presload.Location=ns
    11. my_geob = geodata.GeoEntityById(ns.Location.Ids[0]).Bodies
    12. for myb in my_geob:
    13. my_treeb = ExtAPI.DataModel.Project.Model.Geometry.GetBody(myb)
    14. if my_treeb.Material != 'Water Liquid':
    15. presload.SharedRefBody=my_treeb
  • Member, Moderator, Employee Posts: 323
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited March 26 Answer ✓

    or if we have all of the FSI faces in one named selection instead (called here myfsi - change name as needed), then the below might help:

    1. model=ExtAPI.DataModel.Project.Model # refer to Model
    2. analysis = model.Analyses[0]
    3. solution = analysis.Solution
    4. impLoadGrp = ExtAPI.DataModel.GetObjectsByName('Imported Load (A2) ')[0] # change as needed
    5. geodata = ExtAPI.DataModel.GeoData
    6.  
    7. ns=ExtAPI.DataModel.GetObjectsByName('myfsi')[0] # change name of NS as needed
    8. nsids=ns.Location.Ids
    9. for nsi in nsids:
    10. presload=impLoadGrp.AddImportedPressure()
    11. selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    12. selection.Ids=[nsi]
    13. presload.Location=selection
    14. selection=ExtAPI.SelectionManager.ClearSelection()
    15. my_geob = geodata.GeoEntityById(nsi).Bodies
    16. for myb in my_geob:
    17. my_treeb = ExtAPI.DataModel.Project.Model.Geometry.GetBody(myb)
    18. if my_treeb.Material != 'Water Liquid':
    19. presload.SharedRefBody=my_treeb
This discussion has been closed.