Skip to content

Commit e4890a7

Browse files
committed
addressing some PR comments, merge in develop
1 parent 8e75b33 commit e4890a7

5 files changed

Lines changed: 12 additions & 13 deletions

File tree

SU2_CFD/include/numerics/CNumerics.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,11 +1407,10 @@ class CNumerics {
14071407
* \param[in] val_residual - residual of the numeric function.
14081408
* \param[out] ERR - Presencse of NaN in vector
14091409
*/
1410-
static bool CheckResidualNaNs(bool implicit, int nVar, ResidualType<>(residual)){
1410+
static bool CheckResidualNaNs(bool implicit, int nVar, const ResidualType<> residual) {
14111411

14121412
bool ERR = false;
1413-
bool jac_j = false;
1414-
if (residual.jacobian_j != nullptr) jac_j =true;
1413+
const bool jac_j = residual.jacobian_j != nullptr
14151414

14161415
for (auto iVar = 0; iVar<nVar; iVar++){
14171416
if (residual[iVar] != residual[iVar]) ERR = true;

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void CFVMFlowSolverBase<V, R>::ComputeUnderRelaxationFactor(const CConfig* confi
544544
/* We impose a limit on the maximum percentage that the
545545
density and energy can change over a nonlinear iteration. */
546546

547-
if ((iVar == 0) || (iVar >= nVar - 1)) {
547+
if ((iVar == 0) || (iVar == nVar - 1)) {
548548
const unsigned long index = iPoint * nVar + iVar;
549549
su2double ratio = fabs(LinSysSol[index]) / (fabs(nodes->GetSolution(iPoint, iVar)) + EPS);
550550
if (ratio > allowableRatio) {

SU2_CFD/include/solvers/CNEMOEulerSolver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, ENUM_REGI
204204
* a nonlinear iteration for stability.
205205
* \param[in] config - Definition of the particular problem.
206206
*/
207-
void ComputeUnderRelaxationFactor(const CConfig *config) override;
207+
void ComputeUnderRelaxationFactor(const CConfig *config) final;
208208

209209
/*!
210210
* \brief Set the fluid solver nondimensionalization.

SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeChemistry(const CConfig *config)
110110
if (implicit) {
111111
for (iVar = 0; iVar<nVar; iVar++) {
112112
for (jVar = 0; jVar<nVar; jVar++) {
113-
jacobian[iVar][jVar] = jacobian[iVar][jVar] * Volume;
113+
jacobian[iVar][jVar] *= Volume;
114114
}
115115
}
116116
}
@@ -164,13 +164,13 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeVibRelaxation(const CConfig *conf
164164

165165
residual[nSpecies+nDim+1] = VTterm * Volume;
166166

167-
if (implicit) {
168-
for (iVar = 0; iVar<nVar; iVar++) {
169-
for (jVar = 0; jVar<nVar; jVar++) {
170-
jacobian[iVar][jVar] = jacobian[iVar][jVar] * Volume;
171-
}
167+
if (implicit) {
168+
for (iVar = 0; iVar<nVar; iVar++) {
169+
for (jVar = 0; jVar<nVar; jVar++) {
170+
jacobian[iVar][jVar] *= Volume;
172171
}
173172
}
173+
}
174174

175175
/*--- Relax/limit vt transfer ---*/
176176
if(config->GetVTTransferResidualLimiting()){

SU2_CFD/src/solvers/CNEMOEulerSolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,12 +959,12 @@ void CNEMOEulerSolver::ComputeUnderRelaxationFactor(const CConfig *config) {
959959
}
960960
}
961961

962-
/*--- Energy ---*/
962+
/*--- Energy ---*/
963963
if (iVar == (nVar-2)){
964964
su2double ratio = fabs(LinSysSol[index]) / (fabs(nodes->GetSolution(iPoint, iVar)) + EPS);
965965
if (ratio > allowableRatio) {
966966
localUnderRelaxation = min(allowableRatio / ratio, localUnderRelaxation);
967-
}
967+
}
968968
}
969969
}
970970
}

0 commit comments

Comments
 (0)