Fluids

Fluids

Logarithmic of a variable giving zero value

    • sirisha
      Subscriber

      Hello everyone,


      The following is the code for saving a UDS in UDMI.


      The logarithmic function of volume fraction is returning a zero value for entire domain, although that is the case.


      Is something wrong in the syntax of writing log itself ? or could anyone suggest a way to get the log values of a variable.


      Thankyou


       


      DEFINE_ADJUST(lnvolgb, d)


      {


      #if !RP_HOST


      Thread *t;


      Thread **pt;


      cell_t c;


      int phase_domain_index = 1.;


      void Enable_Extended_Neighbourhood(Domain *phase_domain_index);


      Domain *pDomain = DOMAIN_SUB_DOMAIN( d, phase_domain_index);


      {


      thread_loop_c(t,pDomain) 



      begin_c_loop(c,t) 


      {


      C_UDSI(c,t,2)=(double)log((double)C_VOF(c,t));


      }


      end_c_loop(c,t) 



      Alloc_Storage_Vars(pDomain,SV_UDSI_RG(2),SV_UDSI_G(2),SV_NULL);


      Scalar_Reconstruction(pDomain, SV_UDS_I(2),-1,SV_UDSI_RG(2),NULL);


      Scalar_Derivatives(pDomain,SV_UDS_I(2),-1,SV_UDSI_G(2),SV_UDSI_RG(2),NULL);


      }


      mp_thread_loop_c (t,d, pt)


      if (FLUID_THREAD_P(t))


      {


      Thread *ppt = pt[phase_domain_index];


      begin_c_loop (c,t)


      {


      C_UDMI(c,t,16) = C_UDSI(c,ppt,2);


      }


      end_c_loop (c,t)


      }


      Free_Storage_Vars(pDomain,SV_UDSI_RG(2),SV_UDSI_G(2),SV_NULL);


      #endif


      }

Viewing 0 reply threads
  • You must be logged in to reply to this topic.