CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   USRSRC User scalar (http://www.cfd-online.com/Forums/cfx/20373-usrsrc-user-scalar.html)

Andrea May 18, 2004 04:29

USRSRC User scalar
 
I need set a source in a mass fraction equation.

In command file I set

MASS FRACTION1 'HYD'

In usrsrc routine which string I should set like getvar argument?

Thanks

Andrea Musso

Jeff May 23, 2004 00:31

Re: USRSRC User scalar
 
Trying hard to recall CFX-4 stuff.....

You need to find the equation index and then check to see if USRSRC is being called for the equation you want. Since HYD is a scalar and is embedded in the SCAL array, you need to get the SCAL index and add the mass fraction index to it (-1).

IPHASE = 1 ! first phase only

CALL GETSCA('HYD',IHYD,CWORK)

CALL GETVAR('USRSRC','SCAL ',ISCAL)

IVAR = ISCAL + IHYD - 1

IF (IEQN.EQ.IVAR) THEN

DO INODE = 1,NNODE ! loop over nodes

SU(INODE,IPHASE) = ............

SP(INODE,IPHASE) = ............

ENDDO

ENDIF

Hope this helps. You really need to switch to CFX-5. It's much easier than this, and fewer and fewer people remember this CFX-4 stuff.

Jeff


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