-
-
March 28, 2021 at 10:41 am
Raiq33
SubscriberHi,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 pm
YasserSelima
SubscriberHello,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 pm
Raiq33
Subscriberthanks 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 pm
YasserSelima
Subscriber(%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 pm
Raiq33
SubscribernAs 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 pm
YasserSelima
Subscriberrun one iteration / timestep and checkn -
March 29, 2021 at 4:01 pm
Raiq33
SubscriberThis is what I did. n -
March 29, 2021 at 6:46 pm
YasserSelima
SubscriberNot 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
-
- 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 in cfd post
-
2688
-
2138
-
1355
-
1140
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.