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

UDF for saturation temperature for Lee's Condensation model

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2020, 09:28
Default UDF for saturation temperature for Lee's Condensation model
  #1
New Member
 
Chun Wheng
Join Date: Aug 2011
Posts: 5
Rep Power: 12
Boo85 is on a distinguished road
Hello everyone!

I am doing a fluent simulation for the condensation of water vapor on a cool surface exposed to air. So right now I am planning the simulation and would like some idea on how to write the UDF, as I think a UDF is needed to adjust the saturation temp based on the air moisture in the air above it.

The idea I have is to use VOF with 2 phases:
  1. Air phase with species transport (air and water vapor)
  2. Liquid water for the condensation of water

The objective is to use the UDF for calculate the saturated air temperature from ONLY the air phase assuming that is the primary phase. Therefore the UDF should not perform any calculations on the liquid water phase.


The UDF I found on the other thread, which I modified is this:

#include "udf.h"
#define rho_dry_air 1.2
#define rho_wv 0.59
DEFINE_PROPERTY(saturation_temperature,c,thread)
{
Thread *t_air = THREAD_SUB_THREAD(thread,0);
real mass_dry_air = C_YI(c,t_air,0)*rho_dry_air;
real mass_wv = C_YI(c,t_air,1)*rho_wv;
if (mass_dry_air>0) {
w = mass_wv / mass_dry_air;
return w*(XXXXXXXXXXXXXXXXXXXXXXXXXXXXX);
} else {
return 1000;
}
}

So with the humidity ratio, w, I will calculate the saturated air temperature under the return function. Most importantly will the UDF be able to achieve the calculation of just the air phase this way or am I totally off?

I have done very simple UDFs before like for the profile etc. This is my first UDF working with VOF, multiple species and using thread_sub_thread, so i am wondering if I am on the right track.

Any comments will be greatly appreciated! Thanks!
Boo85 is offline   Reply With Quote

Old   August 21, 2021, 16:05
Default
  #2
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,546
Blog Entries: 6
Rep Power: 51
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Quote:
Originally Posted by Boo85 View Post
Hello everyone!

I am doing a fluent simulation for the condensation of water vapor on a cool surface exposed to air. So right now I am planning the simulation and would like some idea on how to write the UDF, as I think a UDF is needed to adjust the saturation temp based on the air moisture in the air above it.

The idea I have is to use VOF with 2 phases:
  1. Air phase with species transport (air and water vapor)
  2. Liquid water for the condensation of water

The objective is to use the UDF for calculate the saturated air temperature from ONLY the air phase assuming that is the primary phase. Therefore the UDF should not perform any calculations on the liquid water phase.


The UDF I found on the other thread, which I modified is this:

#include "udf.h"
#define rho_dry_air 1.2
#define rho_wv 0.59
DEFINE_PROPERTY(saturation_temperature,c,thread)
{
Thread *t_air = THREAD_SUB_THREAD(thread,0);
real mass_dry_air = C_YI(c,t_air,0)*rho_dry_air;
real mass_wv = C_YI(c,t_air,1)*rho_wv;
if (mass_dry_air>0) {
w = mass_wv / mass_dry_air;
return w*(XXXXXXXXXXXXXXXXXXXXXXXXXXXXX);
} else {
return 1000;
}
}

So with the humidity ratio, w, I will calculate the saturated air temperature under the return function. Most importantly will the UDF be able to achieve the calculation of just the air phase this way or am I totally off?

I have done very simple UDFs before like for the profile etc. This is my first UDF working with VOF, multiple species and using thread_sub_thread, so i am wondering if I am on the right track.

Any comments will be greatly appreciated! Thanks!
Were you able to find out solution of your problem?
Far is offline   Reply With Quote

Reply

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
UDF saturation temperature (evaporation model Fluent) bbarbier07 Fluent UDF and Scheme Programming 11 June 15, 2021 04:18
primary/secondary phase in VoF condensation model soumitra2102 FLUENT 2 December 16, 2019 10:41
interFoam wave propagation and explosion of Courant number and residuals ChiaraViola OpenFOAM Running, Solving & CFD 1 June 26, 2019 05:36
Modified k-e turbulence model UDF Travis Fluent UDF and Scheme Programming 7 November 11, 2018 20:21
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27


All times are GMT -4. The time now is 08:04.