We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

Ansys Learning Forum Forums Discuss Simulation Fluids Mixture model – Threads and sub_threads Reply To: Mixture model – Threads and sub_threads

Diogo Martinho
Subscriber

Hi, 
Thanks for your attention and answer.

Can I just ask you as an overview. If I wanted to define something as the previous equation could I use something like: 

    Thread *mixture_thread;
    Thread **pt;  /* initialize pt  */
    pt = THREAD_SUB_THREADS(mixture_thread);
 
 
So, at the end it would look something like: 


DEFINE_DIFFUSIVITY(diff_uds, c, t, uds_i)
 
{
 
    double diff = Diff_nil, lam;
 
    double T = T0;
 
    int Zone_ID = THREAD_ID(t);
 
    Thread *mixture_thread;
 
    Thread **pt;  /* initialize pt  */ 
 
    pt = THREAD_SUB_THREADS(mixture_thread); /* I think pt[0] is liquid; pt[1] is gas */
 
 
 
if (uds_i == C_H2)
 
    {
 
        if (Zone_ID == Membrane) 
 
            diff=Diff_H2(c,t)*pow(Get_Porosity(c,t),1.5)*C_VOF(c,pt[0]);
 
        else if (Zone_ID == Nelectrode || Zone_ID == Pelectrode) 
 
            diff=Diff_H2(c,t)*pow(Get_Porosity(c,t),1.5)*C_VOF(c,pt[0]);
 
        else if (Zone_ID == ext_neg)  // This is changed. It was commented out previously.
 
            diff=Diff_H2(c,t)*pow(Get_Porosity(c,t),1.5)*C_VOF(c,pt[0]);
 
        else 
 
            diff=Diff_nil;
 
 
 
Kind regards,

Diogo