|
[Sponsors] |
April 18, 2011, 03:21 |
Transient Temperature Profile
|
#1 |
New Member
|
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. |
|
April 18, 2011, 23:18 |
|
#2 |
New Member
|
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) } |
|
February 23, 2015, 06:33 |
Thank you.
|
#3 |
Member
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11 |
Hi Alven,
Thanks a lot for your UDF. This will help me for sure. |
|
August 26, 2015, 08:25 |
|
#4 |
New Member
Batuhan Savaskan
Join Date: Aug 2015
Posts: 9
Rep Power: 11 |
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. |
|
September 18, 2015, 04:47 |
Tabular input is also possible mate!
|
#5 | |
New Member
Lamboram
Join Date: Jul 2011
Location: Munich
Posts: 16
Rep Power: 15 |
Quote:
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 |
||
September 18, 2015, 05:23 |
|
#6 |
Member
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11 |
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.
|
|
October 3, 2018, 12:02 |
|
#7 | |
Member
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11 |
Quote:
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 |
||
Tags |
temperature profile, udf profile bounday, unsteady |
|
|
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 |