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

Udf, define_profile, vof

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 24, 2010, 14:05
Question Udf, define_profile, vof
  #1
New Member
 
Grzegorz Kondora
Join Date: Oct 2010
Posts: 13
Rep Power: 15
kondora is on a distinguished road
Hello all,

Let's assume that we have a Eulerian multiphase simulation. Number of phases is n_phases. For the velocity inlet for each phase we would like to specify volume fraction, which is calculated somewhere within UDF and written to global variable. To do that, we must use DEFINE_PROFILE macro, whose arguments are: DEFINE_PROFILE(vof_profile,t,i), so: name, thread and position/index of variable being set. Let say that we would like to create only one universal function DEFINE_PROFILE, which will be hooked in B.C. panel for each phase other than 1. Here's part of my code:

Code:
some code

DEFINE_PROFILE(vof_profile,t,i)
{

    #if !RP_HOST /* SERIAL or NODE */

        int ii;

        face_t f;

        Thread *mixture_thread = THREAD_SUPER_THREAD(t);

        Thread **pt;
        pt = THREAD_SUB_THREADS(mixture_thread);

        for(ii = 1; ii < n_phases+1; ii++)
        {
            if(pt[ii] == t)
            {
                Message("\Found it!!!, DOMAIN_PHASE_INDEX is, ii = %d\n", ii);
            }
        }

        begin_f_loop(f,t)
        {
            F_PROFILE(f,t,i) = alpha[ii-1]; /* global array whose elements are calculated in other function
                                                          and having indices according to: ii = PHASE_DOMAIN_INDEX - 1 */
        }
        end_f_loop(f,t)

    #endif /* !RP_HOST */
}
Can it be easier? I mean - is there any super-hidden macro wich return pointer to the Domain or PHASE_DOMAIN_INDEX, for example:

Code:
DEFINE_PROFILE(vof_profile,t,i)
{
   Domain *domain = GET_DOMIAN_POINTER_HAVING_GIVEN_PHASE_THREAD(t);
    ...
}
Do you know any other, easier way than I posted? It should be available in FLUENT, esspecialy because people are often using DEFINE_PROFILE macro. Thanks in advance!!!

Last edited by kondora; October 24, 2010 at 14:14. Reason: Changed title
kondora is offline   Reply With Quote

Reply

Tags
define_profile, udf, vof


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
HELP! adding a mass source to VOF eqn. by UDF??? ROOZBEH FLUENT 5 December 3, 2016 17:53
UDF Defining VOF Free Surface at Outlet Alex Fluent UDF and Scheme Programming 13 August 8, 2012 16:50
HELP! UDF sinusoidal wave, VOF model, porous face! A8anato_psofimi FLUENT 2 November 10, 2009 14:42
UDF to read data from a file for VOF model Pablo FLUENT 0 October 23, 2008 07:02
writing UDF for modelig mass transfer for VOF ardalan soleymani FLUENT 0 July 11, 2007 01:09


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