CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF to modify inlet fluid temperature

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

LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2016, 22:11
Question UDF to modify inlet fluid temperature
New Member
Vipul Patel
Join Date: Apr 2013
Location: New Delhi
Posts: 2
Rep Power: 0
Vipul_Patel is on a distinguished road
Dear all,
In my simulation, I want to modify my inlet boundary condition according to the temperature obtained at the outlet boundary.
Inlet temperature = Outlet temperature - 5.0
I am trying to write a UDF for this purpose. I am able to compile the UDF but I am not able to assign it to the inlet boundary. When I am trying to assign it to the inlet boundary, fluent automatically terminates.

My UDF is as follows:

#include "udf.h"
real Tout[100];
FILE *fid;
FILE *fid1;

DEFINE_ADJUST(Out_temp, domain)
face_t f;
int i=1;
int ID = 6;
Thread *thread = Lookup_Thread(domain, ID);
fid=fopen("T_out", "w");

begin_f_loop(f, thread)

fprintf(fid,"%f\n", Tout[i]);


DEFINE_PROFILE(Inlet_Temp, thread6, position)
face_t f;
cell_t c;
int i,j;

fid1=fopen("T_in", "w");

fprintf(fid1, "%f\n", Tout[i]-5.0);


Please let me know if the present methodology is correct or not. Is it possible to update the inlet boundary temperature according to the outlet boundary temperature by any other means??

Vipul_Patel is offline   Reply With Quote


boundary condition, udf code

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 08:15
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Error in Two phase (condensation) modeling adilsyyed CFX 15 June 24, 2015 20:42
Setting Inlet as Wall until flow occurs via UDF emmkell Fluent UDF and Scheme Programming 0 May 1, 2012 13:05
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11

All times are GMT -4. The time now is 07:38.