MarcoFossati / projects-cluster

Collection of projects in computational aerodynamics within ACE/FASTT
4 stars 1 forks source link

Get the python script to remesh for RAE2822 #38

Closed calumy closed 6 years ago

calumy commented 6 years ago
calumy commented 6 years ago

Current error: "IOError: [Errno 2] No such file or directory: 'MachGradient.csv'"

This error comes from this section of code:

gradFields = [] for f, fieldName in enumerate(remeshingInfo.gradientQuantities): gradFields.append([])

firstDataCol = 0
with open(fieldName + 'Gradient.csv', 'rb') as csvfile:
  nodeDataReader = csv.reader(csvfile, delimiter=',')
  row1 = next(nodeDataReader)
  for colCnt, c in enumerate(row1):
    if fieldName + 'Gradient:0' in c:
      firstDataCol = colCnt
      break

with open(fieldName + 'Gradient.csv', 'rb') as csvfile:
  nodeDataReader = csv.reader(csvfile, delimiter=',')
  next(nodeDataReader)
  for row in nodeDataReader:
    gradFields[f].append(mag([float(c) for c in row[firstDataCol:firstDataCol+3]])) # magnitude of the gradient

There is no mention of the 'MachGradients.csv' before this point in the script. At this point, Run0 has been compleated and the following files have been output in the run folder:

As well as the files used to configure and run the simulation.

The 'solution_flow.dat' holds information on

Will look into how to convert this to the correct fromat that can be read by the python script.

calumy commented 6 years ago

'ComputeGradients.py' was run using pvpython to compute 'MachGradient.csv' and 'PressureGradient.csv'.

Both files have been attached as '.xlsx' files as '.csv' files are not supported by GitHub.

It was interesting to note that there was no data for 'MachGradient:2', 'PressureGradient:2' and 'Points:2' on both files. Will investigate further.

MachGradient.xlsx

PressureGradient.xlsx

calumy commented 6 years ago

Noticed that the inputs for RAE2822 do not have any flow fields. This means that the program has not been calculating them.

The 3D case has a flow quantity defined as Mach.

calumy commented 6 years ago

Successfully managed to remesh for one iteration.

Original mesh and remeshed mesh images and files attached. Files are in '.txt' format at '.msh' is not supported.

Origional mesh: image

Remeshed mesh: image

RAE2822_v0.txt RAE2822_v1.txt

calumy commented 6 years ago

Gradients for original mesh are:

Mach Gradients: image

Pressure Gradients: image

It can be seen that the mach and pressure gradients are greatest at the shock that occurs on the upper surface of the aerofoil.

The images below show the mach and pressure for the original run:

Mach Plot: image

Pressure Plot: image

calumy commented 6 years ago

There appears to have been an error when the mach and pressure gradients were calculated for the second run.

Mach Gradients: image

In this image, the blue background should not be visible.

Pressure Gradients: image

Like the mach gradients, the blue background should not be visible.

When the next itteration was run, this caused the error: 'Info : No scalar element found containing point' as gmsh could not find data for each node.

calumy commented 6 years ago

Flow field 'mach' added.

calumy commented 6 years ago

Changed the way that the run folder was created and this has solved the gradients issue above. Before a .su2 file was copied from the base directory for every run. Now the .su2 file that is created for each mesh is copied to each run folder.

Mach Plot: Run 0: image

Run 1: image

Run 2: image

Run 3: image

It can be seen that the position of the shock on the top surface of the aerofoil becomes more defined and the position of where it interacts with the top surface moves towards the back of the aerofoil.

Mesh: Run 0: image

Run 1: image

Run 2: image

Run 3: image

It can be seen that the mesh density increased from run 0 to run 3, specifically around the location of the shock on the top edge.

Mesh Details Run Nodes Elements 0 2006 4012 1 6458 12916 2 6222 12444 3 9575 19514