|
[Sponsors] |
July 24, 2014, 11:03 |
Set UDS on wall...
|
#1 |
Senior Member
Phoevos
Join Date: Mar 2009
Posts: 104
Rep Power: 17 |
Hi to everyone,
I am trying to calculate the material derivative of a quantity in the near wall vicinity (i.e. at the 1st cell from the wall) and, for post processing reasons, I want to plot it on the wall surface. The simulation is mixture multiphase, with 2 phases. So I built the following UDF: Code:
DEFINE_ADJUST(calculate_dadt,d) { real time_step, dvofdt_e, dvofdt_m; int n; Thread *t, *tf; cell_t c; face_t f; d = Get_Domain(1); /* mixture domain if multiphase */ time_step = CURRENT_TIMESTEP; thread_loop_c (t,d) { begin_c_loop(c,t) { C_UDSI(c,t,2) = 0; dvofdt_e = (C_UDSI(c,t,0)-C_UDSI_M1(c,t,0))/time_step; dvofdt_m = dvofdt_e +C_U(c,t)*C_UDSI_G(c,t,0)[0] +C_V(c,t)*C_UDSI_G(c,t,0)[1] +C_W(c,t)*C_UDSI_G(c,t,0)[2]; C_UDSI(c,t,2) = dvofdt_m; /* set UDS on the wall */ c_face_loop(c,t,n) { tf = C_FACE_THREAD(c,t,n); f = C_FACE(c,t,n); if (THREAD_ID(tf) == 8) { F_UDSI(f,tf,2) = C_UDSI(f,tf,2); } } } end_c_loop(c,t) } } I have to mention that, since I do not want to solve for the UDS, but only to calculate gradients, I exclude it from Solution Controls -> Equations, however I hook the above UDF as a DEFINE_adjust UDF. Does anyone have any idea how can I instruct Fluent to copy the cell values of the desired UDS on selected wall boundaries? Thanks in advance.. |
|
July 24, 2014, 22:48 |
|
#2 |
Senior Member
|
First of all,
Code:
F_UDSI(f,tf,2) = C_UDSI(f,tf,2); Code:
F_UDSI(f, tf, 2) = C_UDSI(c, t, 2); Code:
Lookup_Thread, F_C0, THREAD_T0 |
|
July 25, 2014, 06:57 |
|
#3 |
Senior Member
Phoevos
Join Date: Mar 2009
Posts: 104
Rep Power: 17 |
Blackmask you are absolutely right!
I was confused with the thread/cell/face indexes that's way it did not work. Now it works as it should! I will think about implementing it the way you proposed, instead of looping all cells... Thanks a lot. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
correction of Grub after installing Windows XP and 8 | immortality | Lounge | 20 | January 5, 2014 18:41 |
[snappyHexMesh] determining displacement for added points | CFDnewbie147 | OpenFOAM Meshing & Mesh Conversion | 1 | October 22, 2013 10:53 |
Help with GNUPlot | Renato. | Main CFD Forum | 6 | June 6, 2007 20:51 |
UDS flux through wall and interior face. | shuqin | FLUENT | 2 | July 29, 2006 04:54 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |