We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.

Ansys Learning Forum Forums Discuss Simulation Fluids Fluent error Reply To: Fluent error

s_singh2
Subscriber

 

Yes, you are right sir. I have checked my udf and found out where error occur but i didn’t know how to solve it.
This is my finction (a part of udf)

DEFINE_ADJUST(area_density, domain)
{
    Thread *t;
    Thread **pt;
    cell_t c;
    Domain *pDomain = DOMAIN_SUB_DOMAIN(domain, 0);
    real voidx, voidy, voidz = 0;

    Message(“Entering DEFINE_ADJUST(area_density)…\n”);

    if (pDomain == NULL) {
        Message(“Error: Sub-domain P_PHASE not found.\n”);
        return;
    }

    Alloc_Storage_Vars(pDomain, SV_VOF_RG, SV_VOF_G, SV_NULL);
   
    Scalar_Reconstruction(pDomain, “vof”, SV_VOF, -1, SV_VOF_RG, NULL);
    Scalar_Derivatives(pDomain, “vof”, SV_VOF, -1, SV_VOF_G, SV_VOF_RG, Vof_Deriv_Accumulate);

    Alloc_Storage_Vars(domain, SV_T_RG, SV_T_G, SV_NULL);
    T_derivatives(domain);
    Free_Storage_Vars(domain, SV_T_RG, SV_NULL);

    mp_thread_loop_c(t, domain, pt) {
        if (FLUID_THREAD_P(t)) {
            Thread *tp = pt[P_PHASE];
            begin_c_loop(c, t) {
                #if RP_3D
                C_UDMI(c, t, 0) = (C_VOF_G(c, tp)[0] * C_T_G(c, t)[0] + C_VOF_G(c, tp)[1] * C_T_G(c, t)[1] + C_VOF_G(c, tp)[2] * C_T_G(c, t)[2]);
                #endif
                #if RP_2D
                C_UDMI(c, t, 0) = (C_VOF_G(c, tp)[0] * C_T_G(c, t)[0] + C_VOF_G(c, tp)[1] * C_T_G(c, t)[1]);
                #endif
            }
            end_c_loop(c, t)
        }
    }

    Message(“Freeing storage variables…\n”);
    Free_Storage_Vars(pDomain, SV_VOF_RG, SV_VOF_G, SV_NULL);
    Free_Storage_Vars(domain, SV_T_G, SV_NULL);

    Message(“Exiting DEFINE_ADJUST(area_density)…\n”);
}

in this function error occurs in
 Scalar_Reconstruction(pDomain, “vof”, SV_VOF, -1, SV_VOF_RG, NULL);
 Scalar_Derivatives(pDomain, “vof”, SV_VOF, -1, SV_VOF_G, SV_VOF_RG, Vof_Deriv_Accumulate);
I also tried by putting "pressure-based" but result is same. I tried to search it but i didn't find an answer.
When I remove these two scalars then there is no error in calculation but my results are coming not accurate. Can you help me to solve this