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

UDF for porosity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2007, 04:23
Default UDF for porosity
  #1
Giacomo
Guest
 
Posts: n/a
Hi all. I am new with UDF. I have to simulate the changing in time of the porosity and permeability of a porous media. I wrote a UDF for porosity to be constant (=0.30) and it works:

#include "udf.h"

DEFINE_PROFILE(porosity, t, i) { real x[ND_ND]; cell_t c; real r;

begin_c_loop(c,t)

{

C_CENTROID(x,c,t);

r=x[1];

F_PROFILE(c,t,i)=0.30; }

end_c_loop(c,t) }

The probelm is that the evolution in time of porosity should be something like

porosity(t_[i]) = f(porosity(t_[i-1]))

How can I store the porosity value of the previous time step to use it in the next time step? And where can I store it? I tried to create an array to store it, but it didn't work...

I hope I made myself clear... Thanks in advance and regards

Giacomo
  Reply With Quote

Old   July 19, 2007, 07:21
Default Re: UDF for porosity
  #2
Giacomo
Guest
 
Posts: n/a
Sorry, I forgot to say that I use FLUENT 6.1.22. Thanks again
  Reply With Quote

Old   July 19, 2007, 16:22
Default Re: UDF for porosity
  #3
sujith
Guest
 
Posts: n/a
u can use the User Defined memory in Fluent through Define->User defined->memory. Enable one user defined memory. Initialize the UDM with initial porosity values. In the define profile UDF do the following operations loop over all cells 1. calculate new porosity using the previous value

porosity[t] = f(UDM) 2. Assign the UDM new value of porosity UDM = porosity[t]

  Reply With Quote

Old   July 23, 2007, 10:23
Default Re: UDF for porosity
  #4
Giacomo
Guest
 
Posts: n/a
Thanks, sujith. I have allocated two UDM's and now it seems to work. The UDF is the following:

DEFINE_PROFILE(porosity, t, i) { cell_t c; int tm = N_TIME;

begin_c_loop(c,t)

{

if (tm==1)

{

F_PROFILE(c,t,i)=0.30;

C_UDMI(c,t,1)=F_PROFILE(c,t,i);

}

else

{

F_PROFILE(c,t,i)=0.30+0.1*C_UDMI(c,t,1);

C_UDMI(c,t,1)=F_PROFILE(c,t,i);

} } end_c_loop(c,t) }

The problem is that it works only for the 1st and 2nd time step, then it does not update the porosity any more... Why?

Thanks very much

Giacomo
  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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 08:37.