CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Problem in generating too many pointsFoamerrorprintStackFoam%3cIMG SRC%3d%22httpopenfoamcfdonlinecomforumclipartproud gif%22 ALT%3d%22O%22 BORDER%3d0%3estreamamp (http://www.cfd-online.com/Forums/openfoam/60783-problem-generating-too-many-pointsfoamerrorprintstackfoam-3cimg-src-3d-22httpopenfoamcfdonlinecomforumclipartproudgif-22-alt-3d-22o-22-border-3d0-3estreamamp.html)

marhamat August 6, 2008 03:49

Hi OpenFOAM I add a code to
 
Hi OpenFOAM

I add a code to channelOodles Solver for generating arbitrary points in every iteration in the solution domain .
When the points number is below than 92,the code works OK.But when the points number is upper than 92(for ex:100 or 1000 points),after some iteration the run fails.

n=85 YYY[n]= 0.230973cellRandom1 9017
n=86 YYY[n]= 0.171737cellRandom1 140439
n=87 YYY[n]= 0.2166cellRandom1 51072
n=88 YYY[n]= 0.1761cellRandom1 32538
n=89 YYY[n]= 0.240889cellRandom1 75073
n=90 YYY[n]= 0.205857cellRandom1 50671
n=91 YYY[n]= 0.241429cellRandom1 14997
n=92 YYY[n]= 0.243897cellRandom1 135296
Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
Foam::sigSegv::sigSegvHandler(int)
[0xffffe420]
channelOodles [0x8060d6c]
__libc_start_main
__gxx_personality_v0
Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
Foam::sigSegv::sigSegvHandler(int)
[0xffffe420]
channelOodles [0x8060d15]
__libc_start_main
__gxx_personality_v0

>>You can see the part of the written code:

Random perturbation(1234567);


int loopRandX;
int loopRandZ;
for(int n=1;n<=bubbleNumber.value();n++)
{
Info<< "n="<< n ;
loopRandX =rand() % 10000 + 1;
Info<< " loopRandX= "<<loopRandX ;
XXX[n] = (loopRandX*deltaX)/10001 + xFirst.value();
Info<< " XXX[n]= "<< XXX[n] ;
YYY[n]= ((perturbation.GaussNormal()+1)/2)*deltaY +yFirst.value();
Info<< " YYY[n]= "<< YYY[n] ;
loopRandZ =rand() % 1000 + 5;
Info<< " loopRandZ= "<<loopRandZ ;
ZZZ[n] = (loopRandZ*deltaZ)/1005 + zFirst.value();
Info<< " ZZZ[n]= "<< ZZZ[n]<< endl ;

position[n] = XXX[n] * vector(1,0,0) + YYY[n] * vector(0,1,0) + ZZZ[n] * vector(0,0,1) ;
label cellRandom1 = mesh.findCell(position[n]);
cellRandom[cellRandom1] = mesh.C()[cellRandom1];
Info<< "cellRandom1 "<< cellRandom1 << endl;
}
Ideas are welcom.
With Best Regards
Marhamat


All times are GMT -4. The time now is 19:56.