|
[Sponsors] |
February 27, 2023, 11:31 |
c_face_loop seems not working
|
#1 |
New Member
Romain Million
Join Date: Nov 2022
Location: Saint Nazaire, France
Posts: 4
Rep Power: 4 |
Hello everybody,
I am trying to get face centroïd of each face of cells that I browse with c_loop but the c_face_loop macro seems not working... Does any one have any hint on what is wrong with this code ? Or any information on this macro, Fluent udf manual is very light about it... Code:
DEFINE_ON_DEMAND(Centroid) { face_t face; cell_t cell; int n; Domain *domain = Get_Domain(2); /* 1 = mixture, 2=primary phase, 3=secondary phase etc*/ int zone_id = 2; Thread *thread = Lookup_Thread(domain,zone_id); Thread *thread_face; real xc[ND_ND], xf[ND_ND], va[ND_ND]; begin_c_loop_int(cell, thread) { C_CENTROID(xc, cell, thread); Message("\nc %f %f %f\n", xc[0], xc[1], xc[2]); c_face_loop(cell,thread, n) { face = C_FACE(cell, thread, n); thread_face = C_FACE_THREAD(cell, thread, n); F_CENTROID(xf, face, thread_face); Message("\nc %f %f %f\n", xf[0], xf[1], xf[2]); } } end_c_loop_int(cell, thread); } |
|
February 28, 2023, 02:46 |
|
#2 |
Member
Odisha
Join Date: Jan 2020
Posts: 59
Rep Power: 6 |
I think the problem is not with c_face_loop.
You have used begin_c_loop_int which loops over all the interior cells (only) in a domain. Meanwhile, your zone_id points towards the entire domain which contains both interior and exterior cells. This is causing a conflict. Also, include the #if !RP_HOST . . . #endif line in your code. |
|
February 28, 2023, 04:14 |
|
#3 | |
New Member
Romain Million
Join Date: Nov 2022
Location: Saint Nazaire, France
Posts: 4
Rep Power: 4 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TUI - Strange behavior related to the working directory | Dav[ID] | FLUENT | 5 | September 6, 2022 15:45 |
Porous media coefficients and working fluid | Dronzer | FLUENT | 1 | June 30, 2020 23:23 |
findCell() in parallel: not working if location is outside the domain | TobiWol | OpenFOAM | 0 | January 10, 2018 15:33 |
Processor 0 not working | vishwesh | OpenFOAM Running, Solving & CFD | 0 | November 17, 2017 04:35 |
DPM parallel is not working but serial is working | johnwinter | FLUENT | 1 | March 27, 2012 03:01 |