CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Macros for cell volume particle is in DPM (fluent 18.1) (https://www.cfd-online.com/Forums/fluent-udf/200174-macros-cell-volume-particle-dpm-fluent-18-1-a.html)

skumar112 March 26, 2018 15:13

Macros for cell volume particle is in DPM (fluent 18.1)
 
Hello

I wanted to inquire what the macros is for the volume of the cell the particle is IN. I have tried using C_VOLUME(c,t) however I keep getting back an error illegal index, indirection not allowed

pakk March 27, 2018 10:27

Can you show how you tried this? The macro is correct, by without context I can not see how you specified c and t, or even if you forgot to do that.

skumar112 March 28, 2018 09:08

I have changed this to what I have included below however this still does not seem to be working.
cphase_state_t *c = &(tp->cphase[0]);
Thread *t = TP_CELL_THREAD(tp);
cell_t c0;
volume = C_VOLUME(c0,t)

pakk March 28, 2018 09:47

This does not work because you are not telling what c0 is.

skumar112 March 28, 2018 09:49

I have put cell_t c0; which tells what c0 is. is that wrong there?

pakk March 28, 2018 09:52

You have told the compiler that c0 is a variable of the type "cell_t" (well done!). But you did not say the value of c0!

Fluent does not know which cell is c0! You still have to tell Fluent that you want c0 to be the cell that the particle is in.

skumar112 March 28, 2018 09:53

That makes a lot of sense !!! that part was confusing me quite a bit how fluent knows which cell volume to calculate. How would I go about doing this?

pakk March 28, 2018 09:57

There are some macros in the manual. Look in "Table 3.29: Macros for Particle Cell Index and Thread Pointer Defined in dpm_types.h" in the Fluent Customization Manual.

skumar112 March 28, 2018 10:02

would cell_t c0 = TP_CELL(tp); specify the cell the particle is in?

pakk March 28, 2018 10:16

Did you check the table?

skumar112 March 28, 2018 10:17

Yes I got the macros from the table, from my best guess that should do the trick. I just wanted to make sure I wasn't wrong

pakk March 28, 2018 10:19

Did you see the text next to "TP_CELL(tp)" in that table? It answers almost literally what you are asking me...


All times are GMT -4. The time now is 19:28.