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

Iteration number for junction box routine

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 26, 2008, 16:29
Default Iteration number for junction box routine
  #1
Allan
Guest
 
Posts: n/a
I am using a junction box routine called after every time step in a transient run. I would like to make statements which determines wether to read information from a file after the first time step and save these in the memory in fortran or to read the information from the memory after the preceding time steps.

Basically i need to call the iteration number which attain the values 1,2,...,n for the ith iteration.

I have tried to call atstep, ctstep, Accumulated Time Step, Current Time Step, but I get the same value after each time step.

I have found something about CALL_TRANS_INFO but nothing which explains how this works.

Can anybody help me?
  Reply With Quote

Old   March 27, 2008, 08:50
Default Re: Iteration number for junction box routine
  #2
Allan
Guest
 
Posts: n/a
I might now rephrase my question. I have found out that I might be able to get the information needed by specifying an expression as:

timevariable = aitern

Then I define an additional variable which I assign the value of "timevariable".

But now my problem is how to call an additional variable in Fortran?

I have read in the manual that "USER_GETVAR" does not work in a junction box routine and I am therefore lost as to what I can Call to get the variable into my fortran routine at each time step.
  Reply With Quote

Old   April 13, 2009, 15:16
Default
  #3
New Member
 
Ahmad
Join Date: Mar 2009
Posts: 5
Rep Power: 9
cryogenicT is on a distinguished road
Try the subroutine below. You can find an extended version in CFX-PRE documentation.

#include "cfx5ext.h"
dll export(get_tstep_info)
SUBROUTINE GET_TSTEP_INFO (CZ, DZ, IZ, LZ, RZ)
C
C Example of obtaining transient info for all domains
C
C Include directives
#include "MMS.h"
#include "cfd_constants.h"
C
C Arguments
CHARACTER*(1) CZ(*)
DOUBLE PRECISION DZ(*)
INTEGER IZ(*)
LOGICAL LZ(*)
REAL RZ(*)
C
C External functions
C Functions to convert integers/reals to character strings
CHARACTER*4 CFROMI, CFROMR

C Function to concatenate an integer on to the end of a string
CHARACTER*(MXDNAM) CCATI
EXTERNAL CCATI, CFROMI, CFROMR
CHARACTER FILENAME*8
CHARACTER ATSTEPCHAR*4
INTEGER I,N
C
C Local parameters
CHARACTER*(*) ROUTIN
PARAMETER (ROUTIN = 'GET_TSTEP_INFO')
C
C Local variables
CHARACTER*4 CRESLT
CHARACTER*120 User_Domain_Name
CHARACTER*(MXDNAM) CDIR_GLOB, CZONE
CHARACTER*(MXPNAM) CDRNAM
C
C Number of zones & iterator
INTEGER NZN, IZN
C Number of timesteps, accumulated timesteps, coefficient loops
INTEGER NTSTEP, ATSTEP, NCLOOP
C Time, accumulated time, timestep value
REAL RTIME, GTIME, DT
C
C ================================================== ====================
C Executable statements
C ================================================== ====================
C
C ----------------------------------------------------------------------
C Obtain and write non zone specific data
C ----------------------------------------------------------------------
C
C Obtain number of timesteps and accumulated timesteps
CALL PSHDIR ('/FLOW/SOLUTION', 'STOP', CRESLT)
CALL PEEKI ('NTSTEP', IONE, NTSTEP, 'STOP', CRESLT, IZ)
CALL PEEKI ('ATSTEP', IONE, ATSTEP, 'STOP', CRESLT, IZ)
CALL POPDIR ('STOP', CRESLT)
C Write to standard output
CALL MESAGE( 'WRITE-ASIS', ' ')
CALL MESAGE( 'WRITE', ' Time Step = '//CFROMI(NTSTEP))
CALL MESAGE( 'WRITE', ' Accumulated Time Step = '//CFROMI(ATSTEP))

END
cryogenicT is offline   Reply With Quote

Old   April 14, 2009, 05:03
Default
  #4
New Member
 
Martijn
Join Date: Mar 2009
Posts: 14
Rep Power: 9
Martijn is on a distinguished road
I had some time ago the same problem, and solved it by writing a text file with the value of atstep with a User Cel function which is later on read by the junction box routine. It is easy and works always .
Martijn is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
junction box routine and CEL function bornspur CFX 2 February 3, 2009 03:24
junction box routine - more than one? Ollimarc CFX 1 March 18, 2008 03:32
Junction Box Routine Shared Object Library sam CFX 0 March 3, 2008 13:52
User CEL or Junction Box routine? Lexi CFX 6 January 22, 2004 09:52
junction box routine Lexi CFX 2 January 21, 2004 05:55


All times are GMT -4. The time now is 18:57.