|
[Sponsors] |
September 14, 2017, 16:43 |
Macro for my equation
|
#1 |
Member
ARAVIND SRIDHARA
Join Date: Jan 2017
Posts: 32
Rep Power: 9 |
Hii all,
i am simulating 3D supersonic flow for air and hydrogen. I want to know the mixing efficiency for the present case. The mixing efficiency is defined as follows; ∫▒((Y_f ρu)dA)/((yρu)dA) Where y_f={ y, y<y_s y_s* ((1-y))⁄(1-y_s ), y>y_s y_s is the species mass fraction and ρ is the density u is the velocity. please help in finding the right macroname to define above equations. i have the basic idea of writing the code for udf, my only concern is to find the right macro to define above scalar equation. Every UDF's are defined using DEFINE_MACRONAME(udf_name, passed-in variables) (say for example: DEFINE_PROFILE, to specify boundry conditions). I am unable to find this right Macroname. Last edited by aravind vashista; September 15, 2017 at 01:50. |
|
September 15, 2017, 00:57 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
ANSYS Fluent Customization Manual:
3.2.3.6. Flow Variable Macros for Cells For each cell in domain you can easily got the value of -> density by C_R(c,t) velocity by C_U(c,t);C_V(c,t);C_W(c,t) Could you explain in details, what is the problem with case, you had described. Best regards |
|
September 15, 2017, 01:44 |
|
#3 |
Member
ARAVIND SRIDHARA
Join Date: Jan 2017
Posts: 32
Rep Power: 9 |
Thank you Alexander, and i understood how to access Macros for Cell Flow Variables.
Sir in ANSYS FLUENT UDF's are defined using Functions which are supplied by Ansys Fluent in the name DEFINE_Macros contained within the header udf.h header (example: DEFINE_PROFILE, which helps in giving user defined boundary conditions (say parabolic inlet velocity profile)). In my case i am unable to find right Macroname to right my equation. please help me in finding correct Macroname (DEFINE_MACRONAME(udf_name, passed-in variables)). Thank you |
|
September 15, 2017, 02:45 |
|
#4 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Quote:
In few words, there are several ways, how you can execute UDF functions: 1. DEFINE_ON_DEMAND function is executed once you manually click execute on demand in GUI of Fluent. In tutorials there is an example 2.2.9.DEFINE_ON_DEMAND 2. DEFINE_ADJUST executes at every iteration and is called at the beginning of every iteration before transport equations are solved. So you should put your functions inside this adjust_function body. See 2.2.1.DEFINE_ADJUST 3. DEFINE_EXECUTE_AT_END is executed at the end of an iteration in a steady-state run, or at the end of a time step in a transient run. See 2.2.3.DEFINE_EXECUTE_AT_END Depends on your algorithm you may choose one of this macros and put your functions inside. Read tutorial, there are good enough example Best regards |
||
September 15, 2017, 03:12 |
|
#5 | |
Member
ARAVIND SRIDHARA
Join Date: Jan 2017
Posts: 32
Rep Power: 9 |
Quote:
i will go through the manual and try to implement my code based on ur suggestions. |
||
May 22, 2023, 00:24 |
|
#6 |
New Member
wang kai feng
Join Date: Sep 2021
Posts: 1
Rep Power: 0 |
||
Tags |
define macro, udf's |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with Velocity Poisson Equation and Vector Potential Poisson Equation | mykkujinu2201 | Main CFD Forum | 1 | August 12, 2017 14:15 |
Non-linearity Pressure Equation -- PISO algorithm | gdeneyer | OpenFOAM Programming & Development | 1 | August 23, 2012 06:19 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
continuity equation | Rafal | Main CFD Forum | 4 | November 29, 2006 10:27 |
Two-Phase Buoyant Flow Issue | Miguel Baritto | CFX | 4 | August 31, 2006 13:02 |