|
[Sponsors] |
May 31, 2004, 05:31 |
USRDCC scalar
|
#1 |
Guest
Posts: n/a
|
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 |
|
May 31, 2004, 10:44 |
Re: USRDCC scalar
|
#2 |
Guest
Posts: n/a
|
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 |
|
May 31, 2004, 10:53 |
Re: USRDCC scalar
|
#3 |
Guest
Posts: n/a
|
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 |
|
June 3, 2004, 20:37 |
Re: USRDCC scalar
|
#4 |
Guest
Posts: n/a
|
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solving for an additional species CO in coalChemistryFoam | N. A. | OpenFOAM Programming & Development | 3 | February 18, 2019 06:58 |
dieselFoam problem!! trying to introduce a new heat transfer model | vivek070176 | OpenFOAM Programming & Development | 10 | December 24, 2014 00:48 |
Specifying nonuniform boundary condition | maka | OpenFOAM Running, Solving & CFD | 59 | October 22, 2014 15:52 |
CFX12 rif errors | romance | CFX | 4 | October 26, 2009 14:41 |
STAR-CD user-defined scalar | Murali | Siemens | 0 | February 12, 2003 23:52 |