Right way to access species gradients in a VOF problem?

    • shitizsehgal

      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 only way but if you want top rely on the supported way then you need to follow the description in the Fluent customization manual. Once you did that then you can access the gradients everywhere without the need to allocate anything.
Viewing 1 reply thread
  • You must be logged in to reply to this topic.