CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   The source of user scalar equation (http://www.cfd-online.com/Forums/cfx/19286-source-user-scalar-equation.html)

rambol November 8, 2002 10:38

The source of user scalar equation
 
Hi,everyone If I want to add a user scalar equation in cfx4.3,how could I definite the source of the user scalar equation in user fortran? For example,if the source term is Fa,where would I set the source term in usrsrc, in IF (ICALL.EQ.1) THEN or in IF (ICALL.EQ.2) THEN ?Su=Su+Fa and Su=Fa,which expression is correct?

Astrid November 10, 2002 18:43

Re: The source of user scalar equation
 
Su=Su+Fa adds your source term 'Fa' to the exsisting array of source terms Su. Su=Fa overwrites the array Su. The latter can be painfull if CFX previously has added source terms to this array.

Are you sure you do not need Sp?

Astrid

Mads Bang November 11, 2002 19:45

Re: The source of user scalar equation
 
First use

CALL GETVAR('USRSRC','SCAL ',ISCA) To get the number of scalar equations

then use

CALL GETSCA('MASS FRACTION1',IFRAC1,CWORK) To get equation "MASS FRACTION1"

Then use the criteria

IF (IEQN.EQ.ISCA+IFRAC1-1) THEN To find out when to set the source term

Hope this helps you?

Regarding the source term use the first formulation since the other over writes all information stored in the source.

-Mads

rambol November 14, 2002 08:37

Re: The source of user scalar equation
 
Thanks,astrid and mads Bang your advice is helpful to me.I need Sp term also,but i can't get it from the equation.So the equation is always divergence now.Another question is about Usrbcs.If i want to set the boundary condtion of the user scalar.Is it correct of the next steps? CALL GETSCA('FA',IPA,CWORK) IS=4+IPA A(IS,IB,INODE)=0.0

B(IS,IB,INODE)=1.0

C(IS,IB,INODE)=0


All times are GMT -4. The time now is 20:27.