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/)
-   -   properties change with volume fraction (https://www.cfd-online.com/Forums/fluent-udf/183695-properties-change-volume-fraction.html)

a_Sarlak February 10, 2017 18:36

properties change with volume fraction
 
hi dear friends
i work on nanofluid using mixture model of fluent.
i want to change viscosity using volume fraction so i need udf.
can any body help me, i really need it.
thanks

pakk February 13, 2017 04:30

Look in the Fluent manual for something similar, think about what should be changed, and come here for help to change it.

a_Sarlak February 13, 2017 07:00

Quote:

Originally Posted by pakk (Post 636901)
Look in the Fluent manual for something similar, think about what should be changed, and come here for help to change it.

dear pakk thanks for your respond.
my cod is:
#include "udf.h"
DEFINE_ADJUST(viscouse_function, d)
{
real vf;
real visc;
cell_t cell;
Thread **pt;
Thread *cell_threads;
Domain *mixture_domain;
mp_thread_loop_c(cell_threads, mixture_domain, pt[1])
{
begin_c_loop(cell,pt[1])
{
vf=C_VOF(cell,pt[1]);
visc = vf; /*it just example*/
}
end_c_loop(cell,pt[1])
}
}



but it doesnt work.
i want to change viscosity with volume fraction
did i do a mistake?
thanks

pakk February 13, 2017 07:28

Quote:

but it doesnt work.
Can you be more specific? What makes you say that it doesn't work? Does it crash? Does it give wrong results?

a_Sarlak February 13, 2017 10:44

Quote:

Originally Posted by pakk (Post 636924)
Can you be more specific? What makes you say that it doesn't work? Does it crash? Does it give wrong results?

there is no error when interpret in fluent but when i initialize it says:


Node 0: Process 11020: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 1: Process 10652: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 2: Process 9056: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 3: Process 4044: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 4: Process 10068: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 5: Process 5768: Received signal SIGSEGV.

================================================== ============================

pakk February 13, 2017 11:01

If it is during initializating, then your problem could be a physics problem, not a programming problem.
You are saying in the UDF that viscosity is proportional to the volume fraction. When you initialize, the volume fraction is probably initialized at zero. So you are asking Fluent to initialize a fluid with zero viscosity (a superfluid). Fluent is not made to do that.

Try an equation that will make viscosity not equal to zero, for example:
Code:

visc = 0.000008+vf*0.000001;

a_Sarlak February 13, 2017 11:31

Quote:

Originally Posted by pakk (Post 636959)
If it is during initializating, then your problem could be a physics problem, not a programming problem.
You are saying in the UDF that viscosity is proportional to the volume fraction. When you initialize, the volume fraction is probably initialized at zero. So you are asking Fluent to initialize a fluid with zero viscosity (a superfluid). Fluent is not made to do that.

Try an equation that will make viscosity not equal to zero, for example:
Code:

visc = 0.000008+vf*0.000001;

thanks again
i just do it but the error still remain.


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