Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Nonlinear Iteration Controller for Improved Fluid Solver Robustness & Convergence #790

Merged
merged 82 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
5e79c2a
First implementation of nonlinear controller. Needs cleanup. Not stab…
economon Sep 4, 2019
e9fa062
Merged develop and fixed conflict.
economon Sep 4, 2019
76d22c9
Check point. Still needs more testing.
economon Sep 9, 2019
20ad166
More changes. Still needs testing.
economon Sep 10, 2019
5a274a9
Changed reconstruction gradient. Moved new CFL adaption and removed o…
economon Sep 13, 2019
ccea15a
Preparing for PR.
economon Sep 14, 2019
59c74d7
Merge branch 'develop' into feature_nlctrl
economon Sep 14, 2019
9b3b4a2
Removed unused variable.
economon Sep 14, 2019
071ead0
Added new option for reconstruction gradient. Activated recon. gradie…
economon Sep 26, 2019
3eb5bbd
Coupled CFL adaption to linear solver residual and nonlinear residual…
economon Sep 28, 2019
0271c69
Removed some unused code.
economon Oct 1, 2019
651ab5e
Merge branch 'develop' into feature_nlctrl
economon Oct 1, 2019
bb5d2fc
Merge branch 'develop' into feature_nlctrl
economon Oct 1, 2019
9e5cc2d
Couple of fixes related to the turbulence models.
economon Oct 2, 2019
d41d645
Fixing conflicts. Small bug fixes.
economon Oct 3, 2019
f9951ff
Removed old CFL adaption routine. Sync of the linear solver residual …
economon Oct 4, 2019
2827ea8
Added reporting of min/max delta time and min/max/avg CFL to output. …
economon Oct 8, 2019
6d69ae8
Added new class for marker profile reader and template writer.
economon Oct 13, 2019
f00292d
Adjusting min/max CFL.
economon Oct 13, 2019
81ee004
Merged contiguous cvariable changes and fixed conflicts.
economon Oct 15, 2019
c95cbe8
Merged various_fixes and fixed conflicts.
economon Oct 15, 2019
953dfe7
Fixed memory allocation.
economon Oct 16, 2019
1dd60a7
Removed old relaxation factors.
economon Oct 17, 2019
1cc9393
Updating with various_fixes again.
economon Oct 17, 2019
cacb0e9
Adjusting allocation of the reconstruction gradient memory.
economon Oct 17, 2019
9ef49a9
Adjustment to local CFL and underrelaxation allocations. Important ch…
economon Oct 18, 2019
1ad8850
Merge branch 'develop' into feature_nlctrl
rsanfer Oct 21, 2019
04dd6b2
Updating initializers for reconstruction gradient.
economon Oct 22, 2019
5fc9daa
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Oct 22, 2019
9befd30
Merge branch 'develop' into feature_nlctrl
pcarruscag Oct 22, 2019
8df1d84
fix reconstruction gradient reference mechanism
pcarruscag Oct 22, 2019
f156d75
Fix for SST eddy viscosity expression. Adjusting SST clipping.
economon Oct 24, 2019
6624e0d
Small change to limits.
economon Oct 24, 2019
2b1356d
Meson fix for SU2_DOT_AD build.
economon Oct 25, 2019
00d1852
Removing old options from regression cfgs.
economon Oct 25, 2019
74f907f
Adding gitflow comment to readme.
economon Oct 31, 2019
08eee7b
Update with develop and fixed conflict.
economon Oct 31, 2019
663894e
Merge branch 'develop' into feature_nlctrl
talbring Nov 1, 2019
cf57e62
replace curly braces with parentheses for old compiler compatibility
pcarruscag Nov 1, 2019
b5d51af
Addressing small text clean up.
economon Nov 1, 2019
090f178
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Nov 1, 2019
58f511a
Couple more small changes.
economon Nov 1, 2019
19a3932
Added a routine to reset CFL adaption variables
talbring Nov 4, 2019
aa9a1c3
Bug fix for profile reader.
economon Nov 4, 2019
0314a4d
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Nov 4, 2019
f16e97c
Euler cases checked. Updated regression values.
economon Nov 4, 2019
01f13b8
RANS cases part I. Updated regression values.
economon Nov 4, 2019
2e8ea1d
Merge branch 'develop' into feature_nlctrl
talbring Nov 5, 2019
921ffd5
added reset of underrelaxation
talbring Nov 5, 2019
895c5ee
Merge branch 'feature_nlctrl' of github.com:su2code/SU2 into feature_…
talbring Nov 5, 2019
f900006
Adjustment for SA_NEG so under-relaxation does not cause stall.
economon Nov 6, 2019
8f7bcdc
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Nov 6, 2019
40eab17
Bug fix for unweighted least squares with periodic BCs.
economon Nov 6, 2019
5a7fccf
Updated and fixed conflicts.
economon Nov 6, 2019
f637a91
RANS case regression updates part II. NACA 0012 with new restarts in …
economon Nov 6, 2019
1ae4065
Updated regression values using new restarts.
economon Nov 7, 2019
bd94840
Fix crash for adjoint in tecplot binary writer
talbring Nov 7, 2019
761dc2a
Reverting to old SST clipping. Seems to be important for UQ cases.
economon Nov 7, 2019
6a7c082
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Nov 7, 2019
e896840
Another old conflict fixed.
economon Nov 7, 2019
f4ad569
Fixed initialization issue. More RANS regression updates.
economon Nov 8, 2019
982522f
Continuous adjoint and UQ regressions checked and updated.
economon Nov 8, 2019
72734cc
More regression updates.
economon Nov 8, 2019
6523e74
NICF and Turbomachinery regression updates.
economon Nov 8, 2019
94f559c
Fixing history/volume output for turbomachinery cases
talbring Nov 11, 2019
3dd7b60
Sliding interface regressions updated.
economon Nov 12, 2019
2b91aac
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Nov 12, 2019
b83fcff
fixed conflicts and updated more regressions.
economon Nov 18, 2019
9529e19
Updating discrete adjoint regressions. Also added new restarts for so…
economon Nov 18, 2019
19874e0
Updating reference values for file diff regressions.
economon Nov 19, 2019
7c14cdb
Updating tutorial cases.
economon Nov 22, 2019
e63b1c8
Fixing conflicts.
economon Nov 24, 2019
21e9dae
Merge remote-tracking branch 'upstream/develop' into feature_nlctrl
pcarruscag Nov 25, 2019
2d9bd61
Final parallel regression updates.
economon Nov 26, 2019
33c85a1
More regressions.
economon Nov 26, 2019
89421ce
File diff fixes for regressions.
economon Nov 27, 2019
af79b7f
White space issue in file diff.
economon Nov 27, 2019
11af27f
Updating branch for tutorials.
economon Nov 27, 2019
e530059
More white space fixes for file diff regressions.
economon Nov 28, 2019
24e9a47
Merge branch 'develop' into feature_nlctrl
economon Nov 28, 2019
054266e
Switching test case branch back to develop. Leaving tutorials pointin…
economon Nov 28, 2019
07f9d7f
Merge branch 'feature_nlctrl' of https://github.com/su2code/SU2 into …
economon Nov 28, 2019
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
68 changes: 34 additions & 34 deletions Common/include/config_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CConfig {
su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */
su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */
su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */
su2double StartTime;
su2double StartTime; /*!< \brief Start time for performance tracking of each phase of the code: preprocessing, compute, and output. */
bool ContinuousAdjoint, /*!< \brief Flag to know if the code is solving an adjoint problem. */
Viscous, /*!< \brief Flag to know if the code is solving a viscous problem. */
EquivArea, /*!< \brief Flag to know if the code is going to compute and plot the equivalent area. */
Expand Down Expand Up @@ -463,6 +463,7 @@ class CConfig {
*Kind_SurfaceMovement, /*!< \brief Kind of the static mesh movement. */
nKind_SurfaceMovement, /*!< \brief Kind of the dynamic mesh movement. */
Kind_Gradient_Method, /*!< \brief Numerical method for computation of spatial gradients. */
Kind_Gradient_Method_Recon, /*!< \brief Numerical method for computation of spatial gradients used for upwind reconstruction. */
Kind_Deform_Linear_Solver, /*!< Numerical method to deform the grid */
Kind_Deform_Linear_Solver_Prec, /*!< \brief Preconditioner of the linear solver. */
Kind_Linear_Solver, /*!< \brief Numerical solver for the implicit scheme. */
Expand Down Expand Up @@ -518,6 +519,8 @@ class CConfig {
Kind_Solver_Fluid_FSI, /*!< \brief Kind of solver for the fluid in FSI applications. */
Kind_Solver_Struc_FSI, /*!< \brief Kind of solver for the structure in FSI applications. */
Kind_BGS_RelaxMethod; /*!< \brief Kind of relaxation method for Block Gauss Seidel method in FSI problems. */
bool ReconstructionGradientRequired; /*!< \brief Enable or disable a second gradient calculation for upwind reconstruction only. */
bool LeastSquaresRequired; /*!< \brief Enable or disable memory allocation for least-squares gradient methods. */
bool Energy_Equation; /*!< \brief Solve the energy equation for incompressible flows. */
bool MUSCL, /*!< \brief MUSCL scheme .*/
MUSCL_Flow, /*!< \brief MUSCL scheme for the flow equations.*/
Expand Down Expand Up @@ -558,8 +561,6 @@ class CConfig {
unsigned short Linear_Solver_ILU_n; /*!< \brief ILU fill=in level. */
su2double SemiSpan; /*!< \brief Wing Semi span. */
su2double Roe_Kappa; /*!< \brief Relaxation of the Roe scheme. */
su2double Relaxation_Factor_Flow; /*!< \brief Relaxation coefficient of the linear solver mean flow. */
su2double Relaxation_Factor_Turb; /*!< \brief Relaxation coefficient of the linear solver turbulence. */
su2double Relaxation_Factor_AdjFlow; /*!< \brief Relaxation coefficient of the linear solver adjoint mean flow. */
su2double Relaxation_Factor_CHT; /*!< \brief Relaxation coefficient for the update of conjugate heat variables. */
su2double AdjTurb_Linear_Error; /*!< \brief Min error of the turbulent adjoint linear solver for the implicit formulation. */
Expand Down Expand Up @@ -759,7 +760,6 @@ class CConfig {
Wrt_Performance, /*!< \brief Write the performance summary at the end of a calculation. */
Wrt_AD_Statistics, /*!< \brief Write the tape statistics (discrete adjoint). */
Wrt_MeshQuality, /*!< \brief Write the mesh quality statistics to the visualization files. */
Wrt_InletFile, /*!< \brief Write a template inlet profile file */
Wrt_Slice, /*!< \brief Write 1D slice of a 2D cartesian solution */
Wrt_Projected_Sensitivity, /*!< \brief Write projected sensitivities (dJ/dx) on surfaces to ASCII file. */
Plot_Section_Forces; /*!< \brief Write sectional forces for specified markers. */
Expand Down Expand Up @@ -1625,6 +1625,12 @@ class CConfig {
*/
su2double GetCFL_AdaptParam(unsigned short val_index);

/*!
* \brief Get the values of the CFL adapation.
* \return Value of CFL adapation
economon marked this conversation as resolved.
Show resolved Hide resolved
*/
inline void SetCFL_AdaptParam(unsigned short val_index, su2double val_cfl_param) { CFL_AdaptParam[val_index] = val_cfl_param; }

/*!
* \brief Get the values of the CFL adapation.
* \return Value of CFL adapation
Expand Down Expand Up @@ -3259,18 +3265,6 @@ class CConfig {
* \return <code>TRUE</code> means that the mesh quality metrics will be written to the visualization files.
*/
bool GetWrt_MeshQuality(void);

/*!
* \brief Get information about writing a template inlet profile file.
* \return <code>TRUE</code> means that a template inlet profile file will be written.
*/
bool GetWrt_InletFile(void);

/*!
* \brief Set information about writing a template inlet profile file.
* \param[in] val_wrt_inletfile - flag for whether to write a template inlet profile file.
*/
void SetWrt_InletFile(bool val_wrt_inletfile);

/*!
* \brief Get information about writing a 1D slice of a 2D cartesian solution.
Expand Down Expand Up @@ -3991,11 +3985,29 @@ class CConfig {
void SetKt_PolyCoeffND(su2double val_coeff, unsigned short val_index);

/*!
* \brief Get the kind of method for computation of spatial gradients.
* \return Numerical method for computation of spatial gradients.
* \brief Get the kind of method for computation of spatial gradients used for viscous and source terms.
* \return Numerical method for computation of spatial gradients used for viscous and source terms.
*/
unsigned short GetKind_Gradient_Method(void);

/*!
* \brief Get the kind of method for computation of spatial gradients used for upwind reconstruction.
* \return Numerical method for computation of spatial gradients used for upwind reconstruction.
*/
unsigned short GetKind_Gradient_Method_Recon(void);

/*!
* \brief Get flag for whether a second gradient calculation is required for upwind reconstruction alone.
* \return <code>TRUE</code> means that a second gradient will be calculated for upwind reconstruction.
*/
bool GetReconstructionGradientRequired(void);

/*!
* \brief Get flag for whether a least-squares gradient method is being applied.
* \return <code>TRUE</code> means that a least-squares gradient method is being applied.
*/
bool GetLeastSquaresRequired(void);

/*!
* \brief Get the kind of solver for the implicit solver.
* \return Numerical solver for implicit formulation (solving the linear system).
Expand Down Expand Up @@ -4069,23 +4081,11 @@ class CConfig {
*/
su2double GetLinear_Solver_Smoother_Relaxation(void) const;

/*!
* \brief Get the relaxation coefficient of the linear solver for the implicit formulation.
* \return relaxation coefficient of the linear solver for the implicit formulation.
*/
su2double GetRelaxation_Factor_Flow(void);

/*!
* \brief Get the relaxation coefficient of the linear solver for the implicit formulation.
* \return relaxation coefficient of the linear solver for the implicit formulation.
*/
su2double GetRelaxation_Factor_AdjFlow(void);

/*!
* \brief Get the relaxation coefficient of the linear solver for the implicit formulation.
* \return relaxation coefficient of the linear solver for the implicit formulation.
*/
su2double GetRelaxation_Factor_Turb(void);

/*!
* \brief Get the relaxation coefficient of the CHT coupling.
Expand Down Expand Up @@ -9198,14 +9198,14 @@ class CConfig {
unsigned short GetnConv_Field();

/*!
* \brief Set_StartTime
* \param starttime
* \brief Set the start time to track a phase of the code (preprocessing, compute, output).
* \param[in] Value of the start time to track a phase of the code.
*/
void Set_StartTime(su2double starttime);

/*!
* \brief Get_StartTime
* \return
* \brief Get the start time to track a phase of the code (preprocessing, compute, output).
* \return Value of the start time to track a phase of the code.
*/
su2double Get_StartTime();

Expand Down
14 changes: 6 additions & 8 deletions Common/include/config_structure.inl
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,12 @@ inline su2double CConfig::GetmaxTurkelBeta() { return Max_Beta_RoeTurkel; }

inline unsigned short CConfig::GetKind_Gradient_Method(void) { return Kind_Gradient_Method; }

inline unsigned short CConfig::GetKind_Gradient_Method_Recon(void) { return Kind_Gradient_Method_Recon; }

inline bool CConfig::GetReconstructionGradientRequired(void) { return ReconstructionGradientRequired; }

inline bool CConfig::GetLeastSquaresRequired(void) { return LeastSquaresRequired; }

inline unsigned short CConfig::GetKind_Linear_Solver(void) { return Kind_Linear_Solver; }

inline unsigned short CConfig::GetKind_Deform_Linear_Solver(void) { return Kind_Deform_Linear_Solver; }
Expand All @@ -1014,12 +1020,8 @@ inline unsigned long CConfig::GetLinear_Solver_Restart_Frequency(void) { return

inline su2double CConfig::GetLinear_Solver_Smoother_Relaxation(void) const { return Linear_Solver_Smoother_Relaxation; }

inline su2double CConfig::GetRelaxation_Factor_Flow(void) { return Relaxation_Factor_Flow; }

inline su2double CConfig::GetRelaxation_Factor_AdjFlow(void) { return Relaxation_Factor_AdjFlow; }

inline su2double CConfig::GetRelaxation_Factor_Turb(void) { return Relaxation_Factor_Turb; }

inline su2double CConfig::GetRelaxation_Factor_CHT(void) { return Relaxation_Factor_CHT; }

inline su2double CConfig::GetRoe_Kappa(void) { return Roe_Kappa; }
Expand Down Expand Up @@ -1671,10 +1673,6 @@ inline bool CConfig::GetWrt_AD_Statistics(void) { return Wrt_AD_Statistics; }

inline bool CConfig::GetWrt_MeshQuality(void) { return Wrt_MeshQuality; }

inline bool CConfig::GetWrt_InletFile(void) { return Wrt_InletFile; }

inline void CConfig::SetWrt_InletFile(bool val_wrt_inletfile) { Wrt_InletFile = val_wrt_inletfile; }

inline bool CConfig::GetWrt_Slice(void) { return Wrt_Slice; }

inline bool CConfig::GetWrt_Projected_Sensitivity(void) { return Wrt_Projected_Sensitivity; }
Expand Down
5 changes: 3 additions & 2 deletions Common/include/interpolation_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ class CInterpolator {
*Buffer_Send_nVertex_Donor,/*!\brief Buffer to send number of vertices on the local processor*/
*Buffer_Send_nFace_Donor,/*!\brief Buffer to send number of faces on the local processor*/
*Buffer_Send_nFaceNodes_Donor,/*!\brief Buffer to send the number of nodes assocated with faces per processor*/
*Buffer_Receive_GlobalPoint, /*!\brief Buffer to receive global point indices*/
*Buffer_Send_GlobalPoint,/*!\brief Buffer to send global point indices*/
*Buffer_Send_FaceIndex,/*!\brief Buffer to send indices pointing to the node indices that define the faces*/
*Buffer_Receive_FaceIndex,/*!\brief Buffer to receive indices pointing to the node indices that define the faces*/
*Buffer_Send_FaceNodes,/*!\brief Buffer to send indices pointing to the location of node information in other buffers, defining faces*/
*Buffer_Receive_FaceNodes,/*!\brief Buffer to receive indices pointing to the location of node information in other buffers, defining faces*/
*Buffer_Send_FaceProc,/*!\brief Buffer to send processor which stores the node indicated in Buffer_Receive_FaceNodes*/
*Buffer_Receive_FaceProc;/*!\brief Buffer to receive processor which stores the node indicated in Buffer_Receive_FaceNodes*/

long *Buffer_Send_GlobalPoint,/*!\brief Buffer to send global point indices*/
*Buffer_Receive_GlobalPoint; /*!\brief Buffer to receive global point indices*/

su2double *Buffer_Send_Coord,/*!\brief Buffer to send coordinate values*/
*Buffer_Send_Normal,/*!\brief Buffer to send normal vector values */
*Buffer_Receive_Coord,/*!\brief Buffer to receive coordinate values*/
Expand Down
8 changes: 6 additions & 2 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,11 +996,15 @@ static const map<string, ENUM_SPACE_ITE_FEA> Space_Ite_Map_FEA = CCreateMap<stri
* \brief types of schemes to compute the flow gradient
*/
enum ENUM_FLOW_GRADIENT {
GREEN_GAUSS = 1, /*!< \brief Gradients computation using Green Gauss theorem. */
WEIGHTED_LEAST_SQUARES = 2 /*!< \brief Gradients computation using Weighted Least Squares. */
NO_GRADIENT = 0, /*!< \brief No gradient method. Only possible for reconstruction gradient, in which case, the option chosen for NUM_METHOD_GRAD is used. */
GREEN_GAUSS = 1, /*!< \brief Gradient computation using Green-Gauss theorem. */
LEAST_SQUARES = 2, /*!< \brief Gradient computation using unweighted least squares. */
WEIGHTED_LEAST_SQUARES = 3 /*!< \brief Gradients computation using inverse-distance weighted least squares. */
};
static const map<string, ENUM_FLOW_GRADIENT> Gradient_Map = CCreateMap<string, ENUM_FLOW_GRADIENT>
("NONE", NO_GRADIENT)
("GREEN_GAUSS", GREEN_GAUSS)
("LEAST_SQUARES", LEAST_SQUARES)
("WEIGHTED_LEAST_SQUARES", WEIGHTED_LEAST_SQUARES);

/*!
Expand Down
25 changes: 17 additions & 8 deletions Common/include/toolboxes/C2DContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class AccessorImpl
alignas(AlignSize) Scalar_t m_data[StaticRows*StaticCols];

/*!
* Static size specializations use this do-nothing macro.
* Static size specializations use this do-nothing allocation macro.
*/
#define DUMMY_ALLOCATOR \
void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept {}
Expand All @@ -90,18 +90,27 @@ class AccessorImpl
* runtime internal value that depend on the number of rows/columns.
* What values need setting depends on the specialization as not all have
* members for e.g. number of rows and cols (static size optimization).
* \note Aligned dynamic allocation is disabled for compilation on MAC.
*/
#define REAL_ALLOCATOR(EXTRA) \
#ifndef __APPLE__
#define REAL_ALLOCATOR(EXTRA) \
static_assert(AlignSize % alignof(Scalar_t)==0, \
"AlignSize is not a multiple of the type's alignment spec."); \
"AlignSize is not a multiple of the type's alignment spec."); \
\
void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept { \
EXTRA; \
if(AlignSize==0) \
m_data = static_cast<Scalar_t*>(malloc(sz)); \
else \
m_data = static_cast<Scalar_t*>(aligned_alloc(AlignSize,sz)); \
EXTRA; \
if(AlignSize==0) \
m_data = static_cast<Scalar_t*>(malloc(sz)); \
else \
m_data = static_cast<Scalar_t*>(aligned_alloc(AlignSize,sz)); \
}
#else
#define REAL_ALLOCATOR(EXTRA) \
void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept { \
EXTRA; \
m_data = static_cast<Scalar_t*>(malloc(sz)); \
}
#endif

DUMMY_ALLOCATOR

Expand Down
Loading