# how to identify neighbors of neighbour cell in openfoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 9, 2021, 23:50 how to identify neighbors of neighbour cell in openfoam #1 Senior Member   Kumaresh Join Date: Oct 2016 Posts: 346 Rep Power: 10 Hello Foamers, Assuming a 1D mesh. Lets say, P = point (Actual) nW = west point nE = east point nW2 = west neighbor of west point - unable to access ? Here is the sample code: //************************************************** ************************// Foam::Map

 July 10, 2021, 00:17 #2 Senior Member   Kumaresh Join Date: Oct 2016 Posts: 346 Rep Power: 10 Following the above post, I declared nW2 in different way as, if (T_[cellI] =100) { label nW = niTable0[cellI]; //T(I-1) label nW2 = niTable0[nW]; //T(I-2) Info << "check2: " << nW2 << " " << nW << " " << cellI << endl; T_[nW] = T_[nW] - XX *(T_[nW2] - T_[cellI]) / 2; ----> EQU. (1) //T(I)=T(I)- XX*(T(I-1)-T(I+1))/2; } The error continue prevailing at EQU. (1): and here is the LOG file printed while running the case: //************************************************** ***********// Time = 740 Solving for solid region furnace Min/max T:min(T) [0 0 0 1 0 0 0] 293 max(T) [0 0 0 1 0 0 0] 1323 check2: -1 0 1 //Info << "check2: " << nW2 << " " << nW << " " << cellI << endl; //************************************************** ***********// The printed statement at check 2 looks reasonable accessing nW2 = west neighbor of west point. But, I don't know why the case suddenly stops at t =740s after printing check2 statement. Kindly someone share your ideas please. Thank you