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

need help- UDF line descrition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2012, 08:09
Default need help- UDF line descrition
  #1
New Member
 
mirion
Join Date: Dec 2010
Posts: 24
Rep Power: 15
laxwendrofzx9r is on a distinguished road
Hi,
Simple, could somebody who knows C language under Fluent, describes every line and what this script is doing? I need this for clarification and further learning process
Many Thanks,

#include "udf.h"
#include <math.h>

static real mass_flow(Thread *t, Domain *d)
{
face_t f;
real mfr = 0.;
begin_f_loop(f,t)
{
mfr += F_FLUX(f,t);
}
end_f_loop(f,t)
return mfr*mfr;
}

DEFINE_ON_DEMAND(objective_function)
{
Thread *t;
face_t f;
real mfr = 0.;
Domain *d = Get_Domain(1);


thread_loop_f(t,d)
{
if((4 == THREAD_ID(t))|| (5 == THREAD_ID(t)))
{
mfr += mass_flow(t,d);
}

}
RP_Set_Real("morpher/objective-function",mfr);
}
laxwendrofzx9r is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 04:26
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00
UDF parse error on line 1 ..... (Unusual) Amit Maha FLUENT 4 June 30, 2006 12:15
UDF to change BC from Wall to Grid Line Aaron Smith FLUENT 0 February 21, 2006 09:14
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19


All times are GMT -4. The time now is 09:54.