-
-
May 4, 2023 at 3:17 pm
James
SubscriberGood afternoon,
How does the command F_C0 and F_C1 work? I am trying to model adsorption of heavy metals on porous media and I developed a UDF that loops over the faces at the boundary between the porous media and the inlet zone and then I added the command F_C0 to choose cells in the porous media and carry out the adsorption operation. It didn't work as expected so I wrote a seperate UDF that explains exactly how the functions work. So for example a face at the boundary has the centroid coordinates (0.10, 0.021)m, then shouldn't the centroid coordinates of cell c1 be (0.10 + x, 0.021)? The results I am getting are very weird with the cell coordinates having absurdly large values or simply (0,0).
I have the same question for the functions THREAD_T0 and THREAD_T1. Do these functions select the threads , respectively, on the left and right of the thread provided in the input argument?
My model is quite simple. It's a straight horizontal pipe (25cm) with 5 cm of porous media in the middle. The inlet is on the right, the porous media in the center followed by an outlet.
-
May 4, 2023 at 7:03 pm
Federico Alzamora Previtali
SubscriberUnless you are using the output of F_C0 to obtain the cell centroid with C_CENTROID(xc, c, t), F_C0/F_C1 return cell_t for cell c, on their respective side of the face. F_C0/F_C1 does not return coordinates. cell_t is an integer data type that identifies a particular cell within a cell thread.
Similarily for THREAD_T0, which returns a cell thread pointer for the cell adjacent to the cell. If the cell on the other side of that face does not belong to the same cell thread, THREAD_T1 will return the corresponding cell thread pointer for that cell.
-
May 4, 2023 at 8:06 pm
James
SubscriberThank you Federico for your reply.
Yes, I am using the output of F_C0 to obtain the cell centroid and it does work. My apologies as my question wasn't exactly clear, perhaps I should get straight to the point. How exactly do I choose the cell immediately right of a face? and then choose the cell next to that and so on?
In my UDF I tried to use an "internal" that sits in between the porous media and the inlet area and apply either F_C0 or F_C1 to find the cell immediately to the right (meaning that the cell belongs to the porous media) to apply a formula for change in concentration but everytime I do that, it selects the porous media cell zone. In the image below you can see the concentration at the walls of the porous media is 0.1 for visualization purposes. That's the cell zone selected when I apply
threadC1 = THREAD_T1(thread);ThreadIDC1 = THREAD_ID(threadC1);where thread is the pointer that points to the "internal" boundary condition discussed above.Below are the messages I printed on the console. The thread with ID 5 belongs to the porous media cell zone and thread with ID 2 belongs to an internal boundary condition.I am basically teaching myself to code and I am not experienced at this at all. Any help is appreciated. Also If you have any suggestions on modelling adsorption using bohart adams model and how I should proceed with doing that, that would be awesome. Thank you
-
-
May 5, 2023 at 9:21 am
Rob
Ansys EmployeeInterior threads don't always have a normal so unless you're reporting the cells for c0 and c1 from the same facet you could see the above. I think there's a comment in UDF manual somewhere, it is/was mentioned in the surface reports in Fluent because it can mess with the post processing reports.
The UDF manual is a good source of information. We do provide training too, but you'd need to request that (or much cheaper, Ansys Learning Hub access) via your University.
-
May 5, 2023 at 10:56 am
James
SubscriberVery well. Thank you for the quick response Rob :)
-
-
- 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.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5180
-
3275
-
2453
-
1308
-
970
© 2023 Copyright ANSYS, Inc. All rights reserved.