Hello,
I am running a forward-facing step simulation and encountered an error when trying to import the mesh.
pyfr import fine.msh mesh.pyfrm
Traceback (most recent call last):
File "/home/user01/test_fine/PyFR/venv/bin/pyfr", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/user01/test_fine/PyFR/PyFR/pyfr/__main__.py", line 242, in main
args.process(args)
File "/home/user01/test_fine/PyFR/PyFR/pyfr/__main__.py", line 256, in process_import
reader.write(args.outmesh, args.lintol)
File "/home/user01/test_fine/PyFR/PyFR/pyfr/readers/base.py", line 68, in write
nodes, eles, codec, pmap = mesh = self._to_raw_mesh(lintol)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user01/test_fine/PyFR/PyFR/pyfr/readers/gmsh.py", line 445, in _to_raw_mesh
return mesh.get_eles(lintol, self.progress)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user01/test_fine/PyFR/PyFR/pyfr/readers/base.py", line 342, in get_eles
pmap = self._connect_eles(eles, codec, spinner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user01/test_fine/PyFR/PyFR/pyfr/readers/base.py", line 372, in _connect_eles
self._ident_boundary_faces(bpart, cconn, codec, resid)
File "/home/user01/test_fine/PyFR/PyFR/pyfr/readers/base.py", line 300, in _ident_boundary_faces
lcidx, loff = resid.pop(tuple(sorted(fn)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: (np.int64(7), np.int64(11), np.int64(2502), np.int64(4889))
It seems the issue occurs while identifying boundary faces during mesh import. I suspect it might be related to how the mesh was generated or how boundary conditions were defined in the geo file.
Since I cannot upload files here, I’ve pasted the content of my geo file below for reference:
mm = 0.001;
Mesh.ElementOrder = 1;
h = 10.0 * mm;
inlet_h = 500;
inlet_v = 300;
outlet_h = 400;
outlet_v = 300;
Point(1) = {0, 0, 0, h};
Point(2) = {0, -2 * h, 0, h};
Point(3) = {0, -3 * h, 0, h};
Point(4) = {8*h, -3*h, 0, h/3};
Point(5) = {8*h, -2*h, 0, h/3};
Point(6) = {18*h, -2*h, 0, h};
Point(7) = {18*h, 0, 0, h};
Point(8) = {8*h, 0, 0, h};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 6};
Line(6) = {6, 7};
Line(7) = {7, 8};
Line(8) = {8, 5};
Line(9) = {2, 5};
Line(10) = {8, 1};
Line Loop(10) = {1, 9, -8, 10};
Plane Surface(11) = {10};
Line Loop(20) = {2, 3, 4, -9};
Plane Surface(21) = {20};
Line Loop(30) = {8, 5, 6, 7};
Plane Surface(31) = {30};
Extrude {0, 0, h} {
Surface{11, 21, 31};
Layers{1};
Recombine;
}
Transfinite Line {-36, 10, -34, -9, 56, -3} = inlet_h Using Bump 0.03;
Transfinite Line {-38, 39, 47, -43, 91, 87} = inlet_v Using Bump 0.03;
Transfinite Line {-61, 65} = inlet_v Using Bump 0.03;
Transfinite Line {33, 1, 55, 2, 35, 8, 57, 4, -79, -6} = inlet_v Using Progression 1.02;
Transfinite Line {80, -7, 5, -78} = outlet_h Using Bump 0.03;
Transfinite Line {47, 56, 91, 87} = outlet_v Using Bump 0.03;
Transfinite Surface {11, 21, 31};
Recombine Surface {11, 21, 31};
Physical Surface("Inlet") = {40, 62};
Physical Surface("Outlet") = {92};
Physical Surface("Bottom") = {88, 66};
Physical Surface("Top") = {52, 96};
Physical Surface("Step") = {48, 70};
Physical Surface("Front") = {11, 31, 21};
Physical Surface("Back") = {53, 97, 75};
Physical Volume("Fluid") = {2, 1, 3};
Recombine Volume "*";
I’d appreciate any advice or suggestions on how to fix this error or properly define boundaries to avoid it.
Thank you