August 1, 2023 at 5:47 pm
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
Diogo