CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Ploting Drag Force Vectors

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2014, 16:39
Default Ploting Drag Force Vectors
  #1
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 17
camilo_costa is on a distinguished road
Dears Members,

Anyone has some experience for write an udf to plot the vectors of drag force in a multiphase flow modeled by Euler-Euler approach with VOF model enable?

More specified, I want to see the vectors of the drag force near the interface liquid-gas, responsible for create slug flow pattern in two phase flow.

Thanks!!
camilo_costa is offline   Reply With Quote

Old   September 26, 2014, 14:36
Default Find for variable
  #2
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 17
camilo_costa is on a distinguished road
Well, I find this variable that should be responsible to evaluate the coefficient of the drag force on the XX direction.

C_DRAG_COEFF_ANISO_XX_IJ(c,t,i,j)

But, I dont know what for the index I J are used. Anyone could help me? Thx.

Best Regards
camilo_costa is offline   Reply With Quote

Old   September 29, 2014, 15:17
Default
  #3
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 17
camilo_costa is on a distinguished road
I write this udf, but the problem now is the segmentation violation!! What is wrong? This udf need be written for multiphase problems?


#include "udf.h"
/* Define which user-defined scalars to use. */
enum
{
drag_xx,
N_REQUIRED_UDS
};
DEFINE_ADJUST(adjust_fcn, domain)
{
Thread *t;
cell_t c;
int i = 2;
int j = 3;
/* Make sure there are enough user-defined scalars. */
if (n_uds < N_REQUIRED_UDS)
Internal_Error("not enough user-defined scalars allocated");
/* Fill first UDS with temperature raised to fourth power. */
thread_loop_c (t,domain)
{
if (NULL != THREAD_STORAGE(t,SV_UDS_I(drag_xx)))
{
begin_c_loop (c,t)
{
real drag_xx = C_DRAG_COEFF_ANISO_XX_IJ(c,t,i,j);
C_UDSI(c,t,0) = drag_xx;
}
end_c_loop (c,t)
}
}
}
camilo_costa is offline   Reply With Quote

Old   September 29, 2014, 16:26
Default
  #4
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 17
camilo_costa is on a distinguished road
I modified the udf just for test the calculation of the scalar variable. And works fine. But now I want to know how the variable is responsible for calculate the drag coefficient of a anisotropic drag model? Anyone who knows?

# include "udf.h"
DEFINE_ADJUST(adjust_gradient, mix_dom)
{
Thread **phase_t;
Thread *mix_t;
cell_t c;
face_t f;
int phase_index = 1;
/* Fill UDS with the variable. */
mp_thread_loop_c (mix_t,mix_dom,phase_t)
{
begin_c_loop (c,mix_t)
{
C_UDSI(c,mix_t,0) = C_VOF(c,phase_t[phase_index]);
}
end_c_loop (c,mix_t)
}
mp_thread_loop_f (mix_t,mix_dom,phase_t)
{
if (THREAD_STORAGE(mix_t,SV_UDS_I(0))!=NULL)
begin_f_loop (f,mix_t)
{
F_UDSI(f,mix_t,0) = F_VOF(f,phase_t[phase_index]);
}
end_f_loop (f,mix_t)
}
}
DEFINE_ON_DEMAND(store_gradient)
{
int phase_index = 1;
Thread **phase_t;
Thread *mix_t;
Domain *mix_dom;
cell_t c;
mix_dom=Get_Domain(1);
/* Fill the UDM with magnitude of gradient. */
mp_thread_loop_c (mix_t,mix_dom,phase_t)
{
begin_c_loop (c,mix_t)
{
C_UDMI(c,mix_t,0) = NV_MAG(C_UDSI_G(c,mix_t,0));
}
end_c_loop (c,mix_t)
}
}

Last edited by camilo_costa; October 2, 2014 at 10:39.
camilo_costa is offline   Reply With Quote

Reply

Tags
drag force, multiphase, plot

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActuatorDiskExplicitForce in OF2.1. Help be_inspired OpenFOAM Programming & Development 10 September 14, 2018 12:12
FLUENT: how to record drag force at every time step? qiulan FLUENT 4 March 20, 2017 22:22
Force can not converge colopolo CFX 13 October 4, 2011 23:03
Force vectors for drag during sweeping motion aamer FLUENT 0 April 18, 2011 09:17
formula used for drag force? kamma Main CFD Forum 0 April 2, 2010 11:21


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