|
[Sponsors] |
Fluent UDF for calculate boundary zone centroid and the mass flow |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 19, 2023, 22:41 |
Fluent UDF for calculate boundary zone centroid and the mass flow
|
#1 |
Senior Member
sunil
Join Date: Jul 2012
Location: Bangalore
Posts: 179
Rep Power: 14 |
Hi All,
My geometry consist of >600 boundary surfaces (>30 fluid zones) and I want fluent to extract each boundary centroid so that I can use this information for post-processing. Code:
#include "udf.h" FILE *fout; void Print_Thread_Face_Centroids(Domain *domain, int id) { real FC[3]; face_t f; int n_faces,j; Thread *t = Lookup_Thread(domain, id); n_faces=THREAD_N_ELEMENTS_INT(t); fprintf(fout,"%d\n", n_faces); /* prints number of cell faces */ begin_f_loop(f,t) { F_CENTROID(FC,f,t); fprintf(fout, "f%d %g %g %g\n", f, FC[0], FC[1], FC[2]); } end_f_loop(f,t) fprintf(fout, "\n"); } DEFINE_ON_DEMAND(get_coord) { Domain *domain; /* domain is declared as a variable */ domain = Get_Domain(1); /* returns fluid domain pointer */ fout = fopen("BCData.txt", "w"); Print_Thread_Face_Centroids(domain, 16); fclose(fout); } Please help me in resolving this issue.
__________________
Regards, Sunil Last edited by sunilpatil; November 20, 2023 at 12:56. Reason: Fount a intrim solution so updated that info |
|
Tags |
centroid, executeondemand, fluent - udf |
|
|