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/)
-   -   Fixed temperature for one phase in VOF (https://www.cfd-online.com/Forums/fluent-udf/170152-fixed-temperature-one-phase-vof.html)

Apiano April 25, 2016 11:23

Fixed temperature for one phase in VOF
 
Hi guys, it's my first question in this forum. . I went back to work with Fluent recently.

I am working in a problem with two liquid phases and I want to set a fixed temperature in one of the phases, for the entire simulation. So, the temperature would be fixed in cell zones where there is entirely one phase.
My question is, how do I do that? How can I set the temperature or a UDS fixed in the cell zone?

The idea here is to use the Poisson equation for the energy as the similar electrostatic equation. In this way, the temperature would be the electric potential.

Will this work?
#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
real frac;
begin_c_loop(c,t)
{
frac = C_YI_G(c,t,1)
if (frac > 0.9) C_T(c,T) = 1
}
end_c_loop(c,t)
}

Bruno Machado April 26, 2016 04:51

Quote:

Originally Posted by Apiano (Post 596620)
Hi guys, it's my first question in this forum. . I went back to work with Fluent recently.

I am working in a problem with two liquid phases and I want to set a fixed temperature in one of the phases, for the entire simulation. So, the temperature would be fixed in cell zones where there is entirely one phase.
My question is, how do I do that? How can I set the temperature or a UDS fixed in the cell zone?

The idea here is to use the Poisson equation for the energy as the similar electrostatic equation. In this way, the temperature would be the electric potential.

Will this work?
#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
real frac;
begin_c_loop(c,t)
{
frac = C_YI_G(c,t,1)
if (frac > 0.9) C_T(c,T) = 1
}
end_c_loop(c,t)
}

I am not sure you can or how to do that.

Regarding the piece of code you showed, frac is obtaining the value of the volume fraction gradient of species 1, not the volume fraction C_YI. There is also couple of lines where the " ; " is missing. In addition to that, the the DEFINE_ON_DEMAND, as the name says, is only define on demand, so you gotta execute it manually on Fluent. Not sure this is what you want.

Apiano April 26, 2016 09:14

Yes... I see the code is wrong. But, I found out that I can do that thing with the macro DEFINE_ADJUST(name,d). I'll work on that. If pays off I'll post the code here.


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