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
Ansys EmployeeHello,
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
Ansys EmployeeHello,
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.
-
- The topic ‘Reaction rate for a particular domain’ is closed to new replies.
-
3492
-
1057
-
1051
-
965
-
942
© 2025 Copyright ANSYS, Inc. All rights reserved.