CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   RP_variable for porous information (https://www.cfd-online.com/Forums/fluent-udf/129386-rp_variable-porous-information.html)

crevoise February 4, 2014 06:40

RP_variable for porous information
 
Hello

I am trying to access information about my porous media
I was wondering how to get the 'porosity' value in my udf?

I have tried stuff like:

por = RP_Get_Real("porosity");
por = RP_Get_Real("fluid-porosity");
etc...

but it does not seems such variable exits as a Fluent variable.
Does anyone knows how to access the list of Fluent variables?

I am trying to access such data in order to deal with a porous media only.
In an interpreted UDF, I am writing such loop (for example for the intialization) (let say I have 2 fluid threads and 1 solid thread, one fluid thread being porous):

Code:

DEFINE_INIT(init, d)

Thread *t;
cell_t c;

thread_loop_c(t,d)
    {
    if (NNULP(T_STORAGE_R(t,SV_P)  // to get the fluid threads
       
        // here I wish to get only the porous one, so that explain my above
        question:
        if porosity = 1, etc....
 
    }

Alternatively, in a compiled UDF, I have wrote the following:

Code:

DEFINE_INIT(init, d)

real cporous;
Thread *t;
cell_t c;

thread_loop_c(t,d)
    {
    if (FLUID_THREAD_P(t) && THREAD_VAR(t).fluid.porous)
        {
          begin_c_loop(c,t)
              {
              cporous = cporous + 1;
              }
          end_c_loop(c,t)
        }

    }

but it seems this return the total amount of the fluid cells, both the fluid and the porous.
I do not really understand why the THREAD_Var(t).fuid.porous does not work in the compiled udf.
After several unfruitful tests, I decided to try the way by the interpreted udf (and then the problem on getting the porosity value came, as the THREAD_VAR can be used only in compiled udf).

Thank you for any hint on that problem

estevaotolentino July 22, 2017 12:42

Hi Mr. Crevoise,

I'm having a similar problem. Did you solve the problem of your compiled UDF code ? Were you able to correctly use the terms "FLUID_THREAD_P(t) && THREAD_VAR(t).fluid.porous" ?

Thank you.


All times are GMT -4. The time now is 21:55.