CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDS Diffusion to another gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2023, 16:56
Default UDS Diffusion to another gradient
  #1
New Member
 
Join Date: May 2018
Posts: 29
Rep Power: 8
CFDJonas is on a distinguished road
Hello,

I am currently implementing a pseudo-binary mixture by making use of User-Defined Scalars.

What does pseudo-binary mixture mean?
In the species model of Fluent I have defined 2 species, let's call them A and B. The thermophysical data is fully described by mixing rules by just these two components.

Additionally, component A consists of 4 sub-components, let's call them A1, A2, A3 and A4. Therefore it is valid to say for the mass-fractions:
w_A = w_{A1} + w_{A2} + w_{A3} + w_{A4}
The sub-component's mass fractions are modeled as User-Defined Scalars. I know that in this explicit example, I am able to fully use the normal species model of Fluent. But other things prevent me from doing so. I have to use UDS for the sub-components.

Diffusion
Now it get's complicated: I want to implement the diffusion of both, the whole component A and additionally the sub-components. Mathematically this is quite easy to write down, for example for the UDS transport equation of component A1:

\frac{\partial \rho w_{A_1}}{\partial t} + \nabla \left( \rho \vec{v} w_{A1} - \left( \rho \frac{w_{A1}}{w_A} D_{\text{binary}} \nabla w_{A} + \rho w_{A} 
 D_{\text{subdiffA}} \nabla \frac{w_{A1}}{w_{A}} \right) \right) = S_{w_{A1}}

There the problem rises: The diffusion term is not proportional to the gradient of the species itself (\nabla w_{A1}) but instead to either the "summed" gradient \nabla w_{A} or the quotient \nabla \frac{w_{A1}}{w_A}.

This lead me to the conclusion that I am not able to use the UDS_DIFFUSIVITY for this use case, as this would just modify the diffusion coefficient and multiply it by \nabla w_{A1}. The only thing I could do is put everything before the gradient into the diffusion coefficient and divide by the scalar's gradient. But this seems a little bit fishy (or doesn't it?).

The other possibility that came to my mind was to use DEFINE_UDS_FLUX and put everything into the convection vector.
I am able to construct the needed vectors with C_YI_G of component A for \nabla w_{A} and on the other hand \nabla \frac{w_{A1}}{w_A} is constructable by both, C_YI_G of component A and C_UDSI_G of component A1 and the quotient derivative rule. I have set up a UDF that does exactly that by calculating the diffusion flux term at a face. However this leads to very unstable results and I'm having a hard time debugging it. It also seems very "fudged" doing it like that with all the gradient juggling...

Therefore the question: Is there an easier opportunity to achieve the described problem, is there something important to know about dealing with gradients, or modifying the flux term of a UDS? Would it be better to put it into the diffusion coefficient (which would then need to be anisotropic, because I have to modify each gradient vector's components...)? Stability-wise, are there any modifications to the solver I could do to ensure diffusion of UDS work better?

Thank you very much for your kind help!
CFDJonas is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDS to store Temperature Gradient goksue FLUENT 0 January 13, 2022 13:43
Eddy diffusivity and the simple gradient diffusion hypothesis blyatman Main CFD Forum 4 September 16, 2021 21:52
Gradient of field obtained thro' UDS transport eqn is discontinuous at interfaces jyothsna k ANSYS 0 January 12, 2016 08:00
Harmonic mean Vs Central Differencing (diffusion term- UDS) bharat.cmeri FLUENT 6 October 15, 2014 00:27
Counter gradient diffusion? sheng Main CFD Forum 0 July 23, 1999 08:34


All times are GMT -4. The time now is 14:19.