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

The source of user scalar equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2002, 10:38
Default The source of user scalar equation
  #1
rambol
Guest
 
Posts: n/a
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?
  Reply With Quote

Old   November 10, 2002, 18:43
Default Re: The source of user scalar equation
  #2
Astrid
Guest
 
Posts: n/a
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
  Reply With Quote

Old   November 11, 2002, 19:45
Default Re: The source of user scalar equation
  #3
Mads Bang
Guest
 
Posts: n/a
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
  Reply With Quote

Old   November 14, 2002, 08:37
Default Re: The source of user scalar equation
  #4
rambol
Guest
 
Posts: n/a
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
  Reply With Quote

Reply


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
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
UDF for source term in momentum equation Enrico FLUENT 9 May 30, 2014 12:34
Source Term on Scalar Transport Equation - crashing simulation alessio.nz OpenFOAM 19 February 8, 2011 08:38
Source Term on Scalar Transport Equation alessio.nz OpenFOAM Programming & Development 9 January 31, 2011 08:56
Particle User Source in ANSYS CFX Jun CFX 0 September 8, 2010 10:28


All times are GMT -4. The time now is 04:44.