CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Varying user scalar boundry conditions (http://www.cfd-online.com/Forums/cfx/18346-varying-user-scalar-boundry-conditions.html)

Franz Thomsen May 9, 2000 10:35

Varying user scalar boundry conditions
 
I seem to be having a problem in CFX4.2. I am using the USRBCS subroutine to modify user scalars on a boundary, but I seem to be having a problem using GETSCA to get my scalarvariables for later use in VARBCS. Using GETVAR for eg. the temperature or pressure like in the example works fine. Have any of you had the same problem or if not, could I see the fortran source ?

Regards Franz Thomsen Student Aalborg University

Gert-Jan van der Gulik May 9, 2000 11:11

Re: Varying user scalar boundry conditions
 
The manual is very clear in this:

CALL GETSCA('SCALARNAME',IVAR,CWORK)

IVAR is the number of the scalar equation that you are looking for. Now you can alter the value of the scalar by assigning SCAL(INODE,IPHS,IVAR).

Works fine all the time. If it doesn't help, contact me for some fortran code.

Anyway, good luck.

Gert-Jan van der Gulik

Franz Thomsen May 10, 2000 04:30

Re: Varying user scalar boundry conditions
 
Yes, the manual is very clear about that, and that is I think the problem lies somewhere else. I have included the two pieces of fortran code.

In command file I have specified a patch and set the pressure and a userscalar (TEST1) on this boundry.

My first example shows, like in the example in the manual, how to write one of the "non user scalars" on the boundry to the screen. The result is whatever pressure I specify from the command file.

IUBCSF=2

CALL GETVAR('USRBCS','P ',IPRESSURE)

CALL FILCON('USRBCS','TEST.TXT','OPEN','FORMATTED',

+ 'NEW',INR1,0,IOST,IERR1)

CALL IPREC('MYPATCH','PATCH','CENTRES',IPT,ILEN,JLEN,KL EN,

+ CWORK,IWORK)

DO 103 K = 1, KLEN

DO 102 J = 1, JLEN

DO 101 I = 1, ILEN

INODE = IP(I,J,K)

WRITE(INR1,*) 'PRESSURE : ', VARBCS(IPRESSURE,1,INODE)

101 CONTINUE 102 CONTINUE 103 CONTINUE

My next example shows exactly the same, but with the user scalar. The problem is, that the result of this is not the same as specified in the command file for the user scalar on the boundry.

IUBCSF=2

CALL GETSCA('TEST1',ITEST1,CWORK)

CALL FILCON('USRBCS','TEST.TXT','OPEN','FORMATTED',

+ 'NEW',INR1,0,IOST,IERR1)

CALL IPREC('MYPATCH','PATCH','CENTRES',IPT,ILEN,JLEN,KL EN,

+ CWORK,IWORK)

DO 103 K = 1, KLEN

DO 102 J = 1, JLEN

DO 101 I = 1, ILEN

INODE = IP(I,J,K)

WRITE(INR1,*) 'USER SCALAR : ', VARBCS(ITEST1,1,INODE)

101 CONTINUE 102 CONTINUE 103 CONTINUE

My question is therefore. Why can´t I access my user scalars on the boundry when I can access other variables there ?

Jan Rusås May 10, 2000 04:53

Re: Varying user scalar boundry conditions
 
Dear Franz,

I think your problem is the naming of your scalar, try to read Gert-Jan's reply again. Your naming of the scalar should be SCAL(INODE,IPHS,IVAR) and not as you do it - VARBCS(ITEST1,1,INODE)

Hope this helps, Held og Lykke

Jan

Franz Thomsen May 10, 2000 05:53

Re: Varying user scalar boundry conditions
 
You are right ... problem solved ... thanks :)


All times are GMT -4. The time now is 16:27.