CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Defining source terms at the wall located between two fluids (https://www.cfd-online.com/Forums/fluent/196686-defining-source-terms-wall-located-between-two-fluids.html)

e_cfd December 12, 2017 09:10

Defining source terms at the wall located between two fluids
 
2 Attachment(s)
Dear all,

I have tried to define source terms on a wall (which is a BC with zero thickness and located between two fluids) using F_C0 and F_C1 but the results are strange. I mean I want to have a fixed value of 500 on the top and -500 on the other side of the wall, but what I get is a range of [0 500] on the top and [-500 0] on the downside at two adjacent mesh cells (I need to define source terms on the very first mesh cells at the wall)!
Any help and suggestions are appreciated (or any alternative ways to define source terms). :)

My UDF code:

#include "udf.h"
DEFINE_ADJUST(a_source,domain)
{
Domain *d;

face_t f;
cell_t c;
Thread *t;
cell_t c0;
Thread *t0;
cell_t c1;
Thread *t1;

real source=500;
real sink=-500;

d = Get_Domain(1); /* it should be defined to point to the mixture level */

t = Lookup_Thread(d,3); /* the wall ID is 3 */


begin_f_loop(f,t)
{

c0 = F_C0(f,t); /* wall-up side */
t0 = THREAD_T0(t);

c1 = F_C1(f,t); /* wall-down side :
t1 = THREAD_T1(t);

C_UDMI(c0,t0,0)= source;
C_UDMI(c1,t1,1)= sink;

}


end_f_loop(f,t)

}

e_cfd December 15, 2017 10:43

Any suggestion??

AlexanderZ December 17, 2017 21:11

I guess you have 2 elements wide wall?

This range is interpolation of cfd-viewer. You may try this see true picture:
results -> graphics -> contours -> switch off node values -> OK

Best regards

e_cfd December 18, 2017 10:14

Dear Alexander,

Thank you for your help. Yes you are right about the nodal values.

P. S. : my wall has zero thickness, and if I am not mistaken, C0 and C1 are adjacent fluid elements.

Best regards,


All times are GMT -4. The time now is 04:46.