CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   adding hydrogen with source term (https://www.cfd-online.com/Forums/fluent/191189-adding-hydrogen-source-term.html)

hongzhilin August 3, 2017 04:24

adding hydrogen with source term
 
Hi,everyone,

I use source term to add hydrogen in a closed room, it's weird that the total gas mass gets lower.
It seems that the the hydrogen amount adding to cell replaces the air with the same mole and the air disappears.
This question confused me a lot, please give me some advises.
Here is my setting:
pressure_based solver, transient,with gravity;
energy on, standard k-epsilon, realizable wall Fn, species transport without reaction;
material is air and hydrogen, ideal gas;
operating pressure is 1atm;
all boundaries are adiabatiques walls;
initial temperature is 300k;


here is my udf:
DEFINE_ADJUST(set,d)
{
cell_t cell;
Thread *thread;
real total mass = 1.0;
real total_volume = 0.102526;
real inlet_time = 10.0;
real velocity = 0.1;
real temp;


thread_loop_c(thread,d)
{
begin_c_loop_all(cell,thread)
{
if (CURRENT_TIME>=0.0 && CURRENT_TIME<=inlet_time)
{
if (cell<=100 && cell>=90)
{
temp = C_T(cell,thread);
C_UDMI(cell,thread,0) = total_mass/total_volume/inlet_time;
C_UDMI(cell,thread,1) = (total_mass/total_volume/inlet_time)*14283.0*(temp-298); /*the enthalpy of hydrogen*/
C_UDMI(cell,thread,2) = (total_mass/total_volume/inlet_time)*velocity;
}
else
{
C_UDMI(cell,thread,0) = 0.0;
C_UDMI(cell,thread,1) = 0.0;
C_UDMI(cell,thread,2) = 0.0;
}
}
else
{
C_UDMI(cell,thread,0) = 0.0;
C_UDMI(cell,thread,1) = 0.0;
C_UDMI(cell,thread,2) = 0.0;
}
}end_c_loop_all(cell,thread)
}

}

DEFINE_INIT()
{
/*to make every udmi equal to 0.0*/
}

3*DEFINE_SOURCE{ /*return source = C_UDMI(cell,thread,i)*/; dS[eqn] = 0.0}


All times are GMT -4. The time now is 03:11.