Fluids

Fluids

UDF execution problem in Porous media tutorial of FLUENT

    • vinaychandrakar11
      Subscriber

      Hi Everyone,

      I am trying to simulate the 2D (planar) domain consists of a 90-degree bend. The duct has a porous region covers the bottom and right-hand wall, and the reaction takes place in the porous region only.

      This problem is from the FLUENT UDF tutorial . link for the problem is given below.

      https://www.afs.enea.it/project/neptunius/docs/fluent/html/udf/node246.htm

      Code for reaction rate mentioned in the tutorial is

      /******************************************************************
      rate.c
      Compiled UDF for specifying a reaction rate in a porous medium
      *******************************************************************/
      
      #include "udf.h"
      
      #define K1 2.0e-2
      #define K2 5.
      
      DEFINE_VR_RATE(vol_reac_rate,c,t,r,mole_weight,species_mf,rate,rr_t)
      {
        real s1 = species_mf[0];
        real mw1 = mole_weight[0];
      
        if (FLUID_THREAD_P(t) && THREAD_VAR(t).fluid.porous)
          *rate = K1*s1/pow((1.+K2*s1),2.0)/mw1;
        else
          *rate = 0.;
      
        *rr_t = *rate;
      }
      

      My problem is that I am not able to compile this code and its showing error in the line shown below.

      if (FLUID_THREAD_P(t) && THREAD_VAR(t).fluid.porous)

      As per the problem shown in the tutorial, reaction happens only in the porous zone and above line which is showing error makes sure that its taking porous domain only. But I am not getting why its showing error in this line.

      Can anyone help me with this?

      Thanks in Advance.

    • DrAmine
      Ansys Employee
      Error message?
    • vinaychandrakar11
      Subscriber
      Its showing that "structure reference not implemented". (for "interpreted" option)
      After that I tried to "compile" it but its showing below mentioned error
      and when I used "built in compiler" , its showing that ud._iol.h file not found.


    • vinaychandrakar11
      Subscriber
      Hi Everyone, Problem is resolved now. There are two problems.
      1) It reads only ".c" File not ".C" file.
      2) I am able to compile the UDF with command prompt in my windows system. But unable to do it directly.
    • DrAmine
      Ansys Employee
      Try compiling a dummy Hello World UDF (DEFINE_ON_DEMAND) without reading any Fluent case file.
Viewing 4 reply threads
  • You must be logged in to reply to this topic.