CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   USER_GETVAR (https://www.cfd-online.com/Forums/cfx/19988-user_getvar.html)

Jonathan November 11, 2003 16:21

USER_GETVAR
 
Hello CFXers,

Is it possible to use USER_GETVAR with a User CEL FORTRAN Function twice to obtain two pointers to two different variables?

I want to define a source based on two different mass fractions.

Is this possible with User FORTRAN in CFX 5.6?

Thanks,

Jonathan

Johnson November 11, 2003 16:45

Re: USER_GETVAR
 
Hi Jonathan

You can call user_getvar() as many times as you like within a User CEL Function. Just declare separate pointers for each variable you want to get.

Johnson

Jonathan November 12, 2003 10:28

Re: USER_GETVAR
 
Thank you for your reply, Johnson. I must not understand the User FORTRAN well enough. Isn't RZ the only real pointer variable that you are allowed to declare? Or do I have to set RZ up as an array?

Jonthan

Johnson November 12, 2003 12:38

Re: USER_GETVAR
 
Hi Jonathan

RZ() is the complete working real stack/array for the solver. A pointer returned from user_getvar() (e.g. pVAR1, if you've declared this as a __stack_point__ variable), is a pointer into this stack. Different variables will be located at different locations in the stack, so all you need to declare is a separate pointer for each variable you want to retrieve with user_getvar(), i.e. each time you want to call user_getvar().

Hope this helps,

Johnson

Jinzhihui June 3, 2021 11:10

dear all
Now I am trying to couple CFX with other code.


All times are GMT -4. The time now is 11:59.