CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to control the boiling zone (https://www.cfd-online.com/Forums/fluent/243691-how-control-boiling-zone.html)

ZhangHengyuan June 30, 2022 10:03

How to control the boiling zone
 
I am modelling a gas-liquid two-phase model with a boiling process(VOF model for now),and I want to keep the boiling process in a fixed area.
I set the overheat temperature to 374K, and I hope to get a steady boiling height. I have tried to define the relationship between saturation pressure and boiling point in a table or UDF. But in this way, I still cannot control the boiling height precisely.
Then I am wondering if I can defining the relationship between property and position.

The original udf is shown below:

#include "udf.h"
DEFINE_PROPERTY(saturation_temp,c,t)
{
real sat_t;
real vapor_p;
real static_p;
real operating_p;
static_p=C_P(c,t);
operating_p = RP_Get_Float("operating-pressure");
vapor_p = static_p + operating_p;
sat_t = 1723.6425/(8.05573-log(vapor_p/133.322))-233.08+273.15;
return sat_t;
}

Then I want to define the property changing with height in order to control the bioing zone(represented by height Y), so I changed the UDF then it comes to a failure:

#include "udf.h"
DEFINE_PROPERTY(saturation_temp,c,t)
{
cell_t c;
Thread *t;
real xc[ND_ND];
real x;
real y;
real sat_t;
real vapor_p;
real static_p;
real operating_p;
thread_loop_c(t,d)
{
begin_c_loop_all(c,t)
{
x=xc[0];
y=yc[1];
if (y<0.6||y>0.8)
sat_t = 500
else
static_p=C_P(c,t);
operating_p = RP_Get_Float("operating-pressure");
vapor_p = static_p + operating_p;
sat_t = 1723.6425/(8.05573-log(vapor_p/133.322))-233.08+273.15;
return sat_t;
}
end_f_loop(c,t);
}
}


So, if it possible to define the property, saturation temp, changing with location?And if there's any other way to control the boiling height exactly?

AlexanderZ July 1, 2022 03:51

i recommend you to compile your code always, so you would see where the problem is
xc is not defined in your code

Code:

C_CENTROID(xc,c,t);
x=xc[0];
y=xc[1];

part of code after esle should be in brackets
Code:

{static_p=C_P(c,t);
operating_p = RP_Get_Float("operating-pressure");
vapor_p = static_p + operating_p;
sat_t = 1723.6425/(8.05573-log(vapor_p/133.322))-233.08+273.15;}



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