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

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

 March 22, 2018, 08:32 Outlet temperature to temperature boundary condition of velocity inlet. (UDF) #1 New Member   dongsu park Join Date: Aug 2016 Posts: 2 Rep Power: 0 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.

 March 24, 2018, 02:36 #2 New Member   Doruk Yelkenci Join Date: Apr 2017 Posts: 20 Rep Power: 8 You cant carry variables between 2 different macros. Just use define profile.

March 24, 2018, 23:51
#3
New Member

dongsu park
Join Date: Aug 2016
Posts: 2
Rep Power: 0
Quote:
 Originally Posted by doruk You cant carry variables between 2 different macros. Just use define profile.

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

#include "udf.h"

{

Domain *d;

real temp_in;
int ID_outlet=26;

face_t f;
d = Get_Domain(14);

{
temp_in = F_T(f,t);

}

}

...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?

 March 25, 2018, 12:06 #4 New Member   Doruk Yelkenci Join Date: Apr 2017 Posts: 20 Rep Power: 8 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