CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Acces to solver variables in UDF (https://www.cfd-online.com/Forums/fluent/80967-acces-solver-variables-udf.html)

kondora October 12, 2010 13:28

Acces to solver variables in UDF
 
Hi all,

How to access solver variables (like boundary conditions setting - for example: defined volume fraction for phase of ID 5 for the velocity inlet zone of ID 4) in UDF? I know that I can easily access scheme variables defined, but how to access this specific setting on boundary zone? Thanks in advance!!!

csmith_PADT October 12, 2010 16:09

You could use a UDF macro known as DEFINE_PROFILE(), in which you can specify a profile for a boundary zone. In your case, you could create the profile for the volume fraction on the velocity inlet zone. There is a decent example of how to do this in the Fluent UDF manual.

kondora October 12, 2010 16:18

Ok, thanks. But I'm trying to create an UDF that will be universal, i.e. does not require modifying from the user side. I pretty sure that it is possible to access given settings in FLUENT since those variables are accessed by the solver as well somehow. For example zone name may be accessed by THREAD_NAME(c) while looping over particular domain and thread... Another way to access settings is to use scheme variables, it should have following form: in FLUENT | (%rpgetvar '/bc/wall-ID/phase-ID/vof) | or in UDF | RP_Get_Real("/bc/wall-ID/phase-ID/vof"); |


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