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

temperature initialization

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2021, 03:20
Default temperature initialization
  #1
New Member
 
feride kutbay
Join Date: Sep 2021
Posts: 2
Rep Power: 0
feri_phd is on a distinguished road
Hello cfd online members,

I want to give the initial temperature value on surfaces on my model. I wrote udf code. it works fine for one geometry whereas another model has never work. I tried some things. and I changed the face ID for the new model. To be clear, I will give the steps I did.

1). I wrote udf code as follow;
#include "udf.h"
DEFINE_INIT(my_init_funcf7,domain)
{
real F_T;
face_t f;
int ID=15;
/* loop over all cell threads in the domain */
Thread *thread = Lookup_Thread(domain,ID);
#if RP_NODE
begin_f_loop(f,thread)
{
F_T(f,thread)=374;
}
end_f_loop_all(f,thread)
#endif
}
//f8
DEFINE_INIT(my_init_funcf8,domain)
{
real F_T;
face_t f;
int ID=16;
/* loop over all cell threads in the domain */
Thread *thread = Lookup_Thread(domain,ID);
#if RP_NODE
begin_f_loop(f,thread)
{
F_T(f,thread)=373;
}
end_f_loop_all(f,thread)
#endif
}

2) interpreted to udf and the hooking is done
3). the standard initialization is achieved.

These steps worked fine with one model but for another model doesn't work. I tried another type udf as follows. but it doesn't work still.

#include "udf.h"
DEFINE_INIT(my_init_funcb5,domain)
{
int F_T;
face_t f;
int ID=70;
Thread *t1 = Lookup_Thread(domain,9);
Thread *t2 = Lookup_Thread(domain,10);
thread_loop_f(t1, domain)/* loops over all face threads in a domain*/
{
begin_f_loop(f,t1)
{
F_T(f,t1)=436;
}
end_f_loop_all(f,t)
}
thread_loop_f(t2, domain)/* loops over all face threads in a domain*/
{
begin_f_loop(f,t2)
{
F_T(f,t1)=436;
}
end_f_loop_all(f,t)
}
}


thank you
feri_phd is offline   Reply With Quote

Old   September 10, 2021, 06:19
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
When you say that the code does not work for a geometry, what does that mean? It crashes, it gives wrong results, it gives no results, the simulation diverges... Which one is it?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   September 10, 2021, 06:33
Cool
  #3
New Member
 
feride kutbay
Join Date: Sep 2021
Posts: 2
Rep Power: 0
feri_phd is on a distinguished road
Quote:
Originally Posted by pakk View Post
When you say that the code does not work for a geometry, what does that mean? It crashes, it gives wrong results, it gives no results, the simulation diverges... Which one is it?

Hello pakk,
it doesn't assign specfied temperatures to faces. it initializes with operating temperature.
feri_phd is offline   Reply With Quote

Old   September 10, 2021, 14:27
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Then I can only guess that the thread id is different in the other geometry.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   September 13, 2021, 01:55
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
as you've defined threads explicitly in your code
you don't need to loop over thread anymore
for thread with ID 9 and 10 your code looks like this:
(values 9 and 10 are ddifferent for each case, check in fluent graphical interface)
Code:
#include "udf.h"
DEFINE_INIT(my_init_funcb5,domain)
{
face_t f;

Thread *t1 = Lookup_Thread(domain,9);
Thread *t2 = Lookup_Thread(domain,10);

begin_f_loop(f,t1)
{
	F_T(f,t1)=436;
}
end_f_loop_all(f,t1)


begin_f_loop(f,t2)
{
	F_T(f,t2)=436;
}
end_f_loop_all(f,t2)

}
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
Shadow Wall and temperature norger FLUENT 10 September 28, 2019 11:43
Static temperature and Total temperature Jong-Yoon FLUENT 0 September 25, 2016 01:42
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 17:00
Inlet won't apply UDF and has temperature at 0K! tccruise Fluent UDF and Scheme Programming 2 September 14, 2012 06:08


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