-
-
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
SubscriberHello
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
-
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7742
-
4502
-
2961
-
1449
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.