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

udf: volume fraction gradient in eulerian model

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2004, 19:49
Default udf: volume fraction gradient in eulerian model
  #1
jwwang
Guest
 
Posts: n/a
hi,everyone, I try to use udf to express solid phase pressure,I compile the UDF in FLUENT with no problem, but when I start calculating, FLUENT gives me this: Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

here is my little UDF: #include "udf.h"

DEFINE_SOURCE(y_solid_pressure, cell, thread, dS, eqn) {

real void_s, con, v_s, source=0.0;

void_s = C_VOF(cell, thread);

con = -8.686*(1.0-void_s)+6.385;

if (Data_Valid_P())

v_s = C_VOF_G(cell, thread)[1];//problem is in this sentence

source = pow(10,con)*v_s;

dS[eqn] = 0.0;

return source; }
Geng Fu, 6863523, yp5547 and 1 others like this.
  Reply With Quote

Old   December 7, 2004, 18:42
Default Re: udf: volume fraction gradient in eulerian mode
  #2
ap
Guest
 
Posts: n/a
You can find your answer by looking for similar problem with the temperature gradient in the forum.

You need to add some check to your UDF, because gradients are not defined at the first iteration. Data_Valid_P() is not enough for that.

Regards, ap
  Reply With Quote

Old   December 7, 2004, 19:26
Default Re: udf: volume fraction gradient in eulerian mode
  #3
jwwang
Guest
 
Posts: n/a
thanks a lot! but when I substitute velocity gadient for the volume fration gradient,it's ok! what checks I need?
  Reply With Quote

Old   December 7, 2004, 20:39
Default Re: udf: volume fraction gradient in eulerian mode
  #4
jwwang
Guest
 
Posts: n/a
Hi ap,I see your talk about temperature gradient with Satish,there is a sentence if(NULL != THREAD_STORAGE(t0,SV_T_G)) what is the THREAD_STORAGE(t0,SV_T_G) meaning? i cannot find the Marcos in the fluent UDF manual! in my case,how can i use it? thanks!
  Reply With Quote

Old   December 8, 2004, 08:43
Default Re: udf: volume fraction gradient in eulerian mode
  #5
ap
Guest
 
Posts: n/a
It's a macro which checks if the gradient of the T variable has been stored.

To use it, just replace the thread t0 with the phase thread you need to use, and replace SV_T_G with SV_VOF_G.

You can find the complete list of the variables names in the headers file:

mem.h sg_mem.h sg_mphase.h

Regards,

ap
jiang1016 likes this.
  Reply With Quote

Old   December 8, 2004, 09:03
Default Re: udf: volume fraction gradient in eulerian mode
  #6
jwwang
Guest
 
Posts: n/a
thanks. i change my UDF according your suggestion, it is work,but i do not known why my original UDF didn't work,in both case, i set the solve/set/expert keep temporary solver memory from being freed? yes.could you tell me why? now my udf is: #include "udf.h"

DEFINE_SOURCE(y_solid_pressure, cell, thread, dS, eqn) {

real void_s, con, v_s, source=0.0;

void_s = C_VOF(cell, thread);

con = -8.686*(1.0-void_s)+6.385;

if (NULL != THREAD_STORAGE(thread,SV_VOF_G))

{

v_s = C_VOF_G(cell, thread)[1];

//Message("it is ok! %f \n", v_s);

}

source = pow(10,con)*v_s;

dS[eqn] = 0.0;

return source; }
Silence017 likes this.
  Reply With Quote

Old   December 8, 2004, 10:05
Default Re: udf: volume fraction gradient in eulerian mode
  #7
ap
Guest
 
Posts: n/a
The line

v_s = C_VOF_G(cell, thread)[1];

tries to read the gradient of the volume fraction of a phase.

At the beginning of a calculation, or when you load you case file after closing FLUENT, gradients are not defined. FLUENT needs at least one iteration to compute gradients. If you try to read them before this happens, you get an access violation error. If you keep the solver memory from beeing free, it works only if data are stil in memory, which is not your case.

THREAD_STORAGE(thread,SV_VOF_G) just checks if the memory location is not void. If it is void, it return NULL. This allows you to check if you can read the variable without errors or not.

Regards, ap
jiang1016 likes this.
  Reply With Quote

Old   December 8, 2004, 19:18
Default Re: udf: volume fraction gradient in eulerian mode
  #8
jwwang
Guest
 
Posts: n/a
thank you very much! I have another problems about post processing,I use the Eulerian model to simulate the fluidized bed , now, I want to save the data at the different height per time step, for example, I want to save the data at z=1m and 2m, how can i do it?
  Reply With Quote

Old   December 9, 2004, 16:11
Default Re: udf: volume fraction gradient in eulerian mode
  #9
ap
Guest
 
Posts: n/a
It depends on what you need to save. You can try to use fluent monitors (Solve -> Monitors) on a point, a line or a surface.

Regards,

ap
  Reply With Quote

Old   December 9, 2004, 16:13
Default Re: udf: volume fraction gradient in eulerian mode
  #10
ap
Guest
 
Posts: n/a
I'm workinng on fludized bed too. What kind of approach are you using for the solid granular phase?

Regards, ap
  Reply With Quote

Old   December 9, 2004, 19:07
Default Re: udf: volume fraction gradient in eulerian mode
  #11
jwwang
Guest
 
Posts: n/a
thanks, so we can talk about it , could you tell me your Email, my email is jwwang@home.ipe.ac.cn. I think the property of solid granular phase(such as granular viscosity and granular pressure)is not important in the simulation, so i treat it by the empirical approch,I think if you want to treat it by the kinetic theory of granular flow,the approach of Gidaspow is insufficient, because in fluidized bed, the characteristics is the heterogeneous structure(cluster or bubble), while, the Gidaspow's theory is based on the homogeneous assumption(Maxwellian distribution)or linear correction to the Maxwellian distribution. if you want to use the KTGF, i recommend the theory in the Physical Review Letter 1998, 81(18)3848.
  Reply With Quote

Old   December 9, 2004, 19:16
Default Re: udf: volume fraction gradient in eulerian mode
  #12
jwwang
Guest
 
Posts: n/a
I am new to FLUENT, i need the averaged solid phase volume fraction,so i want to save the information about solid phase fraction per time step in some section of the bed and write the data to file. regards, jwwang
  Reply With Quote

Old   December 9, 2004, 19:19
Default Re: udf: volume fraction gradient in eulerian mode
  #13
jwwang
Guest
 
Posts: n/a
maybe, i mistake what you said, i use the two-fluid model!
  Reply With Quote

Old   December 10, 2004, 09:27
Default Re: udf: volume fraction gradient in eulerian mode
  #14
jwwang
Guest
 
Posts: n/a
Hi, ap! I have another problem! help me! I calculate the interphase drag coefficient by UDF, at the processing, FLUENT suddenly divergence (at the previous iteration step, the residue is less than 0.01),and i output the interphase drag coefficient,and check it,it is ok! but i am sure the divergence is really caused by the UDF, because when i didn't use UDF, there is no problem! when the fluent is divergence,the velocity or pressure is very large,and give: Error: divergence detected in AMG solver: pressure correction Error Object: ()
  Reply With Quote

Old   December 10, 2004, 16:59
Default Re: udf: volume fraction gradient in eulerian mode
  #15
ap
Guest
 
Posts: n/a
In unsteady calculation, you can get some averaged variables activating the "Data sampling for time statistics" option in the Iterate panel.

You'll find the avreaged volume fraction in the "Unsteady statistics" menu, in all postprocessing windows.

Regards, ap
  Reply With Quote

Old   December 10, 2004, 17:02
Default Re: udf: volume fraction gradient in eulerian mode
  #16
ap
Guest
 
Posts: n/a
Can you post your drag UDF?

I know this kind of problems are frequent in FLUENT while using UDF. I'm still working on the implementation of a modified form of the kinetic theory for granular flows in FLUENT, and I have serious problems with convergence related to UDF.

Hi,

ap :-D
  Reply With Quote

Old   December 10, 2004, 17:11
Default Re: udf: volume fraction gradient in eulerian mode
  #17
ap
Guest
 
Posts: n/a
My e-mail is ap.news@virgilio.it

I agree with you. The kinetic theory approach developed by Gidaspow is insufficient, even if it is still considered a valid approach to model fluidized beds.

I'm using the kinetic theory too, but my research focuses on the interaction between the turbulence phenomena of the gas phase in risers and the solid particles.

I didn't read the Physical Review Letter 1998, 81(18)3848, but I'm very interested. Where can I find more information about that kinetic theory?

Hi, ap
  Reply With Quote

Old   December 10, 2004, 17:13
Default Re: udf: volume fraction gradient in eulerian mode
  #18
ap
Guest
 
Posts: n/a
No, you understood my question perfectly. I wanted to know if you're using the kinetic theory or not.

Regards,

ap
  Reply With Quote

Old   December 10, 2004, 19:53
Default Re: udf: volume fraction gradient in eulerian mode
  #19
jwwang
Guest
 
Posts: n/a
you can find it in the Physical Review Letter ,(mianly in) physical review E,journal of fluid mechanics,and physics of fluid. there also has a good book , Nikolai Brilliantov, kinetic theory of granular gases, oxford university press,2004.
  Reply With Quote

Old   December 10, 2004, 20:02
Default Re: udf: volume fraction gradient in eulerian mode
  #20
jwwang
Guest
 
Posts: n/a
thanks! I have solve the problem, it is because there is zero number in the denominator.
  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
The gradient of void fraction in UDF summer FLUENT 2 May 20, 2011 04:34
UDF for Species Mass Fraction Gradient *IN SPECIFIC ZONE * -- e.g. along axis of sym. ksiegs2 Fluent UDF and Scheme Programming 0 February 27, 2011 13:55
Help on accessing volume fraction in mixture model achuneka FLUENT 8 September 4, 2009 07:22
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 13:10.