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

Difficulty with UDF code for HEAT FLUX

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

Like Tree1Likes
  • 1 Post By brunoc

Reply
 
LinkBack Thread Tools Display Modes
Old   December 6, 2015, 15:16
Default Difficulty with UDF code for HEAT FLUX
  #1
New Member
 
Saksham
Join Date: Dec 2015
Posts: 1
Rep Power: 0
etudiant_IITB is on a distinguished road
Hi all.
I am really in need of help regarding the following problem. Your concern is appreciated.
I am trying to solve a 2D solid rectangular plate conduction problem (length in x and height in y with bottom left corner of plate as the origin). The plate is insulated on the left, right and bottom edge but is subjected to a spatially (in x) varying HEAT FLUX on the top edge. For the top edge, I have made the following UDF code but it is not giving the symmetric solution. The function that you see below for the heat flux is a spatially symmetric function with respect to the centre of the plate. I have paid attention in defining the function correctly with respect to the coordinate system in use.
I believe there should be some problem with my UDF C language code below (as I have not clearly understood the use of the x[ND_ND] array).

I would be grateful if someone can please put in a small amount of their time and help me out with this problem.
//***********//
#include "udf.h"
DEFINE_PROFILE(heat_flux,thread,i)
{
real x[ND_ND];
face_t f;
real k;
begin_f_loop(f,thread)
{
k=F_CENTROID (x,f,thread);

F_PROFILE(f,thread,i) = (-3.073e+20)*k^8 + (6.145e+19)*k^7+ (-4.966e+18)*k^6 + (2.072e+17)*k^5 -(4.718e+15)*k^4 + (5.647e+13)*k^3 + (-3.084e+11)*k^2 + (6.515e+08)*k + (-2.148e+05);
// this is the function for the heat flux //
}
end_f_loop(f,thread);
}

Last edited by etudiant_IITB; December 6, 2015 at 16:05. Reason: Problem resolved
etudiant_IITB is offline   Reply With Quote

Old   December 7, 2015, 09:07
Default
  #2
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 272
Rep Power: 12
brunoc is on a distinguished road
F_CENTROID(x,f,thread) will write the coordinates of the centroid on your x array:

x[0], x[1], x[2] = (x, y and z coordinates)

Use those to access each coordinate of the centroid in your equation.
etudiant_IITB likes this.
brunoc is offline   Reply With Quote

Reply

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
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
Heat flux profile UDF B.Hamada Fluent UDF and Scheme Programming 11 July 18, 2014 21:39
UDF error for flux ozy Fluent UDF and Scheme Programming 0 June 10, 2014 11:07
UDF for Heat Flux kishan kumar jaiswal FLUENT 4 April 21, 2014 18:01
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28


All times are GMT -4. The time now is 03:11.