can macro use values returned by other macros?

    • Weiqiang Liu

      Hi all,

      I am writing an UDF to define source term of species in my case. source terms arise because of chemical reaction below:


      carbon in my system is defined as an UDS. I know how to calculate consuming rate of carbon, in other words source term of carbon. For source term of oxygen and carbon dioxide, I want to get source terms by multiplied some factor to carbon's source term according to above chemical reaction. 

      Therefore I need to use value returned by carbon source UDF to define oxygen source term and carbon dioxide source term.

      I am thinking can I just set the value returned by carbon source UDF as global variable and then it can be accessed for all macros in the source code. However, I am worried about the sequence of fluent calling UDFs for these source terms. If fluent solves carbon source terms first, then it's ok to get other species source terms from carbon source. If fluent calculates oxygen and carbon dioxide source first, then problem occurs.

      Is this doable in fluent? Or what's is the sequence of fluent calculating species source term?



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