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

DEFINE_PROFILE on circular inlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2014, 06:43
Question DEFINE_PROFILE on circular inlet
  #1
New Member
 
Khan
Join Date: Dec 2014
Posts: 1
Rep Power: 0
mumtazcore is on a distinguished road
Hi,
I am trying define temperature profile on the circumference of a tube cross-section (circle). I learned that it has to use DEFIFE_PROFILE macro, but all examples show a straight line inlet. Can anybody show me how to include cartisean coordinates in C language. or is it that I am assuming it and nothing needs to be done here?
I am modeling heat flux on a parabolic trough receiver without using the parabolic reflector to work on the temperature contours of the liquid inside .

thanks in advance
mumtazcore is offline   Reply With Quote

Old   March 11, 2016, 02:41
Default heat_flux
  #2
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
Hello,

have you got the solution ?
actually I am also facing the same kind of problem, can you give suggestion
regarding this kind of problem?

thank you.
asmita_iitb is offline   Reply With Quote

Old   March 11, 2016, 06:05
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Quote:
Originally Posted by asmita_iitb View Post
have you got the solution ?
actually I am also facing the same kind of problem, can you give suggestion
regarding this kind of problem?
What profile are you trying to apply to your inlet? The DEFINE_PROFILE macro can be used in cases where the variable is space and/or time dependent. For example, a non-uniform (space dependent) profile could be a parabolic velocity inlet of a fully developed pipe flow. Furthermore, a space and time dependent inlet velocity profile could be a pulsatile flow within an artery. First, form an equation of your variable as a function of the coordinates.
`e` is offline   Reply With Quote

Old   March 11, 2016, 06:27
Default surface heat flux
  #4
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
hi,

I have to apply heat flux on surface.and in my case heat flux and wall temperature is varying wrt x direction and time.
asmita_iitb is offline   Reply With Quote

Old   March 11, 2016, 06:47
Default
  #5
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The DEFINE_PROFILE macro can be used for the temperature profile and DEFINE_HEAT_FLUX can be used for the heat flux profile.

Quote:
Originally Posted by `e` View Post
First, form an equation of your variable as a function of the coordinates.
`e` is offline   Reply With Quote

Old   March 13, 2016, 08:53
Default
  #6
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
Hi,
please check and tel me is this correct or not?


#include "udf.h"
#include "mem.h"
#include "stdio.h"

#define Ta 27.
#define h 7.528
#define PRINT printf
#define C_S 1710.0


DEFINE_ADJUST(udf9,d)
{
real FC[2];
cell_t c;
int ID = 5;
Thread *t;
d=Get_Domain(1);
real temp_wall;
real q_wall;

t = Lookup_Thread(d,ID);

begin_c_loop(c,t)

{
F_CENTROID(FC,c,t);
temp_wall=C_UDSI(c,t,1)/C_S-273.;

q_wall=h*(Ta-temp_wall);

/*printf("x-coord = %f y-coord = %f", FC[0], FC[1]); */
/* printf("temp_wall=%f",temp_wall)
printf("q_wall=%f",q_wall);*/

C_UDMI(c,t,11) = q_wall;

return q_wall;



}
end_c_loop(c,t)
}

DEFINE_PROFILE(udf10,t,i)
{
real FC [2];
real y;
face_t f;
cell_t c;
real heat_flux;

begin_c_loop(c,t)

{
F_CENTROID(FC,c,t);

F_PROFILE(f,t,i) = C_UDMI(c,t,11);

C_UDMI(c,t,12)= heat_flux;

return heat_flux;
}
end_c_loop(c,t)
}
asmita_iitb is offline   Reply With Quote

Old   March 13, 2016, 17:24
Default
  #7
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The DEFINE_ADJUST macro should return void, whereas you're returning 'q_wall'. Have a read of the section on DEFINE_HEAT_FLUX in the UDF manual to determine if this macro is suitable, otherwise use another DEFINE_PROFILE for your heat flux boundary.

For your DEFINE_PROFILE code block, you've assigned 'heat_flux' to UDM-12 which hasn't been initialised (only declared), and then returning this 'heat_flux' variable. I suspect you'd get errors when running this UDF (garbage numbers being used). I recommend you step back and check your boundary condition definitions and explain them in detail so we can better help you.
`e` is offline   Reply With Quote

Old   March 14, 2016, 02:18
Default
  #8
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
Hi,

actualy, I didnt get any error. but what u mentioned is correct. I will consider your suggestion and redo udf.

thank you.
asmita_iitb is offline   Reply With Quote

Old   March 21, 2016, 04:36
Default Temperature dependent property
  #9
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
Hi,

i am solving PCM problem, in this all pcm properties are dependent on temperature, i am using fluent software and energy equation is solving through UDF. so how i incorporate specific heat in udf
asmita_iitb is offline   Reply With Quote

Old   March 21, 2016, 05:43
Default
  #10
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Quote:
Originally Posted by asmita_iitb View Post
i am solving PCM problem, in this all pcm properties are dependent on temperature, i am using fluent software and energy equation is solving through UDF.
Are you using Fluent's energy equation to solve for the temperature field or are you using a UDF (and probably user-defined scalars, UDS)? If the former, then you can use the C_T(c,t) macro for retrieving a cell temperature. For the latter, use the relevant UDS macros.

Quote:
Originally Posted by asmita_iitb View Post
so how i incorporate specific heat in udf
The specific heat can be modified with the DEFINE_SPECIFIC_HEAT macro.
`e` is offline   Reply With Quote

Old   March 23, 2016, 04:42
Default how to write udf for temperature dependent CP
  #11
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
I am using UDF for solving energy equation (UDS) not fluent energy eqn.
all thermophysical properties are temperature dependent .

(Cp is used for calculating temperature in present case)
asmita_iitb is offline   Reply With Quote

Old   March 23, 2016, 07:00
Default
  #12
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
What do you currently have for your UDF? Have a read of the theory guide if you want the equations of the energy equation. If you want to have temperature-dependent specific heat then you could either use a function (if one exists; probably an approximation) or a look up table (reads and interpolates specific heat from a range of values according to temperature).
`e` is offline   Reply With Quote

Old   April 6, 2016, 03:36
Default about specific heat
  #13
New Member
 
asmita
Join Date: Feb 2016
Location: Mumbai
Posts: 11
Rep Power: 10
asmita_iitb is on a distinguished road
hello,

actualy, I tried a lot to incorporate specific heat through udf for solving energy equation but result is not coming correct. now, i have insert all temperature dependent thermophysical properties through udf except specific heat. (I consider avg specific heat).and result is coming according to trend.
once again thank you for your suggestion.
asmita_iitb is offline   Reply With Quote

Reply

Tags
define_profile, udf


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
Total pressure and mass flow boundary condition at inlet bscphil OpenFOAM Pre-Processing 3 July 9, 2017 15:39
Problem with assigned inlet velocity profile as a boundary condition Ozgur_ FLUENT 5 August 25, 2015 05:58
boundary condition for coupled inlet and outlet xxxx OpenFOAM Pre-Processing 2 August 13, 2013 16:51
Inlet Velocity in CFX aeroman CFX 12 August 6, 2009 19:42
Diffusion component at inlet Balaji FLUENT 2 August 8, 2005 08:37


All times are GMT -4. The time now is 16:28.