|
[Sponsors] |
June 10, 2003, 14:03 |
USRBCS
|
#1 |
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 |
|
June 10, 2003, 16:22 |
Re: USRBCS
|
#2 |
Guest
Posts: n/a
|
Can't you specify the exact path in the open statement?
|
|
June 11, 2003, 02:34 |
Re: USRBCS
|
#3 |
Guest
Posts: n/a
|
Hi Shalaby!
Are you working with CFX 4 or -5? Alexandra |
|
June 11, 2003, 02:43 |
Re: USRBCS
|
#4 |
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) |
|
June 11, 2003, 04:02 |
Re: USRBCS
|
#5 |
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 |
|
June 11, 2003, 06:42 |
Re: USRBCS
|
#6 |
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 |
|
June 11, 2003, 07:44 |
Re: USRBCS
|
#7 |
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.
|
|
June 11, 2003, 09:54 |
Re: USRBCS
|
#8 |
Guest
Posts: n/a
|
You can write it in USRBCS in user area 5. Your input file must be in your working directory.
Alexandra |
|
July 16, 2003, 22:05 |
Re: USRBCS
|
#9 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
USRBCS in CFX 5 (actually, 5.7.1) | ATS | CFX | 2 | August 24, 2005 13:30 |
USRBCS | RK | CFX | 2 | February 23, 2005 05:10 |
Define scalar wall boundary by USRBCS? | windhair | CFX | 2 | November 26, 2003 09:00 |
usrbcs for inlet boundary | Jesper Laursen | CFX | 2 | May 31, 2002 17:34 |
USRBCS flag | Alex | CFX | 0 | February 12, 2002 11:41 |