Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

CFX solver crash due to Fortran subroutine during particle tracking simulation

    • Pieter Verboven
      Subscriber

      I am currently working on modeling a multiphase flow problem with particle tracking using ANSYS. I used a fortran subroutine for particle/water droplet injection methods or particle injection region. This fortran code is used to define/determine the particle/water droplet position/location and velocity by random generating them.  This Fortran code was previously used by our college 12 years ago for similar simulations without any issues. However, when I tried to use the same code in my current simulation, the CFX solver crashes after either 40 iterations or at the 4th iteration of particle calculation with error code 194.

      I have identified that the error is being caused by a specific part of the Fortran code, which is shown below. The simulation run without any problem when I modify the P value which used to calculate R2 as: P=(ztemp/xtemp*3.14) or by dividing P by 3 and using a higher number or by multiplying R2 by 1.5 or a higher number while keeping the same P as it is original code. This R2 value used as to determine when to injection the particle as shown in the below fortran code.  However, these modifications result in a rectangular spray pattern or flow rate distribution on the ground, whereas the desired shape should be spherical. Therefore, I need to keep the P or R2 value as it is. Could you please help me to resolve this issue? Why is the Fortran code, which previously worked 12 years ago, not working for the current simulation? Could this be due to the ANSYS version I am using (Ansys 2023R1), or do I need to modernize the Fortran code to the Fortran 90 or 95 version?

      Thank you for your help in advance.

    • Surya Deb
      Ansys Employee

      Hello, 

      Can you check if xtemp is somehow getting assigned a value of zero? If so, then division by zero will cause a crash. You can try adding a very small number in denominator like ztemp/(xtemp+1e-20).

      Regards,

      SD

      • Pieter Verboven
        Subscriber

        Thank you for your response and suggestion. I have checked and verified that the value of xtemp is not being assigned zero at any point in the code. I also tried by adding smaller number in the denominator. Therefore, division by zero is not the issue here.

        As mentioned, I have found that modifying the value of P or R2 resolves the crashing issue, but it results in a rectangular spray pattern rather than the desired spherical shape. I am hoping to find a solution that allows me to keep the original values of P and R2 while achieving the desired spherical shape. I was wondering if it might be possible to obtain a user routine for a flat fan nozzle in order to define injection region?

        If you have any other suggestions or insights, please let me know.

        Best regards

    • rfblumen
      Ansys Employee

      Since it's not possible to debug the code while it's running in the CFX solver, I would add write statements to either write to a file or to the console.  I would monitor the expressions in question to see what is happening near and when the solver crashes.  This will give a better idea of what's happening in the code.

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