Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

SIGSEGV error in hydrogen adsorption-desorption simulation with UDFs

    • u1903003
      Subscriber

      Hello,

      I am trying to simulate the adsorption-desorption process of hydrogen in activated carbon using ANSYS Fluent (student version). My simulation involves 4 user-defined scalars (UDSs). The initialization step completes successfully without any issues. Also, my User-Defined Functions (UDFs) compile without errors.

      However, when I try to run the simulation, it stops immediately, and the following message appears in the console:
      Updating solution at time level N...
      done.

      iter continuity x-velocity y-velocity energy k epsilon uds-0 uds-1 uds-2 uds-3 time/iter

      ==============================================================================

      Node 1: Process 5678: Received signal SIGSEGV.

      ==============================================================================

      ==============================================================================

      Node 2: Process 15482: Received signal SIGSEGV.

      ==============================================================================

      ==============================================================================

      Node 0: Process 19840: Received signal SIGSEGV.

      ==============================================================================

      ==============================================================================

      Node 3: Process 21612: Received signal SIGSEGV.

      ==============================================================================

      ===============Message from the Cortex Process================================

      Fatal error in one of the compute processes.

      ==============================================================================
      I am running this simulation on a system with the following specifications:
      16 GB RAM
      Intel Core i7 13th Gen processor
      Could this error be related to how my UDFs or UDSs are implemented?
      Could this issue be related to hardware limitations or Fluent's student version restrictions?
      I would appreciate any guidance on resolving this problem.

    • Rob
      Forum Moderator

      It's likely the UDF and UDS, I assume you did set sufficient UDS memory? 

      • u1903003
        Subscriber

        hi Rob,

        Thank you for your reply. I set 4 UDS before compiling the UDF, but I am still encountering the same types of errors. I suspect there might be an issue with how pressure is being calculated.

        In my UDF, I am using the following line:  P = C_P(c, t) + RP_Get_Real("operating-pressure") 

        The initial and inlet pressure are set at 0.04858 MPa, while the operating pressure is defined as 10 MPa.The pressure is expected to rise quickly, but in my case, it decreases rapidly and even becomes negative. Due to this negative pressure, I am unable to obtain the value of usdi(c, t, 0).

        Below is the portion of the UDF that I am currently using

        DEFINE_ADJUST(adsorption, domain) {
            Thread *t; 
            cell_t c; 
            real E, A, P;
         
            thread_loop_c (t, domain) {
                begin_c_loop (c, t) {
                    real tem = C_T(c, t);
                    P = C_P(c, t) + RP_Get_Real("operating-pressure");
                    E = 3080 + 18.9 * tem;
                    A = 8.31429 * tem * log(1.47E9 / P);
                    C_UDSI(c, t, 0) = 71.6 * exp(-A * A / (E * E));
                }
                end_c_loop (c, t)
            }
        }
        DEFINE_ADJUST(q_ads, domain) {
            Thread *t; 
            cell_t c;
            real dt;
            
            thread_loop_c(t, domain) {
                begin_c_loop(c, t) {
                    dt = RP_Get_Real("physical-time-step");
                    C_UDSI(c, t, 1) = C_UDSI_M1(c, t, 1) + 0.15 * dt * (C_UDSI_M1(c, t, 0) - C_UDSI_M1(c, t, 1));
                }
                end_c_loop(c, t)
            }
        }
         
    • Rob
      Forum Moderator

      Check your boundary conditions are suitable, and I'd consider adding a trap to ensure the UDF can always return a value. That way if something does go wrong you can diagnose the case without it crashing. 

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