Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Parameterize Arrhenius factors in Fluent

    • Mike H.
      Subscriber

      Hi,

      I am trying to figure out how to run a parametric study in Fluent where I can quickly update the activation energy for one of my chemical reactions (I have 24 reactions, 18 species), then iterate to get the new solution. I can't find a TUI command to directly access a reaction's kinetics. I can use define/material/change-create, but that makes me step through every piece of data for every reaction...very slow.

      Alternatively, I would have to write a UDF to alter the reaction rate of a specific reaction, but that seems like overkill.

      Finally, I can't set the Arrhenius values as input parameters that Workbench can use (at least I don't think I can).

      Thanks!

    • Rob
      Forum Moderator

      Not everything is exposed for parameters, expressions or simple UDFs. The TUI commands can be a little complex, and this is one of the reasons for the PyFluent work. 

      What are you trying to get from the study? Ie do you need a number at the end of this or to optimise something based on the result? Just wondering if a batch script/journal would be an easier option (set up & initialise all 24 cases outside Workbench then use a journal to run them sequentially). 

    • Mike H.
      Subscriber

      Rob, thanks for your reply. I would like to run many studies, overnight if possible, by changing Activation Energy a bit, then seeing its effect on my outlet temperature and species. I would do this for several of my 24 reactions. Eventually, optimizing such values would be desired.

      I could do a journal file, but the define/material/change command has dozens of inputs for the mechanism: it wants species, stoich, arrhenius, etc, for each reaction. Figuring out that long text string would likely have many errors.

      Last resort is iteratively changing the Arrhenius values by hand in the GUI each time, then running, post-processing, then repeat.

      Thanks, Mike 

    • Rob
      Forum Moderator

      If you use the Simulation Reports in Fluent then that's Post semi-automated. I suspect the Arrhenius value(s) aren't exposed as someone will then try and adjust during a calculation which will probably end badly. Check the Ansys Github for PyFluent - there may be a way using that. 

    • Mike H.
      Subscriber

      I was able to print the activation energy value for my reaction #4 using this Scheme command:

      > (list-ref (list-ref (list-ref (list-ref (list-ref (list-ref (%rpgetvar 'materials) 9) 4) 1) 4) 5) 2)

      2.607e+08

      Here, 9=material, 4=reactions, 1=finite rate, 4=reaction #, 5=arrhenius, 2=activation energy.

      Question: does anyone know the Scheme command to change that value?

      Thanks.

    • Rob
      Forum Moderator

      Just a word of caution when messing with Scheme commands. Save everything first and don't overwrite the file. It is possible to corrupt the case messing with them, and you'll need to set up from the mesh file again. 

    • Shamkhal Mammadov
      Subscriber

      Hi, do you guys know how can I activate Arrhenius's reaction rate through Python commands? I have been trying for the past 2 days but no luck. I am doing optimization and I run cases with different species i need to define the Arrhenius backward rate for each reaction but I do not know how to do it with commands

       

    • Rob
      Forum Moderator

      Using PyFluent, or normal TUI commands? 

      • Shamkhal Mammadov
        Subscriber

        Command line. I can convert it to pyfluent command easily.

    • Rob
      Forum Moderator

      Have a look in the 

      /define/materials/change-create mixture-template

      It's an option buried in that yes/no/value command string. 

      • Shamkhal Mammadov
        Subscriber

        In that section it asks if i want to turn on reaction I choose yes, but it doesnt allow me to  'specify values' enter values.

    • Rob
      Forum Moderator

      Hmm, it's possible it's not hooked up in the TUI. I'll check. 

      • Shamkhal Mammadov
        Subscriber

        so her eis the commands form my session:

        it allows to enter values only for the forward reaction, additional screen below:

        as it can be seen i chosen yes for the backward reactiion, but it did not allowed me to specify backward reaction:

        normally here if i click and arrhenius backard rate i can activate  factor and activation energy for backward reactions:

    • Rob
      Forum Moderator

      Which suggests it's not been made available in the TUI. I've asked a colleague. 

      • Shamkhal Mammadov
        Subscriber

        Does it mean, that i can not activate it even with command lines ? 

    • Rob
      Forum Moderator

      It means that I've asked a colleague to double check, and that you need to be patient until he's done that. 

    • Ren
      Ansys Employee

      I've checked the Fluent text user interface and it looks that not all settings related to reactions are exposed in the text interface. One possible workaround would be to use a Chemkin mechanism file. You can modify the reaction kinetic data and then re-import the mechanism file using the text command:

      /file/import/chemkin-mechanism

       

Viewing 12 reply threads
  • The topic ‘Parameterize Arrhenius factors in Fluent’ is closed to new replies.