CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Problem with looping over faces in certain cell

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 9, 2015, 15:31
Default Problem with looping over faces in certain cell
  #1
Member
 
Join Date: Dec 2014
Posts: 38
Rep Power: 3
Harry321 is on a distinguished road
Hi I try to write a macro to loop over faces of certain cell, to check mass flux over there. I found out that there is a macro to loop over a faces in the cell. I try to use it and every time a get an error "Segmentation fault". and Error Object:#f. Could anybody help my with this UDF?
DEFINE_ADJUST(voidf, super_domain)
{
FILE *fp;
fp = fopen("data.txt", "a");
Thread *t;
cell_t c;
face_t f;

thread_loop_c(t, super_domain)
{
begin_c_loop_int(c, t)
{
c_face_loop(c, t, i)
{
f = C_FACE(c, t, i);
massflow += F_FLUX(f, t);
fprintf(fp, "masflow: %f \n", massflow);
}
massflow = 0.0;
fprintf(fp, "\n\n");

}
end_c_loop_int(c, t)
}
fclose(fp);
}
Harry321 is offline   Reply With Quote

Old   January 9, 2015, 22:57
Default
  #2
Member
 
Join Date: Dec 2014
Posts: 38
Rep Power: 3
Harry321 is on a distinguished road
I should mentioned, in previous post, that I work with several phases. And glad to inform I found the solution to the problem
Harry321 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
interFoam running blowing up sandy13 OpenFOAM Running, Solving & CFD 2 May 5, 2015 07:16
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
[Other] Mesh Importing Problem cuteapathy ANSYS Meshing & Geometry 1 June 7, 2012 13:39
Looping over faces in a cell Senthil FLUENT 3 April 11, 2002 11:41


All times are GMT -4. The time now is 06:37.