General Mechanical

General Mechanical

Mechanical APDL, Post Processing, Reaction probe

    • Yasuki Kadohiro
      Subscriber

      Hi,

      I'm trying to extract the heat flux results at each Named selection of my model by using Reaction probe, and export those results to the csv file. Since there are more than 50 Named selections, I want to use APDL code to do the above mentioned process at once. I have successfully extracted and exported temperature results with the APDL code, but I cannot do the same with the reaction probe.

      The reaction is Convection, and I want to extract/export the maximum heat value by using the APDL code as shown in the following picture. 

      I'd really appreciate it if you could tell me how I can code to obtain the reaction probe (convection) results. If the provided information is not enough, please let me know.

      Thank you very much in advance!!

      Sincerely,

      Yasuki Kadohiro 

    • Erik Kostson
      Ansys Employee

      Hi

       

      So If I understand from the reaction probe image you show above, you want to get the maximum (say -346.76 W in above image) automatically for 50 named selections? If it is like that we can use ACT mechanical scripting instead of apdl.

      All the best

      Erik

    • Yasuki Kadohiro
      Subscriber

      Dear Erik,

      Thank you very much for your kind reply. 

      Yes. Your understanding is correct. If you do not mind, can you show me an example of the ACT mechanical scripting code that applies the convective boundary condition to one named selection, and extracting/exporting the max heat flow results as Reaction Probe results?

      Thank you very much in advance!

      Sincerely,

      Yasuki

    • Erik Kostson
      Ansys Employee

       

       

      Hi 

       

      This is beyond the scope of what I can help with (ACT script) – perhaps other members of the forum can help.

       

      What could help is :

       

      do a for loop to go through all the named selections and for everyone do the following:

       

       

       

      To add convection:

      cn=ExtAPI.DataModel.Project.Model.Analyses[0].AddConvection()

       

      To add reaction probe:

      rp=ExtAPI.DataModel.Project.Model.Analyses[0].Solution.AddReactionProbe()

       

      I would suggest also the course on ALH for ACT scripting if it is of interest.

      Hope this helps

      Erik

       

       

    • Yasuki Kadohiro
      Subscriber

      Dear Erik,

      Thank you so much for your kind reply!

      I will try coding it. 

      Sincerely,

      Yasuki 

    • Erik Kostson
      Ansys Employee

      No worries – all the best – it should be doable with less than 30 lines so not too bad.

       

       

      Below is a start for the for loop on the named selections and the fopen to save the maxheat from every probe created:

       

      model = ExtAPI.DataModel.Project.Model
      analysis=model.Analyses[0]
      ns=model.NamedSelections.Children
      fpath = “D:/”
      fname = “Maxheat.txt”
      f = open(fpath+fname,”w”)
      maxh =[]
      ids =[]
      for n in ns:

      Once all the probes are done (1st step explained above), the model is solved (2nd), and then we do another loop (over nr. of probes) to extract the maxheat value on all the probes. We can use their object id number from the first loop when creating them via ExtAPI.DataModel.GetObjectById(idnr)

       

    • Yasuki Kadohiro
      Subscriber

      Dear Erik,

      Thank you so much for your advises! I could successfully automate the process that i wanted to! 

      Sincerely,

      Yasuki

    • Erik Kostson
      Ansys Employee

      Many thanks - that is great to hear. All the best

      Erik

Viewing 7 reply threads
  • You must be logged in to reply to this topic.