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

Iteration number for junction box routine

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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 i´th 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, 16:16
Default
  #3
New Member
 
Ahmad
Join Date: Mar 2009
Posts: 5
Rep Power: 17
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, 06:03
Default
  #4
New Member
 
Martijn
Join Date: Mar 2009
Posts: 14
Rep Power: 17
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

Old   March 7, 2018, 09:45
Default Junction box routine
  #5
New Member
 
Laghouat
Join Date: Feb 2018
Posts: 7
Rep Power: 8
zaoui is on a distinguished road
Hi all
me also, I want to set up a simulation in Ansys-cfx with user Junction Box Routine(in Fortran). This JBR is called at the end of each timestep in order to get the the velocity field components (for special area), treat them and inject them again into the solver for the next time step.So, my question is exactely how can a user fortran routine deal (get ,inject...) with the velocity field components every timestep. Please I need your help or a tutorial for this special purpose
Thanks for all
zaoui is offline   Reply With Quote

Old   March 7, 2018, 11:51
Default
  #6
Senior Member
 
Join Date: Feb 2011
Posts: 496
Rep Power: 18
Antanas is on a distinguished road
Quote:
Originally Posted by zaoui View Post
Hi all
me also, I want to set up a simulation in Ansys-cfx with user Junction Box Routine(in Fortran). This JBR is called at the end of each timestep in order to get the the velocity field components (for special area), treat them and inject them again into the solver for the next time step.So, my question is exactely how can a user fortran routine deal (get ,inject...) with the velocity field components every timestep. Please I need your help or a tutorial for this special purpose
Thanks for all
First thing to try is RTFM
Antanas is offline   Reply With Quote

Old   March 7, 2018, 17:42
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Laghouat: You posted the same post on 3 threads. Please do not do this again. Ask a question once and once only.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   March 8, 2018, 07:35
Default
  #8
New Member
 
Laghouat
Join Date: Feb 2018
Posts: 7
Rep Power: 8
zaoui is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Laghouat: You posted the same post on 3 threads. Please do not do this again. Ask a question once and once only.
Ok sir noted
zaoui is offline   Reply With Quote

Old   March 8, 2018, 07:55
Default
  #9
New Member
 
Laghouat
Join Date: Feb 2018
Posts: 7
Rep Power: 8
zaoui is on a distinguished road
Hi Antanas
I don't understand your reply "RTFM ".
Breafly my question is, how can we get velocity fiel solution after each timestep, treat it and reinject it again as initialisation for the next timestep.All this with a JBR defined in ANSYS-CFX pre.If I understood correctly USER_GETVAR do not work with JBR.
please I need your help .
zaoui is offline   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
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 06:50.