|
[Sponsors] |
July 16, 2008, 17:06 |
Help! Function not LOOPing
|
#1 |
Guest
Posts: n/a
|
Hi, I'm trying to define a loop to generate a recurring capacitor charge-discharge function to be interpreted in FLUENT as an input profile. For some reason, it doesn't seem to be looping at all. I get the first curve, then it stays constant (at 0). There are no errors in interpreting so I'm guessing it is ok syntax wise. All the variables are properly specified. Am I missing something important to make sure it loops?
Here is what it should look like: http://commons.wikimedia.org/wiki/Im...-discharge.svg /* modeled after an RC charging-discharging curve */ /* p = entire period (including resting time) */ /* xp = cross-over point from charging to discharging */ /* pb = period (total charge-discharge time) */ /* a = amplitude*/ p=20; xp=3; pb=5; a=5; flow_time1=0; flow_time3=pb; begin_f_loop(f, thread) {F_CENTROID(x,f,thread); if (flow_time == (flow_time3+p)) { flow_time1=flow_time1+p; flow_time3=flow_time3+p; } if ((flow_time > flow_time1) && (flow_time < flow_time3)) { flow_time2=flow_time - flow_time1; if (flow_time2 <= xp) {F_PROFILE(f,thread,nv) = a*(1-exp(-flow_time2/(pb/6))); } else {F_PROFILE(f,thread,nv) = a*(exp((xp-flow_time2)/(pb/10))); } else { F_PROFILE(f,thread,nv) = 0; } } end_f_loop(f, thread) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
looping | rr123 | FLUENT | 1 | July 8, 2008 17:49 |
Looping in UDF!!! | safa | FLUENT | 0 | December 11, 2007 08:07 |
LOOPING ON NODES | Luca | FLUENT | 0 | January 10, 2005 16:23 |
Looping Problem?? | KKLAU | FLUENT | 1 | June 5, 2004 05:48 |
Looping over cells | Karl | FLUENT | 4 | March 26, 2002 21:18 |