<div dir="ltr"><div><div>Hi Jing,<br><br></div>Following your instructions, I re-generate a new 2D cylinder mesh (see attachment, plz), set the upper (4) and bottom (3) as the periodics, the distance in y is 30,<br>the setting as followed:<br>convert('cyl.msh', curves={7:{'type':'C', 'radius':-0.5, 'depth': 3, 'circle_center': (0, 0)}}, periodic_dx={(3,4) : [0, 30.0, 0]}, bcs={ 5: 'O', 6: 'v', 7: 'W'})<br><br></div><div>as fas as fine, while it failed to convert , error informations are<br><br><br><i>Traceback (most recent call last):<br>  File "mshconvert_new.py", line 15, in <module><br>    convert('cyl.msh', curves={7:{'type':'C', 'radius':-0.5, 'depth': 3, 'circle_center': (0, 0)}}, periodic_dx={(3,4) : [0, -30.0, 0]}, bcs={ 5: 'O', 6: 'v', 7: 'W'})<br>  File "/home/wei/Workstation/CFD/mshconvert/mshconvert.py", line 1458, in convert<br>    create_periodic_face_map(periodic_dx)<br>  File "/home/wei/Workstation/CFD/mshconvert/mshconvert.py", line 304, in create_periodic_face_map<br>    - abs(dx)) < 1.e-7*norm(dx)):<br>ValueError: operands could not be broadcast together with shapes (2,) (3,) </i><br><br></div><div>would you like to help me? thanks!<br><br></div><div>regards<br><br></div><div>Wei<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-09 16:15 GMT+02:00  <span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Wei,<br>
<br>
>1. to impose the periodic boundary conditons: in the script, it strongly<br>
>recommend to impose "P" through the script, then how to setup it in<br>
>mshconvert.py? the way<br>
>convert('mesh.msh', bcs={1:'W',2:'v',3:'O',4:'P', 5:'P'})<br>
> can generate the rea field but failed in the step of genmap. so how to<br>
> treat boundary 4 and 5 as periodic BCs?<br>
<br>
Probably you should have to do likes<br>
<br>
convert('mesh.msh', periodic_dx={(4,5) : [0, 0, 2]}, bcs={1:'W',2:'v',3:'O'})<br>
<br>
Where the "periodic_dx" is to specify which pair-zone is periodic and what is the orientation of zones. in the example, zones 4,5 are the periodic boundaries and on the z-direction with distance of 2.<br>
<br>
>2. about the curved wall. there is no problem to  define a circle by<br>
>"Circle" command, but if I want to using "m" to define a spline curve, how<br>
t>o seed middle points? I know in Gambit I can mesh the line using 3 node, I<br>
>defined 3 node mode to mesh a circle, and using "m" instead of "circle",<br>
>however,  it failed to generate the rea file. the circle merged into a<br>
>point, then what should I do to active the spline curve?<br>
<br>
Yes, it seems to be bugs in the python script  with "m" method. In the python script, the midpoints is (somehow) defined by<br>
 ...<br>
 x_m = (x_1+x_2)/2;<br>
 y_m = (y_1+y_2)/2;<br>
...<br>
However, in the nek5000 (tools/prenek/zipper2.f) it read the values of (x_q, y_q) instead of (x_m,y_m) !?<br>
....<br>
!   subroutine xyzquad(xl,yl,zl,nxl,nyl,nzl,e)<br>
...<br>
     do k=1,nedge<br>
         if (ccurve(k,e).eq.'m') then<br>
            j = eindx(k)<br>
            xq(j) = curve(1,k,e)<br>
            yq(j) = curve(2,k,e)<br>
            zq(j) = curve(3,k,e)<br>
         endif<br>
      enddo<br>
...<br>
This should be confirmed by nek5000 developers.<br>
<br>
Thanks.<br>
<br>
/Jing<br>
<br>
________________________________________<br>
From: <a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov">nek5000-users-bounces@lists.mcs.anl.gov</a> <<a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov">nek5000-users-bounces@lists.mcs.anl.gov</a>> on behalf of <a href="mailto:nek5000-users-request@lists.mcs.anl.gov">nek5000-users-request@lists.mcs.anl.gov</a> <<a href="mailto:nek5000-users-request@lists.mcs.anl.gov">nek5000-users-request@lists.mcs.anl.gov</a>><br>
Sent: Wednesday, June 8, 2016 18:18<br>
To: <a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a><br>
Subject: Nek5000-users Digest, Vol 88, Issue 8<br>
<br>
Send Nek5000-users mailing list submissions to<br>
        <a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:nek5000-users-request@lists.mcs.anl.gov">nek5000-users-request@lists.mcs.anl.gov</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:nek5000-users-owner@lists.mcs.anl.gov">nek5000-users-owner@lists.mcs.anl.gov</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Nek5000-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: Nek5000-users Digest, Vol 88, Issue 5<br>
      (<a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a>)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 8 Jun 2016 18:15:42 +0200<br>
From: <a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a><br>
To: <a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a><br>
Subject: Re: [Nek5000-users] Nek5000-users Digest, Vol 88, Issue 5<br>
Message-ID:<br>
        <<a href="mailto:mailman.23474.1465402725.24727.nek5000-users@lists.mcs.anl.gov">mailman.23474.1465402725.24727.nek5000-users@lists.mcs.anl.gov</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello Jing,<br>
<br>
Recently I am also working on converting fluent mesh to nek5000. I have<br>
generated the *msh from gambit, then using the mshconvert.py tool to<br>
convert a simple mesh with a circular cylinder inside a square.<br>
<br>
simply, I can get the *rea file with circle of the "W", "v" and "O". but I<br>
have met two problems;<br>
<br>
1. to impose the periodic boundary conditons: in the script, it strongly<br>
recommend to impose "P" through the script, then how to setup it in<br>
mshconvert.py? the way<br>
<br>
convert('mesh.msh', bcs={1:'W',2:'v',3:'O',4:'P', 5:'P'})<br>
<br>
can generate the rea field but failed in the step of genmap. so how to<br>
treat boundary 4 and 5 as periodic BCs?<br>
<br>
2. about the curved wall. there is no problem to  define a circle by<br>
"Circle" command, but if I want to using "m" to define a spline curve, how<br>
to seed middle points? I know in Gambit I can mesh the line using 3 node, I<br>
defined 3 node mode to mesh a circle, and using "m" instead of "circle",<br>
however,  it failed to generate the rea file. the circle merged into a<br>
point, then what should I do to active the spline curve?<br>
<br>
Thanks!<br>
<br>
Wei<br>
<br>
2016-06-08 15:46 GMT+02:00 <<a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a>>:<br>
<br>
> Hi Mansi,<br>
><br>
> You can find the updated "mshconvert.py" in the attachment.  You can run<br>
> the script for your case likes<br>
><br>
> ###<br>
> $ ipython<br>
><br>
> In [1]: from mshconvert import *<br>
> Converting from ANSYS Fluent format (.msh) to Nek5000, semtex or FEniCS<br>
> format<br>
><br>
> In [2]: convert('mesh_hexa_final.msh', bcs={10:'W',11:'v',12:'v',13:'O'})<br>
> ...<br>
> ###<br>
><br>
> Here I assume that BC "W" is on zone 10, "v" is on zones 11 and 12, and<br>
> 'O' on zone 13.<br>
><br>
> The snapshot for the Nek5000 mesh using visit is also attached in the<br>
> email.<br>
><br>
> /Jing<br>
><br>
><br>
_______________________________________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov">Nek5000-users@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font size="4"><b><font face="arial narrow,sans-serif"><br></font></b></font><span><div><font face="Bookman Old Style"><font color="#7f7f7f">Wei HE 何偉<br></font></font></div><div><font face="Bookman Old Style" color="#7f7f7f">School of Aeronautics</font></div><div><font face="Bookman Old Style" color="#7f7f7f">Universidad Politécnica de Madrid</font></div></span><a href="http://www.cfm.upm.es/" target="_blank">http://www.cfm.upm.es/</a><br></div></div></div>
</div>