CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   GMSH and SU2 NPOIN/NELEM Errors (https://www.cfd-online.com/Forums/su2/232618-gmsh-su2-npoin-nelem-errors.html)

djpicho December 21, 2020 15:27

GMSH and SU2 NPOIN/NELEM Errors
 
1 Attachment(s)
Hello All,

I have been working to mesh a "crazy" airfoil I have made in GMSH but when inputting into SU2, SU2 generates the error:

"Mismatch between NPOIN and number of points listed in mesh file. Please check the mesh file for correctness."

For 3 days I have been trying to figure out what could possibly be going wrong but I'm stumped at this point. I have made new scripts after new scripts and learned a lot in the process but I seem to be getting nowhere. I have attached my .geo file in a text format for anyone who is willing to help me to take a look at. The common errors from what I have seen is not specifying volumes or surfaces correctly but I am 95% sure I have. Another common error is when hitting "Save all elements" on the export. I have avoided that. Even if I do "Save all elements" and error generates. The mesh generates in GMSH how I would want it to but SU2 refuses to accept it. The mesh file is too large to attach in here according to CFD Online. Again, I would greatly appreciate the help and the learning experience from this. Any thought out explanation would greatly help me learn more.

Thank you.

leonid-as January 20, 2021 08:43

1 Attachment(s)
hi, I uploaded your grid, I got this picture.
Best regads

djpicho January 20, 2021 09:59

Hi,
Unfortunately when I try to upload the CAD file on here if gives me errors. Essentially a wing is supposed to stick out the center of that in the stream. GMSH doesn't mesh the geometry properly and SU2 gives out the error I am talking about when trying to run a simulation.

Thanks.

bigfootedrockmidget January 26, 2021 12:49

This is usually because additional supporting points are saved that were used for e.g. defining circles.

The solution is to put the entire mesh surface (2D) or mesh volume (3D) into a physical group and then when saving you have to unselect the 'save all elements' option.

here is a piece of python code that you can use to check if you have unused points in your point list. You can copy-paste this into a jupyter labs session.

Code:

filename="bend.su2"
 def getnpoints():
    npoints=0
    with open(filename) as f:
       
        for line in f:
            l=line[0:4]
            if l=="NPOI":
                npoints=line.split()[1]
                print(npoints)
                break
    f.close()
    return (npoints)



# now loop over elements and check which points are used in the mesh
def getunusedpoints():
    numberarray=list(range(0,npoints))
    print("len=",len(numberarray))
    print(numberarray[1:4])
    nelems=0
    with open(filename) as f:
        line = f.readline()
        line = f.readline()
        if line[0:4]=="NELE":
            nelems=int(line.split()[1])
            print("number of elements=",nelems)
           
        counter=0
        for line in f:
            l = line.split()
            for i in range(1,len(l)-1):
                try:
                    numberarray[int(l[i])]=-1
                except:
                    # do nothing
                    numberarray
                   
            if counter==nelems:
                break
            counter=counter+1
   
    unusedpointsarray=[]
    for i in numberarray:
        if i != -1:
            unusedpointsarray.append(i)           
    return(unusedpointsarray)


npoints = int(getnpoints())
print("number of points =",npoints)
 p = getunusedpoints()


djpicho January 26, 2021 13:00

I'll take a look at this and try to solve it. Thank you!

TKatt March 9, 2021 15:12

Hi,
Can you try using the Coherence feature https://gmsh.info/doc/texinfo/gmsh.h...metry-commands ? I dont use the openCascade kernel so i don't know how that interacts


Cheers, Tobi


All times are GMT -4. The time now is 11:21.