User defined memory value changing
1 Attachment(s)
Hi guys,
In my UDF code, I'm trying to #define a value and use it as one of the factors to be included in DPM body force. However, when I set that defined value as C_UDMI (user defined memory 40) and check in the CFD-post to see if it really did stay constant, it shows me that the value have fluctuated. Anyone knows why the Fluent would change the #defined C_UDMI value on its own? Or should I use other methods to check the #defined value? Thanks in advance, james Kim and Here's my code! #include "udf.h" #define TSTART 0.0 /* field applied at t = tstart */ #define pi 3.14159265359 #define mu0 pi*4E2 #define gravity 3.2997E-6 #define mobility 4.15E-6 DEFINE_DPM_BODY_FORCE(particle_body_force,p,i) { cell_t c = RP_CELL(&(p->cCell)); Thread *t = RP_THREAD(&(p->cCell)); real bforce = 0.0000000000000000; if (P_TIME(p) >= TSTART) { C_UDMI(c,t,40) = mobility; C_UDMI(c,t,39) = pi; if (i == 0) bforce = 0.5*mobility*C_UDMI(c,t,1)/mu0 + gravity + P_VEL(p)[0]; else if (i == 1) bforce = 0.5*mobility*C_UDMI(c,t,2)/mu0; } else bforce = 0.0000000000000000; /* an acceleration should be returned */ return (bforce); } |
That is very odd. Try to remove this part from code:
Code:
C_UDMI(c,t,40) = mobility; https://www.sharcnet.ca/Software/Flu...g/node1035.htm |
A complete code noobie embarrassing myself here:
Should the Code:
(P_TIME(p) >= TSTART) Code:
(TP_TIME(p) >= TSTART) Code:
DEFINE_DPM_BODY_FORCE(particle_body_force,tp,i) |
All times are GMT -4. The time now is 20:45. |