|
[Sponsors] |
April 7, 2015, 15:38 |
UDF, gradient
|
#1 |
Member
Join Date: Dec 2014
Posts: 38
Rep Power: 12 |
Dear collegues,
I want to calculate for UDS source term formula like this: is the scalar solved for the UDS transport equation. In Fluent units for source in UDS are in this case is used as a unit for scalar I assumed this equation could by written like that: so I wrote a UDF (shown below) and I am not sure if I can use a gradient of UDSI like that. In Fluent in Solution Controls -> Equations I deselected equation for User Scalar 1, User Scalar 0 is selected. This part is put in DEFINE_ADJUST thread_loop_c (t,super_domain) { begin_c_loop_all (c, t) { t01 = THREAD_SUB_THREADS(t); /*this part is used only to show fluent proper phase */ t02 = t01[0]; t03 = t01[1]; C_UDSI(c,t03, 1) = C_VOF(c,t03); /* C_UDSI(c,t03,0) is a phi for which I want to calculate source term */ C_UDMI(c,t03,1) = 5*C_R(c, t03)*C_UDSI(c,t03,0)*(C_U(c,t03)* C_UDSI_G(c,t03,1)[0]+C_V(c,t03)* C_UDSI_G(c,t03,1)[1]+C_W(c,t03)* C_UDSI_G(c,t03,1)[2])/3; } end_c_loop_all (c,t) } and then in DEFINE_SOURCE in return I put value of C_UDMI calculated in DEFINE_ADJUST. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wall shear stress gradient udf | Andrew | FLUENT | 3 | April 4, 2018 02:36 |
UDF for temperature gradient | mariam.sara | Fluent UDF and Scheme Programming | 8 | March 7, 2018 22:01 |
The gradient of void fraction in UDF | summer | FLUENT | 2 | May 20, 2011 04:34 |
UDF temp gradient tutotial | tejasvikrishna | FLUENT | 0 | April 4, 2011 12:10 |
Gradient in UDF | summer | FLUENT | 0 | September 1, 2006 14:50 |