Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
59d8ac2
small fix for the 1x2 agglomerations for implicit line agglomeration
bigfooted Sep 25, 2026
17badc0
linear prolongation
bigfooted Sep 25, 2026
453befc
fix FMG turbulence
bigfooted Sep 25, 2026
05511b3
codi error
bigfooted Sep 26, 2026
d9e044d
codi error
bigfooted Sep 26, 2026
9f1885b
tests with adaptive cfl, and fix to viscous flux for multigrid
bigfooted Sep 27, 2026
76271d1
improve some agglomeration for rae2822
bigfooted Sep 27, 2026
2247399
wall ends are first order
bigfooted Oct 2, 2026
845ec6e
small fix to adaptive CFL and mpi treatment
bigfooted Oct 4, 2026
e2e83b6
precommit
bigfooted Oct 4, 2026
537b3c7
Merge branch 'develop' into feature_mg_linear_prolong
bigfooted Oct 4, 2026
2f53349
huge update
bigfooted Oct 12, 2026
c6d8d78
Make agglomeration multigrid robust on 3D stretched grids with wall ends
bigfooted Oct 12, 2026
cbd0486
Take the coarse multigrid viscous flux from the edge difference only
bigfooted Oct 12, 2026
c9d3a76
Bound the adaptive CFL below the level where the residuals flip-flop
bigfooted Oct 13, 2026
13a0539
Potential fix for pull request finding 'CodeQL / Poorly documented la…
bigfooted Oct 14, 2026
77fb320
Merge branch 'feature_mg_linear_prolong' of https://github.com/su2cod…
bigfooted Oct 15, 2026
947e88e
update
bigfooted Oct 15, 2026
e23ca03
Merge branch 'develop' into feature_mg_linear_prolong
bigfooted Oct 15, 2026
998e11a
update linear prolongation
bigfooted Oct 16, 2026
a66ff51
less linear iterations for coarser grids
bigfooted Oct 17, 2026
3ddbe35
modify adaptive CFL stalling behavior
bigfooted Oct 17, 2026
33ba725
linear prolongation of the solution at full multigrid promotion
bigfooted Oct 17, 2026
b302b3b
keep the wall condition of the turbulence variables at full multigrid…
bigfooted Oct 17, 2026
03df519
report the correction norm before smoothing, no correction smoothing …
bigfooted Oct 18, 2026
9f17b9b
inverse-distance-squared weights in the prolongation gradient fit
bigfooted Oct 18, 2026
74ca133
Merge branch 'develop' into feature_mg_linear_prolong
bigfooted Oct 22, 2026
b4aeeb1
pre-commit
bigfooted Oct 23, 2026
a96ed95
fix parmetis
bigfooted Oct 30, 2026
1576492
single CFL probe at residual plateaus instead of the cut ratchet
bigfooted Nov 7, 2026
865e2ab
reuse the coarse residual of the forcing term as the first coarse pre…
bigfooted Nov 7, 2026
32142a2
cap coarse-level linear iterations at 3, add TURB_SUBITER, fix coarse…
bigfooted Nov 14, 2026
fbdd06b
default MG_CFL_SCALING 0.5, update multigrid regression references
bigfooted Nov 15, 2026
02243ca
Merge branch 'develop' into feature_mg_linear_prolong
bigfooted Nov 16, 2026
83152ea
Fix the open CodeQL findings
bigfooted Nov 16, 2026
5dc4e68
Clean up options, diagnostics and portability
bigfooted Nov 16, 2026
a0cb51c
Move the point-to-point synchronized ILU level sweeps to their own br…
bigfooted Nov 16, 2026
a40a82e
Compute the flow gradient on the active level of the full-multigrid s…
bigfooted Nov 16, 2026
0bf8a1c
Grow the wall-end correction fade across partition interfaces
bigfooted Nov 16, 2026
05a5901
Keep anisotropic lines on one rank within the ParMETIS load tolerance
bigfooted Nov 16, 2026
70b2427
Use the effective distance in the scalar compressible viscous Jacobians
bigfooted Nov 16, 2026
977fd74
Add regression cases for the new multigrid options
bigfooted Nov 16, 2026
faf1536
Restore the linear-solver CFL adaptation and run the active startup l…
bigfooted Nov 17, 2026
b30c9c1
Merge branch 'develop' into feature_mg_linear_prolong
bigfooted Dec 5, 2026
410ebd2
Fix the AD build, bound the ParMETIS anisotropy weights, drop per-ran…
bigfooted Dec 5, 2026
d23ce72
Fix the discrete adjoint with OpenMP and multigrid
bigfooted Dec 5, 2026
57b1dc3
Update regression references for the multigrid changes
bigfooted Dec 5, 2026
1b95e76
Fix the coarse linear-solver cap, wall-end flags and incompressible c…
bigfooted Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ class CConfig {
MUSCL_Heat, /*!< \brief MUSCL scheme for the (fvm) heat equation.*/
MUSCL_AdjFlow, /*!< \brief MUSCL scheme for the adj flow equations.*/
MUSCL_AdjTurb, /*!< \brief MUSCL scheme for the adj turbulence equations.*/
MUSCL_Species; /*!< \brief MUSCL scheme for the species equations.*/
MUSCL_Species, /*!< \brief MUSCL scheme for the species equations.*/
MUSCL_FirstOrderWallEnds; /*!< \brief First-order reconstruction at no-slip wall ends and sharp wall edges.*/
su2double MUSCL_Kappa, /*!< \brief Blending coefficient for U-MUSCL scheme (for the runtime eq. system). */
MUSCL_Kappa_Flow, /*!< \brief Blending coefficient for U-MUSCL scheme for the flow equations.*/
MUSCL_Kappa_Turb, /*!< \brief Blending coefficient for U-MUSCL scheme for the turbulence equations.*/
Expand Down Expand Up @@ -1118,6 +1119,7 @@ class CConfig {
su2double ParMETIS_tolerance; /*!< \brief Load balancing tolerance for ParMETIS. */
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
bool ParMETIS_anisotropyWgt; /*!< \brief Weight graph edges by cell anisotropy and keep anisotropic lines on one rank. */
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
bool DiscreteAdjoint, /*!< \brief AD-based discrete adjoint mode. */
DiscreteAdjointDebug; /*!< \brief Discrete adjoint debug mode using tags. */
Expand Down Expand Up @@ -1149,6 +1151,7 @@ class CConfig {
bool RelFrame_SlidingPlane; /*!< \brief option for relative frame slidingplane */
bool RampMotionFrame; /*!< \brief option for ramping up or down the motion Frame values */
bool RampOutlet; /*!< \brief option for ramping up or down the outlet values */
unsigned short Turb_SubIter; /*!< \brief Turbulence iterations per flow iteration. */
bool RampMUSCL;
bool RampRotatingFrame; /*!< \brief option for ramping up or down the motion Frame values */
bool RampTranslationFrame; /*!< \brief option for ramping up or down the outlet values */
Expand Down Expand Up @@ -1178,6 +1181,8 @@ class CConfig {
unsigned short *MG_PreSmooth_p{nullptr}, *MG_PostSmooth_p{nullptr}, *MG_CorrecSmooth_p{nullptr};
unsigned short nMG_CflScaling_p{0};
su2double *MG_CflScaling_p{nullptr};
unsigned short nMG_LinSolIter_p{0};
unsigned short *MG_LinSolIter_p{nullptr};

ENUM_STREAMWISE_PERIODIC Kind_Streamwise_Periodic; /*!< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */
bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or otherwise outlet source term. */
Expand Down Expand Up @@ -3907,6 +3912,14 @@ class CConfig {
*/
const CMGOptions& GetMGOptions() const { return MGOptions; }

/*!
* \brief Linear solver iterations on a multigrid level. The finest active level, also during the
* full-multigrid startup, uses LINEAR_SOLVER_ITER.
*/
unsigned long GetMG_LinSolIter(unsigned short iMesh) const {
return (iMesh <= FinestMesh) ? Linear_Solver_Iter : MGOptions.MG_LinSolIter[iMesh];
}

/*!
* \brief plane of the FFD (I axis) that should be fixed.
* \param[in] val_index - Index of the arrray with all the planes in the I direction that should be fixed.
Expand Down Expand Up @@ -4867,6 +4880,11 @@ class CConfig {
/*! \brief Whether the heat equation reconstructs. */
bool GetMUSCL_Heat(void) const { return MUSCL_Heat; }

/*!
* \brief Get if edges at no-slip wall ends and sharp wall edges are reconstructed to first order.
*/
bool GetMUSCL_FirstOrderWallEnds(void) const { return MUSCL_FirstOrderWallEnds; }

/*!
* \brief Get if the upwind scheme used MUSCL or not.
* \return MUSCL scheme.
Expand Down Expand Up @@ -7450,6 +7468,11 @@ class CConfig {
*/
su2double GetCFLRedCoeff_Turb(void) const { return CFLRedCoeff_Turb; }

/*!
* \brief Get the number of turbulence iterations per flow iteration.
*/
unsigned short GetTurb_SubIter(void) const { return Turb_SubIter; }

/*!
* \brief Value of the CFL reduction in species problems.
* \return Value of the CFL reduction in species problems.
Expand Down Expand Up @@ -10310,6 +10333,11 @@ class CConfig {
*/
long GetParMETIS_EdgeWeight() const { return ParMETIS_edgeWgt; }

/*!
* \brief Whether ParMETIS weights graph edges by cell anisotropy and partitions with coordinates.
*/
bool GetParMETIS_AnisotropyWeight() const { return ParMETIS_anisotropyWgt; }

/*!
* \brief Find the marker index (if any) that is part of a given interface pair.
* \param[in] iInterface - Number of the interface pair being tested, starting at 0.
Expand Down
3 changes: 2 additions & 1 deletion Common/include/geometry/CMultiGridGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class CMultiGridGeometry final : public CGeometry {
vector<std::array<su2double, MAXNDIM>> normal; /*!< \brief Unit normal there, pointing into the domain. */
vector<su2double> strength; /*!< \brief Local anisotropy, the ordering key. */
vector<char> tier; /*!< \brief Paving order: 0 viscous wall, 1 Euler
wall, 2 anything else. */
wall, 2 anything else; one more once the
mixed nodes are put first. */
unsigned long nRefusedCurvature = 0; /*!< \brief Euler wall nodes the curvature limit kept out. */
};

Expand Down
40 changes: 40 additions & 0 deletions Common/include/geometry/CPhysicalGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,46 @@ class CPhysicalGeometry final : public CGeometry {
*/
void PrepareAdjacency(const CConfig* config);

#if defined(HAVE_MPI) && defined(HAVE_PARMETIS)
/*!
* \brief ParMETIS edge weights that make cutting across the short edges of anisotropic cells expensive.
* \param[in] maxWeight - Cap on the weight of any edge.
* \return One weight per entry of the adjacency array.
*/
vector<idx_t> ComputeAnisotropyEdgeWeights(long maxWeight) const;

/*!
* \brief Reads, for any global points of the linear partition, a value each rank holds for its own points.
* \param[in] wanted - Global indices to read.
* \param[in] localValue - Value of every local point.
* \return The value of each wanted point.
*/
vector<unsigned long> FetchFromOwners(const vector<unsigned long>& wanted,
const vector<unsigned long>& localValue) const;

/*!
* \brief Joins points into lines along the strong anisotropic edges and names each line by its lowest global index.
* \param[in] adjwgt - Anisotropy weight of every entry of the adjacency array.
* \param[out] lineEdge - Whether each entry of the adjacency array is a line edge.
* \return Global index of the root of the line of every local point, the point itself when it is on no line.
*/
vector<unsigned long> LinkAnisotropicLines(const vector<idx_t>& adjwgt, vector<char>& lineEdge) const;

/*!
* \brief Moves each split line to the partition that holds most of its points and stays within the load tolerance.
* \param[in] root - Line roots from LinkAnisotropicLines.
* \param[in] vwgt - Vertex weight of every local point.
* \param[in] maxImbalance - Largest partition load over the mean load.
* \param[in,out] part - Partition of every local point.
* \param[out] longestLine - Number of points of the longest line.
* \param[out] nSplit - Number of lines left split.
* \return Number of points that changed partition, summed over all ranks.
*/
unsigned long KeepLinesTogether(const vector<unsigned long>& root, const vector<idx_t>& vwgt,
passivedouble maxImbalance, vector<idx_t>& part, unsigned long& longestLine,
unsigned long& nSplit) const;
#endif

/*!
* \brief Find repeated nodes between two elements to identify the common face.
* \param[in] first_elem - Identification of the first element.
Expand Down
3 changes: 2 additions & 1 deletion Common/include/linear_algebra/CSysSolve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ class CSysSolve {
* \param[in,out] LinSysSol - Linear system solution
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
* \param[in] maxIter - Iteration cap replacing LINEAR_SOLVER_ITER in standard mode, 0 keeps the config value.
*/
unsigned long Solve(MatrixType& Jacobian, const CSysVector<su2double>& LinSysRes, CSysVector<su2double>& LinSysSol,
CGeometry* geometry, const CConfig* config);
CGeometry* geometry, const CConfig* config, unsigned long maxIter = 0);

/*!
* \brief Solve the adjoint linear system using a Krylov subspace method
Expand Down
6 changes: 6 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const unsigned int MAX_NUMBER_FFD = 15; /*!< \brief Maximum number of FFDB
enum: unsigned int{MAX_SOLS = 14}; /*!< \brief Maximum number of solutions at the same time (dimension of solution container array). */
const unsigned int MAX_TERMS = 7; /*!< \brief Maximum number of terms in the numerical equations (dimension of solver container array). */
const unsigned int MAX_ZONES = 3; /*!< \brief Maximum number of zones. */
const unsigned short MAX_MGLEVELS = 10; /*!< \brief Maximum number of coarse multigrid levels, which bounds the per-level arrays of the multigrid integration. */
const unsigned int MAX_FE_KINDS = 7; /*!< \brief Maximum number of Finite Elements. */
const unsigned int NO_RK_ITER = 0; /*!< \brief No Runge-Kutta iteration. */

Expand Down Expand Up @@ -1243,10 +1244,13 @@ struct CMGOptions {
std::vector<unsigned short> MG_PostSmooth; /*!< \brief Multigrid post-smoothing iterations per level. */
std::vector<unsigned short> MG_CorrecSmooth; /*!< \brief Multigrid Jacobi correction-smoothing per level. */
std::vector<su2double> MG_CflScaling; /*!< \brief Per-level CFL scaling factors relative to the previous (finer) level. Entry [i] scales level i+1 from level i. Size = nMGLevels. */
std::vector<unsigned long> MG_LinSolIter; /*!< \brief Linear solver iteration cap per MG level (entry 0 = finest). */
bool MG_Smooth_EarlyExit{false}; /*!< \brief Enable early exit for MG smoothing iterations. */
bool MG_Smooth_Output{false}; /*!< \brief Output compact per-cycle smoothing summary. */
su2double MG_Smooth_StagnationTol{0.0}; /*!< \brief Stagnation early exit: stop if current_rms >= prev_rms * tol. 0 = disabled. */
bool MG_Implicit_Lines{false}; /*!< \brief Enable implicit-lines agglomeration from walls. */
bool MG_Linear_Prolongation{false}; /*!< \brief Prolong the correction with a limited least-squares
gradient instead of piecewise-constant injection. */
unsigned long MG_Startup_Iter{100}; /*!< \brief Iterations per mesh during FMG startup, and the length of each level's CFL ramp. 0 = no iteration budget. */
su2double MG_Startup_Convergence{-2.0}; /*!< \brief FMG: orders of magnitude (log10) that CONV_FIELD must drop on the
active level before promoting to the next finer one. Negative is a
Expand Down Expand Up @@ -2949,6 +2953,7 @@ enum class MPI_QUANTITIES {
COORDINATES , /*!< \brief Vertex coordinates communication. */
COORDINATES_OLD , /*!< \brief Old vertex coordinates communication. */
MAX_LENGTH , /*!< \brief Maximum length communication. */
WALL_DISTANCE , /*!< \brief Wall distance and roughness of the nearest wall communication. */
GRID_VELOCITY , /*!< \brief Grid velocity communication. */
SOLUTION_EDDY , /*!< \brief Turbulent solution plus eddy viscosity communication. */
STOCH_SOURCE_LANG , /*!< \brief Stochastic source term for Langevin equations communication. */
Expand All @@ -2966,6 +2971,7 @@ enum class MPI_QUANTITIES {
MOM_COEFF , /*!< \brief Momentum coefficient for the Rhie-Chow scheme. */
MOM_CORRECTION , /*!< \brief Momentum correction for the pressure-based poisson solver (used when computing HbyA). */
HBYA_CORRECTION , /*!< \brief HbyA correction for the pressure-based poisson solver. */
FIRST_ORDER_RECONSTRUCTION, /*!< \brief First-order reconstruction flag at wall ends. */
};

/*!
Expand Down
Loading