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

boundary condition in fluent, which is a function of density

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 28, 2017, 13:08
Default boundary condition in fluent, which is a function of density
  #1
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

 


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
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 18:02
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 01:12.