|January 27, 2014, 12:02||
UDF to read cell var. based on particle position
Join Date: May 2013
Posts: 257Rep Power: 6
I'm currently working on a routine to read local tracer gradients, based on particle position; so globally:
- Read in which cell C particle P resides at timestep T
- Update user defined scalar to take the value of C for particle P
I don't have any experience on writing UDFs (The ANSYS tutorials show how to use them, but not how to write them.) but expected the routine to be very much like the DPM_SCALAR_UPDATE macro supplied in the UDF manual.
However, when I try to literally copy this routine:
cphase_state_t *c = &(p->cphase);
p->user = 0.;
viscosity_0 = c->C_YI(i);
with i the component index I want to read; it gives the error C_YI is not defined in cphase_state.
If I use
conc_0 = c->yi[i];
p->user = conc_0;
The routine runs, but the output is always zero.
Probably I'm just doing something stupid, based on my lack of UDF/C programming knowledge, but I'm a bit lost in how to continue/where to look.
For example, I cannot find any comprehensive list containing accessible and variables and structures; does anybody know where to find such a list?
And of course, any ideas on how to read the local concentration would be much appreciated.
Thanks in advance!
|February 3, 2014, 12:14||
Join Date: Nov 2013
Posts: 670Rep Power: 9
It is not much, but maybe it can help you a bit.
|Thread||Thread Starter||Forum||Replies||Last Post|
|how to know position of particle in PTK||areriko||CFX||0||November 19, 2007 22:19|
|udf of the "particle-body-force" for help||zhaoh||FLUENT||0||January 11, 2007 06:52|
|How to read data into my UDF???||Harshit Gupta||FLUENT||3||June 15, 2006 02:34|
|strain rate at arbitrary position in a cell||K. Kevala||FLUENT||0||February 4, 2004 18:14|
|How can I get the particle current position in UDF||cfdfans||FLUENT||4||April 2, 2001 05:03|