UDF saturation temperature (evaporation model Fluent)
Hi everyone,
I want to simulate the evaporation of water with VOF model (water-liquid to water-vapor). I am using the evaporation-condensation model. In this model, we can put the desired saturation temperature (373.15 K for water). However this value is not always constant because it can change with pressure. I want to evaporate water by decreasing the pressure. That's why I want to create a UDF to compute this saturation temperature in function of pressure (if pressure decreases, the saturation temperature decreases too...). Here what I wrote (but nothing happens) : #include "udf.h" DEFINE_PROPERTY(saturation_temp,c,t) { real sat_t; real vapor_p; real static_p = C_P(c,t); real operating_p = RP_Get_Float("operating-pressure"); vapor_p = static_p + operating_p; // absolute pressure = static pressure + operating pressure sat_t = (1723.6425/(8.05573-log(vapor_p/133.322))-233.08)+273.15; // Pressure in Pa to mmHg (Yaws) return sat_t; } I cannot find something about it, I do not know if I have to use DEFINE_PROPERTY... Can anyone help me? Thanks in advance! |
you should hook your UDF
change constant 373.15K to your UDF function best regards |
Quote:
So the problem is still here. Do you think a DEFINE_PROPERTY is ok to define the temperature? |
yes it is OK
try this Code:
#include "udf.h" |
Quote:
Actually I want to evaporate water liquid (to water vapor) in a 2D container by warming the bottom wall. I did it correctly with the saturation temperature as a constant but when I replace with my UDF nothing happens, there is no water vapor. I should get the same result as the case with a constant... If you have another idea thanks in advance... Best regards |
Code:
#include "udf.h" best regards |
I tried it, it works well so UDF works but not the one function of pressure...
Best regards |
1. try with othe temperature 300, 400
2. try this Code:
#include "udf.h" |
I have found the solution!
Actually, there were 2 problems in my UDF. The first one was the operating pressure: change Float to Real. The second was with the "log": the correct formulation for a variable is "double log10 (double x)". You can find the final code: #include "udf.h" DEFINE_PROPERTY(saturation_temp,c,t) { real sat_t; real vapor_p; real static_p = C_P(c,t); real operating_p = RP_Get_Real ("operating-pressure"); vapor_p = static_p + operating_p; // absolute pressure = static pressure + operating pressure sat_t = (1723.6425/(8.05573-((double)log10((double)vapor_p/133.322)))-233.08)+273.15; // Pressure in Pa to mmHg (Yaws) return sat_t; } |
when you start fluent in double precision regime all "reals" are double
best regards |
Hi Sir,
Could you please help? I used your code and it goes "The computed saturation temperature <=0.0. What should I do? it has already driven me crazy!! |
most likely you didn't put correct operating pressure
|
Quote:
Hiiiii what is the basis of this formula "sat_t" is there a detailed explanation thanks in advance |
All times are GMT -4. The time now is 06:23. |