Fluids

Fluids

TUI and scripting

    • vedama
      Subscriber

      Hello,

      I want to get started on an automated process of adaption on Fluent on a cluster but I want to adapt cells based on how many cells are being marked. Let's say for example, I have 1000 cells and 100 of those cells have a pressure value above 1E+05 Pascal threshold and I only want to mark those for adaption.

      In my scripting code, I would iteratively change the pressure threshold to different values until I get 100 cells marked for refinement and use that value as a refinement criterion by entering it in the TUI. I know the commands to modify adaption criterion using TUI and I know I need the *.out file to be able to make changes but I want to combine it with my external code (could be any language). I'm looking for guidance on how to go about this simultaneously on my external code with an active fluent window open. I hope my question makes sense?

    • Rob
      Ansys Employee
      The adaption tools will allow cells to be marked if their value hits a pre-set criterion. However, whilst the register will report the number of cells in it, I'm not sure that's available to any of the report functions: they'd be the way to get a parameter out of Fluent.
    • DrAmine
      Ansys Employee
      In Fluent itself you can try to create a Scheme script which will detect how many cells are marked for adaption and store that in a rampant variable which you might access elsewhere. With that value you can steer Fluent to adjust the pressure threshold till you get what you want as number of cells.
    • vedama
      Subscriber

      Okay, I had no idea Scheme programming existed in Fluent. Thank you! This might be quite a basic follow-up question, but how would I store the value printed? When I type:
      (ti-menu-load-string (format #f "/mesh/adapt/list-adaption-cells\n"))
      I get:
      /mesh/adapt/list-adaption-cells No. of cells marked for refinement : 708
      > #t
      How would I got about storing 708? I want to keep running this step through a do-loop, adjusting threshold values, until I arrive at a specified value, say 100.
    • DrAmine
      Ansys Employee
      You can then use things like pick-robust or pick-a-real to pick that value. More can be found on the Ansys Customer Portal (if you have access).
    • vedama
      Subscriber
      Pick-robust works great. Thank you!
    • DrAmine
      Ansys Employee
      Welcome!
Viewing 6 reply threads
  • You must be logged in to reply to this topic.