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

Outlet temperature to temperature boundary condition of velocity inlet. (UDF)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2018, 08:32
Default Outlet temperature to temperature boundary condition of velocity inlet. (UDF)
  #1
New Member
 
dongsu park
Join Date: Aug 2016
Posts: 2
Rep Power: 0
dillon is on a distinguished road
Good day Guys.

I have a big problem to give temperature condition in inlet condition.

Simulation is like under.

there is a pipe in sea water. and initial temperature condition of sea water is 277.15K and pipe and fluid are 343.15K.

I want to give outlet temperature to inlet temperature.

like that

time step 1 of outlet temperature to time step 2 of inlet temperature
and

time step 2 of outlet temperature to time step 3 of inlet temperature.

I'm not familiar with c++ code and i think i couldn't make this for myself.

this is code i found and revised....


#include "udf.h"

#define get_temp_zone_ID 26

real Abstemperature =343.15;

DEFINE_ADJUST(find_Abstemperature,domain)
{
#if !RP_HOST
Thread *ft,*ct;
face_t f;
cell_t c;
/* int ID = 26; */

Abstemperature =343.15;

ft = Lookup_Thread(doamin,get_temp_zone_ID);
ct = THREAD_T0(ft);

Abstemperature =343.15;

begin_f_loop(f,ft)
{
c = F_C0(f,ft);
if(Abstemperature > C_T(c,ct))
Abstemperature = C_T(c,ct);

}
end_f_loop(f,ft)
#endif
}

DEFINE_PROFILE(Abstemperature, t, enq)
{
face_t f;

begin_f_loop(f, t)
{
F_PROFILE(f, t, enq) = Abstemperature;
}

end_f_loop(f, t)
}

If anyone professional in UDF..

Please help me

Sincerely Dillon.
dillon is offline   Reply With Quote

Old   March 24, 2018, 02:36
Default
  #2
New Member
 
Doruk Yelkenci
Join Date: Apr 2017
Posts: 20
Rep Power: 9
doruk is on a distinguished road
You cant carry variables between 2 different macros. Just use define profile.
doruk is offline   Reply With Quote

Old   March 24, 2018, 23:51
Default
  #3
New Member
 
dongsu park
Join Date: Aug 2016
Posts: 2
Rep Power: 0
dillon is on a distinguished road
Quote:
Originally Posted by doruk View Post
You cant carry variables between 2 different macros. Just use define profile.
Thank you for reply doruk.

as you say. I make code using only difine profile like this

#include "udf.h"

DEFINE_PROFILE(temp_in,thread,i)
{

Domain *d;

real temp_in;
int ID_outlet=26;

face_t f;
Thread *t;
d = Get_Domain(14);

t= Lookup_Thread(d, ID_outlet);

begin_f_loop(f,thread)
{
temp_in = F_T(f,t);

F_PROFILE(f, thread, i) = temp_in;

}
end_f_loop(f,thread)

}


...but it cant work..

when i click 'Initialize' error pops up

massage is "MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started."

what should i d?
dillon is offline   Reply With Quote

Old   March 25, 2018, 12:06
Default
  #4
New Member
 
Doruk Yelkenci
Join Date: Apr 2017
Posts: 20
Rep Power: 9
doruk is on a distinguished road
check your threads. You have defined t= Lookup_Thread(d, ID_outlet) but for the loop you are using begin_f_loop(f,thread).

Change it to begin_f_loop(f,t)

Hope it works now
Best Regards
Doruk
doruk 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
The method on dealing with velocity in static pressure outlet boundary condition mona.li CFX 2 September 30, 2017 02:33
map outlet boundary profile as an inlet condition using UDF Daniel_Khazaei Fluent UDF and Scheme Programming 2 June 20, 2016 12:53
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
How to mention neuman boundary condition for velocity at the outlet or inlet?? Souviktor FLUENT 0 June 1, 2009 14:30


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