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/)
-   -   DPM Switching (https://www.cfd-online.com/Forums/fluent-udf/200486-dpm-switching.html)

skumar112 April 4, 2018 12:10

DPM Switching
 
I am trying to implement a custom heating and evaporation law in fluent for DPM droplets. But for some reason only one of the two laws activate. when you use the fluent in built models for droplets both evaporation and heating occur during every time step and evaporation stops once the volatile fraction is consumed. when I implement the same thing I can either get the heating law to work with no evaporation or evaporation with no heating. can anyone suggest what may be going wrong here

DEFINE_DPM_SWITCH(dpm_switch,tp,ci)
{
Material *m = TP_MATERIAL(tp);
real v_f = DPM_VOLATILE_FRACTION(tp);

if (TP_T(tp) < DPM_VAPOR_TEMP(tp,m))
{
TP_CURRENT_LAW(tp) = DPM_LAW_USER_1;
}
if ((TP_T(tp) > DPM_VAPOR_TEMP(tp,m)) && (TP_MASS(tp) > (1 - v_f) * TP_INIT_MASS(tp)))
{
TP_CURRENT_LAW(tp) = DPM_LAW_USER_2;
}
else if ( (TP_MASS(tp) <= (1 - v_f) * TP_INIT_MASS(tp)))
{
TP_CURRENT_LAW(tp) = DPM_LAW_USER_3;
}
}


All times are GMT -4. The time now is 15:27.