-
-
August 1, 2023 at 8:11 am
Diogo Martinho
SubscriberDear all,
I am modelling an electrochemical cell, and I am planning to use the mixture model. I have been trying to understand throught the UDF guide and online forums (others posts) how I should define the different pointers to access the different phases (primary phase is liquid and secondary gas).
So, for example, equation 28 (attached), s^k is the volume fraction of the phase k (all the others are constants) and I would like to define this in a DEFINE_DIFFUSIVITY. I know that volume fraction is C_VOF but I really have a hard time understanding how to call or define the different phases/threads/...
Is there anyone that could explain it a bit more?
Kind regards, -
August 1, 2023 at 5:07 pm
Atharva Nagarkar
Ansys EmployeeHello
Please find the links below from the Ansys UDF Manual. I have attached the documentation on the basic data types used in Ansys Fluent as well as Multiphase specific data types. Additionally, there is a link of another forum discussion where primary and secondary phase threads are defined. Please refer to the UDF code mentioned in the forum discussion link.
1.7. Data Types in Ansys Fluent
1.9.1. Multiphase-specific Data Types (ansys.com)
SIGSEGV error during initialization in the fluent simulation with UDF (ansys.com) – Forum Discussion
If you are not able to access the links, please refer to this forum discussion: Using Help with links (ansys.com)
Thanks!
-
August 1, 2023 at 5:47 pm
Diogo Martinho
SubscriberHi,
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]);elsediff=Diff_nil;Kind regards,
Diogo
-
-
- The topic ‘Mixture model – Threads and sub_threads’ is closed to new replies.
-
3044
-
971
-
858
-
851
-
792
© 2025 Copyright ANSYS, Inc. All rights reserved.