CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Inviscid Supersonic Wedge Mesh Adaptation Issue

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2018, 03:47
Post Inviscid Supersonic Wedge Mesh Adaptation Issue
  #1
New Member
 
Alex
Join Date: Jul 2018
Posts: 8
Rep Power: 7
AlexF is on a distinguished road
Hi SU2 community,


I am new to CFD and SU2, so any advice or help is greatly appreciated:

I am trying to use the SUPERSONIC_SHOCK mesh adaptation to capture the shock for a 2D wedge. However, whenever I run “python mesh_adaptation.py –f config_file” I receive the following error after the initial CFD solution is achieved:

Traceback (most recent call last):
File "/home/username/Documents/SU2/SU2-6.1.0/SU2_PY/mesh_adaptation.py", line 116, in <module>
main()
File "/home/username/Documents/SU2/SU2-6.1.0/SU2_PY/mesh_adaptation.py", line 72, in main
options.save_all )
File "/home/username/Documents/SU2/SU2-6.1.0/SU2_PY/mesh_adaptation.py", line 100, in mesh_adaptation
SU2.io.restart2solution(config)
File "/home/username/Documents/SU2/SU2-6.1.0/SU2_PY/SU2/io/tools.py", line 1141, in restart2solution
restarts = expand_zones(restart,config)
File "/home/username/Documents/SU2/SU2-6.1.0/SU2_PY/SU2/io/tools.py", line 1073, in expand_zones
if int(config.NZONES) > 1:
File "/home/username/Documents/SU2/SU2-6.1.0/SU2_PY/SU2/io/config.py", line 131, in __getattr__
raise AttributeError('Config parameter not found')


I have tried looking at the code, but to no avail yet.

The configuration file I used is similar to the inviscid supersonic wedge tutorial's, except the mesh adaptation lines are placed at the very bottom.

Is there a missing parameter from my original configuration file? (I understand that the configuration does not give a good solution, I am just trying to figure out how to use the mesh adaptation feature.)

Also, if instead, I run “SU2_MSH config_file” using the restart file from the original solution, the mesh is changed, but incorrectly. I tried this with a mesh of quadrilaterals and triangles to see if there was any difference, but both randomly divided the cells when doing the adapting. I attached screenshots of the "adapted" and original grids from both cases to show my problem.


Thanks for any help,
Alex
Attached Images
File Type: jpg adapted_quad_grid.jpg (150.6 KB, 34 views)
File Type: jpg original_quad_grid.jpg (145.8 KB, 27 views)
File Type: jpg original_triangle_grid.jpg (174.5 KB, 27 views)
File Type: jpg adapted_triangle_grid.jpg (176.3 KB, 31 views)
Attached Files
File Type: txt config_file.txt (13.7 KB, 20 views)
AlexF is offline   Reply With Quote

Old   October 9, 2018, 21:48
Default Missing Config Variable
  #2
Member
 
Peter Brady
Join Date: Apr 2014
Location: Sydney, NSW, Australia
Posts: 54
Rep Power: 11
pbrady2013 is on a distinguished road
Hi Alex,


In answer to your direct question I think that you are right in that your config file is missing a variable as the stack trace dumps:


Quote:
raise AttributeError('Config parameter not found')

Which is not super helpful - a better error would indicated which config variable you are missing.


When I hit this on SU2 its usually something that I've missed. The bugger is finding it.


In which case I go back to the template case that I based this on. Double and triple check my cfg files and to avoid my serious PEBKAC errors rerun the example/template to make sure I've not messed up my solver environment. I run multiple versions of SU2, OpenFOAM, CFD-ACE with different compilers, mpi, etc so sometimes the local environments get messed up.


Hope that helps,
-pete
pbrady2013 is offline   Reply With Quote

Old   October 10, 2018, 05:57
Default
  #3
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 465
Rep Power: 13
pcg is on a distinguished road
Hi Alex,

Thanks for your interest in SU2.
Can you try adding: NZONES= 1 to your config file. (I have never used the mesh adaptation functionality, but from a quick look at the files mentioned in the call stack that may be the issue).

Cheers,
Pedro
pcg is offline   Reply With Quote

Old   October 10, 2018, 22:34
Default
  #4
New Member
 
Alex
Join Date: Jul 2018
Posts: 8
Rep Power: 7
AlexF is on a distinguished road
Thanks Peter and Pedro,

Adding NZONES= 1 does solve the 'Config parameter not found' error received when running mesh_adaptation.py; however, the resulting adapted grids are still the same incorrect ones as before.

I’m not sure if this is related, but whenever I run KIND_ADAPT= GRAD_FLOW to adapt based on the density gradient (as opposed to using SUPERSONIC_SHOCK), I receive the following output from SU2 along with no adaptation (even though my grid is composed of quads or triangles):
--------------------- Start numerical grid adaptation -------------------
WARNING: Tried to find 4455 cells suitable for adaptation, but only found 0
The following cell types are currently adaptable:
+ triangles
+ quadrilaterals
+ tetrahedrons
Your grid may have too high a percentage of other types.
Number of elements to adapt: 0

Thanks again for any additional help,
Alex
AlexF is offline   Reply With Quote

Old   October 11, 2018, 04:52
Default
  #5
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 465
Rep Power: 13
pcg is on a distinguished road
Hi Alex,

From the code it looks like that may happen if no cells fit the criteria for adaptation.
I recommend that you open an issue: https://github.com/su2code/SU2/issues
Hopefully someone who works with mesh adaptation will see it, be sure to attach your files so that whoever picks up the issue can reproduce your results.

Thanks,
Pedro
pcg is offline   Reply With Quote

Old   November 23, 2018, 20:16
Default
  #6
New Member
 
Alex
Join Date: Jul 2018
Posts: 8
Rep Power: 7
AlexF is on a distinguished road
For anyone who is running into this problem,


Referencing:
https://github.com/su2code/SU2/issues/606

The mesh adaptation code is only compatible with ASCII files in the current release of SU2.

Just as clarkpede commented, the adaptation will work for KIND_ADAPT= GRAD_FLOW if you specify the following in the configuration file:

% Write binary restart files (YES, NO)
WRT_BINARY_RESTART= NO
%
% Read binary restart files (YES, NO)
READ_BINARY_RESTART= NO


Best,
Alex
AlexF is offline   Reply With Quote

Old   June 21, 2019, 12:46
Default Mesh Adaptation error with GRAD_FLOW
  #7
New Member
 
Mons
Join Date: May 2019
Posts: 21
Rep Power: 6
monika_1387 is on a distinguished road
I used the same GRAD_FLOW with below ASCII file chnages to NO in .cfg file.. Still getting the error as below. Can you please help how you resolved it?

WARNING: Tried to find 14980 cells suitable for adaptation, but only found 0
The following cell types are currently adaptable:
+ triangles
+ quadrilaterals
+ tetrahedrons
Your grid may have too high a percentage of other types.
Number of elements to adapt: 0



Also, I am trying WAKE earlier but it was not at all working, did you tried WAKE or others type for this mesh adaptation?







Quote:
Originally Posted by AlexF View Post
For anyone who is running into this problem,


Referencing:
https://github.com/su2code/SU2/issues/606

The mesh adaptation code is only compatible with ASCII files in the current release of SU2.

Just as clarkpede commented, the adaptation will work for KIND_ADAPT= GRAD_FLOW if you specify the following in the configuration file:

% Write binary restart files (YES, NO)
WRT_BINARY_RESTART= NO
%
% Read binary restart files (YES, NO)
READ_BINARY_RESTART= NO


Best,
Alex
monika_1387 is offline   Reply With Quote

Old   June 21, 2019, 20:10
Default
  #8
New Member
 
Alex
Join Date: Jul 2018
Posts: 8
Rep Power: 7
AlexF is on a distinguished road
Hi Monika,

As I stated on the GitHub issue page, I have not used the mesh adaptation tools since December. Also, the only adaptation option I used was GRAD_FLOW.

I went back and re-downloaded the example .cfg and grid files I posted on the GitHub: 'Config_file_and_mesh.zip'. These are just the files from the supersonic wedge tutorial with the added configuration parameters for the adaption. After changing KIND_ADAPT to GRAD_FLOW and adding

% Write binary restart files (YES, NO)
WRT_BINARY_RESTART= NO
%
% Read binary restart files (YES, NO)
READ_BINARY_RESTART= NO

as clarkpede stated, it still produced appropriate results. I attached an image of the grid I obtain after a single adaptation cycle along
with an image of the original grid.

I am using v6.1.0.

I reattached the .cfg file with the changes stated above. Maybe this will point something out you may have missed.

Hope this helps,
Alex
Attached Images
File Type: jpg original_grid.jpg (119.1 KB, 38 views)
File Type: jpg adapted_grid.jpg (122.1 KB, 43 views)
Attached Files
File Type: zip inv_wedge_HLLC_cfg.zip (3.4 KB, 19 views)
AlexF is offline   Reply With Quote

Old   April 21, 2020, 12:31
Default
  #9
Member
 
Giovanni Medici
Join Date: Mar 2014
Posts: 45
Rep Power: 12
giovanni.medici is on a distinguished road
I'm trying to follow your instruction to adapt a mesh (supersonic inv_wedge), with Su2 7.0.2, unfortunately when I run SU2_MSH, an error follows

Code:
--------------------- Start numerical grid adaptation -------------------
WARNING: Tried to find 6873 cells suitable for adaptation, but only found 0
The following cell types are currently adaptable: 
+ triangles
+ quadrilaterals
+ tetrahedrons
Your grid may have too high a percentage of other types.
Number of elements to adapt: 0
Is mesh adaption still a feature, or is it limited only to some branches?

Is there any alternative which is supported in the latest releases?

Googling around I found a very interesting post on gitHub https://github.com/su2code/SU2/issues/606. Unfortunately my understanding is that the very promising Inria pyAMG relies on a former version of SU2, and so is branched from current release.

Am I wrong?
giovanni.medici is offline   Reply With Quote

Old   April 28, 2020, 14:36
Default
  #10
Member
 
Giovanni Medici
Join Date: Mar 2014
Posts: 45
Rep Power: 12
giovanni.medici is on a distinguished road
I may (partially) answer to at least some of the questions that I wrote on last post.

I've been iterating on a post on the SU2 git, and was pointed by Brian Munguía to a live and updated branch ( feature_adap ) of SU2 7.0.x which incorporates updated pyAMG libraries.

I managed to go through the mesh adaption process.

A remark which is worth highlighting here, is that the compilation of the branch (in particular of the pyAMG) relies on Python >= 3.7.
giovanni.medici is offline   Reply With Quote

Reply

Tags
mesh adaptation, supersonic, wedge

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
[snappyHexMesh] extrudeMesh + snappyHexMesh 2d wedge mesh Tobi OpenFOAM Meshing & Mesh Conversion 42 January 15, 2019 18:04
Inviscid Supersonic Wedge Treash SU2 0 June 1, 2017 10:06
Wedge water impact DFBI Overset mesh jcamilleri STAR-CCM+ 1 March 31, 2014 12:58
mesh adaptation for hexa mesh Pete CFX 4 April 6, 2005 18:43


All times are GMT -4. The time now is 14:08.