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

Temperature profile UDF for 3D cylinder surface

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 5, 2015, 12:17
Default Temperature profile UDF for 3D cylinder surface
  #1
New Member
 
Himel Barua
Join Date: Aug 2014
Posts: 2
Rep Power: 0
Himel is on a distinguished road
Hi,

I am trying to incorporate a temperature profile on a surface of a 3D cylidner.

I have been using this code. But, when i tried to interprete the code it starts to say undeclared variable. I have some idea to write UDF for 2D case where the boundary is a line, But for 3D case where the boundary is surface i am not very sure.

Can anyone please help me in this regard?

I am giving the code here.


#include "udf.h"
DEFINE_PROFILE(temperature_prof,thread,index)
{
real x[ND_ND];
real y;
face_t f;
begin _f_loop (f, thread)

{
F_centroid(x,f,thread);
y=x[0];
F_PROFILE(f,thread,index)=-11497.5*y*y-659.781*y+1350;
}
end_f_loop(f,thread)
}

I am confused about particularly the red line, for 2D surface sholud the x should be 1D or 2D array ?
Himel is offline   Reply With Quote

Old   June 16, 2015, 10:59
Default UDF for Imposing Heat Transfer Coefficient as a function of temperature on a line
  #2
New Member
 
Joseph Thodiyil
Join Date: Jun 2015
Posts: 2
Rep Power: 0
thodij is on a distinguished road
Hi,

I am new to UDF's. I am trying to impose a Convection heat transfer coefficient on a line on the OD of the pipe (in a pipeline 2D axisymmetric model), as function of the surface temperature.

This is my attempt. Please provide your comments.

/*----------------------------------------------------------------------------------------
heffupstream_rev.c
UDF for specifying steady-state external CHTC, heff on a line as a function of Surface
Temperature, Ts in a 2D axisymmetric CFD model: heff(Ts) = beta1*exp(beta2*Ts) + beta3
Temperature Ts is in Kelvins.
/*---------------------------------------------------------------------------------------*/
#include "udf.h"
#define beta1 8.83421; /* W/m^2.K */
#define beta2 1.45536e-3; /* 1/K */
#define beta3 -5.25737; /* W/m^2.K */
/* t is a pointer to the face's thread */
DEFINE_PROFILE(heff_upstream, c, t)
{

/* Variable Declarations */
real Ts = C_T(c,t); /* Ts is in Kelvins & C_T is the Cell Temperature variable Macro */
face_t f; /* f is a face thread index */
begin_f_loop(f,t)
{
F_PROFILE(f, t) = beta1 * exp(beta2*Ts) + beta3;
}

end_f_loop(f, t)

}
thodij is offline   Reply With Quote

Reply

Tags
fluent, temperature profile, udf

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
libOpenSMOKE Tobi OpenFOAM Programming & Development 502 July 23, 2015 21:14
How to do UDF for temperature profile on a semi-disc? Reivax Fluent UDF and Scheme Programming 5 April 7, 2015 22:54
temperature profile variation -UDF ahvz Fluent UDF and Scheme Programming 4 July 23, 2013 07:55
Layers don't fully surround surface EVBUCF OpenFOAM Native Meshers: snappyHexMesh and Others 14 August 20, 2012 04:31
Boundary Temperature Profile UDF error shikamaru Fluent UDF and Scheme Programming 1 May 18, 2012 21:19


All times are GMT -4. The time now is 07:50.