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

How to access C_VOF_G (volume fraction gradient)

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

Reply
 
LinkBack Thread Tools 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: 2
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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
volume fraction = nan Virtual-iCFD OpenFOAM Running, Solving & CFD 8 June 12, 2015 18:15
Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Native Meshers: blockMesh 43 February 18, 2014 03:42
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
InterFoam channel Flow runnig very slowly Wokl OpenFOAM Running, Solving & CFD 4 January 9, 2014 03:52
non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42


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