-
-
March 28, 2021 at 10:41 amRaiq33SubscriberHi,Currently, I'm using non-premixed combustion model and aiming to modify some equations using UDF. In this modification, I need to use the temperature and mass fraction gradients. It is true that there are macros for these gradients but when I included them in the UDF file, I got errors. nIn the UDF manual, I found a code ( showgrad.c), which can be used to show the available gradients in my model. When I used that code, the available gradient variables for my particular case and data files are pressure and velocities gradients.My question is how I can use the temperature gradient ?.For the mass fraction gradient, it is written in the UDF manual that the mass fraction gradient is available only for the density-based solver and to use it in the pressure-based solver, I need to set the rpvar 'species/save-gradients? to #t. Hence, I typed in the text command the followingnn(rpsetvar 'species/save-gradients? #t)nnbut unfortunately, nothing has changed. So, is there any way to make the mass fraction gradient available in my model?Thanks in advance for your help. n
-
March 28, 2021 at 2:16 pmYasserSelimaSubscriberHello,ntype (rpgetvar 'species/save-gradients?) and see if you get true (#t) or not ... nAlso if you want to recall gradient of any variable, save it to C_UDSI and then you can recall the gradient by C_UDSI_G ... don't forget to disable solving the UDS associated with this variable.nAnd for the temperature, yes you can use the temperature gradient ... C_T_G(c,t)nn
-
March 28, 2021 at 6:39 pmRaiq33Subscriberthanks for your reply. nI typed (rpsetvar 'species/save-gradients? #t) in the console but nothing has changed. I do not know if there is another way to make the mass fraction gradient available in the model or not. n
-
March 28, 2021 at 9:55 pmYasserSelimaSubscriber(%rpgetvar 'species/save-gradients?) .. this should give you the value of the variable . See if it is true or falsen
-
March 29, 2021 at 12:59 pmRaiq33SubscribernAs expected, the value of the variable is false. Then, when I used the following command, (rpsetvar 'species/save-gradients? #t), the value of the variable becomes true. After that, I used the showgrad.c code to show the available gradients in my model but the gradient of species mass fraction was not one of the available gradient variables for my case and data files. nI'm totally confused. n
-
March 29, 2021 at 1:53 pmYasserSelimaSubscriberrun one iteration / timestep and checkn
-
March 29, 2021 at 4:01 pmRaiq33SubscriberThis is what I did. n
-
March 29, 2021 at 6:46 pmYasserSelimaSubscriberNot sure why ... now you have to go with solution of UDS ... nUse Define_AdjustnLoop through all threads and cellsnSave the mass fraction into C_UDSI(c,t,i)nNow you can call the gradient from any other function using C_UDSI_G(c,t,i) ... this will have 2/3 components in x, y and z direction.nDon't forget to increase the number of user defined scalar and disable solving the equationn
-
November 19, 2023 at 4:46 pmRamesh Chandra MishraSubscriber
Hi
i am solving an equation which requires concentration gradient as a term. So i write concentration as mass fraction*density to a C_UDSI and then use C_UDSI_G to solve the equation. But I am getting zero everytime. Please note that i don't disable solving the equation for UDS. Is it because of that or there is something to be done in my case file?
A snippet of code is as follows:
thread_loop_f(t, d){  begin_f_loop(f,t)  {    F_CENTROID(x, f, t);if (x[0] >= 108 && x[0] <= 126 && x[1] == 18 && x[2] >= 90 && x[2] <= 126 ){          F_AREA(A,f,t);co = F_C0(f, t);       Âto = THREAD_T0(t);   //obtaining corresponding thread of adjacent cellreal integrand;real conc_grad_roof;real mu_t_roof = C_MU_T(co,to);    //turbulent viscosityÂC_UDSI(co,to,0)= C_YI(co,to,0) * RHO_1;  //storing concentration of CO as user defined scalar(UDS)conc_grad_roof=(C_UDSI_G(co,to,0)[1]);    //concentration gradient of COÂintegrand = (mu_t_roof /0.7)*conc_grad_roof;   //TURBULENT POLLUTANT FLUXPCH_turb_roof -= integrand*NV_MAG(A);      //Overall value of PCH integral        }      }             Â    end_f_loop(f,t)} -
November 21, 2023 at 10:57 amRobForum Moderator
You're mixing face and cell loops, that may not be helping.Â
-
Viewing 9 reply threads
- The topic ‘use of temperature and mass fraction gradients in UDF’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Script error Code: 800a000d
- Fluent fails with Intel MPI protocol on 2 nodes
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Encountering Error in Heterogeneous Surface Reaction
Top Contributors
-
1191
-
513
-
488
-
225
-
209
Top Rated Tags
© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.