TAGGED: define-source, linearization, udf
-
-
May 23, 2025 at 3:55 pm
karam.aljeratli
SubscriberHello,
I am using UDFs with various Source Terms that affect species and UDS values (evaporation/condensation for example). As there are various phenomena being simulated, some Scalars and Species have several Define_Sources hooked. These Source Terms are each Linearized and i have made sure extensively that the linearizations are accurate; however, the scalars and species equations are still not stable due to the non-linear source terms. Is addition of the source terms and linearization of their sum (as opposed to each single one seperately) a more suitable approach? Below are very simplified examples of what i mean:
Approach 1:
Define_Source(source_1,c,t,dS,eqn){
source = -1.0 * C_YI(c,t,H2O);
dS[eqn] = -1.0;
return source;
Define_Source(source_2,c,t,dS,eqn){
source = -1.0 * C_YI(c,t,H2O) * C_YI(c,t,H2O);
dS[eqn] = -2.0 * C_YI(c,t,H2O);
return source;
Aproach 2 (Both Sources Added and linearized Together)
Define_Source(source,c,t,dS,eqn){
source = -1.0 * C_YI(c,t,H2O) - 1.0 * C_YI(c,t,H2O) * C_YI(c,t,H2O);
dS[eqn] = -1.0 - 2.0 * C_YI(c,t,H2O);
return source;
Conceptually, it seems both approaches are equivalent, however i suspect that the solver is not treating the linearization properly using the first approach, as the stability is very bad without underrelaxation which really slows down my solution. As this is not discussed in the manuals i thought i could ask here for guidance regarding this issue.
Sorry for the long post and thank you for your assistance 😃 -
May 29, 2025 at 1:38 pm
Rob
Forum ModeratorI'd use the combined approach. I assume you're sinking/sourcing mass and energy to ensure everything balances?Â
-
June 2, 2025 at 4:15 am
Rajat Chaudhari
Ansys EmployeeHi Karam,
For each scalar quantity, there will be one corresponding source term, so all source terms should be summed and treated using a combined approach.
If the source terms pertain to a species like Hâ‚‚O, a corresponding mass source term must also be included.
If the source term is associated with a User-Defined Scalar (UDS), linearization has minimal impact, provided the source term is not a function of the UDS itself.
-
- You must be logged in to reply to this topic.
- JACOBI Convergence Issue in ANSYS AQWA
- Is it able to solve turbomachinery using density-based solver in Fluent?
- Two-way FSI simulation
- Ensight Force_per_unit area_EV
- RIBBON WINDOW DISAPPEARED
- Fluent Meshing Error when .dsco not .stp
- Ansys Fluent for modelling Ocean Wave reactions to Wave Barriers
- Battery Pack cooling
- ISAT ABORT error
- UNASSIGNED INTERFACE ZONE DETECTED FOR INTERFACE…
-
4597
-
1495
-
1386
-
1209
-
1021
© 2025 Copyright ANSYS, Inc. All rights reserved.