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

How to access C_VOF_G (volume fraction gradient)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 3, 2014, 15:41
Default How to access C_VOF_G (volume fraction gradient)
  #1
New Member
 
Join Date: Nov 2014
Posts: 7
Rep Power: 12
joha is on a distinguished road
Hi,

I'm trying to get the following UDF to work:
Code:
DEFINE_SOURCE(z_cap_force, cell, thread, dS, eqn) {

    real source=0.0;
    //skip source on first iteration (no gradient available)
    if (NULL != THREAD_STORAGE(thread,SV_VOF_G)){
        source = 150*C_VOF_G(cell, thread)[2];

        printf("Fk: %f\n", Fk);
        printf("C_VOF_G[0]: %f\n", C_VOF_G(cell, thread)[0]);
        printf("C_VOF_G[1]: %f\n", C_VOF_G(cell, thread)[1]);
        printf("C_VOF_G[2]: %f\n", C_VOF_G(cell, thread)[2]);
    }

    dS[eqn] = 0.0;
    return source;
}
The line "NULL != THREAD_STORAGE(thread,SV_VOF_G)" is "stolen" from one of the forum threads here If I got it right this macro checks if the volume fraction gradients have been stored. I also read that I have to set "Keep temporary solver memory from being freed?" to yes what I did.

Nevertheless "(NULL != THREAD_STORAGE(thread,SV_VOF_G))" is never true.

Anyone got an idea what went wrong?
joha is offline   Reply With Quote

Reply


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 11:51
volume fraction = nan Virtual-iCFD OpenFOAM Running, Solving & CFD 8 June 12, 2015 19:15
InterFoam channel Flow runnig very slowly Wokl OpenFOAM Running, Solving & CFD 4 January 9, 2014 03:52
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42


All times are GMT -4. The time now is 16:26.