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

USRBCS

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2003, 13:03
Default USRBCS
  #1
shalaby Hemdan
Guest
 
Posts: n/a
I have measurments data at duct inlet and I want to apply this as a boundary conditions. I have the file. How can I read open and read this file in USRBCS to read velocity. In the file, I have U, V, and W.

Best regards

Shalaby
  Reply With Quote

Old   June 10, 2003, 15:22
Default Re: USRBCS
  #2
Jan Rusås
Guest
 
Posts: n/a
Can't you specify the exact path in the open statement?
  Reply With Quote

Old   June 11, 2003, 01:34
Default Re: USRBCS
  #3
Alex
Guest
 
Posts: n/a
Hi Shalaby!

Are you working with CFX 4 or -5?

Alexandra
  Reply With Quote

Old   June 11, 2003, 01:43
Default Re: USRBCS
  #4
Alex
Guest
 
Posts: n/a
Hi!

These are the commands I used in an user routine in CFX 4 to read data from a file. Hpore this helps.

Alexandra

call FILCON('USRCVG','../datei.txt','OPEN','FORMATTED'

+ ,'OLD',idjjjj,iLREC,IOST,IERR)

if( IERR .eq. 0 ) then

write(*,*)'Error!'

endif

read(idjjjj,180) SCAL(inode,1,iscJx)

+ ,SCAL(inode,1,iscJy)

+ ,SCAL(inode,1,iscJz)

+ ,SCAL(inode,1,iscJg)

+ ,SCAL(inode,1,iscjh)

call FILCON('USRCVG','../datei.txt','CLOSE','FORMATTED',

+ 'OLD',idjjjj,iLREC,IOST,IERR)

180 FORMAT(5E16.6)
  Reply With Quote

Old   June 11, 2003, 03:02
Default Re: USRBCS
  #5
shalaby Hemdan
Guest
 
Posts: n/a
hi Jan Rusås

The following what I have changed in USRBCS. In USER AREA 3 and USER AREA 5.

C+++++++++++++++++ USER AREA 3 +++++++++++++++++++++++++++++++++++++++++ C---- AREA FOR USERS TO DIMENSION THEIR ARRAYS

DIMENSION UVEL(40,80)

C C---- AREA FOR USERS TO DEFINE DATA STATEMENTS

OPEN(10,FILE='inlet_3.dat')

DO 1 J=1, 80

DO 1 I=1, 40

READ(10,*) UVEL(I,J) 1 CONTINUE

CLOSE (10) C C+++++++++++++++++ END OF USER AREA 3 ++++++++++++++++++++++++++++++++++ C C---TO SET THE U V W VELOCITY AT THE INLET C----INTEROGATE GETVAR FOR VARIABLES NUMBER

CALL GETVAR('USRBCS','U ',IU)

C SET IPHS = 1 FOR SINGLE PHASE FLOW

IPHS = 1 C USE IPREC TO FIND ADDRESSES

CALL IPREC('INLET','PATCH','CENTRES',IPT,ILEN,JLEN,KLEN ,

+ CWORK,IWORK)

C LOOP OVER PATCH

DO 103 K = 1, KLEN

DO 102 J = 1, JLEN

DO 101 I = 1, ILEN C USE STATMENT FUNCTION IP TO GET ADDRESSES C INODE = IP(I,J,K) C SET VARBCS

VARBCS(IU,IPHS,INODE) =UVEL(I,J) 101 CONTINUE 102 CONTINUE 103 CONTINUE C+++++++++++++++++ END OF USER AREA 5

++++++++++++++++++++++++++++++++++

Shalaby
  Reply With Quote

Old   June 11, 2003, 05:42
Default Re: USRBCS
  #6
shalaby Hemdan
Guest
 
Posts: n/a
hi Alexandra

I am using CFX4.4. I think that is what you vare worked with. I want to know where can I write this command. If this in USRBCS in which user file.

Shalaby
  Reply With Quote

Old   June 11, 2003, 06:44
Default Re: USRBCS
  #7
Jan Rusås
Guest
 
Posts: n/a
You do not specify the path for the file, which means that CFX will look for the file in maybe a temp dir or in the dir where put the calculations. I do not know if there is a smart option in CFX4 to open a file in the same directory as from where the calculations are started. But if you specify the correct path in you open statement it will find the file.
  Reply With Quote

Old   June 11, 2003, 08:54
Default Re: USRBCS
  #8
Alex
Guest
 
Posts: n/a
You can write it in USRBCS in user area 5. Your input file must be in your working directory.

Alexandra
  Reply With Quote

Old   July 16, 2003, 21:05
Default Re: USRBCS
  #9
jeff
Guest
 
Posts: n/a
Shalaby,

CFX-4 automatically copies all the files it "thinks" it needs for the run to a temporary directory just below your working directory (something like .CFX_temp) while the problem is running. Unfortunately it does NOT know to copy your data file, therefore it is ALWAYS one level up from the runtime temp directory. You should open data files then with the string "../data.dat" to indicate one level up.

Secondly, check the manual under USER FORTRAN for all the units used by CFX. I think opening unit 10 is risky as most of the first dozen units are used by various physical models and diagnotics output. I typically use a unit above 50 to be safe.

Also, unless you know that you will always be using a single block (2D test cases), use IPALL instead of IPREC. If your patch covers more than one block face, IPREC will only get one of the block faces. IPALL will get them all. You'll have to do some X,Y,Z matching to interpolate the data onto the patch, but it's safer.

Jeff
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
USRBCS in CFX 5 (actually, 5.7.1) ATS CFX 2 August 24, 2005 12:30
USRBCS RK CFX 2 February 23, 2005 04:10
Define scalar wall boundary by USRBCS? windhair CFX 2 November 26, 2003 08:00
usrbcs for inlet boundary Jesper Laursen CFX 2 May 31, 2002 16:34
USRBCS flag Alex CFX 0 February 12, 2002 10:41


All times are GMT -4. The time now is 14:03.