Fluids

Fluids

Right way to access species gradients in a VOF problem?

    • shitizsehgal
      Subscriber
      Hi,

      I am interested in using species gradient of one of the species in a mixture. I am trying to find the 'right' and accurate way to access species gradient in ANSYS Fluent. A quick web search tells me that a common way to do that is:
      1. Type (rpsetvar 'species/save-gradients? #t)
      2. Write a DEFINE_ADJUST udf to access gradients. This UDF has Alloc_Storage_Vars commands that can be typically used for any scalar including Volume fraction, temperature, and species (my guess).

      I have been able to access Volume fraction and Temperature gradients using DEFINE_ADJUST UDF and validate the results for a condensation problem. I used DEFINE_SOURCE UDFs to write energy and mass source terms.

      Now, I am interested in a problem that considers species gradients. My question is:
      1. Is DEFINE_ADJUST the only way? I tried to run a fluid flow simulation to access the gradients using DEFINE_ADJUST and was able to access them. However, saving the cas and data and running the simulaton after re-opening saved cas and data files leads to SEGMENTATION faults. To avoid this, I have unload and load the UDF with species gradients and then run my simulation.

      Can someone please tell me as to how can I prevent this problem? I didn't face any issues when working with temperature and volume fraction gradients using the same UDF. Any help will be appreciated.
    • DrAmine
      Ansys Employee
      There is no unique way but I recommend to follow the steps described in the official Anys Fluent Customization manual to access gradients in general and espcially species gradients. One you follow that you have the gradients of species without the need to allocate anything.
    • DrAmine
      Ansys Employee

      Any updates.

    • shitizsehgal
      Subscriber

      I just saw your comment today because I didn't get any notification that someone had commented on the post. I will try your suggested way and comment here to update you. So, if I understand it correctly, you are suggesting that I use the method in Fluent Customization Manual and access the gradients in UDF as needed without writing the DEFINE_ADJUST UDF? Is that what you are saying?

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