Atharva Nagarkar
Ansys Employee


As Ansys employees, we cannot debug UDFs on this platform. However, can you share more details about the error you receive when you run the solution? 

One possible issue could be with the C_UDMI macro. You can use the C_UDMI macro to access or store the value of the user-defined memory in a cell. It can be used to allocate up to 500 memory locations in order to store and retrieve the values of cell field variables computed by UDFs. If the number of field variable values to be stored exceed 500, you may receive a memory storage error. Please find the link from the Ansys UDF Manual for this macro below.

Additionally, I have attached links from the Ansys UDF Manual for the DEFINE_SOURCE, DEFINE_EXECUTE_ON_LOADING and Gradient macros. Please ensure that you have appropriately used these macros.

DEFINE_SOURCE - 2.3. Model-Specific DEFINE Macros ( -> Check section 2.3.43

DEFINE_EXECUTE_ON_LOADING - 2.2. General Purpose DEFINE Macros ( -> Check section 2.2.6

Gradient - 3.2. Data Access Macros ( -> Check section

C_UDMI - 3.2. Data Access Macros ( -> Check section

If you are not able to access the link, please refer to this forum discussion: Using Help with links (