CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   subroutine call order (https://www.cfd-online.com/Forums/siemens/53526-subroutine-call-order.html)

CMB October 23, 2003 09:14

subroutine call order
 
Hi,

This might be problem dependent, but in a general case, using SIMPLE alg. in a steady state problem, which of the following subroutines are called first in an itteration. Say if I would like to call: sorent.f, sorsca.f and fluinj.f. My guess is that enthalpy changes are calculated in a first instance just after momentum balance, but between fluinj and sorsca I do not really know. I would appreciate any informations about the order in which subroutines are called in Star CD.

Kind regards, C.

Richard October 23, 2003 11:12

Re: subroutine call order
 
Why is it important to know? If the coding depends on the coupling of source terms, this should resolve itself by convergence. On the other hand, if you have some procedural requirement like passing information from one subroutine to another or initialising everything in the first subroutine called, you should be able to write FORTRAN that does this without knowing the call sequence. Remember you have the INTFLG array - all subroutines can see it, it's initialised to 0 and it's values are "remembered" by STAR. So you can use it to pass flag from one subroutine to another.

Thomas October 24, 2003 01:54

Re: subroutine call order
 
simply write a 'write (*,*) 'blabla-1/2/3...' in each subroutine, then you will see.

Brian October 24, 2003 04:19

Re: subroutine call order
 
Ask your CD-adapco representative for a copy of the course material on User Subroutines. It's explained pretty well there, in Chapter 4, but it's too much to paste here, and includes diagrams.

Juliet November 26, 2003 19:08

ABOUT INTFLG
 
Hi,experts can you give me detailed information about INTFLG, how to use it, what is it mean?

thanks a lot Juliet

CMB November 27, 2003 10:34

Re: ABOUT INTFLG
 
Hi, I am no expert but this is what I know about it, when coding, STAR can help ensuring that something is only executed once and ensuring something is only executed once per itteration/time step. You can use the array intflg for that, the array contains 100 integers which are initialised to zero and which the user is free to modify. STAR does nothing but store them, hence the user can teat them as arbitrary flags.

to ensure that something is executed only once do:

IF (INTFLG(1).EQ.0) THEN C CODE...

INTFLG (1)=1

ENDIF to ensure that this si executed once per itteration do:

IF (INTFLG(1).EQ.0) THEN

INTFLG(2)=-1

INTFLG(1)=1

ENDIF

IF (INTFLG(2).NE.ITER) THEN C CODE...

INTFLG(2) = ITER

ENDIF

this is something I got from the user subroutine adapco course manual, talk to them and ask them to send you a copy, there are some other usefull things in it. Good luck, bye


All times are GMT -4. The time now is 15:23.