Skip to content

Commit 0d09263

Browse files
committed
python source term for heat solver
1 parent ab62777 commit 0d09263

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

SU2_CFD/include/solvers/CHeatSolver.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,17 @@ class CHeatSolver final : public CScalarSolver<CHeatVariable> {
196196
unsigned short iMesh,
197197
unsigned short iRKStep) override;
198198

199+
/*!
200+
* \brief Source term computation.
201+
* \param[in] geometry - Geometrical definition of the problem.
202+
* \param[in] solver_container - Container vector with all the solutions.
203+
* \param[in] numerics_container - Description of the numerical method.
204+
* \param[in] config - Definition of the particular problem.
205+
* \param[in] iMesh - Index of the mesh in multigrid computations.
206+
*/
207+
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
208+
CConfig *config, unsigned short iMesh) override ;
209+
199210

200211
void Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) override;
201212

SU2_CFD/src/solvers/CHeatSolver.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,22 @@ void CHeatSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_contain
311311
}
312312
}
313313

314+
void CHeatSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
315+
CConfig *config, unsigned short iMesh) {
316+
317+
CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM];
318+
319+
/*--- Regular source terms go here. ---*/
320+
/*--- ... ---*/
321+
322+
/*--- Custom user defined source term (from the python wrapper) ---*/
323+
if (config->GetPyCustomSource()) {
324+
CustomSourceResidual(geometry, solver_container, numerics_container, config, iMesh);
325+
}
326+
327+
}
328+
329+
314330
void CHeatSolver::Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) {
315331

316332
BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS {

0 commit comments

Comments
 (0)