I actually miswrote my boundary conditions. What I want to impose is:<br><br>(U.n) u + (p * IdentityMatrix + inv(Re) * grad(u)) . n = 0<br><br>that is, if n = (0,0,1)^T = ez:<br><br>p = 0<br>dux/dz = Re * W * ux<br>duy/dz = Re * W * uy<br>
duz/dz = Re * W * uz<br><br>Concerning the velocity bc, I assume once again that the following code would do the trick:<br><br><div style="margin-left: 80px;">subroutine usrchk</div><div style="margin-left: 80px;"><br></div>
<div style="margin-left: 80px;">[...]</div><div style="margin-left: 80px;">common /mygrad/ gradux(lx1,ly1,lz1,lelt), ... , gradwz(lx1,ly1,lz1,lelt)<br></div><div style="margin-left: 80px;"><br>call gradm1(graduv,graduy,graduz,vx)<br>
call gradm1(gradvx,gradvy,gradvz,vy)<br></div><div style="margin-left: 80px;">call gradm1(gradwx,gradwy,gradz,vz)</div><div><br></div><div>[...]</div><div>
<br></div><div>and then in userbc</div><div><br></div><div style="margin-left: 80px;"><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;"> subroutine userbc (ix,iy,iz,iside,eg)<br>
include 'SIZE'<br> include 'TOTAL'<br> include 'NEKUSE'<br><br> common /mygrad/ ...<br>
<br> integer e,eg<br><br> e = gllel(eg) ! global element number to processor-local el. #<br><br></span></div><div style="margin-left: 80px;"><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;">c
Assuming param(2)<0 in .rea, Re = 1./param(2) since in connect2 or
subs1 I do not remember there is first param(2) = -1/param(2)</span></div>
<div style="margin-left: 80px;"><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;"><br> ux = (1./param(2)) * vz(ix,iy,iz,ie) * graduz(ix,iy,iz,ie)<br> uy = (1./param(2)) * vz(ix,iy,iz,ie) * gradvz(ix,iy,iz,ie)<br>
uz = (1./param(2)) * vz(ix,iy,iz,ie) * gradwz(ix,iy,iz,ie)<br><br></span></div><br>However, how do I make the code take this into account along with keeping the p = 0 imposed at the outflow? I presume I should use the 'o' bc character instead of 'O' in my .rea boundary conditions definition section. Is that correct?<br>
<br>Best regards,<br>JC<br><br><div class="gmail_quote">On 19 April 2011 19:34, Jean-Christophe Loiseau <span dir="ltr"><<a href="mailto:loiseau.jc@gmail.com">loiseau.jc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Nek's.<div><br></div><div>I would like to use the following boundary condition as my outflow condition for the adjoint perturbation mode:</div><div><br></div><div>p = du/dz = dv/dz = 0</div><div>dw/dz = Re * Uz * uz</div>
<div><br></div><div>where Uz is the z-component of the base flow. I would be tempted to do something like:</div><div><br></div><div>subroutine usrchk</div><div><br></div><div>[...]</div><div>common /mygrad/ gradwx(lx1,ly1,lz1,lelt)</div>
<div> $ gradwy(lx1,ly1,lz1,lelt)</div><div> $ gradw(zlx1,ly1,lz1,lelt)</div><div><br></div><div>call gradm1(gradwx,gradwy,gradz,vz)</div><div><br></div><div>[...]</div><div>
<br></div><div>and then in userbc</div><div><br></div><div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;"> subroutine userbc (ix,iy,iz,iside,eg)<br>
include 'SIZE'<br> include 'TOTAL'<br> include 'NEKUSE'<br><br> common /mygrad/ gradwx(lx1,ly1,lz1,lelt)<br> $ , gradwy(lx1,ly1,lz1,lelt)<br> $ , gradwz(lx1,ly1,lz1,lelt)<br>
<br> integer e,eg<br><br> e = gllel(eg) ! global element number to processor-local el. #<br><br></span></div><div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;">c Assuming param(2)<0 in .rea, Re = 1./param(2) since in connect2 or subs1 I do not remember there is first param(2) = -1/param(2)</span></div>
<div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;"><br> uz = (1./param(2)) * vz(ix,iy,iz,ie) * gradwz(ix,iy,iz,e)</span></div>
<div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;"><br></span></div><div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;">However I am not sure how to handle the other boundary conditions on u, v and p.</span></div>
<div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;"><br></span></div><div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;">Regards,</span></div>
<div><span style="border-collapse: collapse; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size: 13px;">JC</span></div><div><br></div><div>-- <br>Jean-Christophe<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Jean-Christophe<br>