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

UDF Temperature boundaries Condition

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By flotus1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2012, 07:50
Default UDF Temperature boundary Conditions
  #1
New Member
 
Join Date: Jul 2012
Posts: 6
Rep Power: 13
sylvix48 is on a distinguished road
I'm trying to set a variable temperature as boundary condition on the exterior surface of a cylinder. I work in 3D and I've done the attached udf. It is well compiled under Fluent but there is no fluctuation of temperature along the tube. In my case the Temperature should change on the Z axis but in the simulation it seems that it changes on the x axis. Could you tell my if my UDF is OK and why it doesn't work ?

Thanks

Here's the code :

#include"udf.h"

/* profile for temperature */

DEFINE_PROFILE(z_temperature,t,i)

{
real z[ND_ND];
real y;
face_t f;

begin_f_loop(f,t)
{
F_CENTROID(z,f,t);
y=z[0];


F_PROFILE(f,t,i) =4.6706*10*10*10*10*10*10*y*y*y*y*y+2.3199*10*10*1 0*10*10*10*y*y*y*y-85471*y*y*y-72106*y*y-437.51*y+1722.5;
}
end_f_loop(f,t)


}
Attached Files
File Type: c temperature.c (442 Bytes, 24 views)

Last edited by sylvix48; July 17, 2012 at 09:20.
sylvix48 is offline   Reply With Quote

Old   July 17, 2012, 11:06
Default
  #2
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
z[0] reads the x-coordinate. No wonder your profile changes with x.

use z[2] instead.
sylvix48 likes this.
flotus1 is offline   Reply With Quote

Old   July 18, 2012, 03:01
Default
  #3
New Member
 
Join Date: Jul 2012
Posts: 6
Rep Power: 13
sylvix48 is on a distinguished road
Thanks a lot, it works !

I'm beginner in the UDF coding, I don't know all the stuff about it
sylvix48 is offline   Reply With Quote

Old   July 20, 2012, 12:26
Default
  #4
New Member
 
Join Date: Jul 2012
Posts: 18
Rep Power: 13
mila_oliv is on a distinguished road
I'm also new at udf and I want to stabilish simple boundary conditions.

I'm trying to implement stream function to compare my result with fluent's result.

On the cavity walls, Velocity is zero. Do I have to mention this or when I simulate I set this on fluent?

Look what I've done:

Quote:
#include "udf.h"
#include "mem.h"


DEFINE_SOURCE(funcaocorrente,c,t,ds,eqn)
{

real NV_VEC(psi);
real NV_VEC(vxdy);
real source;
int n,m,deltay;
cell_t c;
Thread *t;

/* the following are the boudary conditions that I don't know if I need to write. 1 is the starting point and e the ending point of the mesh*/
psi[i][1]=0;
psi[i][e]=0;
psi[1][j]=0;
psi[e][j]=0;

n=C_NNODES(c,t);
e=n^0.5;
m=e-1;
deltay=1/m; /*mesh size: mXm and cavity size: 1 meter*/
vxdy=NV_S(C_U(c,t),*=,deltay);
source=NV_V(psi,+=,vxdy); /* psi[i][j+1]=psi[i][j]+(Vx*delta y) or stream function definition*/
dS[eqn]=C_U(c,t);
return source;

}
mila_oliv 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
UDF setting wall boundary condition with a DEFINE_PROFILE NLao FLUENT 3 September 2, 2019 00:33
defining temperature profile with UDF mohammadkm Fluent UDF and Scheme Programming 11 July 3, 2013 00:15
Please Help! Temperature profile UDF for 3D geometry subhankar_bhandari FLUENT 2 April 16, 2011 05:30
Help please! UDF for Temperature profile in 3D subhankar_bhandari Fluent UDF and Scheme Programming 2 August 16, 2010 08:37
boundary condition for temperature ane Main CFD Forum 0 March 24, 2008 04:27


All times are GMT -4. The time now is 00:05.