|
[Sponsors] |
calculate dot product of two gradient vector in UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 28, 2014, 09:49 |
calculate dot product of two gradient vector in UDF
|
#1 |
Member
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 16 |
Hello all,
I would like to calculate this k.w (k is gradient of the kinetic energy and w is the gradient of the specific dissipation rate) for each cell. Can you tell me how should write it in UDF? I used several ways to compute the dot product multipler like as: #include "udf.h" #include "math.h" DEFINE_ON_DEMAND(grad) { Domain *domain=Get_Domain(ROOT_DOMAIN_ID); cell_t c; Thread *t; real s7; thread_loop_c(t,domain) /*loops over all cell threads in domain*/ { begin_c_loop(c,t) /* loops over cells in a cell thread */ { s7=C_K_G(c,t)[0]*C_O_G(c,t)[0]+C_K_G(c,t)[1]*C_O_G(c,t)[1]+C_K_G(c,t)[2]*C_O_G(c,t)[2]; Message("Gradient of k and w in a cell are: (%f) \n", s7); } end_c_loop(c,t) } } |
|
February 28, 2014, 14:32 |
|
#2 | |
Member
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 16 |
The problem is solved now. Actually, it needs to active solve/se/expert and let to software to save all gradient data.
Thanks all Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for time-mean temperature gradient | nenazarian | Fluent UDF and Scheme Programming | 1 | November 12, 2012 04:30 |
The gradient of void fraction in UDF | summer | FLUENT | 2 | May 20, 2011 04:34 |
Possible Bug in double dot product ampamp operator | david_h | OpenFOAM Bugs | 1 | September 14, 2007 16:58 |
UDF sample for velocity gradient | J.Y.Shin | FLUENT | 2 | January 19, 2007 19:04 |
how to calculate two vectors's product when using | xqy | Phoenics | 0 | August 23, 2002 04:05 |