CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for saturation temperature for Lee's Condensation model (https://www.cfd-online.com/Forums/fluent-udf/230412-udf-saturation-temperature-lees-condensation-model.html)

Boo85 September 22, 2020 09:28

UDF for saturation temperature for Lee's Condensation model
 
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!

Far August 21, 2021 16:05

Quote:

Originally Posted by Boo85 (Post 783460)
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?


All times are GMT -4. The time now is 19:51.