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

radial heat flux (cylindrical-pipe)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2016, 16:01
Default radial heat flux (cylindrical-pipe)
  #1
H.H
New Member
 
Hamza
Join Date: Mar 2016
Posts: 5
Rep Power: 10
H.H is on a distinguished road
please can any help me for solving following polynomial function of local heat flux on Cylindrical pipe. having issues in applying Cartesian to polar logic (arctan theta) .


DEFINE_PROFILE(heatflux,thread,position)
{
real x[ND_ND],xcoord,ycoord,Degree;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
Degree=x[2];
Degree=atan(ycoord/xcoord)*(180/3.14159265);

if (0<=Degree&&Degree<=88) F_PROFILE(f,thread,position) = 1005-3.0*Degree+0.689*pow(Degree,2)-0.0005*pow(Degree,3);
else F_PROFILE(f,thread,position) = -19.90+1.9*Degree-1049.0*pow(Degree,2)+0.005*pow(Degree,3);
}

end_f_loop(f,thread)
}
H.H is offline   Reply With Quote

Old   April 4, 2016, 17:31
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Use the Message(); function to check your code (debugging); print the angles and heat fluxes and compare them to what you expect. Read about the atan2 function; this function returns the angle in the correct quadrant.
`e` is offline   Reply With Quote

Old   April 5, 2016, 07:58
Default
  #3
H.H
New Member
 
Hamza
Join Date: Mar 2016
Posts: 5
Rep Power: 10
H.H is on a distinguished road
Sir, thanks for the suggestion. but what will be the position of message(); line??
Can you do me a favor? to rephrase the program according to you suggestion of message(); line as well as by using atan2 (tetha) suggestion. please if u donot mind. it might take precious time of yours. but im trying to some for ouple of days, but im unable to program and having limited time left for my project defend.

i will be thankful to you always.
Regards,
H.H
H.H is offline   Reply With Quote

Old   April 15, 2016, 06:23
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You're using the variables ycoord and xcoord without initialising (garbage numbers from memory); evaluate these values for each face (and include the Message(); function):

Code:
#include "udf.h"

DEFINE_PROFILE(heatflux,thread,position)
{
	real x[ND_ND],xcoord,ycoord,Degree; 
	face_t f;
	
	begin_f_loop(f,thread)
	{
		F_CENTROID(x,f,thread);
		xcoord = x[0];
		ycoord = x[1];
		Degree=atan(ycoord/xcoord)*(180/3.14159265);
		Message("Degree = %e at [x,y,z] = [%e,%e,%e]\n",Degree,x[0],x[1],x[2]);

		if (0<=Degree&&Degree<=88) F_PROFILE(f,thread,position) = 1005-3.0*Degree+0.689*pow(Degree,2)-0.0005*pow(Degree,3);
		else F_PROFILE(f,thread,position) = -19.90+1.9*Degree-1049.0*pow(Degree,2)+0.005*pow(Degree,3);
	} 
	end_f_loop(f,thread)
}
If you're not getting the correct degree for the corresponding Cartesian coordinates then have a read of this reference page for the atan2 function.
`e` 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
Conjugate Heat Transfer: Wall Heat Flux at Coupled Walls? MaxHeat FLUENT 4 September 14, 2017 10:44
Heat trasfer coefficient in a pipe - Fluent elios FLUENT 1 February 6, 2015 14:18
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
Heat Flux Profile at Fluid-Porous Interface Hitch8 CFX 4 December 15, 2012 09:57
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 15:26.