
[Sponsors] 
Advective flux field not divergencefree in DEFINE_UDS_FLUX 

LinkBack  Thread Tools  Search this Thread  Display Modes 
May 22, 2020, 06:31 
Advective flux field not divergencefree in DEFINE_UDS_FLUX

#1 
New Member
Sergio
Join Date: May 2020
Location: Toulouse
Posts: 5
Rep Power: 2 
Hello,
I am trying to define a userdefined scalar to describe the transport of a suspension in a channel with an obstacle in Fluent. Because there are distanceinteractions between the obstacle and the colloids, there is an extra term to the species transport equation. The modified equation is: where rho is the density (constant in my case), phi is the mass fraction of the species, v is the velocity of the fluid, Pi is a "potential" representing the distanceinteractions with the obstacle and J is the diffusive flux. The problem I am facing is that, even though the velocity is divergencefree, the gradient of Pi is not. And according to the 2013 UDF manual I retrieved, one cannot include an advective flux that is not divergencefree. Does anyone know if that's still true even for the most recent versions? Or is it possible now to set advective fluxes that are not divergencefree under DEFINE_UDS_FLUX? In case it is really not possible to do so, I would think it is because the software does something like the following, where psi is the advective flux: Is that really what it does? If so: can I still use my nondivergencefree term and add an implicit source term (phi * divergence(psi)) in order to correct my equation? Thanks in advance! 

May 24, 2020, 06:57 
Divergence Free Field

#2 
Senior Member

The requirement of divergence free field is not imposed by Fluent but by physics. If a source term is being modeled, instead of the phenomenon being simulated, then field may not be divergence free. However, if that source term is neglected, then the field must be divergence free else the continuity equation will not be satisfied. So, the idea of including source term to ensure conservation should work.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum 

May 25, 2020, 09:06 

#3 
New Member
Sergio
Join Date: May 2020
Location: Toulouse
Posts: 5
Rep Power: 2 

May 25, 2020, 09:51 
Continuity

#4 
Senior Member

Conservation of the scalar you are trying to solve, the UDS. Divergence free means that for each cell the inlet flux must be equal to outlet flux. If that is not the case, scalar will end up showing unrealistic values in the domain.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum 

May 25, 2020, 11:16 

#5 
New Member
Sergio
Join Date: May 2020
Location: Toulouse
Posts: 5
Rep Power: 2 
But again, the conservation for the scalar I am trying to solve is given by the following equation:
Above equation is satisfied, which means my scalar is actually being conserved. I have attached a figure showing the derivation of the mass balance equation over a control volume. Perhaps you are refering to the divergence of the overall species flux at stationary state? I.e.: at stationary state If that is the case, I agree with you. But what is written in the UDF manual is that the advective term has to be divergencefree. And I am still not convinced that is a condition imposed by physics. 

May 25, 2020, 12:05 
Advective Flux of UDS

#6 
Senior Member

The statement does not talk about advection term but the flux returned by the UDF. The flux returned by the UDF if summed over each cell must be zero. However, as mentioned earlier, the premise for this statement is that there is no source. Since your case has a source term, the condition would not be applicable, but might require correction such that if there is no source the flux is 0.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum 

May 25, 2020, 13:39 

#7 
New Member
Sergio
Join Date: May 2020
Location: Toulouse
Posts: 5
Rep Power: 2 
There is no actual source term in my case study. The "source term" appearing after developing (c.f. last equation in my first message) is just a "fantasy" source term. According to the mass balance illustration I have shown in the figure attached to my previous reply, we can see that there is no real source term. Only fluxes contribute to the mass balance equation.
Further, according to UDF manual, DEFINE_UDS_FLUX needs to return (c.f. screenshot attached), where A refers to the face normal vector and in my case. And having the sum of over the faces of a cell being 0 is equivalent to saying that . Therefore, I believe I am correct when I say that Fluent requires (which I'm calling the advective term) to be divergencefree. To avoid any confusion from my part, would you mind writting down which term exactly do you expect to be divergencefree? 

May 26, 2020, 07:10 
Advection Term

#8 
Senior Member

Yes, it is or , if compressible flow, that needs to be divergence free, but since you have two terms that are responsible for conveying the species or whatever the scalar represents, whole of the term needs to be divergence free. Since, from continuity equation, is divergence free, so, the second component should be divergence free on its own accord, i.e., gradient of your distance interaction should be divergence free as well. You mentioned in the first post that it is not divergence free. In that case, there will always be some scalar either leftover or takenfrom each cell. It is quite possible that is the desired outcome of the distance interaction. As long as these over or undershoots are bounded, there should not be much issue, but in any case, you should be able to explain the physical significance of the distance interaction in increasing or reducing scalar in each cell.
In my view, you should run one simulation and observe the convergence as well as imbalance of UDS.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum 

May 27, 2020, 14:07 

#9 
New Member
Sergio
Join Date: May 2020
Location: Toulouse
Posts: 5
Rep Power: 2 
Thank you for your answer, Vinerm. I have followed your advise and simulated a case study as follows:
1) 2D closedbox domain 2) Stagnant fluid 3) Advection field not divergencefree: 4) Initial concentration of particles Profile at steady state is attached. It turns out that the scalar is conserved (average of phi is equal to 0.1 at steady state). And comparing Fluent with an opensource solver, both give the same results at steady state. So I think I'll just ignore the warning in UDF manual for now. 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to calculate divergence of a field in CFDpost  shafa_hn  CFX  1  December 22, 2017 17:15 
fluent divergence for no reason  sufjanst  FLUENT  2  March 23, 2016 16:08 
foamCalc: Fatal io error calculating divergence of velocity field  rendagar  OpenFOAM Running, Solving & CFD  0  February 4, 2014 10:20 
Divergence Free on the Magnetic Field  Valdemir  Main CFD Forum  1  March 19, 2003 18:33 
help:spectral methods & divergence free functionsn  D. Puigjaner  Main CFD Forum  1  August 28, 2000 10:06 