TAGGED: define-source, numerical-instability, udf
-
-
January 22, 2026 at 2:06 am
James411project
SubscriberHello everyone!
I used DEFINE_SOURCE to define mass, momentum, and energy source terms. I am now encountering convergence difficulties. After investigation, it seems the issue may be that I did not linearize the source terms. In the calculation, I specified them as explicit: dS[eqn] = 0. I am now planning to address the problem through source term linearization, but my source terms are very complex, making it difficult to derive the derivatives of the source terms with respect to the solution variables. In this case, how should I specify dS[eqn]? Additionally, I have observed that even with dS[eqn] = 0, convergence can be achieved for positive source terms, but it fails for negative source terms.
Thank you very much for your time and assistance!
-
January 22, 2026 at 4:14 pm
jcooper
Ansys EmployeeHi James:
What are the expressions for source terms you are trying to linearize? Note that source coefficients (carried in dS[eqn]) must always be negative in order for linearization to work. This can often be achieved by rearranging the source expression.
Source linearization doesn't always have to use the derivative. Sometimes you can use S/(phi - SN) , where S is the source expression, phi is the solved variable and SN is a small number< 1.0e-08. (This works best for species with negative source terms.) The source coefficient formulation works because it grows as phi is depleted, allowing the source term to become more strongly enforced and fight off numerical over and undershoots.
For more information, I suggest you take a look at the following resource, which is old, but still a valuable classic. It covers numerics and source linearization in detail.
https://catatanstudi.wordpress.com/wp-content/uploads/2010/02/numerical-heat-transfer-and-fluid-flow.pdf
Regards,
Judy
-
January 23, 2026 at 3:27 am
James411project
SubscriberThank you for your professional response and suggestions. I am currently working on the non-equilibrium condensation of wet flue gas, which requires simultaneously considering water vapor condensation and evaporation, nucleation and growth processes, and the partial pressure effects of non-condensable gases.
In this model, I have defined the gas-phase mass, momentum, and energy source terms, along with the source terms for the droplet number transport equation and liquid mass fraction. I attempted to differentiate these source terms with respect to the solution variables. While I successfully obtained analytical derivative expressions for the other terms, the energy source term proved difficult to resolve analytically due to the complex growth rate expressions and temperature-dependent thermodynamic properties involved. Although I previously considered using numerical differentiation, I have decided to adopt your suggestion.
-
-
- 您必须登录才能回复此主题。
- Application of EDC occurs flame extinguishing
- 用EDC计算发现燃料不能顺利喷出
- 热仿真计算收敛
- Must EDC model need an initial flow field?
- Compile the UDF code and apply it to the DPM.
- Please help me check if there are any issues with the UDF.
- Negative droplet growth rate in Fluent wet steam model
- Difficulty in Complex Source Term Linearization
-
4934
-
1638
-
1386
-
1242
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.