Tushargh29 / transonic_shock_buffet

This repository is dedicated to the studienarbeit project of "Numerical investigation of 2D transonic shock-buffet around a NACA 0012-34 airfoil using OpenFOAM and flowTorch" undertaken by Mr. Tushar Gholap under the guidance of Dr. Andre Weiner.
6 stars 3 forks source link

Mesh improvements #10

Closed AndreWeiner closed 3 years ago

AndreWeiner commented 3 years ago

Hi Tushar,

your next task will be to make the mesh of the base case more suitable for buffet simulations. I suggest the following changes for a start:

Suggestion: initially, be moderate the changes to see how meshing time and memory consumption are affected be the different meshing parameters.

Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

Thank you. Instructions noted. I will get back to you as soon as possible.

Regards, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I have made the necessary changes in the files mentioned by you in the instructions. Do I need to run the simulation based on these changes on Phoenix similar to what I did in the last issue? or shall I show these changes to you and then start running the simulation? I made changes as per my capacity of what I understood taking reference of the OpenFoam documentation.

Also, please confirm where can I observe the computation time required for simulation - log.rhoPimpleFoam file right?

Thank you.

Best regards, Tushar

darshan315 commented 3 years ago

Hi Tushar,

Bests, Darshan.

AndreWeiner commented 3 years ago

Hi Tushar, please, try to perform the meshing on the cluster. If things don't work out initially, check the log files, especially for the apps with changed settings. Start easy and try to make one change at a time. Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

Please have a look on the mesh. I have made some mesh refinement changes based on the given instructions.

I observed yPlus value around 2.69

Rest we can discuss in tomorrow's meeting.

Thank you. ssss

Tushargh29 commented 3 years ago

Hello Sir, I implemented the changes suggested by you in today's meeting. Let me know your feedback. I can see the region refinement boxes in the form of mesh also distance based airfoil region mesh. But I am not sure about wakeBox mesh region as I cannot see it clearly. A1 A2 A3 A4 A5 A6

Nevertheless, suggest me something if needed, if this is okay then I can modify the refinement levels to get close to 1. Currently, with this configuration I am getting yPlus equals to 5.16.

Thank you.

Regards, Tushar

AndreWeiner commented 3 years ago

Hi Tushar, the refinement boxes and the surface distance-based refinement don't seem to have the wanted effect yet. The refinement regions should look somewhat like sketched here: naca_mesh_ref_zones

One important note: the mesh is scaled by a factor of 0.18352 after the meshing. Therefore, you have to define the refinement regions according to the unscaled mesh. The chord length of the unscaled airfoil is exactly one.

Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

I understood and will get back to you with the update soon.

Thanks.

Regards, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

If we are scaling the wakeBox and shockBox by the scaling factor of 0.18352 then we also need to scale the main refinementBox with this value right?

Please let me know.

Thanks

Tushar

AndreWeiner commented 3 years ago

The refinementBox entry is already properly set up. Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

Sure, understood.

Thanks.

Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I tried altering the dimensions of both wakeBox and shockBox and scaling them with the factor 0.18352.

But I noticed that somehow only airfoil section is getting implemented and the in the regionRefinement section the wakeBox and shockBox implementation is skipped so that everytime I am getting the same result in paraview.

I am attaching the screenshot of my geometry section including the dimensions of all the boxes.

Please suggest.

Thank you.

Regards, Tushar Screenshot from 2020-12-02 18-19-04

AndreWeiner commented 3 years ago

Hi Tushar,

Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

Actually the same results I was getting with the type - box, I just thought I should give a try with what they included in the Openfoam documentation. Nevertheless, I will try these instructions, reduce the boxes and see what happens.

I will let you know.

Thanks.

Regards, Tushar

AndreWeiner commented 3 years ago

Hi Tushar, I updated my last comment above. The type might not have been the problem. Try changing the following entries:

// old values
    maxLocalCells 100000;
    maxGlobalCells 2000000;
// suggested new values
    maxLocalCells 2000000;
    maxGlobalCells 8000000;

Be careful not to set the refinement levels to a too high value. If that doesn't work, please send me the log-file of snappy. Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

Sure, I will try this and let you know. Thanks.

Regards, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I simply followed the instruction given by you in the issue taskpoints. I implemented following steps:

  1. I created the workflow only for meshing in which i made changes in the runCase file where I excluded the execution restore0Dir, the second decomposePar, and rhoPimpleFoam.

  2. I changes number of processors from 2 to 4 where I changed the number of subdomains in both the decomposeParDict.

  3. I made changes in the jobscript and change in the runCase command for parallel execution of MPI i.e (-np 4)

  4. Then for the surface and region refinement I made the changes in the _transonic_shock_buffet/testcases/naca0012-34-base/snappyHexMeshDict . a. Increased refinementSurfaces level (7 7). b. Added nSurfaceLayers 8; c. Added airfoil, wakeBox, shockBox in the refinementRegions also included in the geometry section as we discussed. I kept the refinement level 6 for both _wakeBox_and shockBox

That is what I have followed till now. I made changes in the snappyHexmesh file located in the testcase folder. and analyzing the results from post.foam file in the run folder.

Please let me know your feedback.

Thanks.

Regards, Tushar

AndreWeiner commented 3 years ago

Hi Tushar,

Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

  1. I executed the meshing on Phoenix - pushing the changes to remote repo from local repo and git pull in the transonic folder present on Phoenix then submitting the jobscript on Phoenix.

  2. Yes I changed the snappyHexMeshDict located in my machine _testcases folder then after git push and pull commands I checked this dictionary in the cluster folder It was correctly showing the changes done earlier in the local file.

  3. I am changing snappyHexMeshDict in the _testcases folder not in run folder.

  4. I am closing all the command terminals, folders and files before starting the new meshing on cluster.

Let me know your feedback sir.

Thanks.

Regards, Tushar

AndreWeiner commented 3 years ago

Hi Tushar, I'll create a pull request soon (have a look at the changes). I created some refinement boxes to start with, but the mesh still needs some improvements. Here is the workflow I used to check results:

If you have questions, let me know. I'll also post some flow results here soon.

Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

I got the instructions. Could you please elaborate the last instruction about local repo (using scp or rsync), how does it relate to opening the post.foam file in Paraview for post processing?

Rest of the things I understood.

Thanks.

Regards, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

One more thing I noticed that you changed the workflow by uncommenting the execution of restore0Dir, the second decomposePar, and rhoPimpleFoam, does that mean this time I need to run the full simulation not just meshing on the cluster?

Please explain. Thanks.

Regards, Tushar

AndreWeiner commented 3 years ago

Hi Tushar, I uncommented the solver execution to see how the new mesh affects the simulation results. You can uncomment them if you like. Here is an example of how to sync you local data with the cluster. I also attach a picture of the current mesh. mesh_refinement

Best, Andre

AndreWeiner commented 3 years ago

Hi Tushar, I think it makes sense to add another small refinement box in the airfoil's wake: wakebox Best, Andre

Tushargh29 commented 3 years ago

Thanks a lot sir.

Now I got the idea how to deal with sync command.

Now the first thing I will do is uncommenting the solver execution, running only meshing on cluster then follow the sync commands, I should get the same result of mesh what you posted above.

Also I got the idea of adding another small wakeBox. I will implement after this.

I will get back to you soon.

Regards. Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I started making changes in the mesh refinement in order to make wall distance value close to the yPlus = 1. I am making changes in the nSurfaceLayers . Also, I added a small wake box at the trailing edge of the airfoil. I did meshing on cluster and implemented the steps given by you like clearing previous simulation data and sync command.

But when I am opening the post.foam file in Paraview, the airfoil is missing surprisingly and I tried but could not rectify it. Could you please tell me why is this happening?

Thank you.

Regards, Tushar Screenshot from 2020-12-07 15-45-23

AndreWeiner commented 3 years ago

Hi Tushar, whatever you changed, it was not successful. Try to make one small change at a time and ensure that always a correct mesh is created. Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

I made a change in the nSurfaceLayers by trial and error and finally at nSurfaceLayers = 10 I got the wall distance such that it's yPlus value is coming around 1.945

Now I will try to implement small wakeBox in the mesh. I will let you know.

Thanks.

Regards, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I implemented the small wake box behind the trailing edge of the airfoil called as trailingBox. Also, I checked whether or not the wall distance going close to yPlus = 1. I am attaching the screenshot of the meshing including the small wake box. From this meshing configuration we are getting the yPlus approximately 1(something 1.4 or1.6 varying the position of the cell on the surface) keeping nSurfaceLayers = 10.

You please have a look on it, let me know what you think about the dimension of the box. Suggest me changes if needed. Thank you.

Regards, Tushar

Screenshot from 2020-12-08 22-02-56

Tushargh29 commented 3 years ago

Hello Sir,

  1. I have implemented the smallest wake box in the close proximity of trailing edge of an airfoil with the refinement level of 6.

  2. I have performed the simulation for revised Mach number of 0.8 and analyzed the result in Paraview.

  3. I think it has captured the buffet slightly but you please explain me what is happening there exactly in detail.

  4. I am attaching the animation GIF below, please let me know your feedback on it.

  5. Also, give me further instructions to follow. Actually, I am planning to start the simulations on two new cases: Mach_0.82 and Mach_0.84 simultaneously on Phoenix.

  6. The simulation total time was somewhere around 1hour, so less compared to the base case. I think this is because of increased number of processors right? Please correct me if I am wrong.

Thank You.

Best Regards, Tushar Mach_no_0 8_animation

AndreWeiner commented 3 years ago

Hi Tushar, thanks for the data. Some comments:

Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

  1. Yes, I will set that refinement level more than 6 and see what happens.

  2. Yes, unfortunately the simulation is not completed it got terminated.

  3. Yes, I checked the log.rhoPimpleFoam it is showing this error message: Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted. mpirun detected that one or more processes exited with non-zero status, thus causing the job to be terminated. I search why this happened, I got the answer like this: This error message usually occurs because the number of MPI processes you have requested (via the -np argument to mpirun) is not consistent with the number of worker processes required. So should I change/increase the number of -np 16 in the runCase file? Please suggest.

  4. No sign of buffet, okay understood.

  5. Yes, I checked min of yPlus is 1.514 and max of yPlus is somewhere around 8-9 but if we select somewhat horizontal cell appropriately it is too close to 1.

  6. Yes, I will set higher frames in Paraview.

Thank you.

Best regards, Tushar simulatzion_bug

AndreWeiner commented 3 years ago

Hi Tushar, the solver fails after a while, presumably because the mesh quality is not sufficient. Can you send me the case via TU-BS cloud storage? Best, Andre

Tushargh29 commented 3 years ago

Hello Sir, Sure, I have created a separated folder named as my_case_Tushar where I have uploaded the zip file of the entire case in which please find this particular case named as Mach_0.8 in the testCases folder. I hope you were expecting the same from your above instruction.

Is this a major problem? Considering this much efforts in refining mesh still solver does not consider sufficient? Just asking Please let me know what you think. Thank you.

Best regards, Tushar

AndreWeiner commented 3 years ago

Hi Tushar, I cannot open the archive. Neither unzip nor tar are able to open it. How did you create the archive? Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

I think now it should be proper.

Best, Tushar

AndreWeiner commented 3 years ago

Hi Tushar, the instability in the solution very likely originates from the leading edge: temperature_field_nose I am not yet sure what would be the best way to stabilize the solution. However, looking at yPlus, the mesh is still not fine enough at the airfoil surface: yplus_ma0 8 So, as a first step, keep refining the mesh close to the surface. First, I suggest increasing the surface refinement level by one. Maybe this change also stabilizes the solution. Best, Andre

Tushargh29 commented 3 years ago

Hello Sir,

Thanks a lot. Yes, I will try to increase the surface refinement level and see what happens. I will let you know soon.

Best, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I have uploaded the updated case of simulation on the cloud. Please have a look. Thanks.

Tushar

AndreWeiner commented 3 years ago

Hi Tushar, after changing meshing parameters, you should first check if a proper mesh was created and then start the simulation. If you open the current mesh, you see that no surface layers were created. Moreover, most regions were not refined due to the enormous intermediate cell count (more than 9 Mio according to log.snappyHexMesh). airfoil_surface

Here is what I suggest to do:

blocks ( hex (0 1 2 3 4 5 6 7) (140 80 1) simpleGrading (1 1 1) );


- *snappyHexMesh*
  - remove the *precisionBox*
  - set `maxGlobalCells 32000000;`
  - set the surface refinement to `level (6 6);`

Before starting the simulation, check if the layers were created correctly.
Best, Andre
Tushargh29 commented 3 years ago

Hello Sir,

Instructions noted, will get back to you soon. Thanks.

Tushar

AndreWeiner commented 3 years ago

Hi Tushar, I had an idea for improving the mesh quality at the trailing edge. We can use snappyHexMesh's feature refinement. You can implement it with the following steps:

naca0012-34.stl { // How to obtain raw features (extractFromFile || extractFromSurface) extractionMethod extractFromSurface;

// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0  : selects no edges
// - 180: selects all edges
includedAngle       150;

subsetFeatures
{
    // Keep nonManifold edges (edges with >2 connected faces)
    nonManifoldEdges       no;

    // Keep open edges (edges with 1 connected face)
    openEdges       yes;
}

// Write options

// Write features to obj format for postprocessing
writeObj            yes;

}

// ***** //

- add *surfaceFeatureExtract* to *runCase*

... $runSerial ./transformGeometry $case echo "Running surfaceFeatureExtract on " $case $runSerial "surfaceFeatureExtract" $case &> ${case}log.surfaceFeatureExtract echo "Running blockMesh on " $case ...

- add the following entry to the subsection *features* in *snappyHexMeshDict*

features ( { file "naca0012-34.eMesh"; level 7; } );



Following this strategy, you should get an increased refinement around the trailing edge. Therefore, you **won't** need another box for region refinement around the trailing edge. Let me know is the feature refinement improves the mesh quality.

Best, Andre
Tushargh29 commented 3 years ago

Hello Sir,

Firstly, sorry for the late reply. Yes, I will definitely implement this. As per last discussion, I got the sign of surface layers around the airfoil surface, then I implemented the very small wake box at the trailing edge to improve the discontinuity there but unfortunately again I got the same error of terminating the simulation abruptly, so I thought this idea of addition of the small wake box is not working.

But thank you so much for your suggestion so that we can increase refinement at the TE. I will try this and let you know tomorrow.

Thanks.

Regards, Tushar

Tushargh29 commented 3 years ago

Hello Sir,

I implemented the above instructions, added surfaceFeatureExtractDict and made other changes.

I am attaching the refinement screenshot at the TE of airfoil after this implementations. Also I will attach the log files of snappyHexMesh and surfaceFeatureExtractDict in the email. Please have a look on it, suggest me any changes if needed.

Thank you.

Regards, Tushar

surfaceFeatureExtract

AndreWeiner commented 3 years ago

Switched from automatic to structured meshing approach with blockMesh.