Fluids

Fluids

C_VOLUME(c,t) crashes for parallel run

    • Ales23
      Subscriber

      Dear all,

      I am trying to parallelize my calculation. However, I am facing a problem with a cell macro:

      I have following code:

      begin_c_loop_int(c,t)

      {

      Message("%e ",C_VOLUME(c,t));

      }

      end_c_loop_int(c,t)

      For this simple code the simulation crashes. If I want to display C_P(c,t), it works.

      Important note: It is 2D simulation.

      Thank you for your help

    • Karthik R
      Administrator
      Hello Can you please try running a script from the Fluent customization manual to make sure this is not a systems-related issue? Also, what is the objective of your UDF?
      Karthik

    • Ales23
      Subscriber
      thank you. in the end I found the error. I excess a wrong thread
    • Karthik R
      Administrator
      Awesome! Good luck with your projects.
    • alexandra17
      Subscriber
      Hi! I kind of have the same issue here and I do not think it relates with the thread. Every time I introduce the macro C_VOLUME my code crashes. I need to determine the volume of each cell in order to calculate the partial pressure. I have a one phase mixing model with two species air and water vapors. I narrowed down my code to this C_Volume thing because it refuses to work. Every time I insert this I get the sigsegv error. Does anyone has any idea what I am missing here pretty please?
      #include "udf.h"
      #include "mem.h"
      DEFINE_ON_DEMAND(mass)
      {
      Domain *d = Get_Domain(1);
      Thread *t;
      cell_t c;
      real vol;
      begin_c_loop(c,t)
      {
      vol = C_VOLUME(c,t);
      Message("%e\n", vol);
      }
      end_c_loop(c,t)
      }
    • Ales23
      Subscriber
      you are not assigning a thread. You have only declared add t=Lookup_Thread(ID,d);
      ID is equal to the domain zone
    • alexandra17
      Subscriber
      Hi Ales23! Thank you for your response! I've done that already as I am interested in a certain zone in my domain. The error remains the same. :(
    • alexandra17
      Subscriber
      I have checked to make sure the ID number corresponds to the zone I want and it does. The code I created works fine as long as I do not introduce the C_VOLUME macro.
    • Ales23
      Subscriber
      but in your code t=Lookup_Thread() is missing as I can see
    • alexandra17
      Subscriber
      I attach my code with the Lookup_thread that I missed. The error remains the same. The ID number is fine. I have checked it already.
      #include "udf.h"
      #include "mem.h"
      DEFINE_ON_DEMAND(mass)
      {
      Domain *d = Get_Domain(1);
      Thread *t;
      int ID = 5;
      t = Lookup_Thread(d, ID);
      cell_t c;
      real vol;
      begin_c_loop(c,t)
      {
      vol = C_VOLUME(c,t);
      Message("%e\n", vol);
      }
      end_c_loop(c,t)
      }
    • Ales23
      Subscriber
      are you using interior ID or cell zone condition?
    • alexandra17
      Subscriber
      I am using the ID from a Boundary Condition, I guess that means that is interior ID right?
    • Ales23
      Subscriber
      you have to use the one from Cell conditions
    • alexandra17
      Subscriber
      Oh I see! Thank you very much! It works fine now. However, this is not what I intended. Could you please tell me how to determine the cell volumes for a certain boundary area? I need to calculate the condensation rate on a window in a room.
    • Rob
      Ansys Employee
Viewing 14 reply threads
  • You must be logged in to reply to this topic.