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/)
-   -   F_NNODE returns double number of nodes (https://www.cfd-online.com/Forums/fluent-udf/131070-f_nnode-returns-double-number-nodes.html)

falkon March 8, 2014 06:58

F_NNODE returns double number of nodes
 
Hello, I have done a UDF for a dynamic mesh.

This UDF finds some cells in the mesh that I am 100 % sure that are part of a none structured mesh (triangular prism cells). So when the case is initialized it writes a file .txt in the work directory with the coordinates of the nodes of each face of each cell.

This is the part of the code of the UDF and is inside a begin_c_loop:
Quote:

c_face_loop(cells, thread_cells, n)
{
f2 = C_FACE(cells, thread_cells, n);
numbernodes = F_NNODES(f2, thread_cells);
fprintf(a, "nodes in face: %d\n", numbernodes);
f_node_loop(f2, thread_cells, n2)
{
node2 = F_NODE(f2, thread_cells, n2);
X[0] = NODE_X(node2);
X[1] = NODE_Y(node2);
X[2] = NODE_Z(node2);
fprintf(a, "x: %1.15f y: %1.15f z: %1.15f\n", X[0], X[1], X[2]);
}
}
And what is written in the file for the first cell:
Quote:

nodes in face: 6
x: -0.028009595349431 y: 0.017595577985048 z: 0.005138859618455
x: -0.028174242004752 y: 0.017617683857679 z: 0.005138888955116
x: -0.028068123385310 y: 0.017737546935678 z: 0.005138861481100
x: -0.028009733185172 y: 0.017596147954464 z: 0.006166666280478
x: -0.028174497187138 y: 0.017618408426642 z: 0.006166660226882
x: -0.028068279847503 y: 0.017738135531545 z: 0.006166667677462
nodes in face: 6
x: 0.012321649119258 y: -0.028466019779444 z: 0.002055961871520
x: 0.011974476277828 y: -0.028290204703808 z: 0.002055956050754
x: 0.012330438941717 y: -0.028029493987560 z: 0.002056002384052
x: 0.012321634218097 y: -0.028466070070863 z: 0.003083726158366
x: 0.011974455788732 y: -0.028290253132582 z: 0.003083724761382
x: 0.012330439873040 y: -0.028029559180140 z: 0.003083783434704
nodes in face: 6
x: 0.009093324653804 y: -0.024432502686977 z: 0.001027791760862
x: 0.009238600730896 y: -0.024395937100053 z: 0.001027804682963
x: 0.009149624966085 y: -0.024585215374827 z: 0.001027849735692
x: 0.009093423373997 y: -0.024432476609945 z: 0.002055566292256
x: 0.009238678030670 y: -0.024395916610956 z: 0.002055579330772
x: 0.009149681776762 y: -0.024585222825408 z: 0.002055631252006
nodes in face: 6
x: -0.027399869635701 y: 0.017587393522263 z: 0.004111350979656
x: -0.027274513617158 y: 0.017676485702395 z: 0.004111340269446
x: -0.027248876169324 y: 0.017524981871247 z: 0.004111215937883
x: -0.027399865910411 y: 0.017587494105101 z: 0.005138638429344
x: -0.027274474501610 y: 0.017676435410976 z: 0.005138631910086
x: -0.027248846367002 y: 0.017524989321828 z: 0.005138775333762
nodes in face: 6
x: -0.027567202225327 y: 0.022387191653252 z: 0.008222170174122
x: -0.027757761999965 y: 0.022486202418804 z: 0.008222165517509
x: -0.027604026719928 y: 0.022614669054747 z: 0.008222172968090
x: -0.027567058801651 y: 0.022387424483895 z: 0.009250000119209
x: -0.027757575735450 y: 0.022486483678222 z: 0.009250000119209
x: -0.027603834867477 y: 0.022614952176809 z: 0.009250000119209
There are two problems:

Why in a face are six nodes when the faces are triangular or rectangular?

And the other problem is that those faces must be two triangular and three rectangular for each cell and they aren't.

Is curious that most of the values differs a bit from another of the same face and if you plot the six points of a face you can see they are almost the same by pairs. But why this happens? I'm not understanding something right?

I have searched in the manual trying to find something that explains this but I haven't find anything.

I'm using fluent 12 in Ubuntu 13.10 and the manual is also of fluent 12.

Thank you for your help.


All times are GMT -4. The time now is 13:39.