|
[Sponsors] |
how to plot new function or variable in fluent? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 10, 2014, 12:35 |
|
#21 | |
New Member
Jups
Join Date: Jul 2014
Posts: 12
Rep Power: 12 |
Quote:
thankyou Hersey,, later i will tell u how the progress.. |
||
July 11, 2014, 02:51 |
|
#22 |
New Member
Jups
Join Date: Jul 2014
Posts: 12
Rep Power: 12 |
SUN, HERSEY..
i have already try it.. i make q in DEFINE_ADJUST and i use time step 0.001.. it's work.. but the result is not what i want Code:
#include "udf.h" #define P 3000000 #define T 300 #define e 0.65 #define Rc 500 #define k 0.00013996 #define qe 0.0698337 double q, time, turq; DEFINE_INIT(q_init,d) { cell_t c; Thread *t; thread_loop_c(t,d) { begin_c_loop_all(c,t) { C_T(c,t)=300; C_P(c,t)=100000; q = 0; } end_c_loop_all(c,t) } } DEFINE_ADJUST(adsorpsi,d) { cell_t c; Thread *t; thread_loop_c(t,d) { begin_c_loop_all(c,t) { time = CURRENT_TIME; turq = k*(qe-q); q = q+turq*time; C_UDMI(c,t,0) = q; C_UDMI(c,t,1) = turq; } end_c_loop_all(c,t) } } DEFINE_SOURCE(mass_source, c, t) { real source; source = -((1-e)/e)*C_UDMI(c,t,1); return source; } DEFINE_SOURCE(y_velocity, c, t) { real source; source = -C_UDMI(c,t,1)*C_V(c,t); return source; } DEFINE_SOURCE(radial_velocity, c, t) { real source; source = -C_UDMI(c,t,1)*C_U(c,t); return source; } DEFINE_SOURCE(energy_source, c, t) { real ha, source; ha = 720.9272; source = -C_UDMI(c,t,1)*Rc*H; return source; } my result is "iterasi udm adjust" pic.. and the result i want is "sahoo" pic.. my case use porosity.. i imagine the result should be is like this.. when the methane flow through inlet,, the pressure and temperature at above is more highly than below... like we say, the vessel is 100cm high.. the pressure and temp at 0cm is different than 100cm.. but my result is same.. have any idea? |
|
October 14, 2014, 02:30 |
hi
|
#23 |
Member
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13 |
hi,
i am facing the similar problem. my UDF of source term is showing zero output. here is my Udf , if anybody know the problem please help me . DEFINE_SOURCE(xmom,c,t,dS,eqn) { real x[ND_ND]; real source,ve; C_CENTROID(x,c,t); ve=sqrt((pow(C_U(c,t),2.0)+pow(C_V(c,t),2.0)+pow(C _W(c,t),2.0))); source =-1.225*0.2*0.55* C_U(c,t)*ve; C_UDMI(c,t,0)=source; return source; } thanks |
|
October 14, 2014, 02:36 |
hi
|
#24 |
Member
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13 |
hi
i am facing the similar problem. my UDF of source term is showing zero output. here is my Udf , if anybody know the problem please help me . DEFINE_SOURCE(xmom,c,t,dS,eqn) { real x[ND_ND]; real source,ve; C_CENTROID(x,c,t); ve=sqrt((pow(C_U(c,t),2.0)+pow(C_V(c,t),2.0)+pow(C _W(c,t),2.0))); source =-1.225*0.2*0.55* C_U(c,t)*ve; C_UDMI(c,t,0)=source; return source; } thanks |
|
October 14, 2014, 08:15 |
|
#25 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
Make sure "ve" and "C_U(c,t)" are non-zero by printing them out. Also, add dS[eqn] (derivative of source term) before returning the source.
Cheers! |
|
October 15, 2014, 00:12 |
hi
|
#26 |
Member
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13 |
thanks for hint. SUN ,
now UDF working |
|
Tags |
new function, plot |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
heat transfer with RANS wall function, over a flat plate (validation with fluent) | bruce | OpenFOAM Running, Solving & CFD | 6 | January 20, 2017 07:22 |
LiencubiclowRemodel | nzy102 | OpenFOAM Bugs | 14 | January 10, 2012 09:53 |
Variable Density Function | ryzd | FLUENT | 1 | August 25, 2011 15:16 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |