CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Accessing Solver data for UDF (

CFDtoy April 12, 2006 13:24

Accessing Solver data for UDF

I am using an two phase eulerian model. Liquid in air. I want to obtain the cell pressure within the liquid region.

I operate a source function in the liquid domain. If I use

pvalue = C_P(c,t),

do I get mixture static pressure,If not what ?

Again, If I use C_K(c,t) for turbulent kinetic energy, I am not sure what am I actually accessing?

I am not clear how to identify my zone and how to obtain cell values for liquid and gas separately.

Please help


Tim Li April 12, 2006 14:41

Re: Accessing Solver data for UDF
I think you should make sure the thread is in mixture level. Then you can get the mixture pressure with C_P. To access phase, you can use thread_sub_thread to obtain the thread for each phase. I am working on the UDF too. Here is my code to access the phase. Hope it well help.

int ID = 6; /* Zone ID for wall zone from Boundary Conditions panel Obtain the zone ID from boundary condition panel */

t_m = Lookup_Thread(d,ID); /* mixture level thread */

t_g = THREAD_SUB_THREAD(t_m, 0); /* gas phase thread */

t_s = THREAD_SUB_THREAD(t_m, 1); /* solid phase thread */


Jun April 12, 2006 22:43

Re: Accessing Solver data for UDF

Could you use export in the file to find all data including you want?

CFDtoy April 12, 2006 23:12

Re: Accessing Solver data for UDF
Hi Li: Thanks for your reply. I would like to use add a momentum source only in the liquid portion of the liquid-gas mixture.

Now this source is volumetric and is not applied across the boundary.

source definition reads DEFINE_SOURCE(name, c ,t , dS, eqn) etc

I would like to add source based on the liquid static pressure. Now this source is computed in all the cells..well, i need to find out C_P only for cells with liquid. as you put it ..i guess using the zone ID would be a good idea. But again, my basic question is ..if I dont do any thread evaluation..and perform just C_P(c,t)..what do i get ?



Tim April 13, 2006 16:12

Re: Accessing Solver data for UDF
Sorry, I don't know how to exprot. Actually, I am newbie in UDF.


Tim April 13, 2006 16:38

Re: Accessing Solver data for UDF
I think it depends on what the thread 't' is passed by the Fluent solver. If you are not sure, you can get the domain that owns that thread with THREAD_DOMAIN(t), then compare the domain id with the ID number in Define/Phase panel. Or just output some variables of thread t to judge. Do I answer your question? Hope I do.


Jun April 13, 2006 16:45

Re: Accessing Solver data for UDF

In the menu "File" =>"Export".

Tim April 13, 2006 16:52

Re: Accessing Solver data for UDF
I usually export my data to Tecplot to plot or analyse.

All times are GMT -4. The time now is 09:23.