|
[Sponsors] |
April 2, 2016, 16:01 |
radial heat flux (cylindrical-pipe)
|
#1 |
New Member
Hamza
Join Date: Mar 2016
Posts: 5
Rep Power: 10 |
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) } |
|
April 4, 2016, 17:31 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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.
|
|
April 5, 2016, 07:58 |
|
#3 |
New Member
Hamza
Join Date: Mar 2016
Posts: 5
Rep Power: 10 |
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 |
|
April 15, 2016, 06:23 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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) } |
|
|
|
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 |