CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   how to call variables of CFX by FORTRAN (https://www.cfd-online.com/Forums/cfx/218141-how-call-variables-cfx-fortran.html)

cscfx June 10, 2019 09:55

how to call variables of CFX by FORTRAN
 
hello,everybody,i want to implant a transport equation to CFX, and i add a additional variable to CFX,and the source terms of the transport equation are related to variables of CFX,such as velocity,volume fraction,density.etc. so i write the sources by Fortran language,but i did not know how to calling the variables(such as velocity,volume fraction,density),anybody can give me some help? thanks a lot! I've been puzzled by this question for a long time. i sincerely hope you can give me some helps!

Opaque June 10, 2019 10:14

Have you done the user Fortran tutorial for sources?

Please search the ANSYS CFX documentation for USER_GETVAR utility, which give you access to variables using the same syntax as used in the expression language, i.e. CEL.

For example, if you need velocity, you use something along

CALL USER_GETVAR( 'Velocity', ...)

cscfx June 11, 2019 07:07

than you for your reply
 
Quote:

Originally Posted by Opaque (Post 735854)
Have you done the user Fortran tutorial for sources?

Please search the ANSYS CFX documentation for USER_GETVAR utility, which give you access to variables using the same syntax as used in the expression language, i.e. CEL.

For example, if you need velocity, you use something along

CALL USER_GETVAR( 'Velocity', ...)

thank you for your reply,Opaque. i do as you said. there is part of my program, as you can see,in the source term,i used "Velo_water "as the water.velocity,is this right? the other variables deal with the same way, thanks!
CALL USER_GETVAR( 'water.Velocity', ...pVelo_water,..) ,in source term,when i want to use water.Velocity,i just need to use "Velo_water",is this right?
do ILOC=1,NLOC
source(ILOC)=2.0/3.0*Velo_water(ILOC)
END do
sorry ,the picture can not be inserted.


All times are GMT -4. The time now is 22:36.