Skip to content

Commit a77ab48

Browse files
committed
Add BC_Periodic to HeatSolver.
1 parent f361b13 commit a77ab48

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

SU2_CFD/include/solvers/CHeatSolver.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ class CHeatSolver final : public CSolver {
247247
CConfig *config,
248248
unsigned short val_marker) override;
249249

250+
/*!
251+
* \brief Impose a periodic boundary condition by summing contributions from the complete control volume.
252+
* \param[in] geometry - Geometrical definition of the problem.
253+
* \param[in] solver_container - Container vector with all the solutions.
254+
* \param[in] numerics - Description of the numerical method.
255+
* \param[in] config - Definition of the particular problem.
256+
*/
257+
void BC_Periodic(CGeometry* geometry, CSolver** solver_container, CNumerics* numerics, CConfig* config) final;
258+
250259
/*!
251260
* \brief Set the conjugate heat variables.
252261
* \param[in] val_marker - marker index

SU2_CFD/src/solvers/CHeatSolver.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,20 @@ void CHeatSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solv
893893
}
894894
}
895895

896+
void CHeatSolver::BC_Periodic(CGeometry* geometry, CSolver** solver_container, CNumerics* numerics,
897+
CConfig* config) {
898+
/*--- Complete residuals for periodic boundary conditions. We loop over
899+
the periodic BCs in matching pairs so that, in the event that there are
900+
adjacent periodic markers, the repeated points will have their residuals
901+
accumulated corectly during the communications. For implicit calculations
902+
the Jacobians and linear system are also correctly adjusted here. ---*/
903+
904+
for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic() / 2; iPeriodic++) {
905+
InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_RESIDUAL);
906+
CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_RESIDUAL);
907+
}
908+
}
909+
896910
void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, CConfig *config) {
897911

898912
unsigned long iPointNormal;

0 commit comments

Comments
 (0)