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

Re: scalar transport equation problem

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2003, 10:32
Default Re: scalar transport equation problem
  #1
Benny
Guest
 
Posts: n/a
Hi all,

I set a scalar transport equation in fluent, but it surprised me that when the Iterating began, the solution of the scalar converged at once, that is, Residual was equal to perfect zero. When I finished the iterating and plot the result, I found that the value on the zone were all equal to zero. I think it means that such calculation of the scalar is invalid. Could somebody tell me how this happens? Thank you!

Benny
  Reply With Quote

Old   September 26, 2003, 13:19
Default Re: scalar transport equation problem
  #2
Ale
Guest
 
Posts: n/a
Hi

I suppose that your scalar is not entering your system, but it is generated in the domain, isnt'it?

You can try to answer to these questions:

-did you define the right source term for your UDS?

-did you enabled the source term in the boundary condition panel for 'fluid' (you have to click in the box of the 'source terms', and then to choose in the list the right source for each UDS')?

- if your source term is partially evaluated in a DEFINE_ADJUST function, have you selected it in the Function Hooks panel (define->user defined-> function hooks)?

- if the source term should be zero(your UDS simply transported in your system), check your boundary conditions.

Hope this helps.

Regards,

Ale

  Reply With Quote

Old   September 26, 2003, 22:51
Default Re: scalar transport equation problem
  #3
Benny
Guest
 
Posts: n/a
Hi Ale,

Thank you so much! I defined the right source term for my UDS, right sources have been selected after enabling the 'source term' in the Fluid Zone, and DEFINE_ADJUST has also been seclected in the Function Hooks panel.

So I think that myabe I defined wrong Boundary Conditions of the UDS. I'd like to know whether we should set the same value for the same scalar but in different zone. For instance, in the Wall and Inlet zone, should the value of a scalar be equal to each other; or we should set different value for it according to the real conditions? Thank you!

Best regards!

Benny

  Reply With Quote

Old   September 29, 2003, 06:20
Default Re: scalar transport equation problem
  #4
Ale
Guest
 
Posts: n/a
You should set the correct b.c. for each zone; e.g. at walls you should set flux=0 if your scalar is a chemical species, the real flux if it is heat (or zero if your system is adiabatic), at inlets you should set the real value you have in the inlet stream and so on...

If you have non-zero values at inlets you must have non-zero values in the domain.

Check the value of diffusivity, especially if you are not computing the convective flux (to compute the convective flux you have to select 'mass_flow_rate' as flux function for your UDS), and the value of your source terms (by UDMs).

Let me know if you find the problem...

Best luck and best regards,

Ale
  Reply With Quote

Old   May 9, 2010, 23:12
Unhappy Scalar transport: NEED HELP!
  #5
lig
New Member
 
Gloria
Join Date: Feb 2010
Posts: 16
Rep Power: 16
lig is on a distinguished road
Hi,

I also meet the same problem. I use scalar transport equation to simulate the particle transport in a porous zone in 2D. The source term at each cell is U*A*CE*Cin/Vcontrol (The UDS equation has no density term),
U is the cell velocity
A is face area, which is also the face normal vector of the face (dx for V, and dz for U)
CE is the collection efficiency of porous zone at each cell,
Cin is the UDS which is the number concentration of the particle
Vcontrol is the control volume of the cell which is dx*dz in 2D.
The following is the code I wrote. Please help me to find the error, I am a starter and nobody near me can help me :-(.

Oh, BTW, as for the boundary of the porous zone (rectangular W*H), I set "interface" for three sides of the zone where it stand in the air, and the bottom is set to wall.




Quote:
Originally Posted by Benny
;108168
Hi all,

I set a scalar transport equation in fluent, but it surprised me that when the Iterating began, the solution of the scalar converged at once, that is, Residual was equal to perfect zero. When I finished the iterating and plot the result, I found that the value on the zone were all equal to zero. I think it means that such calculation of the scalar is invalid. Could somebody tell me how this happens? Thank you!

Benny

#include "udf.h"
#include "stdio.h"

#define dp 0.875e-6 /*particle diameter (um) */
#define Dcyl 0.006 /*cylinder diameter of tree stem&twig (m) */
#define Dleaf 0.001 /*leaf diameter of tree stem&twig (m) */
#define K 1.38e-23 /*Boltzmann constant (Nm/K)*/
#define T 293 /*Temperature at 20C (K)*/
#define mu 1.789e-5 /*viscosity (N s/m^2) */
#define rhoP 1050 /*density of particle (Kg/m^3)*/
#define rhoA 1.225 /*density of air (Kg/m^3)*/
#define pi 3.1415926 /*constant Pi */
#define lambda 0.066 /*mean free path (um) */
#define g 9.81 /*gravity acceleration m/s^2*/
#define Cpol 1.32 /*Polhausen coefficient*/
#define dx 0.16 /*dx=W/n, W=1.6m, n=10 (m)*/
#define dz 0.1375 /*dz=H/n H=2.2m, n=16, m */

/*Calculated constant by giving a dp*/
#define Cc 1.177 /*Slip corrction factor*/
#define dm 3.22492e-11 /*laminar diffusion coefficient (m^2/s) */
#define Trel 2.49589e-6 /*relaxation time of the particle (s)*/
#define Usettle 0.00002882 /*settling speed of particle (m/s) */
#define B 8.55378e-7
#define D 68458.70124
/************************************************** ************************************************** ***************/

DEFINE_SOURCE(uds_source0,c,t,dS,eqn)
{

real source;
face_t f;
real x[ND_ND], z, Ucell, volume,NV_VEC(A), NV_VEC(Uface);
z=x[1];
Ucell=C_U(c,t);
volume=C_VOLUME(c,t);
F_AREA(A,f,t);
int i;

/**********************For collection efficiency of leaves and cylinder of the tree (CEcell) ************************/
/*CE is the total collection efficiency =CEcyl+CEleaf (<=1)at each cell */
real CEcell,CEcell_c,CEcyl,CEleaf, SADcell;
real Ec,Ec_c, El, El_c;/*collection efficiency of each cell due to all deposition mechanisms*/
real Edc, Edl; /*collection efficiency of cylinder&leaf due to DIFFUSION*/
real Eiic, Eiil; /*collection efficiency of cylinder&leaf due to INTERCEPTION+IMPACTION*/
real Eic, Eil; /*collection efficiency of cylinder&leaf due to IMPACTION*/
real Rec, Rel,Stkc, Stkl, Rc, Rl;

Rec=D*Dcyl*Ucell; /*Reynolds number for flow around a cylinder*/
Rel=D*Dleaf*Ucell; /*Reynolds number for flow around a leaf*/
Stkc=Trel*Ucell/Dcyl;/*Stk number for flow around a cylinder*/
Stkl=Trel*Ucell/Dleaf; /*Stk number for flow around a leaf*/
Rc=dp/Dcyl; /*interception parameter for flow around a cylinder*/
Rl=dp/Dleaf; /*interception parameter for flow around a leaf*/
/************************************************** ************************************************** ********************/

begin_f_loop(f,t)
{

C_CENTROID(x,f,t);
/*for cylinder collection efficiency at each cell due to all deposition mechanisms*/
Edc= B/pow((Dcyl*Ucell),0.5);
Eiic = (Stkc/(Stkc+0.8)-(2.56-log10(Rec)-3.2*Rc)/(10*sqrt(Stkc)))*(1+Rc);
Eic = Eiic;
if (Eic >(1+Rc)){
Eiic = pow(Stkc/(Stkc+0.8),2);
}
else if (Eic< 0){
Eiic= pow(Stkc/(Stkc+0.8),2);
}
else{
Eiic= Eic;
}
/*cylinder*/Ec = (Edc + Eiic);
Ec_c=Ec;
if (Ec_c>=1){
Ec=1;
}
else if (z>((3/8)*x[0]+2.5)&&z>((-3/8)*x[0]+1.9)&&z<(-2.1*x[0]-1.46)&&z<(2.1*x[0]+1.9)){
Ec=0;
}
else {
Ec=Ec_c;
}


/*Surface area density (SAD)of foliage */
if (z <= 2.07){

SADcell = -3.99043*pow(z,3)+12.8994*pow(z,2)-7.58257*z+1.89096;
}
else {
SADcell = -224.925*pow(z,2)+912.217*z-918.31;
}

CEcyl = 1-exp(1-SADcell*Ec*dx);

/*total collection efficiency at each cell */

CEcell=2*CEcyl;
CEcell_c=CEcell;
if (CEcell_c>=1){
CEcell=1;
}
else {
CEcell=CEcell_c;
}

source = C_UDSI(f,t,0)*CEcell*Ucell*F_AREA(A,f,t)/volume;
dS[eqn] = CEcell*Ucell*F_AREA(A,f,t)/volume;
}
end_f_loop(f,t)


return source;
}
lig is offline   Reply With Quote

Old   March 22, 2018, 14:28
Default
  #6
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 8
gouravjee is on a distinguished road
Quote:
Originally Posted by Benny
;108168
Hi all,

I set a scalar transport equation in fluent, but it surprised me that when the Iterating began, the solution of the scalar converged at once, that is, Residual was equal to perfect zero. When I finished the iterating and plot the result, I found that the value on the zone were all equal to zero. I think it means that such calculation of the scalar is invalid. Could somebody tell me how this happens? Thank you!

Benny
i have a uds function that calculates source term but i am concerned about the rest of the equation.
can you tell me where the remaining of the part of the equation is solved and how to write code for that ?
gouravjee is offline   Reply With Quote

Reply

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
UDF Transport equation for transition momentum thickness Reynolds number Wantami FLUENT 0 April 9, 2011 03:50
Scalar transport in Lid driven cavity CFDtoy Main CFD Forum 2 February 19, 2011 10:43
User defined scalar transport problem (UDS) jpcfd FLUENT 0 June 8, 2010 05:50
Is it possible to influence the velocity of an scalar transport equation? jannnesss CFX 1 January 11, 2010 13:02
Energy equation convergence problem Reza Main CFD Forum 0 August 27, 2003 14:09


All times are GMT -4. The time now is 01:26.