CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF!where find the variables for phase velocities (https://www.cfd-online.com/Forums/fluent/28761-udf-where-find-variables-phase-velocities.html)

eric July 29, 2001 20:58

UDF!where find the variables for phase velocities
 
For the single flow, the velocity variables in the three directions could express as C_U(c,thread), C_V(c,thread) and C_W(c,thread). However, in the two-phases flows, where find the variables for the phase velocities?

I guess they could be expressed as C_U(c,thread,i), but I could not confirm it.

Any help would be appreciated!

eric

Tobias Hirsch August 2, 2001 04:20

Re: UDF!where find the variables for phase veloci
 
I am working with the Algebraic Slip model with two phases. The define statements for the access to the variables can be found in the src -directory of your Fluent installation. There you should look at the file sg_mphase.h. Normally you should include this file via #include "sg_mgphase.h" into your source code. Since this did not work I just copied the needed define statements to the beginning of my udf-file. Some examples:

#define C_RHO_PHASE(c,t,phase) C_STORAGE_R(c,t,SV_PHASE_RHO+phase)

#define C_SLIP_U(c,t) C_STORAGE_R(c,t,SV_SLIP_U)

#define C_SLIP_V(c,t) C_STORAGE_R(c,t,SV_SLIP_V)

#define C_VOF(c,t,phase) C_STORAGE_R(c,t,SV_VOF_0+phase)

This gives you access on rho, slip velcoities and volume fraction. I did not use the pure velocities but You will find them in this file or perhaps in the file mem.h

eric August 2, 2001 04:46

Re: UDF!where find the variables for phase veloci
 
Thanks greatly.


eric August 3, 2001 06:16

Re: UDF!where find the variables for phase veloci
 
I have not find the viables for the pure velocities of the two phases yet.

where...

Tobias Hirsch August 3, 2001 06:21

Re: UDF!where find the variables for phase veloci
 
With which multiphase model are you working? Volume of Fluid, Cavitation or algebraic slip?

eric August 3, 2001 07:45

Re: UDF!where find the variables for phase veloci
 
I use the algebraic slip model to simulate the water-sediment two-phase flow.

Thanks greatly!


Tobias Hirsch August 3, 2001 08:11

Re: UDF!where find the variables for phase veloci
 
Ok. In the algebraic slip model Fluent works with the mixture values, that means mixture velocity, mixture density. It does not store the values of the velocities of the different phases. To calculate these velocities you can access to

1. mixture velocity C_U(c,t), C_V()....

2. slip velocity C_SLIP_U(c,t), C_SLIP_V(c,t),..

The velocity of the phases can be obtained from

u_ph1 = u_m + u_m-ph1

where u_ph1 is the velocity of phase1, u_m is the mixture velocity and u_m-ph1 is the diffusion velocity. The diffusion velocity can be calculated from the slip velocity u_slip via

u_m-ph1 = (1-c_ph1) * u_slip

with the mass fraction c_ph1 = alpha_ph1 * rho_ph1 / rho_m

The last two equations are valid if you use only two phases. For more phases see the Fluent manual.

So when you need the velocities of the separate phases you have to calculate them in this way.

To have access to all variables you should add thiese lines to the head of your udf-file:

#define C_RHO_PHASE(c,t,phase) C_STORAGE_R(c,t,SV_PHASE_RHO+phase)

#define C_SLIP_U(c,t) C_STORAGE_R(c,t,SV_SLIP_U)

#define C_SLIP_V(c,t) C_STORAGE_R(c,t,SV_SLIP_V)

#define C_VOF(c,t,phase) C_STORAGE_R(c,t,SV_VOF_0+phase)

Another tip: When you calculate some values via udf and you load your case and data file, some values are not updated automatically or updated using the default Fluent law but not your own udf. You have to perform one iteration with the udf to display the correct values.

Have much fun with the algebraic slip model. I also have problems with this...


eric August 4, 2001 09:25

Re: UDF!where find the variables for phase veloci
 
thanks greatly.

I believe I would get benefit from your ideas..

Regards,

abhilasht April 15, 2020 13:30

Please share UDF file
 
Quote:

Originally Posted by Tobias Hirsch
;97946
Ok. In the algebraic slip model Fluent works with the mixture values, that means mixture velocity, mixture density. It does not store the values of the velocities of the different phases. To calculate these velocities you can access to

1. mixture velocity C_U(c,t), C_V()....

2. slip velocity C_SLIP_U(c,t), C_SLIP_V(c,t),..

The velocity of the phases can be obtained from

u_ph1 = u_m + u_m-ph1

where u_ph1 is the velocity of phase1, u_m is the mixture velocity and u_m-ph1 is the diffusion velocity. The diffusion velocity can be calculated from the slip velocity u_slip via

u_m-ph1 = (1-c_ph1) * u_slip

with the mass fraction c_ph1 = alpha_ph1 * rho_ph1 / rho_m

The last two equations are valid if you use only two phases. For more phases see the Fluent manual.

So when you need the velocities of the separate phases you have to calculate them in this way.

To have access to all variables you should add thiese lines to the head of your udf-file:

#define C_RHO_PHASE(c,t,phase) C_STORAGE_R(c,t,SV_PHASE_RHO+phase)

#define C_SLIP_U(c,t) C_STORAGE_R(c,t,SV_SLIP_U)

#define C_SLIP_V(c,t) C_STORAGE_R(c,t,SV_SLIP_V)

#define C_VOF(c,t,phase) C_STORAGE_R(c,t,SV_VOF_0+phase)

Another tip: When you calculate some values via udf and you load your case and data file, some values are not updated automatically or updated using the default Fluent law but not your own udf. You have to perform one iteration with the udf to display the correct values.

Have much fun with the algebraic slip model. I also have problems with this...


Can you please share UDF file for this.


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