|
[Sponsors] |
April 3, 2018, 10:26 |
Fluent DPM UDF Diverges in parallel
|
#1 |
Member
sunil kumar
Join Date: May 2016
Posts: 80
Rep Power: 10 |
Hello
I am trying to employ the inert heating law as a UDF In fluent however when I run it in parallel it diverges. This does not happen when run in series, in the fluent manual it states that no additional adjustments need to be made for DPM UDF's run in parallel. Any suggestions what may be going wrong here? DEFINE_DPM_LAW(Heating,tp,ci) { /* get the cell and Thread that the particle is currently in */ cphase_state_t *c = &(tp->cphase[0]); Thread *t = TP_CELL_THREAD(tp); mp = TP_MASS(tp); Dp = DPM_DIAM_FROM_VOL(mp / TP_RHO(tp)); Ap = DPM_AREA(Dp); Tp = TP_T(tp); dt = TP_DT(tp); real Pr = c->sHeat * c->mu / c->tCond; real Nu = 2.0 + 0.6 * sqrt(tp->Re) * pow(Pr, 1./3.); real h = Nu * c->tCond / Dp; TP_T(tp) = Tp + dt * h * Ap * (c->temp - Tp) / (mp * tp->Cp); } |
|
April 4, 2018, 06:39 |
|
#2 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Code:
DEFINE_DPM_LAW(Heating,tp,ci) { /* get the cell and Thread that the particle is currently in */ cphase_state_t *c = &(tp->cphase[0]); /* the line above is not the normal way to find the cell! instead use cell_t c = TP_CELL(tp); */ real mp = TP_MASS(tp); real Dp = DPM_DIAM_FROM_VOL(mp / TP_RHO(tp)); real Ap = DPM_AREA(Dp); real Tp = TP_T(tp); real dt = TP_DT(tp); real Pr = c->sHeat * c->mu / c->tCond; /* all "c->" contructions are under-the-hood constructions, that might work now but fail later. Don't do this, just use the normal Fluent way: c->mu should be C_MU(c,t) for example. To do this, you should re-add the thread t that I removed. */ real Nu = 2.0 + 0.6 * sqrt(tp->Re) * pow(Pr, 1./3.); real h = Nu * c->tCond / Dp; TP_T(tp) = Tp + dt * h * Ap * (c->temp - Tp) / (mp * tp->Cp); /* tp->Cp is actually DPM_SPECIFIC_HEAT(tp,t)? */ } |
||
April 4, 2018, 09:29 |
|
#3 |
Member
sunil kumar
Join Date: May 2016
Posts: 80
Rep Power: 10 |
I had declared the variables globally outside of the function I have managed to fix this thank you for your help
|
|
August 30, 2018, 11:04 |
Same Problem
|
#4 |
New Member
Alec H.
Join Date: Aug 2018
Posts: 4
Rep Power: 8 |
Hi, I am having the same problem with a relatively simple UDF of mine. When I run in serial, it converges with no problem. In parallel, it diverges at random timesteps, but will always diverge.
What steps did you take to solve your problem? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FLUENT Parallel Problem (UDF) | soheilr | Fluent UDF and Scheme Programming | 1 | June 16, 2016 08:55 |
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT | subhankar_bhandari | Fluent UDF and Scheme Programming | 0 | August 19, 2010 04:09 |
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT | subhankar_bhandari | FLUENT | 0 | August 19, 2010 04:01 |
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT | subhankar_bhandari | Main CFD Forum | 0 | August 19, 2010 04:01 |
UDF for PARALLEL FLUENT | Cfdtoy | FLUENT | 0 | March 14, 2004 01:55 |