Fluids

Fluids

UDS source term as a function of distance => unexpected discontinuous staircase output

    • tpsagaro
      Subscriber

      Hi,

      Sure I'm missing something. The purpose is to use a scalar (UDS) with a source term that depends on the horizontal coordinate X (no convection, no diffusion). As a test, I have written the following source term that once compiled generates a non-continuous output showing a staircase behavior at fixed intervals of 1 m. I expected a continuous behavior so I do not know what is wrong here.

      #include "udf.h"

      DEFINE_SOURCE(source_test,c,t,dS,eqn)

      {

      real x[ND_ND];

      real source;

      {

      source = x[0];

      dS[eqn] = 0.;

      }

      return source;

      }

    • tpsagaro
      Subscriber
      Solved:nThere should be a:nC_CENTROID(x,c,t); nbelow the: real source; linenAnd initialize the case.n
    • Karthik R
      Administrator
      Glad you were able to resolve. Thank you for posting the answer.nKarthikn
Viewing 2 reply threads
  • You must be logged in to reply to this topic.