Konstantine Kourbatski
Ansys Employee

Hello,


This is always a significant challenge to deal with strong explicit nonlinear sources added through a UDF. As abenhadj pointed out, linearization of this complex source implementation is not possible in the framework of the Fluent's UDFs.


My suggestions are as following:


1) save source components into user defined memories in DEFINE_ADJUST by looping over all the cells in the fluid thread. This will make the source components available for post-processing. Don't apply sources to the equations yet


2) use if(first_iteration) in DEFINE_ADJUST to retain information only at the 1st iteration of the subiterative loop 


3) post-process the source UDMs to confirm they are what you are expecting. Using a simple canonical problem where sources can be analytically calculated would help with comparison 


4) apply sources, but with a small value multiplier to artificially reduce their magnitude. This will help you establish stability limits on the source magnitude


5) apply source relaxations, i. e.


source = alpha * source_current_iteration + (1 - alpha) * source_prev_iteration


where 0 <= alpha < = 1


Slow ramp up of source magnitude (4) and applying source relaxation (5) can potentially help to stabilize the solution.


6) apply this together with under-relaxing equations to which the sources are applied to.


Other than that, there is little else I can think of, other than some implicit source implementation, which unfortunately cannot be done in the framework provided by Fluent.