|
[Sponsors] |
May 12, 2011, 10:45 |
UDF issues
|
#1 |
Member
EH
Join Date: Dec 2010
Posts: 61
Rep Power: 15 |
Hi all,
I am having some problems with UDF. Basically I have written a UDF which worked well before and now that I have developed a new model, when I use the same UDF, it gives me problems. The UDF is as follows: PHP Code:
The problem now is that this part the cells are not within the limits set. In other words, in this section: if ((xx >= xxmin) && (xx <= xxmax)) { if ((yy >= yymin) && (yy <= yymax)) { Message("zz = %f\n", zz); if ((zz >= zzmin) && (zz <= zzmax)) when I print out the values of zz after xx and yy, they are not within the zzmin and zzmax limit, hence I get a division by zero. There are definitely cells within the z limit. Anyone knows why this is happening? Thanks and I really appreciate any help. Sincerely, EH |
|
May 13, 2011, 04:49 |
|
#2 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
I think the problem is that the grid partition belonging to node-0 does not include all (or even any) cells of this cell_thread "thtank". Hence some or all cells actually within your limits simply can not be found by this node. If so, then running in serial should give correct results. Check this.
cheers |
|
May 13, 2011, 05:42 |
|
#3 | |
Member
EH
Join Date: Dec 2010
Posts: 61
Rep Power: 15 |
Hi,
Thank you. I think this may be the reason why I am not getting the limits. Unfortunately I have to run it in parallel since this is a very large problem. However, I thought node-0 is the node that stores all the coordinates. Is this correct? Thanks, EH Quote:
|
||
May 13, 2011, 06:18 |
|
#4 | |
Member
EH
Join Date: Dec 2010
Posts: 61
Rep Power: 15 |
Hi again,
I tried reversing the code to compute the temperature at all the non-zero nodes i.e. by using IF (! I AM NODE ZERO) After computation, I need to pass the result to node zero. Usually we compute everything in node zero and pass it to nonzero nodes. Is it possible to pass values from non zero nodes to node zero, ie something like this: compute_node_loop_zero(i) { PRF_CSEND_DOUBLE(i, &Tout, 1, myid); PRF_CSEND_DOUBLE(i, &Tin, 1, myid); } } /* Reception of average temperature from node zero */ if(I_AM_NODE_ZERO_P) { PRF_CRECV_DOUBLE(0, &Tout, 1, 0); PRF_CRECV_DOUBLE(0, &Tin, 1, 0); } Any help is really appreciated Thanks, EH Quote:
|
||
May 13, 2011, 06:21 |
|
#5 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
No, as far as I know every node has full information about everything but also only in its partition. The only special thing with node-0 is that he is in charge for communication with host.
Thus in general every node has to perform the desired actions on its own and then a global summation has to be done. See section 7.5.4 in the udf manual how this works. cheers |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About UDF compiling issues: 'nmake' | Haoyin Shan | Fluent UDF and Scheme Programming | 15 | November 4, 2019 19:05 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |