CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

When to use User-defined Scalar (UDS) for concentration?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By zobekenobe

LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2015, 09:35
Default When to use User-defined Scalar (UDS) for concentration?
New Member
Join Date: Dec 2012
Posts: 3
Rep Power: 13
THC is on a distinguished road
I have a salt solution whereby the density (rho) of the solution is a function of salt concentration (mA). The process is a membrane separation, whereby as time goes by, the salt concentration in the feed will change as water permeate through the membrane, thus the density will also change.

What I have done was create a UDF for the density and using "Macros for Cell Variables" for species mass fraction, C_YI(c,t,i) as defined in FLUENT UDF Manual Release 14, Table 3.8.

mA = C_YI(c,t,i); /*concentration of NaCl. i had been declared as species NaCl*/
rho = 997.1*(1.0 + 0.696*mA);

I had managed to compile and run the simulation.

However, all the references I found did not use this method; instead they used a UDS (user-defined scalar) function for NaCl concentration. An example: The UDS represent solute concentration and was solved simultaneously with governing equations.

My question:
1) Is the method I used above (using C_YI) correct? and will it give the same solution as using UDS for concentration? (I cannot check the solution myself as I don't know how to use UDS).

2) What is the difference between UDS and UDF? Under what conditions (or when) do we need to use UDS?

Thank you.

Last edited by THC; October 30, 2015 at 10:54.
THC is offline   Reply With Quote

Old   May 30, 2019, 09:04
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 72
Rep Power: 17
zobekenobe is on a distinguished road
The UDF or the USER DEFINED FUNCTION is the macros for dealing or specifying conditions at boundaries or in the domain.

the UDS or USER DEFINED SCALAR is when you want to write transport equations for a scalar of your own, which is solved along with transport equations for flow. Hence in your case of membrane separation, a transport equation for concentration would be solved.
Mars35 likes this.
zobekenobe is offline   Reply With Quote



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[User Defined Scalar in the Eulerian Model rafacerq Fluent Multiphase 0 December 11, 2014 10:28
Fluent User defined Scalars and UDF Anirudh_Deodhar Fluent UDF and Scheme Programming 0 February 16, 2011 20:16
solving passive scalar by user function in AVLFIRE huyp Main CFD Forum 0 September 4, 2008 10:21
User defined scalar Tomik FLUENT 0 February 8, 2007 19:23
user defined scalar saghir FLUENT 1 December 4, 2006 05:25

All times are GMT -4. The time now is 12:24.