CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   unsteady UDS (http://www.cfd-online.com/Forums/fluent/36722-unsteady-uds.html)

PriyankaJoshi May 20, 2005 10:12

unsteady UDS
 
In the example about unsteady UDS given in Fluent 6.2 Manual

DEFINE_UDS_UNSTEADY(uns_time,c,t,i,apu,su)

{

real physical_dt, vol, rho, phi_old;

physical_dt = RP_Get_Real("physical-time-step");

vol = C_VOLUME(c,t);

rho = C_R_M1(c,t);

*apu = -rho*vol / physical_dt;/*implicit part*/

phi_old = C_STORAGE_R(c,t,SV_UDSI_M1(i));

*su = rho*vol*phi_old/physical_dt;/*explicit part*/

}

Can anybody please explain what the macro C_STORAGE_R does and what the argument SV_UDSI_M1(i) is all about?

Does i correspond to the user defined scalar? Also how do you declare the user-defined scalars in your UDF? (or, is it necessary, since you already do it in Define->User-defined->Scalars)

Thanx,

Priya.


us May 20, 2005 10:43

Re: unsteady UDS
 
C_STORAGE_R is the macro that stores the value of a cell variable. SV_UDSI_M1 is the stored value of previous time step.

Once you have activated the UDS in FLUENT, you solve it ,just like any other transport equations, during the calculation and so its related face and cell values are there in the domain. You can have access to it through related UDS macros(eg. C_UDSI or F_UDSI) in any UDF you design.

Regards, Umesh

PriyankaJoshi May 20, 2005 14:01

Re: unsteady UDS
 
Thanx a ton, Umesh

Some more queries regarding the usage of UDS

1. The Fluent manual states that the units for the source term for a UDS, while UDS Transport Modeling, should be the same as that of the UDS itself.

In my case (solid-liquid adsorption), the UDS is solid phase species concentration (q). I write the source term as k * a * (C-Ceq) where C and Ceq are in g/L and the product K * a, has the units of 1/sec, with the result that the source term has the units g/L.sec. How do I overcome this? (with respect to the statement in the above paragraph)

Please help,

Priya.

PriyankaJoshi May 20, 2005 14:03

Re: unsteady UDS
 
q has the units of g/L

Priya.

us May 20, 2005 16:09

Re: unsteady UDS
 
Hi Priya,

Yes, the units have to be same and the source term is always per unit volume. Each term in UDS should have units of (Kg)(Scalar_variable)/(m^3-s). Means, your source term, i think, should be k*a*rho*(C-Ceq). Things will be fine with that.Pl. double check. regards, US

PriyankaJoshi May 21, 2005 04:11

Re: unsteady UDS
 
Hi Umesh,

But Section 7.28.1 of User's Manual in Fluent 6.2 version states the following,

"User-Defined Scalar Sources

To define a source for a user-defined scalar transport equation, specify the User defined scalar-n term. (There will be one for each user-defined scalar you have defined.) The units for a user-defined scalar source will be the appropriate SI units for the scalar quantity"

So the units for the UDS source term (UDS in my case is the solid phase species concentration 'q' in g/L) should be g/L itself and not (Kg)(Scalar_variable)/(m^3-s).What do you say?

But then if this is the case and you go for transient term in UDS Transport modeling where you have a d(rho.phik)/dt (where phik is the UDS,Look up Equation 11.2-1 of UDF manual) term that clearly has the units of (Kg)(Scalar_variable)/(m^3-s).Since all the terms in an equation should have the same units,what should be the units for my UDS source term?

What is this contradiction in the manual?Or is it that I have interpreted it in a wrong way?Please help me out

Priya.

us May 23, 2005 11:50

Re: unsteady UDS
 
Hi,

You are right about what manual says. But if I mention it more precisely then it is, "The units for a user-defined scalar source should be the appropriate SI units based on the SI units for relevant Scalar quantity". The DEFINE_SOURCE for your UDS must return value to Fluent in SI unit. So when you calculate your UDS source it should be using values of k, a , C etc. in SI that in turn returns source term in SI value. In total, all the terms in your equation should have same units. The sorce term value should be per unit volume. Means, your UDS source also should have Kg*scalar_SI_unit/(m^3-s) if it is used as a transport equation. Hope this helps. Best regards, -US

IndrajitW December 13, 2012 02:27

Quote:

Originally Posted by us
;120828
C_STORAGE_R is the macro that stores the value of a cell variable. SV_UDSI_M1 is the stored value of previous time step.

Once you have activated the UDS in FLUENT, you solve it ,just like any other transport equations, during the calculation and so its related face and cell values are there in the domain. You can have access to it through related UDS macros(eg. C_UDSI or F_UDSI) in any UDF you design.

Regards, Umesh

Hi Umesh,
Please tell me if C_STORAGE_R stores only the value of cell variable or the cell variable value*density, since _R generally refers to density calculations.
Indrajit


All times are GMT -4. The time now is 03:35.