<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Francesco,</div><div class=""><br class=""></div><div class="">Robin boundary condition is implemented already for the passive scalar, in the form of Newton cooling boundary condition. You can see how this is implemented in subroutine BCNEUSC. In your case ITYPE=-1 and CB=‘c ' in the subroutine, and you need to only set ‘HC’ accordingly. We tested this and even our turbulent simulations are stable with Robin BC.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Sudhakar.</div><br class=""><div><blockquote type="cite" class=""><div class="">On 21 Apr 2017, at 20:35, <a href="mailto:nek5000-users@lists.mcs.anl.gov" class="">nek5000-users@lists.mcs.anl.gov</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Neks<div class="">I'm trying to implement a slip-length (Robin) as boundary condition for a plane channel flow, namely:</div><div class="">(u+du/dy)_{wall}=0</div><div class="">where x and y are the streamwise and wall normal directions respectively.</div><div class=""><br class=""></div><div class="">Following the latter post:</div><div class=""><a href="http://lists.mcs.anl.gov/pipermail/nek5000-users/2011-April/001313.html" target="_blank" class="">http://lists.mcs.anl.gov/<wbr class="">pipermail/nek5000-users/2011-<wbr class="">April/001313.html</a><br class=""></div><div class=""><br class=""></div><div class="">here there's what I came up with:<br class=""></div><div class=""><br class=""></div><div class=""><div class="">c-----------------------------------------------------------------------</div><div class=""> subroutine userchk</div><div class=""> include 'SIZE'</div><div class=""> include 'TOTAL'</div><div class=""> common /my_DEBUG/ rmodulate</div><div class=""> common /my_ROBIN/ ROBIN_mask(lx1,ly1,lz1,lelt)</div><div class=""> $ , work1(lx1,ly1,lz1,lelt)</div><div class=""> $ , work2(lx1,ly1,lz1,lelt)</div><div class=""> $ , graduy(lx1,ly1,lz1,lelt)</div><div class=""> n = nx1*ny1*nz1*nelv</div><div class="">!!!Build Up MASKS!</div><div class=""> if (istep.eq.0) then</div><div class=""> do i=1,n</div><div class=""> x=xm1(i,1,1,1)</div><div class=""> y=ym1(i,1,1,1)</div><div class=""> if(x.gt.3.and.x.lt.4)then</div><div class=""> ROBIN_mask(i,1,1,1)=1.0<br class=""></div><div class=""> else</div><div class=""> ROBIN_mask(i,1,1,1)=0.0</div><div class=""> endif</div><div class=""> enddo</div><div class=""> endif</div><div class="">!Compute velocity gradient</div><div class=""> call rzero(graduy,n)</div><div class=""> call gradm1(work1,graduy,work2,vx)</div><div class=""> call dsavg(graduy)</div><div class="">! call outpost(work1,graduy,work2,pr,t,'GRD')</div><div class="">!Da aggiungere l'eventualità del 3D...</div><div class=""> rmodulate = 0.5*(tanh(0.25*time-10)+1)</div><div class=""> if (nid.eq.0) write(6,*)"MODULATE", rmodulate,time</div><div class=""> return</div><div class=""> end</div><div class="">c-----------------------------------------------------------------------</div></div><div class=""><div class="">c-----------------------------------------------------------------------</div><div class=""> subroutine userbc (ix,iy,iz,iside,eg)</div><div class="">c NOTE ::: This subroutine MAY NOT be called by every process</div><div class=""> include 'SIZE'</div><div class=""> include 'TOTAL'</div><div class=""> include 'NEKUSE'</div><div class=""> integer e, eg</div><div class="">!Imposing Fancy Boundary Conditions...</div><div class="">![Nek5000-users] Robin boundary conditions for the velocity</div><div class=""> common /my_ROBIN/ ROBIN_mask(lx1,ly1,lz1,lelt)</div><div class=""> $ , work1(lx1,ly1,lz1,lelt)</div><div class=""> $ , work2(lx1,ly1,lz1,lelt)</div><div class=""> $ , graduy(lx1,ly1,lz1,lelt)</div><div class=""> common /my_DEBUG/ rmodulate</div><div class=""> e=gllel(eg) ! global element number to processor-local el. #</div><div class=""> ux=1*graduy(ix,iy,iz,e)*rmodulate</div><div class=""> uy=0.0</div><div class=""> uz=0.0</div><div class=""> return</div><div class=""> end</div><div class="">c-----------------------------------------------------------------------</div><div class=""> subroutine useric (ix,iy,iz,ieg)</div><div class=""> include 'SIZE'</div><div class=""> include 'TOTAL'</div><div class=""> include 'NEKUSE'</div><div class=""> ux=1.0*y**2</div><div class=""> uy=0.0</div><div class=""> uz=0.0</div><div class=""> temp=0</div><div class=""> return</div><div class=""> end</div><div class="">c-----------------------------------------------------------------------</div></div><div class=""><br class=""></div><div class="">The code becomes unstable in the gradient computation due to some point-to-point oscillations.</div><div class="">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 class="">but at a given "slip-length amplitude" oscillations deteriorates the solution.</div><div class="">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 class=""><br class=""></div><div class="">By the way, this is my box.BOX file:</div><div class=""><br class=""></div><div class="">base.rea</div><div class="">2 spatial dimension ( < 0 --> generate .rea/.re2 pair)</div><div class="">1 number of fields</div><div class="">#=======================================================================</div><div class="">#</div><div class=""># Example of .box file for channel flow</div><div class="">#</div><div class=""># If nelx (y or z) < 0, then genbox automatically generates the</div><div class=""># grid spacing in the x (y or z) direction</div><div class=""># with a geometric ratio given by "ratio".</div><div class=""># ( ratio=1 implies uniform spacing )</div><div class="">#</div><div class=""># Note that the character bcs _must_ have 3 spaces.</div><div class="">#</div><div class="">#=======================================================================</div><div class="">#</div><div class="">Box</div><div class="">-32 -16 nelx,nely,nelz for Box</div><div class="">0 6.2832 1. x0,x1,gain</div><div class="">-1 1 1. y0,y1,gain</div><div class="">P ,P ,v ,v , , bc's (3 chars each!)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I was wondering if you might be able to give me some advice.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class=""><br class=""></div><div class="">Francesco <br class=""></div></div>
_______________________________________________<br class="">Nek5000-users mailing list<br class=""><a href="mailto:Nek5000-users@lists.mcs.anl.gov" class="">Nek5000-users@lists.mcs.anl.gov</a><br class="">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users<br class=""></div></blockquote></div><br class=""></body></html>