TAGGED: fluent, fluid, reaction-kinetics, udf
-
-
August 28, 2023 at 12:57 pm
Young Duk Lee
SubscriberHi everyone!
I am simulating decomposition of Ammonia in a channel. i have 3 zones, all fluid and I want to select a particular zone where the reaction takes place.
second, I want to define the reaction rate as temperature dependent. how can I get the temperature of that cell where the UDF is being calculated.
Thankyou.
My code is as follows:
#include "udf.h"#define A 4e15#define E 196200.0DEFINE_VR_RATE(my_rate, c, t, r, mole_weight, species_mf, rate, rr_t){real s1 = species_mf[1];real mw1 = mole_weight[1];if (FLUID_THREAD_P(t)&&ZONE_ID(5))*rate = A * exp(-E / 8.31412 / 1000) * s1/100000;else*rate = 0;*rr_t = *rate;} -
August 29, 2023 at 10:40 am
Atharva Nagarkar
SubscriberHello,
You can select a particular zone id by assigning the pointer to point at the corresponding zone using the Lookup_Thread macro. You will need to get the corresponding zone ID. Here is the link from the Ansys UDF Manual regarding the macro.
3.2.6. Special Macros (ansys.com) -> Check section 3.2.6.1
To access the temperature for a cell, you can use the flow variable macro for temperature. The macro is C_T(c,t). Here is the link of the same from the UDF Manual.
3.2. Data Access Macros (ansys.com) -> Check section 3.2.3.6
For reference, here is the link of the definition of the macro DEFINE_VR_RATE. Please check out the examples below the theory of the macro for better understanding.
2.3. Model-Specific DEFINE Macros (ansys.com) -> Check section 2.3.53
Additionally, I see that you have defined mole weight and assigned it to the variable "mw1". However, you have not used this variable anywhere. You might want to remove unncessary variables from your UDF.
If you are not able to access the link, please refer to this forum discussion: Using Help with links (ansys.com)
Thanks!
-
September 4, 2023 at 4:45 am
Young Duk Lee
SubscriberThankyou very much.
-
September 4, 2023 at 4:50 am
-
September 4, 2023 at 6:00 am
Atharva Nagarkar
SubscriberHello,
Please refer to the 3rd link I shared above and the corresponding section.
Here, “mw” or in your case “mole_weight” is the pointer to array of species molecular weights. You can simply access the species by using the correct index of the species inside the array. This array is directly passed by Fluent solver to the UDF so all you need is the order in which the specie are defined in Fluent. Accordingly, you can specify the correct index for the species you want.
Thanks!
-
September 5, 2023 at 3:01 am
Young Duk Lee
Subscriberthanks alot for your reply.
i couldnt find the index numbering starts at 0 or 1. so in my case I am giving the reaction rate for ammonia decomposition and ammonia is the fifth material in my list of mixture-materials.
so do I give the index 4 (if index numbering starts from 0) or should I give the index 5 (if the numbering starts from 1).
Thankyou.
-
- 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
-
7578
-
4424
-
2949
-
1422
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.