Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Surface Reaction: UDF: Ansys Fluent Error – reg

    • sudeepns.197me025
      Subscriber

      Dear Ansys Community,

      Greetings of the day!


      As discussed before, I am carrying out surface reactions for steam methane reforming reactions and for this purpose, I am employing UDF. 

      The UDF file gets imported without any error; I load the library and hook the UDF. However, I am getting this error while running the surface reaction, 'Node 24: Process 20840: Received signal SIGSEGV'. 
       
      Requesting you to give the possible points to troubleshoot this error. 
       
      I am attaching the screenshots of UDF and .trn files for your reference. 
       
      Looking forward to hearing from you. 
       
       
       
       
       
    • Rob
      Forum Moderator

      There looks to be something else in the console just above the errors. What does that say? A SIGSEV often means some data is missing so check the set up. 

    • sudeepns.197me025
      Subscriber

      Dear Sir, Thank you for the reply. 

      As per my understanding, I have given all the data. 

      Please, let know, what data might be missing?

      As I am focusing on surface reaction, I have given NO volumetric reactions. 

    • Rob
      Forum Moderator

      And the lack of gas phase reactions in intentional?  What is reported at iterations 8070 to 8077 (the code has failed at the update to 8088). 

    • sudeepns.197me025
      Subscriber

      Hello Sir, 
      1. Before the code failed, I was running cold flow. After that, I switched on the surface reaction, and an error appeared. 

      2. Yes, I don't use gas phase reactions in my model. Only surface reaction. 

      Please Let me know, with respect to my error, what are the parameters I have to look into to solve the error. 

    • Rob
      Forum Moderator

      Can you move to warm flow before turning on the reactions? Does the UDF have calls for any data that's not already in the model? Note, I've not read the code and won't be doing so, the wider community are free to comment though. 

    • thamilmani
      Subscriber

      From just skimming your code, I assume the error could be from

      C_P(f, t) 

      You are trying to access a cell macro using face_t 

      Just like how Rob mentioned, I think UDF has no access to some data that you are trying to use!? So C_P(f, t) could be one.

    • Rob
      Forum Moderator

      Good spot  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v242/en/flu_udf/flu_udf_DataAccessMacros.html%23flu_udf_FaceVariableMacros

       

    • sudeepns.197me025
      Subscriber

      Yeah, Thank you for the reply. 
      I had changed that (Cell to Face) and tried to run the Surface reaction CFD. 

      The surface reaction is not happening. 

      • thamilmani
        Subscriber

        But no more SIGSEGV error?

        See, I didn't get to see your code logic. Now that the code is without errors.

        Plot your reaction rate and see the values are in your expected range!?

    • sudeepns.197me025
      Subscriber

      Yes, no more SIGSEGV error. 

      As soon as I turn on the surface reaction, the residuals of CH4, CO2, Energy, and Continuity nearly shoot up to e+30 and apparently, I receive a Floating point error. 
      (Note: I turn on the Surface reaction in the Porous Zone)

      To overcome that error, now I am running simulation by keeping Volumetric reaction in porous zone and utilizing UDF for surface reaction. As per my observation after 20K iterations (2000 time steps with 10 iterations), I found surface reaction is not happening even though I am using UDF. 

    • Rob
      Forum Moderator

      Which suggests that something isn't hooked up correctly or that the UDF isn't being triggered due to something in the definitions in the code. 

    • sudeepns.197me025
      Subscriber

      Hello sir, 

      Is there any way to get to know this "UDF isn't being triggered due to something in the definitions in the code"

      This is my updated UDF




    • Rob
      Forum Moderator

      Read through what you're calling from Fluent, and then what the UDF should return. You may need to add the UDF returns to a UDM and see what's going on at each stage. 

    • sudeepns.197me025
      Subscriber

      Sir, According to my best of the knowledge, the fluent solver is not considering the UDF while solving the surface reaction. 

    • Rob
      Forum Moderator

      Not considering (ie not hooked up) or not triggering (threshold for species, temperature or whatever)? Hence using UDMs to see what's going on. 

    • sudeepns.197me025
      Subscriber

      Sir, thank you for the hint. Now, I am using UDM and will update the result once the simulation is completed. 

    • Rob
      Forum Moderator

      No need to run to completion, you just need enough iterations/time steps to see whether anything is happening. 

    • sudeepns.197me025
      Subscriber

      Sir, As per the observation, there is no information available for UDM after the completion of 50% of the simulation. 
      This indicates that the Fluent does not identify UDF for the surface reaction. 

      To further clarify, I am using the Ansys 2024 R1 version and, hence, additional compiler tools, such as Visual Studio, I am not using. 

      To compile the UDF, I am following these steps, If I am wrong, kindly guide me. 
      1. I am sving the UDF in .c format
      2. Using the Compiler command, I will import it to the fluent environment and build it, and further, I will load it. 
      3. I will hook it with the argument name given in the UDF code. 
      4. Initialize and run the simulation. 
      5. If UDM is used, I will allocate a memory value of 10.

      Please let me know, what to be done to trigger the UDF.

    • Rob
      Forum Moderator

      What triggers the UDM call? If I set a trigger as IF time>1500.s and only run to 800. s the UDF may be correctly hooked but won't show anything as the IF statement isn't satisfied. Assuming you have checked the triggers, start replacing some of the calculated values with constants: you need to find if the UDF result is "nothing happens", if it's not triggered or if you've made an error in the maths. Staff will not debug code, and given the quantity of code & images giving it a quick once over isn't practical. 

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