|
[Sponsors] |
July 19, 2007, 04:23 |
UDF for porosity
|
#1 |
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 |
|
July 19, 2007, 07:21 |
Re: UDF for porosity
|
#2 |
Guest
Posts: n/a
|
Sorry, I forgot to say that I use FLUENT 6.1.22. Thanks again
|
|
July 19, 2007, 16:22 |
Re: UDF for porosity
|
#3 |
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] |
|
July 23, 2007, 10:23 |
Re: UDF for porosity
|
#4 |
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 |
|
|
|
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 |