|
[Sponsors] |
August 10, 2012, 09:09 |
need help- UDF line descrition
|
#1 |
New Member
mirion
Join Date: Dec 2010
Posts: 24
Rep Power: 16 |
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); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regarding FoamX running Kindly help out | hariya03 | OpenFOAM Pre-Processing | 0 | April 18, 2008 05:26 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |
UDF parse error on line 1 ..... (Unusual) | Amit Maha | FLUENT | 4 | June 30, 2006 13:15 |
UDF to change BC from Wall to Grid Line | Aaron Smith | FLUENT | 0 | February 21, 2006 10:14 |
Problems of Duns Codes! | Martin J | Main CFD Forum | 8 | August 15, 2003 00:19 |