Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

rpsetvar not working for materials

    • Mike H.
      Subscriber

      Hello,

      Background: I have a large chemical reaction mechanism running in 2D Fluent. It consists of 24 reactions and 17 species. I am looking to do sensitivity studies, where I turn off a reaction, then re-run to get its contribution to the results.

      I previously tried deactiviting specific reactions in the mechanism be de-selecting them. However, for reasons unknown, that did not actually deactivate them. A sure way to deactivate is to set the pre-exponential factor to a small fraction of its original value, say, two orders of magniutude lower. This effectively turns off the reaction.

      Now to the issue. Doing this with the GUI is painful, so I am doing it with scheme commands. 

      Problem: The (rpsetvar 'materials mymaterials) does not actually update the materials database or the GUI. 

      Possible Solution: By searching through this document [https://www.cfdyna.com/CFDHT/SchemeLanguage.pdf], I found a command called set-all-materials!. This one actually works and updates the GUI values.

      Question: Does anyone know why rpsetvar doesn't work? Also, does an easier way to update kinetic parameters exist (non-GUI)?

      Thanks.

      BTW, here is my workflow:

      (define mat (%rpgetvar 'materials))

      (define mymaterials (replace mat 1.5e+14 1.5e+12))

      (set-all-materials! mymaterials)

      where "replace" is a scheme procedure I found online:

      (define (replace lst find repl)
          (if (pair? lst)
              (cons
                  (replace (car lst) find repl)
                  (replace (cdr lst) find repl))
              (if (equal? find lst)
                  repl
                  lst)))
    • SVV
      Ansys Employee

      Hi,

      To change the Arrhenius coefficients without GUI, one way is to transcribe reactions into a Chemkin mechanism and then use a recorded journal to read another version of the mechanism.

       

      Please note, as per part of forum policy, we cannot debug/write scripts.

       

    • Mike H.
      Subscriber

      v.v.,

      Thank you for the suggestion, and I appreciate that scripts can break Fluent if not careful! I am doing some other work in Chemkin, so I will look into that. 

      Can I import multiple Chemkin mechanisms and then switch between them in cell zones?  Or, do I overwrite the mechanism each time I import. 

      Thank you.

Viewing 2 reply threads
  • The topic ‘rpsetvar not working for materials’ is closed to new replies.
[bingo_chatbox]