|
[Sponsors] |
January 11, 2017, 16:25 |
Density UDF Divergence
|
#1 |
Member
Join Date: Jun 2016
Posts: 64
Rep Power: 10 |
Hello all.
I am attempting to use a UDF to define a density that changes every iteration. However, the code I am using results in a x-momentum divergence error upon the first iteration. I created a fresh Fluent setup with the only changes from default being using the transient solver and the following UDFs for initialization and material density (hooked correctly of course): Code:
#include "udf.h" #define thread_ID 2 /* thread ID of the fluid cell zone */ #define rho_water 997 /* density of water */ DEFINE_INIT(initialize, d) { Thread *t = Lookup_Thread(d, thread_ID); cell_t c; begin_c_loop(c, t) { C_UDMI(c, t, 0) = 1; } end_c_loop(c, t) } DEFINE_PROPERTY(density, c, t) { real Y_water = C_UDMI(c, t, 0); real rho_f = rho_water * Y_water; return rho_f; } Code:
real Y_water = 1.0; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Divergence detected in AMG solver: k when udf loaded | google9002 | Fluent UDF and Scheme Programming | 3 | November 8, 2019 00:34 |
Interpret-Real Gas UDF | ndabir | Fluent UDF and Scheme Programming | 3 | November 18, 2015 08:29 |
Error using UDF to modify density | NRD | FLUENT | 1 | July 13, 2011 08:35 |
density UDF problem | wanghuiru | FLUENT | 0 | August 18, 2008 08:35 |
UDF: Density Cell Gradient Vector Macros | matteo | FLUENT | 0 | December 1, 2007 13:14 |