@@ -159,6 +159,19 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM
159159
160160 SetBaseClassPointerToNodes ();
161161
162+ /* --- Communicate and store volume and the number of neighbors for any dual CVs that lie on on periodic markers. ---*/
163+ for (unsigned short iPeriodic = 1 ; iPeriodic <= config->GetnMarker_Periodic () / 2 ; iPeriodic++) {
164+ InitiatePeriodicComms (geometry, config, iPeriodic, PERIODIC_VOLUME);
165+ CompletePeriodicComms (geometry, config, iPeriodic, PERIODIC_VOLUME);
166+ InitiatePeriodicComms (geometry, config, iPeriodic, PERIODIC_NEIGHBORS);
167+ CompletePeriodicComms (geometry, config, iPeriodic, PERIODIC_NEIGHBORS);
168+ }
169+ /* --- Store if implicit scheme is used. This has implications on the Residual and Jacobian handling for periodic
170+ * boundaries ---*/
171+ const bool euler_implicit = (config->GetKind_TimeIntScheme_Heat () == EULER_IMPLICIT);
172+ SetImplicitPeriodic (euler_implicit);
173+
174+
162175 /* --- MPI solution ---*/
163176
164177 InitiateComms (geometry, config, SOLUTION);
@@ -1288,11 +1301,12 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_
12881301
12891302 /* --- Modify matrix diagonal to assure diagonal dominance ---*/
12901303
1291- if (nodes->GetDelta_Time (iPoint) != 0.0 ) {
1292-
1304+ const su2double dt = nodes->GetDelta_Time (iPoint);
1305+ if (dt != 0.0 ) {
1306+ /* --- For nodes on periodic boundaries, add the respective partner volume. ---*/
12931307 // Identical for flow and heat
1294- const su2double Delta = geometry->nodes ->GetVolume (iPoint) / nodes->GetDelta_Time (iPoint);
1295- Jacobian.AddVal2Diag (iPoint, Delta );
1308+ const su2double Vol = geometry->nodes ->GetVolume (iPoint) + geometry-> nodes ->GetPeriodicVolume (iPoint);
1309+ Jacobian.AddVal2Diag (iPoint, Vol / dt );
12961310
12971311 } else {
12981312 Jacobian.SetVal2Diag (iPoint, 1.0 );
@@ -1340,6 +1354,12 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_
13401354 }
13411355 }
13421356
1357+ /* --- Synchronize the solution between master and passive periodic nnodes after the linear solve. ---*/
1358+ for (unsigned short iPeriodic = 1 ; iPeriodic <= config->GetnMarker_Periodic () / 2 ; iPeriodic++) {
1359+ InitiatePeriodicComms (geometry, config, iPeriodic, PERIODIC_IMPLICIT);
1360+ CompletePeriodicComms (geometry, config, iPeriodic, PERIODIC_IMPLICIT);
1361+ }
1362+
13431363 /* --- MPI solution ---*/
13441364
13451365 InitiateComms (geometry, config, SOLUTION);
0 commit comments