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

Define_profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 19, 2011, 04:33
Default Define_profile
  #1
Member
 
EH
Join Date: Dec 2010
Posts: 61
Rep Power: 6
ehooi is on a distinguished road
Hi,
Does anyone know if such computations are allowed in DEFINE_PROFILE?

Code:
 
DEFINE_PROFILE(heater_bc,t,i)
{

#if !RP_HOST
if(I_AM_NODE_ZERO_P)
{
begin_c_loop(c,thtank)
{
C_CENTROID(coord,c,thtank);
x=sensor_coord[0];
y=sensor_coord[1];
z=sensor_coord[2];

if ((x >= xmin) && (x <= xmax))
{ 
if ((y >= ymin) && (y <= ymax))
{
if ((z >= zmin) && (z <= zmax))
{
Tpoint = Tpoint + C_T(c,thtank); /* get thermosensor temperature */
nt = nt + 1.0; /* count number */
}
}
}
}
end_c_loop(c,thtank)
Tpoint =Tpoint/nt; /* Average over all cells calculated */
compute_node_loop_not_zero(i)
{
PRF_CSEND_DOUBLE(i, &Tpoint, 1, myid);
}
}
.
.
.
.
IF (Tpoint < Tcutoff)
F_PROFILE = 1000
ELSE
F_PROFILE = 0
end
I have avoided all the variable declaration and some other syntax to shorten it. The reason I do not use DEFINE_ADJUST is because after calculating Tpoint, I don't know how to store it. I can write it as

begin_c_loop
C_UDMI=Tpoint
end_c_loop

but Tpoint actually doesnt belong to a particular cell. Other than the F_UDMI and C_UDMI, does anyone know how to pass the value calculated from DEFNE_ADJUST to DEFINE_PROFILE?

Thank you all.


Cheers
EH


ehooi 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



All times are GMT -4. The time now is 02:32.