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

Temperature updating UDF

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

LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2023, 11:24
Post Temperature updating UDF
New Member
Join Date: May 2022
Posts: 3
Rep Power: 4
FFerrario is on a distinguished road
Greetings everyone.

I have made this UDF code that is part of a larger whole, but right now I'm concentrated in this temperature change section. I want to see how the temperature of the inlet, which simulates the evaporation rate of a small pool in a fully diffusive manner (no wind current), changes. Account for the flow rate and convective heat transfer from the surroundings, I have the following code:

real T_Face, M_Face,MF_rate, V_mag, A_dish, HTC;
face_t f;
HTC = K/0.0002;
A_dish = 0.003619;
/*Mass flow rate estimation*/
V_mag = pow((pow(F_U(f,t),2)+pow(F_V(f,t),2)+pow(F_W(f,t), 2)),0.5);
MF_rate = V_mag*A_dish*F_R(f,t);
/*Mass estimation*/
F_UDMI(f,t,1) = F_UDMI(f,t,2)-0.05*MF_rate;
/*Current mass value*/
M_Face = F_UDMI(f,t,1);
/*Temperature estimation*/
F_UDMI(f,t,3) = F_UDMI(f,t,4);
/*Current temperature value*/
T_Face = F_UDMI(f,t,3);
F_PROFILE(f,t,i) = T_Face-((DHev*MF_rate*0.05)/(M_Face*Cp))+((HTC*A_dish*0.05*(293.15-T_Face))/(M_Face*Cp));
F_UDMI(f,t,4) = F_T(f,t);
/*Save current temperature for the next timestep*/
F_UDMI(f,t,2) = M_Face;
/*Save current mass for next timestep*/
Message("M_face= %f", M_Face);

As you see, I account for the previous time step temperature and mass reduction from the pool through F_UDMIs, but they don't seem to be updating. Do you think you could help me?

Thanks a lot,
FFerrario is offline   Reply With Quote

Old   August 21, 2023, 12:21
New Member
pavan vemula
Join Date: Jun 2022
Posts: 3
Rep Power: 4
vemula is on a distinguished road
Sometimes it can be due to an option in fluent in the run calculation tab called as update profile interval if you set to 1 and try again it might help
vemula is offline   Reply With Quote

Old   August 22, 2023, 01:42
Senior Member
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
F_UDMI(f,t,1) = F_UDMI(f,t,2)-0.05*MF_rate;
F_UDMI(f,t,2) is not define for the irst times step
best regards

press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 29, 2023, 12:50
New Member
Join Date: May 2022
Posts: 3
Rep Power: 4
FFerrario is on a distinguished road
Right, this value is defined during the initialization step. To tell the truth, the code does work, but results are not what I expected. Due to the nature of diffusive evaporation, not including the temperature change in the simulation while estimating the evaporation is not a big deal, thus I did do some simulations where I can get a mass flow rate with a constant temperature. With this mass flow rate, I can use the data listed in the equation to estimate how the temperature profile SHOULD behave (it would lose 1 K in 12 minutes, which makes sense). Instead, my model loses 10 K (in fluent) in 12 minutes, by evaporating 1 g of liquid in that time. This is very excessive. From the code above, what could lead to this gross overprediction? I have checked all values possible. The only one being actively calculated by the model is the mass flow rate, that is in the order of 10e-6 Kg.
FFerrario is offline   Reply With Quote


heat and mass transfer, udf code, udmi.uds

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
Inlet temperature as a function of outlet temperature UDF wimblo Fluent UDF and Scheme Programming 5 November 25, 2021 06:06
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 07:15
UDF to Define Temperature Dependent Negative Heat Source ATIKADAR Fluent UDF and Scheme Programming 1 September 23, 2019 03:52
interFoam wave propagation and explosion of Courant number and residuals ChiaraViola OpenFOAM Running, Solving & CFD 1 June 26, 2019 05:36
problem in temperature and liquid fraction value in the udf durg FLUENT 0 October 23, 2018 01:52

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