<div dir="ltr">Hi Neks<div>I'm trying to implement a slip-length (Robin) as boundary condition for a plane channel flow, namely:</div><div>(u+du/dy)_{wall}=0</div><div>where x and y are the streamwise and wall normal directions respectively.</div><div><br></div><div>Following the latter post:</div><div><a href="http://lists.mcs.anl.gov/pipermail/nek5000-users/2011-April/001313.html" target="_blank">http://lists.mcs.anl.gov/<wbr>pipermail/nek5000-users/2011-<wbr>April/001313.html</a><br></div><div><br></div><div>here there's what I came up with:<br></div><div><br></div><div><div>c-----------------------------------------------------------------------</div><div> subroutine userchk</div><div> include 'SIZE'</div><div> include 'TOTAL'</div><div> common /my_DEBUG/ rmodulate</div><div> common /my_ROBIN/ ROBIN_mask(lx1,ly1,lz1,lelt)</div><div> $ , work1(lx1,ly1,lz1,lelt)</div><div> $ , work2(lx1,ly1,lz1,lelt)</div><div> $ , graduy(lx1,ly1,lz1,lelt)</div><div> n = nx1*ny1*nz1*nelv</div><div>!!!Build Up MASKS!</div><div> if (istep.eq.0) then</div><div> do i=1,n</div><div> x=xm1(i,1,1,1)</div><div> y=ym1(i,1,1,1)</div><div> if(x.gt.3.and.x.lt.4)then</div><div> ROBIN_mask(i,1,1,1)=1.0<br></div><div> else</div><div> ROBIN_mask(i,1,1,1)=0.0</div><div> endif</div><div> enddo</div><div> endif</div><div>!Compute velocity gradient</div><div> call rzero(graduy,n)</div><div> call gradm1(work1,graduy,work2,vx)</div><div> call dsavg(graduy)</div><div>! call outpost(work1,graduy,work2,pr,t,'GRD')</div><div>!Da aggiungere l'eventualità del 3D...</div><div> rmodulate = 0.5*(tanh(0.25*time-10)+1)</div><div> if (nid.eq.0) write(6,*)"MODULATE", rmodulate,time</div><div> return</div><div> end</div><div>c-----------------------------------------------------------------------</div></div><div><div>c-----------------------------------------------------------------------</div><div> subroutine userbc (ix,iy,iz,iside,eg)</div><div>c NOTE ::: This subroutine MAY NOT be called by every process</div><div> include 'SIZE'</div><div> include 'TOTAL'</div><div> include 'NEKUSE'</div><div> integer e, eg</div><div>!Imposing Fancy Boundary Conditions...</div><div>![Nek5000-users] Robin boundary conditions for the velocity</div><div> common /my_ROBIN/ ROBIN_mask(lx1,ly1,lz1,lelt)</div><div> $ , work1(lx1,ly1,lz1,lelt)</div><div> $ , work2(lx1,ly1,lz1,lelt)</div><div> $ , graduy(lx1,ly1,lz1,lelt)</div><div> common /my_DEBUG/ rmodulate</div><div> e=gllel(eg) ! global element number to processor-local el. #</div><div> ux=1*graduy(ix,iy,iz,e)*rmodulate</div><div> uy=0.0</div><div> uz=0.0</div><div> return</div><div> end</div><div>c-----------------------------------------------------------------------</div><div> subroutine useric (ix,iy,iz,ieg)</div><div> include 'SIZE'</div><div> include 'TOTAL'</div><div> include 'NEKUSE'</div><div> ux=1.0*y**2</div><div> uy=0.0</div><div> uz=0.0</div><div> temp=0</div><div> return</div><div> end</div><div>c-----------------------------------------------------------------------</div></div><div><br></div><div>The code becomes unstable in the gradient computation due to some point-to-point oscillations.</div><div>As you can see I've also tried to use a ramp function in order to make the onset of Robin condition more gentle,</div><div>but at a given "slip-length amplitude" oscillations deteriorates the solution.</div><div>I use ROBIN_mask in order to chose where to have such BC, but it seems that I'm still missing something in computing the velocity gradient GRD.</div><div><br></div><div>By the way, this is my box.BOX file:</div><div><br></div><div>base.rea</div><div>2 spatial dimension ( < 0 --> generate .rea/.re2 pair)</div><div>1 number of fields</div><div>#=======================================================================</div><div>#</div><div># Example of .box file for channel flow</div><div>#</div><div># If nelx (y or z) < 0, then genbox automatically generates the</div><div># grid spacing in the x (y or z) direction</div><div># with a geometric ratio given by "ratio".</div><div># ( ratio=1 implies uniform spacing )</div><div>#</div><div># Note that the character bcs _must_ have 3 spaces.</div><div>#</div><div>#=======================================================================</div><div>#</div><div>Box</div><div>-32 -16 nelx,nely,nelz for Box</div><div>0 6.2832 1. x0,x1,gain</div><div>-1 1 1. y0,y1,gain</div><div>P ,P ,v ,v , , bc's (3 chars each!)</div><div><br></div><div><br></div><div>I was wondering if you might be able to give me some advice.</div><div><br></div><div>Best regards,</div><div><br></div><div>Francesco <br></div></div>