Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Source Term Linearization

    • karam.aljeratli
      Subscriber

      Hello,

      I am using UDFs with various Source Terms that affect species and UDS values (evaporation/condensation for example). As there are various phenomena being simulated, some Scalars and Species have several Define_Sources hooked. These Source Terms are each Linearized and i have made sure extensively that the linearizations are accurate; however, the scalars and species equations are still not stable due to the non-linear source terms. Is addition of the source terms and linearization of their sum (as opposed to each single one seperately) a more suitable approach? Below are very simplified examples of what i mean:
      Approach 1:
      Define_Source(source_1,c,t,dS,eqn){
      source = -1.0 * C_YI(c,t,H2O);
      dS[eqn] = -1.0;
      return source;

      Define_Source(source_2,c,t,dS,eqn){
      source = -1.0 * C_YI(c,t,H2O) * C_YI(c,t,H2O);
      dS[eqn] = -2.0 * C_YI(c,t,H2O);
      return source;

      Aproach 2 (Both Sources Added and linearized Together)
      Define_Source(source,c,t,dS,eqn){
      source = -1.0 * C_YI(c,t,H2O) - 1.0 * C_YI(c,t,H2O) * C_YI(c,t,H2O);
      dS[eqn] = -1.0 - 2.0 * C_YI(c,t,H2O);
      return source;

      Conceptually, it seems both approaches are equivalent, however i suspect that the solver is not treating the linearization properly using the first approach, as the stability is very bad without underrelaxation which really slows down my solution. As this is not discussed in the manuals i thought i could ask here for guidance regarding this issue.

      Sorry for the long post and thank you for your assistance 😃

    • Rob
      Forum Moderator

      I'd use the combined approach.  I assume you're sinking/sourcing mass and energy to ensure everything balances? 

    • Rajat Chaudhari
      Ansys Employee

      Hi Karam,

      For each scalar quantity, there will be one corresponding source term, so all source terms should be summed and treated using a combined approach.

      If the source terms pertain to a species like Hâ‚‚O, a corresponding mass source term must also be included.

      If the source term is associated with a User-Defined Scalar (UDS), linearization has minimal impact, provided the source term is not a function of the UDS itself.

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