UDF: Derivative in Define Source + Getting drag coefficient

    • Rubiker

      Hi everyone!

      I have some questions about UDFs for FLUENT.

      1. The general MACRO for defining a source is DEFINE_SOURCE(name, c, t dS, eqn) and I know that you should provide an equation for the derivative dS for solver stability. If the source term only depends on one variable it is clear how the derivative looks like. For example a source for the x-momentum is a constant multiplied with the velocity in x-dircetion. Thus the derivative is dS[eqn] = constant.

      But how can you provide the derivative if the source term depends on multiple variables such as

      source = C1*x-velocity + C2*y-velocity*z-velocity ?

      Do you have to provide the sum of the partial derivatives like

      dS[eqn] = C1 + C2*z-velocity + C2*y-velocity?

      2. I want to create a source Term which depends on the drag force betwenn the continiuous liquid phase and the dispersed gas phase (Euler/Euler constant bubble size). Is there any MACRO which can pass me the drag force between the two phases in every cell directly or at least the drag coefficient CD? Or do I have to alter the UDF every-time I change the correlation for the drag law in FLUENT? I´ve searched a lot and I only find the possibility to define my own drag-law but not how to get the coefficient.


      Thanks for the answer in advance!


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