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

Transient Temperature Profile

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 8 Post By alven299

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2011, 03:21
Default Transient Temperature Profile
  #1
New Member
 
alven
Join Date: Mar 2009
Location: Malaysia
Posts: 25
Blog Entries: 1
Rep Power: 17
alven299 is on a distinguished road
Dear all,

I wish to impose a transient temperature profile to my inlet boundary condition. I have liquid entering a system at 300K and after 40s, I would like the liquid to enter at 340K, in brief:

when 0<t<40s, T=300K
when t>=40s, T=340K

I know that this is manageable by using UDF, but since I'm very new to UDF and to C programming language, I'd appreciate if anybody could provide me with a sample code to define the said profile.

many thanks.
alven299 is offline   Reply With Quote

Old   April 18, 2011, 23:18
Default
  #2
New Member
 
alven
Join Date: Mar 2009
Location: Malaysia
Posts: 25
Blog Entries: 1
Rep Power: 17
alven299 is on a distinguished road
Have figured it out. Here is the script, hope it might be of help to others:

#include "udf.h"

DEFINE_PROFILE(inlet_temperature,t,i)
{
real x[ND_ND];
real time;
face_t f;

begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
time=CURRENT_TIME;
if(time<40)
F_PROFILE(f,t,i)=300;

else

F_PROFILE(f,t,i)=340;
}
end_f_loop(f,t)
}
alven299 is offline   Reply With Quote

Old   February 23, 2015, 06:33
Default Thank you.
  #3
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Hi Alven,

Thanks a lot for your UDF. This will help me for sure.
Bharadwaj B S is offline   Reply With Quote

Old   August 26, 2015, 08:25
Default
  #4
New Member
 
Batuhan Savaskan
Join Date: Aug 2015
Posts: 9
Rep Power: 11
Batuhan is on a distinguished road
Hello Everyone;

I am using fluent and I have transient experimental temperature data for a surface in excel format. I want to import them to fluent and run. How can I do that? Is there anyone who has the code of this. The code that is written above is a good example but I have 45820 temperature datas and these datas are changing in 1 s . So I have to read the file directly and than run it . Could you help me ?

Thank you very much.
Batuhan is offline   Reply With Quote

Old   September 18, 2015, 04:47
Wink Tabular input is also possible mate!
  #5
New Member
 
Lamboram
Join Date: Jul 2011
Location: Munich
Posts: 16
Rep Power: 15
lamboram is on a distinguished road
Quote:
Originally Posted by Batuhan View Post
Hello Everyone;

I am using fluent and I have transient experimental temperature data for a surface in excel format. I want to import them to fluent and run. How can I do that? Is there anyone who has the code of this. The code that is written above is a good example but I have 45820 temperature datas and these datas are changing in 1 s . So I have to read the file directly and than run it . Could you help me ?

Thank you very much.
The format of the tabular transient profile file is

profile-name n_field n_data periodic?
field-name-1 field-name-2 field-name-3 .... field-name-n_field
v-1-1 v-2-1 ... ... ... ... v-n_field-1
v-1-2 v-2-2 ... ... ... ... v-n_field-2
.
.
.
.
.
v-1-n_data v-2-n_data ... ... ... ... v-n_field-n_data
One of the field-names should be used for the time field, and the time field section must be in ascending order. The periodic? entry indicates whether or not the profile is time-periodic. Set it to 1 for a time-periodic profile, or 0 if the profile is not time-periodic.

An example is shown below:

sampletabprofile 2 3 1
time u
1 10
2 20
3 30

Source : http://jullio.pe.kr/fluent6.1/help/html/ug/node174.htm
lamboram is offline   Reply With Quote

Old   September 18, 2015, 05:23
Default
  #6
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
There is a way to write and read from a text file. Using fprintf and fscanf in C language. I had seen one post on writing data to a file. You can try similarly for reading data from a text file.
Bharadwaj B S is offline   Reply With Quote

Old   October 3, 2018, 12:02
Default
  #7
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Quote:
Originally Posted by alven299 View Post
Have figured it out. Here is the script, hope it might be of help to others:

#include "udf.h"

DEFINE_PROFILE(inlet_temperature,t,i)
{
real x[ND_ND];
real time;
face_t f;

begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
time=CURRENT_TIME;
if(time<40)
F_PROFILE(f,t,i)=300;

else

F_PROFILE(f,t,i)=340;
}
end_f_loop(f,t)
}

Dear Alven, Thank you for sharing the code. I have question related to monitoring the transient BC that is written in C++ code during the transient simulation. I wounder is there any way to visualise the temperature of a specific boundary during the simulation to make sure that the UDF is correct?

Regards
Oula
Oula is offline   Reply With Quote

Reply

Tags
temperature profile, udf profile bounday, unsteady


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
UDF for a horizontal temperature profile CD Fluent UDF and Scheme Programming 9 May 6, 2018 13:13
set temperature on subdomain, in transient mode nicolas CFX 0 August 16, 2006 07:42
stationary flow - transient temperature Nicola Siemens 5 June 16, 2003 06:44
Parabolic temperature Inlet Profile in a tube majestywzh FLUENT 0 April 9, 2003 07:37
temperature profile on boundary sivakumar FLUENT 5 November 24, 2002 01:58


All times are GMT -4. The time now is 18:48.