Looking for a solution?

Where there's a problem there's a solution

  • How to implement production term due to buoyancy for k-omega equations? Note that this is automatically taken into account for k-epsilon models and RSM.

  • These terms will be automatically taken into account in the future release.
    For versions Fluent12.1 (and previous releases), use the following UDF:
    It works for incompressible ideal gas option and can be easily adapted to boussinesq approximation.

    /* A source term to the k equation could be invoked through a */
    /* DEFINE_SOURCE UDF to include this effect in k-omega model */
    #include "udf.h"
    #include "sg.h"
    #include "models.h"

    /* UDF to compute buoyancy production in TKE equation */
    DEFINE_ADJUST(store_tg,domain)
    {
    Alloc_Storage_Vars(domain, SV_T_RG, SV_T_G, SV_NULL);
    T_derivatives(domain);
    Free_Storage_Vars(domain, SV_T_RG, SV_NULL);
    }

    DEFINE_SOURCE(tke_gb, c0, t0, dS, eqn)
    {
    real beta, mu_t, temp;
    real prod1=0.,source;
    real pr_t = M_keprt;

    /* Compute Buoyancy Production */
    mu_t = C_MU_T(c0,t0);
    temp = C_T(c0,t0);
    /* This assumes ideal gas behavior. More general */
    /* implementation would query beta from the solver */
    beta = 1./temp;
    if(NNULLP(T_STORAGE_R_NV(t0, SV_T_G)))
    {
    prod1 = beta*mu_t/pr_t*NV_DOT(M_gravity,C_T_G(c0,t0));
    }
    else
    if (c0==0) Message0("Error, temperature gradient not storedn");
    source = prod1;

    return source;
    }


    /* option full buoyancy directional */
    DEFINE_SOURCE(omega_gb_directional, c0, t0, dS, eqn)
    {
    real beta, mu_t, temp;
    real prod1=0.,source;
    real pr_t = M_keprt;
    real C_epsilon3=1.;

    /* Compute Buoyancy Production */
    mu_t = C_MU_T(c0,t0);
    temp = C_T(c0,t0);
    /* This assumes ideal gas behavior. More general */
    /* implementation would query beta from the solver */
    beta = 1./temp;
    if(NNULLP(T_STORAGE_R_NV(t0, SV_T_G)))
    {
    prod1 = beta*mu_t/pr_t*NV_DOT(M_gravity,C_T_G(c0,t0));
    }
    else if (c0==0) Message0("Error, temperature gradient not storedn");

    C_epsilon3=compute_keC3(C_U(c0,t0),C_V(c0,t0),C_W(c0,t0));

    source=C_epsilon3*M_keC1*MAX(0,prod1)*0.09*C_O(c0,t0);

    return source;
    }



  • Show Form
    No comments yet. Be the first to add a comment!