Floating point error compressible 2D diamond airfoil

Hi Barry,

hm okay very strange :thinking: Seems like I have to start a little research myself on how to overcome possible obstacles in those kinds of simulation.

Cheers!

Jousef

Hi Jousef!

Do let me know if you have any solutions. Still scratching my head over here :disappointed_relieved:

Cheers.

Regards,
Barry

Hi everyone,

Just a quick update. So basically my approach has been really wrong the whole time. The idea was there but the initial guess on what is wrong was well… wrong to say the least. Initially I guessed the numerics were incorrectly set and not enough consideration was given to adjusting the errors within the simulation of the aerofoil. After this was exhausted with the introduction of the automatic relaxation factors, my next guess was the “3D” nature of the 2D simulation. I’m unable to effectively create a true 2D simulation but I figured cutting into a 3D diamond aerofoil like most other 2D via “3D” simulations have done would be alright. I guessed again that it was this that was the issue, turns out it wasn’t.

The core issue after many months of on and off on the project (if you notice the date) was a simple issue with the solver chosen. Dylan has stated in this post why the solver I used (rhoPimpleFoam) was unable to resolve the strong shocks I was looking to re-create in order to verify with the theta beta mach shock graph. In short, rhoPimpleFoam was missing a transonic formulation and instead the laminar transient density based solver (rhoCentralFoam) only can be used. The results produced are now much more workable and it is free of the inherit problems that this thread initially encountered. I’ve went ahead and simulated and here is a screenshot of the initial results.

The strong shocks have shown up and are somewhat behaving as expected. The current shock wave angle here is 48 degrees while the theta beta mach shock graph states that for this speed (Mach 2 or 612.54 m/s) the shock angle should be 45 degrees. The simulation has not truly converged and a simple increase in end time should allow it to reach the correct shock angle.

I will continue to work on this and ideally run several different angles of the diamond aerofoil to validate the shock angle produced once I’ve obtained the correct setup for this particular case.

Thanks everyone for all the help previously and currently.

Cheers.

Regards,
Barry

EDIT: I have made a calculation error in the input values. As mentioned earlier, I deduced the inlet velocity for Mach 2 as 612.54 m/s. That is incorrect. The actual value should be 686.12 m/s. Regardless, that incorrect input value (Mach 1.785) should have produced a shock angle of approximately 52-54 degrees which from the figure I posted, is clearly not the case and at best 7% off and at worse 11%. While relatively speaking this may be acceptable to some degree, but there has been simulations where the the margin of error is less than 1%. I am continuing to work on the issue and am making some progress. Will update as accordingly.

4 Likes

Awesome!! These findings are actually timely for us thanks. I’ll pass the simulation on.

Would refining those shock waves change the results? I can produce a 2D mesh from 3D if you need it to make a super refined 2D mesh.

Best,
Darren.

Hey Darren,

Good coincidence then!

Will need to do a mesh independence study. Still trying to get it a little more refined.

You can? How so? I certainly want to try that out!

Cheers.

Regards,
Barry

EDIT: Hey Darren, not sure about the best way to measure the shock front is. Maybe you could download the results and measure the shock front on your end and compare it with mine? So far I’m getting around 48 deg but if I measure it slightly differently, I can get 45 deg reasonably. Also, will be testing out other schemes, don’t think that will make such a large difference however. Looking forward to your 2D geom so I can start meshing or simulating it. Here is the project link again for your reference.

Hi @Get_Barried, cool, if you produce a mesh with refinements in the areas of the shock waves I can then extrude a side of the mesh to get an actual 2D mesh. Once you have made the mesh, I will download it, extrude it, then give you the settings so you can reproduce for further meshes. P.S. it doesn’t matter if the mesh is huge, as it won’t be once I have extruded it.

And sure I will give it a go.

Best,
Darren

Edit: I get around 48 too (47.86 deg)

Hey Darren,

Apologies for the long reply. Been pretty busy at work and over the weekend was occupied as well.

I decided that performing a MIS would not be smart initially as I’m not sure how the mesh would react for 2D vs 3D and there is no guarantee that the meshes would behave similarly (even if it is close to 2D).

I did get a new mesh up that is relatively fine, hopefully not too fine, and it is under “Shock refined 3”.

Looking forward to the 2D mesh! Let me know if you have any issues.

Cheers.

Regards,
Barry

Hi Barry, Firstly here is the file where the magic happens, in there is extrudeMeshDict which can be edited in the future to extrude other meshes:

Secondly, I created a video on how to do this so you can hopefully do it at your leisure:

And finally here is a project which I uploaded the 2D mesh:

Also, I recommend improving the quality of the extruded face:

As you can see this will likely skew results, I find that this is usually improved if the bounding box slightly intersects the geometry it is meshing so that the face to extrude would belong to the bounding box, not the geometry.

Any questions feel free to ask :slight_smile:

Best,
Darren

2 Likes

Hey Darren,

Awesome stuff! Maybe you should consider doing ASMR :rofl:!

I’ll get to working on it throughout the week. Can the 2D mesh be uploaded and simulated here? I suppose it could. Never really seen a 2D public project before or not that i remember.

EDIT: Ah I see how it works, ignore the above line :stuck_out_tongue: I’ll do some refinements and perform your 3D to 2D!

Cheers buddy and thanks again for the awesome work.

Regards,
Barry

Is it bad I had to google that? :smiley:

Yes just zip up the constant folder and upload it here as an OpenFOAM mesh.

Good luck!
Darren

1 Like

Hey Darren,

I did as you propose and the issue still seems to persist. Seems like maybe the quality controls are deleting the layers at the tip off. Any ideas on how to rectify this?

Cheers.

Regards,
Barry

Hi @Get_Barried, this might be a simple case of reducing the minimum angle between patches for layers to under 20 degrees. if this doesn’t solve then maybe @DaleKramer can help, he was onto something when he was looking at maintaining layers at the TE of his wing. It’s worth a read.

Best,
Darren

Hey Darren,

Your suggestion initially didn’t resolve the issue but it makes perfect sense due to how sharp the edge is. So I’ve continued to implement it as I finally found out what was causing the layering issue below.

This is the result!

Looks pretty good now. What do you think? Might need some more tuning to keep the layers evenly apart and maintain grid quality at the edge, but otherwise much better than the previous iteration.

So the change I made (after much guessing and reading) was to increase the “Max internal face skewness angle [°]”. Not only do the layers appear well now, it further confirms my initial guess that the quality controls are deleting the layers off at this area.

However, the minor catch is that now checkMesh does not deem the mesh as OK even with 0 illegal cells. So some further optimizing of the values for the “Max internal face skewness angle [°]” and maybe the “Max boundary face skewness angle [°]” will be needed along with maybe the layer controls, depending on geometry of course.

Ideally we get something like this in the below figure (in a hex mesh ofc) where the layers “lie on a straight horizontal line” rather than looking like they are converging to a single point like in the above figure.

I’ll go ahead and proceed with the 2D mesh generation now while I continue to optimize the layers. Will keep you posted.

Cheers.

Regards,
Barry

EDIT:

Hey Darren, I’m a little confused about 3D to 2D generation. I’ve downloaded your file posted and attempted to follow the steps in the video but I don’t seem to be able to find the extrudeMeshDict in the folder as you can see below. I’m pretty sure I missed something, so could you enlighten me on what to do?

Your download file

polyMesh
image

Trisurface
image

I’ve also downloaded the refined mesh in this post, the files are as such.

image

image

polyMesh
image

No issues till the part where I had to edit the extrudeMeshDict.

Sorry Barry, I have update the link to include the other files, there should be a system.zip folder, unpack and put that next to constant folder and within system there is the extrudeMeshDict.

Sorry for the late reply.

Best,
Darren

1 Like

Hi everyone,

So just an update on this project. Yes I am still working on it and no it has not been very cooperative :stuck_out_tongue:.

Some small good news, finally got OpenFOAM properly installed (dual boot) in Ubuntu and runs perfectly fine. This has allowed me to generate the much needed 2D meshes. Very special thanks to @1318980 for all his brilliant help and insight. Cheers Darren.

Now for the next set of problems. But first, a screenshot.

Run 7

As you can see, some optimization has been done. I’ve cut the mesh in half basically with a symmetrical BC at the bottom. The diamond is still no-slip and the mach no has been recalculated correctly (I hope, more on this later). For a speed of Mach 2, the theta beta shock graph predicts a shock angle of around 45 degrees.

Well, this is clearly not the case. Why? I’m not sure myself. Which leads to a speculation that again I may have miscalculated the inlet flow speed due to my unfamiliarity of sorta how to based on the material stated. For reference here is the material data (air).

My inlet flow speed of 682.6 m/s is assuming a R = 287, T = 293 K, Gamma of 1.4. The simulation is density based although I’m not sure if I’m controlling the air properties correctly, hence the immense road block.

Till then I will continue cracking on. If anyone wants to chip in and give some ideas, that would be most welcome. If more information is required, do let me know and I will be sure to provide.

Cheers everyone.

Regards,
Barry

1 Like

Think you’re ok on the inlet velocity.

Not sure the cause of the differing results tho. Is this the same setup as your other run all bar the symmetry? Because that was closer.

Best,
Darren

1 Like

Hey @DarrenLynch,

Hmm I agree. Did some testing by increasing the inlet velocity to 900 m/s, same inaccurate behavior. Probably the inlet speed is correct. Something else is causing this problem.

Went to check it and it is slightly different. The obvious change is the last closer run was a 3D simulation (sorta). There are some differences, I remember testing them out but forgot the outcome other than that it was not very successful for whatever reason. I’ll list down the differences below.

Semi-successful run

  • Initial conditions - Pressure 101325 Pa
  • Inlet - Velocity inlet Fixed Value Mach 1.785 (612.54 m/s) | Temp Fixed Value 293 K.
  • Outlet - Pressure Outlet Fixed Value 101325
  • Top and bottom - Sym
  • Foil - Slip Wall | Temp Fixed Value 293 K

Unsuccessful 2D run

  • Initial conditions - Pressure 101325 Pa
  • Inlet - Custom | Velocity inlet Fixed Value Mach 2 (686. m/s) | Pressure Fixed Value 101325 | Temp Fixed Valkue 293 K
  • Outlet - Custom | Velocity Zero Grad | Pressure Zero Grad | Temp Zero Grad
  • Top - Custom | Velocity Zero Grad | Pressure Zero Grad | Temp Zero Grad
  • Bottom - Sym
  • Foil - Slip Wall | Temp Zero Grad

So I’ll address the changes. I didn’t want to force the solution out, so I did change the outlet to zero grad for all in order to do that. Inlet I felt needed to be more defined so I input a fixed value for pressure as well. I did not want the shockwaves to reverb within the bounding domain and affect the sim hence the top of the domain is also zero grad.

Other than this, the other major change is that the new run is a 2D sim and it is also cut in half to reduce the mesh size.

I’ve simulated with the full 2D mesh that is not a sym and same result. Courant number is kept below 1 and another run with max Co at 0.1 also produces the same wrong result.

Darren, I think I will retry the sim with the exact same parameters as the closer run (as same as I can make it) and see how it goes. Update here when its ready.

Cheers mate.

Regards,
Barry

EDIT: The sim following the somewhat closer results setup is done, but the results are similar in that the shock is not attached. In addition, the backflow dosen’t seem to be cooperating very well. It will need some tuning. Reference screenshot below.

Here is a closeup of the detached shock with and without mesh elements.

Side note, the prandtl meyer expansion fans can be seen though which is pretty neat. If only the results were correct :persevere:

2 Likes

@Get_Barried, I am thinking, for supersonic conditions (I was adding to subsonic) the radius I advised on the sharp edge might be too blame, walls are a slip, we don’t need layers, if layers are not needed we don’t need to soften the blow by adding radius and thus their removal should have no negative effects?

Worryingly though I couldn’t see any radius on the symmetric setup? So the problem would still persist?

Best,
Darren

Hey Darren,

That could be true. However, I figured that the radius would be small enough. Then again, the layers do kind of “amplify” the curvature of the tip of the foil so I think you’re on to something.

Yes that was what I was thinking as well. The symmetric setup should effectively remove that radius. I think what I will do now is to keep the sharp edges, maybe make a single layer and see how it goes. Back to Ubuntu!

Will keep you posted.

Cheers.

Regards,
Barry

EDIT: No luck it seems. Below is the screenshot of the results.

Hmm. Back to more digging work :thinking:

2 Likes

Hi everyone,

Back to revive this project yet again. The good news is that the fundamental problem has been fixed. In short the issues were two fold:

  • Air properties were incorrectly defined
  • Amateur mistake of incorrectly calculating the wedge angle

So with that good news, I am in the process of preparing a full report. However, as usual, I have encountered a likely minor problem. In normalizing the air to allow 1m/s to be equivalent to Mach 1, there is a thermodynamic property that was recommended to me in that the Specific Heat is 2.5 J/(kg.K). Now for the life of me, to this day, I have no idea how this value is deduced and searching around yielded no conclusive results. So simply speaking, any insight on this calculation would be highly highly appreciated.

image

Cheers everyone.

Regards,
Barry

2 Likes