|
[Sponsors] |
January 31, 2022, 17:01 |
For Loops as part of an Adjust
|
#1 |
Member
Pierce
Join Date: May 2019
Posts: 40
Rep Power: 7 |
Hello,
I'm trying to add an actuator disk into my simulation which involves creating an X-momentum source code. In order to create a Gaussian distribution over every cell (p) where the actuator disk lies I've created a for loop however upon implementing the adjust function to fluent the solution will not iterate once after 5 minutes (Fluent is not crashing). Any suggestions? See the code here DEFINE_ADJUST(adjust1,d) { Thread *t; cell_t c; real xc[ND_ND]; real variable; thread_loop_c (t,d) { begin_c_loop (c,t) C_CENTROID(xc,c,t); xp = 0.0125; epsilon = 0.052632; sum = 0; delta = 1; n=38; for (i=1 ; i=n ; 1) { yp = -10-(i/38); r = pow((xc[0]-xp),2) + pow((xc[1]-yp),2); term1 = exp(-pow(r/epsilon,2)); eta = term1*(1/M_PI*epsilon*epsilon*delta); sum = sum + eta; } C_UDSI(c,t,0) = sum*500000; C_UDSI(c,t,1) = r; end_c_loop(c,t) } |
|
February 2, 2022, 20:48 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
check this condition
Code:
for (i=1 ; i=n ; 1)
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Input part for automated mesh (2D) | ReubenBuehler | STAR-CCM+ | 4 | November 2, 2018 07:58 |
part remesh for optimization | Marien | ANSA | 1 | May 9, 2017 03:08 |
[snappyHexMesh] snappyHexMesh can't create a fine Mesh from stl from Rhinoceros | Taghi | OpenFOAM Meshing & Mesh Conversion | 13 | May 4, 2017 16:48 |
replacing of shock tube high pressure part with a boundary condition for low pressure | immortality | Main CFD Forum | 0 | May 2, 2013 14:30 |
what boundary condition is proper for simulation of shock-tube low pressure part? | immortality | OpenFOAM Running, Solving & CFD | 0 | May 2, 2013 14:22 |