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

Regarding udf for boundary conditions in transient.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2017, 05:24
Default Regarding udf for boundary conditions in transient.
  #1
New Member
 
Ram Prakash
Join Date: Jun 2017
Posts: 3
Rep Power: 9
Ram Prakash is on a distinguished road
I want to write an udf to make use of the species mass fraction value at the outlet of the previous time step in inlet of the next time step continously in transient analysis. Since I am new in writing udf I read all the functions in the UDF manual of the fluent. Now I am clear in writing an udf for boundary condition profile. Can any tell me how to access the species mass fraction value of the outlet boundary when writing udf for the inlet boundary?
Ram Prakash is offline   Reply With Quote

Old   November 27, 2017, 08:34
Default
  #2
Sun
Senior Member
 
Sun's Avatar
 
Join Date: Nov 2010
Posts: 103
Rep Power: 16
Sun is on a distinguished road
To write your UDF for the boundary condition, you can use:
Code:
DEFINE_PROFILE
. To use the mass fraction of specie "i", you can use:
Code:
C_YI(c,t,i)
and for its value on the previous time step:
Code:
C_YI_M1(c,t,i)
cheers!
Sun is offline   Reply With Quote

Old   November 28, 2017, 02:22
Default
  #3
Senior Member
 
KaLium's Avatar
 
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9
KaLium is on a distinguished road
Quote:
Originally Posted by Sun View Post
To write your UDF for the boundary condition, you can use:
Code:
DEFINE_PROFILE
. To use the mass fraction of specie "i", you can use:
Code:
C_YI(c,t,i)
and for its value on the previous time step:
Code:
C_YI_M1(c,t,i)
cheers!
Does that work if he wants to read the previous values from outlet and add them to inlet?

Maybe he could use EXECUTE_AT_END - macro to save the outlet values and then use DEFINE_PROFILE in inlet?
KaLium is offline   Reply With Quote

Old   November 28, 2017, 04:18
Default
  #4
Sun
Senior Member
 
Sun's Avatar
 
Join Date: Nov 2010
Posts: 103
Rep Power: 16
Sun is on a distinguished road
Yeah I guess it does make sense to fill the outlet face at the end, and then using DEFINE_PROFILE.
Sun is offline   Reply With Quote

Old   December 28, 2017, 14:04
Default boundary condition in fluent, which is a function of density
  #5
New Member
 
mohammad daneshmandi
Join Date: Dec 2017
Posts: 4
Rep Power: 8
m.daneshmandi` is on a distinguished road
Dear all

I want to add a boundary condition in fluent, which is a function of density. For this aim I wrote an UDF code to evaluate the density on the surface of boundary. But a segmentation error has occurred. I know what this error is but I do not know how to fix it and my algorithm is right or not?



Thank you in advance for your help.

#include "udf.h"

DEFINE_PROFILE(inlet_pressure1,t,i)
{
real x[ND_ND];

real rr1;
real vv;

Thread *tf;
face_t f;
cell_t c;
int n;



begin_c_loop(c, t) /* loops over cells in a cell thread */
{

rr1=C_R(c,t);

c_face_loop(c, t, n) /* loops over all faces of a cell */
{
f=C_FACE(c,t,n);
tf=C_FACE_THREAD(c,t,n);





vv=sqrt(pow (F_U(f,t),2)+pow (F_V(f,t),2)+pow (F_W(f,t),2));
F_PROFILE(f,tf,i)=40000000-0.5*rr1*pow (vv,2);

}
}
end_c_loop(c, t)



}
m.daneshmandi` 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
Need help in understanding Transient Periodic & Non-Periodic Boundary Conditions khattaksadia FLUENT 0 May 5, 2017 01:01
UDF for transient pressure outlet boundary from data array nathanblank FLUENT 1 June 1, 2015 04:09
spatial and transient B.C. using UDF Park FLUENT 0 April 28, 2005 22:32
initial conditions with transient UDF Antoine Pages FLUENT 4 September 19, 2004 12:51
UDF for transient boundary condition? Shankar FLUENT 1 November 22, 2003 09:10


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