Repository navigation
Conversation
…ble with initialization
- GG gradient/Hessian calculation on adaptation-specific variable containers - Metric integration and normalization for steady and unsteady flows - Storing of proper primitive variables for Euler solver
|
Is the mesh adaptation code itself open source? |
|
If you mean MMG, it's on Github https://github.com/MmgTools/mmg If you mean the SU2-MMG interface, it's in Alberto's fork https://github.com/xla27/SU2/tree/feat_adap_mmg |
pcarruscag
left a comment
There was a problem hiding this comment.
Excellent. Next question, what do you need from the python wrapper to do all of this outside of the SU2 core?
|
The python script basically just coordinates calls to SU2 and MMG in 2 nested loops, the inner loop being a series of adaptations at a given target mesh size and the outer loop being over a list of sizes. It also handles file conversions since MMG uses libmeshb for both the mesh and metric field. For the file conversion, Alberto has a straight python implementation that I think only handles tris/tets, and I have a separate repo with a C++ implementation/python API that I used for my results that I presented in Varenna https://github.com/bmunguia/limon |
|
Cool, the functionality would be more flexible if the sensor was also configurable via python, what you have here has a list of hardcoded possible variables, in python it would be very easy to target other solvers, create custom mixes of variables etc. |
|
Hi Brian, what's the status? |
|
Hey Nijso, sorry for the delay. I've been a bit swamped lately with a deadline and the holidays so this has been on the backburner, but I'll look at it again this week or next. I know a lot of people have been asking about adaptation on slack so I want to get this in develop ASAP. I still need to implement Pedro's suggestions to use the python wrapper to make the choice of metric sensor more flexible, then I just need to add an example (or maybe a few for different solvers) to test the implementation. |
|
Hi @bmunguia, any update on this? |
…esolving sensor sol/var indices
|
Sorry for the massive delay. I made the implementation a bit more flexible by resolving the indices using it should set them all as sensors and calculate gradients/Hessians for all of them, as well as a Lp-norm normalized metric field for the first entry. I still need to add the python wrapper bit so we can compute metrics of derived quantities like Mach number. This is currently my top priority since I actually need the Mach metric soon for my own work. I'm hoping to get it implemented today or tomorrow. |
|
The overhead of spawning the python wrapper just for a Mach Hessian is too much for my use case, so I implemented a compromise of the Polimi implementation and Pedro's request for a more flexible python wrapper-based implementation using 3 sensor types:
|
|
Hi @bmunguia any updates on this? Can you resolve the conflicts, then we can finalize this implementation. |
- Add METRIC_CUSTOM_SENSOR; unknown METRIC_SENSOR names are now an error - Resolve sensors case-insensitively and store them all on the flow solver in config order - Add SOLVER_FIELD sensors (NU_TILDE, TKE, DISSIPATION, INTERMITTENCY, RE_THETA_T, SPECIES_<i>) copied from their solver's solution - Select solvers by slot instead of by name, and detect NEMO via GetNEMOProblem() - Have Python registry checks sensor lengths and set each sensor in one call
|
Hi @bigfooted it was more or less ready ~6 months ago when I addressed all the comments but I guess it slipped through the cracks. Anyway, I merged yesterday and made some small changes to how custom adaptation sensors are handled. Let me know if there's anything you want cleaned up or handled differently. Once this is finalized, I can work with the Polimi students on updating their SU2-MMG interface. |
Proposed Changes
This PR is part of a joint effort with Alberto Perlini (@xla27) and Andrea Rausa (@rois1995) to implement anisotropic mesh adaptation in SU2. In our SU2 conference talks this year, I presented updates to the metric tensor computation in my fork for unsteady adaptation, and Alberto presented updates to the Python adaptation loop to use the open-source MMG remesher, as well as results for incompressible Euler/NS and NEMO.
Part 1 will focus on my contributions in SU2's post-processing/output to calculate metric tensor fields for feature-based adaptation. Part 2 will focus on the implementation of the adaptation loop in Python, including conversion between SU2 restarts/meshes and the .meshb format.
For the metric tensor field computation, I have implemented:
SetPrimitive_Adapt()to store the chosen adaptation sensorcomputeGradientsGreenGauss.hppwhich calculates the Hessian field for the chosen sensor and stores the lower trianglecomputeMetrics.hppThe following relevant config options have been added:
PR Checklist
pre-commit run --allto format old commits.References