@@ -120,7 +120,7 @@ void CNewtonIntegration::ComputeResiduals(ResEvalType type) {
120120
121121 /* --- Save the default integration scheme, and force to explicit if required. ---*/
122122 auto TimeIntScheme = config->GetKind_TimeIntScheme ();
123- if (type == EXPLICIT) {
123+ if (type == ResEvalType:: EXPLICIT) {
124124 SU2_OMP_MASTER
125125 config->SetKind_TimeIntScheme (EULER_EXPLICIT);
126126 END_SU2_OMP_MASTER
@@ -129,10 +129,14 @@ void CNewtonIntegration::ComputeResiduals(ResEvalType type) {
129129
130130 solvers[FLOW_SOL]->Preprocessing (geometry, solvers, config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, false );
131131
132+ if (type == ResEvalType::DEFAULT) {
133+ solvers[FLOW_SOL]->SetTime_Step (geometry, solvers, config, MESH_0, config->GetTimeIter ());
134+ }
135+
132136 Space_Integration (geometry, solvers, numerics[FLOW_SOL], config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS);
133137
134138 /* --- Restore default. ---*/
135- if (type == EXPLICIT) {
139+ if (type == ResEvalType:: EXPLICIT) {
136140 SU2_OMP_MASTER
137141 config->SetKind_TimeIntScheme (TimeIntScheme);
138142 END_SU2_OMP_MASTER
@@ -187,12 +191,10 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver **
187191
188192 /* --- Current residual. ---*/
189193
190- ComputeResiduals (DEFAULT);
194+ ComputeResiduals (ResEvalType:: DEFAULT);
191195
192196 /* --- Compute the approximate Jacobian for preconditioning. ---*/
193197
194- solvers[FLOW_SOL]->SetTime_Step (geometry, solvers, config, MESH_0, config->GetTimeIter ());
195-
196198 solvers[FLOW_SOL]->PrepareImplicitIteration (geometry, solvers, config);
197199
198200 if (preconditioner) preconditioner->Build ();
@@ -304,7 +306,7 @@ void CNewtonIntegration::MatrixFreeProduct(const CSysVector<Scalar>& u, CSysVect
304306
305307 PerturbSolution (u, factor);
306308
307- ComputeResiduals (EXPLICIT);
309+ ComputeResiduals (ResEvalType:: EXPLICIT);
308310
309311 /* --- Finalize product. ---*/
310312 factor = 1.0 / factor;
@@ -339,9 +341,13 @@ void CNewtonIntegration::Preconditioner(const CSysVector<Scalar>& u, CSysVector<
339341 else {
340342 /* --- Approximate diagonal preconditioner. ---*/
341343
344+ const bool dt1st = (config->GetTime_Marching () == TIME_MARCHING::DT_STEPPING_1ST);
345+ const bool dt2nd = (config->GetTime_Marching () == TIME_MARCHING::DT_STEPPING_2ND);
346+ const su2double dt = config->GetDelta_UnstTimeND () * (dt1st + 1.5 * dt2nd);
347+
342348 SU2_OMP_FOR_STAT (omp_chunk_size)
343349 for (auto iPoint = 0ul ; iPoint < geometry->GetnPointDomain (); ++iPoint) {
344- su2double delta = solvers[FLOW_SOL]->GetNodes ()->GetDelta_Time (iPoint) /
350+ su2double delta = ( solvers[FLOW_SOL]->GetNodes ()->GetDelta_Time (iPoint) + dt ) /
345351 (geometry->nodes ->GetVolume (iPoint) + geometry->nodes ->GetPeriodicVolume (iPoint));
346352 SU2_OMP_SIMD
347353 for (auto iVar = 0ul ; iVar < u.GetNVar (); ++iVar)
0 commit comments