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

UDF for inhomogenous Neumann boundary condition

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2009, 16:24
Default UDF for inhomogenous Neumann boundary condition
  #1
New Member
 
Akhilesh Kumar Sahu
Join Date: Jul 2009
Posts: 1
Rep Power: 0
akhilesh is on a distinguished road
Hello

I am new to FLUENT
I have to set du/dy=G, G=0.01,0.02. (d is partial derivative) @ some boundary.
discretized form of the above eq would be

(u_f-u_c)/del_y=k

u_f=k*del_y+u_c

here u_f is u velocity at face center and u_c is same at cell center of corresponding cell and del_y is distance between face center and cell center.
I have written the following udf to set this..


#include"udf.h"
#define dy 0.08754886724
#define G 0.01
#define uavg 0.1
#define H 10.0


DEFINE_PROFILE(top_x_velocity,thread,nv)
{
face_t f;
cell_t c0;
Thread *t0;

begin_f_loop(f,thread)
{
F_CENTROID(z,f,thread);
c0 = F_C0(f,thread);
t0 = THREAD_T0(thread);
F_PROFILE(f,thread,nv)=G*dy+C_U(c0,t0);


}
end_f_loop(f,thread)
}

no problem in interpretation..
but results are not coming fine.
I have checked the face center and cell center value of u at that boundary, they are coming same, like for symmetry boundary condition.
Please help me in finding the bug in the udf.

THanks
akhilesh is offline   Reply With Quote

Old   June 3, 2012, 05:38
Default
  #2
New Member
 
moon
Join Date: Feb 2012
Posts: 26
Rep Power: 14
moun139 is on a distinguished road
dear,

i have the same problem .
moun139 is offline   Reply With Quote

Old   June 3, 2012, 10:01
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Try this:

#include "udf.h"
#include "sg.h"
DEFINE_PROFILE(wall_x_velocity, t, i)
{
real dr0[ND_ND];
real A[ND_ND];
real es[ND_ND];
real s, ds, A_by_es;
face_t f;

s=2.0; /*Specify your own value*/

begin_f_loop(f, t)
{
BOUNDARY_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0);
F_PROFILE(f, t, i) = C_U(F_C0(f,t),THREAD_T0(t))+s*ds;
}
end_f_loop(f, t)
}

You may also want to check BOUNDARY_FACE_GEOMETRY in the manual to improve the approximations in the UDF above; indeed it is assumed that the wall parallel velocity is along the x direction. A more correct implementation should first obtain the wall parallel velocity from the full 3D one, use this one to define the velocity at the wall from the specified wall normal gradient (also accounting for grid non-orthogonalities) and then project this velocity back to the three coordinates. This UDF provides you all the ingredients to accomplish the task, you just need to put in some vector algebra.

However, in the wall panel you also have the option to directly specify the shear at the wall, making the above UDF actually not required.
sbaffini is offline   Reply With Quote

Old   December 24, 2012, 12:14
Default
  #4
Member
 
Satish Gupta
Join Date: Jun 2012
Posts: 30
Rep Power: 14
Rahul123 is on a distinguished road
If I have to write a UDf for du/dy=0. Can I write it as F_PROFILE(f, t, i) = C_U(F_C0(f,t),THREAD_T0(t));
Rahul123 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFX Solver : Sudden crash Hervé CFX 2 June 16, 2008 07:40
UDF for pressure oulet boundary condition Jubs FLUENT 0 February 13, 2007 01:26
NEUMANN BOUNDARY CONDITION IN MESHLESS METHODS Kémelli Main CFD Forum 2 July 15, 2006 02:41
udf boundary condition stefan FLUENT 0 December 4, 2002 10:10
UDF for boundary condition Shankar FLUENT 4 February 26, 2002 21:00


All times are GMT -4. The time now is 16:58.