CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   USRDCC scalar (https://www.cfd-online.com/Forums/cfx/20407-usrdcc-scalar.html)

Andrea May 31, 2004 04:31

USRDCC scalar
 
Hi all...

I need set the value of a user scalar in a steady state problem.

I'm using USRDCC variable but I don't know how set the value.

I tried the USRTRN but I can't set the value.

Thanks

Andrea

Jeff May 31, 2004 09:44

Re: USRDCC scalar
 
Andrea,

USRDCC variables are user variables that "start" with "USRDCC" (i.e. USRDCC_MYVAL). Once created in the command language by adding a user scalar variable and renaming it to 'USRDCC_myval', you can access it in any of the routines.

Try initializing it to something you can see and plot, like the x coordinate, in USRINT. USRINT only gets called at initialization (whereas USRTRN is a little more tricky as to when it gets called depending on the type of run).

Use the following:

CALL GETSCA('USRDCC_myval',IMYVAL,CWORK)

DO INODE = 1,NCELL

SCAL(INODE,IPHASE,IMYVAL) = {some value}

ENDDO

Run one iteration and you shoul be able to plot your USRDCC_myval variable in the post processor.

NOTE: USRDCC vars are only set at Cell centers (1 to NCELL) and the code interpolates to the boundary nodes. USRD variables require you to set all the nodes (1 to NNODE).

Jeff

Andrea May 31, 2004 09:53

Re: USRDCC scalar
 
Thank you...

I set the initial value using USRINT and I can plot the variable value in postprocess.

Now I need update the variable value at every iteration step (after the solution of the continuity equation nad the species transport equation).

I use USRVIS

USRDIF

USRSRC

USRINT

USRCND

In which is better update my scalar? How can I know when USRTRN is called in a steady state?

Regards

Andrea

Jeff June 3, 2004 19:37

Re: USRDCC scalar
 
USRCVG was coded originally to monitor convergence at each iteration. Therefore, this is a good place to update things like user scalars since it is called at the end of each iteration (NITER = 1 to MAXIT) after everything else is calculated.

USRTRN is really for transient runs and gets called each time step (you can tell which one by looking at the variable KSTEP). However, it can be useful for steady state runs where you want something to happen only at the end of the run (i.e. if your scalars are caclulational for output only an not used by any other equations as sources, etc.). USRTRN gets called once at the beginning of a steady state run with KSTEP=0 and once at the end with KSTEP = NSTEP.

The other routines you mentioned get called at various times and in a different order depending on the options set. You're better off in USRCVG or USRTRN.

Hope this helps, Jeff


All times are GMT -4. The time now is 17:05.