|
[Sponsors] |
August 24, 2011, 14:33 |
UDF-Source term
|
#1 |
New Member
zohreh
Join Date: Feb 2011
Location: Tehran
Posts: 20
Rep Power: 15 |
Hello everybody. I have UDF code for define face area but I don't know how can I use it in a source term which is (Ro*u*A)/L, Ro= density, u=velocity, A=area, L= length!!!
this code is for face area but I don't know how can I use it in above source term I am new in UDF!! please help me DEFINE_ON_DEMAND(calculate_area) { Domain *d = Get_Domain(1); Thread *ft; face_t f; real area = 0.; thread_loop_f(ft,d) { begin_f_loop(f,ft) { real NV_VEC(farea); F_AREA(farea,f,ft); area = NV_MAG(farea); } end_f_loop(f,ft) } } |
|
August 24, 2011, 14:49 |
|
#2 |
Member
Ming Cai
Join Date: Mar 2011
Posts: 50
Rep Power: 15 |
what kind of area you want to get?
Area of Single cell or all the cells? |
|
August 24, 2011, 15:53 |
|
#3 |
New Member
zohreh
Join Date: Feb 2011
Location: Tehran
Posts: 20
Rep Power: 15 |
||
August 24, 2011, 19:46 |
|
#4 | |
Member
Ming Cai
Join Date: Mar 2011
Posts: 50
Rep Power: 15 |
Quote:
the geometry data such as area is stored in mixture domain. I my opinion, you can define a Define on demand function to access the cell face area data and stored them in a udm. then defined a source term utilize the udm. If anybody have better ideas, please notice me. |
||
August 25, 2011, 08:01 |
|
#5 | |
New Member
zohreh
Join Date: Feb 2011
Location: Tehran
Posts: 20
Rep Power: 15 |
Quote:
Thanks for your suggestion. would you please help me to write a UDF as you suggest me? really how can I write a udm and then defined a source term utilize the udm.???? I am new in UDF but read alot! thanks regards |
||
August 25, 2011, 10:28 |
|
#6 | |
Member
Ming Cai
Join Date: Mar 2011
Posts: 50
Rep Power: 15 |
Quote:
I mostly deals with cell data macros. For cell udm, you just simply need to set udm in the GUI console Define->user defined-> user defined memory Set the udm to be the number of udm utilized in the udf In the case of cell udm, for example I want to store cell volume in udm I just simply need to write: DEFINE_ON_DEMAND(name) { Domain *d=Get_Domain(1); Thread *t; cell_t c; thread_loop_c { begin_c_loop { C_UDMI(c,t,0)=C_VOLUME(c,t) } end_c_loop } DEFINE_SOURCE(name,c,t,dS,eqn) /* For example, source = 1/cell_volume */ { real source; source = 1/C_UDMI(c,t,0); /* I'm not sure if it works without Define_on _demand just use source = 1/C_VOLUME(c,t), you can have a try~ */ return source; } In the case of face area, you might just need to change cell related macros into face related ones.. Hope it helps. Good Luck |
||
August 26, 2011, 08:41 |
|
#7 |
New Member
zohreh
Join Date: Feb 2011
Location: Tehran
Posts: 20
Rep Power: 15 |
Hi, Dear mingresal
Thanks for your help. I appreciate for your reply to my last post regards zohreh |
|
August 29, 2011, 03:21 |
velocity inlet udf
|
#8 |
Member
|
hiii friends i am entirely new to using udf's in fluent. I have a cubical geometry, with two inlets on perpendicular adjacent faces. i have to implement udf to only one of the conditions.
i have two cases 1) parabolic velocity inlet ( space varient) 2) sinusodial velocity velocity inlet ( time variant) can any one pls send me the udf ( codes) ... |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Injection of the source term UDF | stage81 | FLUENT | 0 | September 27, 2010 08:20 |
UDF Source Term | Christian | FLUENT | 4 | August 1, 2009 06:53 |
The source term of UDF | summer | FLUENT | 0 | August 24, 2006 18:44 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 14, 2000 00:03 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |