From 0d09263b186c8829f8a9376bb7a82df5a1b2f76e Mon Sep 17 00:00:00 2001 From: bigfooted Date: Thu, 20 Nov 2025 08:47:42 +0100 Subject: [PATCH 01/13] python source term for heat solver --- SU2_CFD/include/solvers/CHeatSolver.hpp | 11 +++++++++++ SU2_CFD/src/solvers/CHeatSolver.cpp | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index a286f9be7717..df2d99149b7f 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -196,6 +196,17 @@ class CHeatSolver final : public CScalarSolver { unsigned short iMesh, unsigned short iRKStep) override; + /*! + * \brief Source term computation. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] numerics_container - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - Index of the mesh in multigrid computations. + */ + void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, + CConfig *config, unsigned short iMesh) override ; + void Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) override; diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 547697690027..d7f8fb2e0507 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -311,6 +311,22 @@ void CHeatSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_contain } } +void CHeatSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, + CConfig *config, unsigned short iMesh) { + + CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM]; + + /*--- Regular source terms go here. ---*/ + /*--- ... ---*/ + + /*--- Custom user defined source term (from the python wrapper) ---*/ + if (config->GetPyCustomSource()) { + CustomSourceResidual(geometry, solver_container, numerics_container, config, iMesh); + } + +} + + void CHeatSolver::Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) { BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { From 4a036f6e1567e0428464ac5d243463c1642753bd Mon Sep 17 00:00:00 2001 From: bigfooted Date: Thu, 20 Nov 2025 09:26:23 +0100 Subject: [PATCH 02/13] remove unused variable --- SU2_CFD/src/solvers/CHeatSolver.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index d7f8fb2e0507..479e81e42b41 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -314,8 +314,6 @@ void CHeatSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_contain void CHeatSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { - CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM]; - /*--- Regular source terms go here. ---*/ /*--- ... ---*/ From 22d6253fb4b8f2e4dde4caa1eea9fd7ab32ab045 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 6 Jan 2026 21:55:39 +0100 Subject: [PATCH 03/13] added regression --- TestCases/parallel_regression.py | 12 ++ .../py_wrapper/custom_heat_source/run.py | 169 ++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 TestCases/py_wrapper/custom_heat_source/run.py diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 9b8dfafe8ec5..532ffd520f4d 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1534,6 +1534,18 @@ def main(): pywrapper_zimont.command = TestCase.Command("mpirun -np 2", "python", "run.py") test_list.append(pywrapper_zimont) + # Heat solver unsteady with source + pywrapper_Unst_Heat_AD = TestCase('pywrapper_Unst_Heat_Source') + pywrapper_Unst_Heat_AD.cfg_dir = "py_wrapper/custom_heat_source" + pywrapper_Unst_Heat_AD.cfg_file = "run.py" + pywrapper_Unst_Heat_AD.test_iter = 100 + pywrapper_Unst_Heat_AD.test_vals = [0.776365, 0.776430, 1.000003] + pywrapper_Unst_Heat_AD.command = TestCase.Command("mpirun -n 2", "python", "run.py") + pywrapper_Unst_Heat_AD.timeout = 1600 + pywrapper_Unst_Heat_AD.tol = 0.00001 + pywrapper_Unst_Heat_AD.new_output = False + test_list.append(pywrapper_Unst_Heat_AD) + pass_list.append(pywrapper_Unst_Heat_AD.run_test()) ############################################## ### Method of Manufactured Solutions (MMS) ### ############################################## diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py new file mode 100644 index 000000000000..9dffe5a15532 --- /dev/null +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python + +## \file run.py +# \brief Unsteady adjoint heat transfer case with custom heat flux. +# \version 8.3.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2025, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import pysu2ad +from mpi4py import MPI + +common_settings = """ +SOLVER= HEAT_EQUATION +INC_NONDIM= DIMENSIONAL + +TIME_DOMAIN= YES +TIME_STEP= 0.002 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER + +FREESTREAM_TEMPERATURE= 300 +MATERIAL_DENSITY= 1000 +SPECIFIC_HEAT_CP = 500 +THERMAL_CONDUCTIVITY_CONSTANT= 10.0 + +MARKER_HEATFLUX= ( x_minus, 0, x_plus, 0, y_minus, 0, y_plus, 0 ) +MARKER_PYTHON_CUSTOM= ( x_minus, x_plus, y_minus, y_plus ) +MARKER_MONITORING= ( x_minus, x_plus, y_minus, y_plus ) + +PYTHON_CUSTOM_SOURCE= YES + +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 100 + +LINEAR_SOLVER= CONJUGATE_GRADIENT +DISCADJ_LIN_SOLVER= CONJUGATE_GRADIENT +LINEAR_SOLVER_PREC= ILU +DISCADJ_LIN_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-5 +LINEAR_SOLVER_ITER= 100 + +MESH_FORMAT= RECTANGLE +MESH_BOX_SIZE= ( 33, 33, 0 ) +MESH_BOX_LENGTH= ( __SIZE__, __SIZE__, 0 ) + +OUTPUT_FILES= RESTART, PARAVIEW +OUTPUT_WRT_FREQ= 100,100 +OBJECTIVE_FUNCTION= AVG_TEMPERATURE + +INNER_ITER= 20 +CONV_RESIDUAL_MINVAL= -4 +CONV_STARTITER= 2 +MAX_TIME= 10.0 +TIME_ITER= 101 +""" + +primal_settings = """ +MATH_PROBLEM= DIRECT +SCREEN_OUTPUT= TIME_ITER, CUR_TIME, INNER_ITER, RMS_RES, LINSOL, AVG_TEMPERATURE, TAVG_AVG_TEMPERATURE +HISTORY_OUTPUT= ITER, RMS_RES, HEAT, TAVG_HEAT +""" + +def HeatSource(time, driver, iPoint): + """Applies a source in the lower left quadrant for a period of time.""" + allCoords = driver.Coordinates() + iHEATSOLVER = driver.GetSolverIndices()['HEAT'] + coord = allCoords.Get(iPoint) + x = coord[0] + y = coord[1] + xp = 0.0125 + yp = 0.0125 + R = 0.0125 + Source = 0.0 + if (time > 0.0): + if ((x-xp)*(x-xp) + (y-yp)*(y-yp) < R*R): + Source = 100.0 + + return Source + +def RunPrimal(size): + """ + Run the heat solver with a custom heat (function of time) flux on all boundaries. + Returns the final average boundary temperature. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config_unsteady.cfg', 'w') as f: + f.write(common_settings.replace('__SIZE__', str(size)) + primal_settings) + comm.Barrier() + + # Initialize the primal driver of SU2, this includes solver preprocessing. + try: + driver = pysu2ad.CSinglezoneDriver('config_unsteady.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2ad.CSinglezoneDriver : ', exception) + raise + + # Get the ID of the markers where the heat flux is applied. + all_marker_ids = driver.GetMarkerIndices() + marker_names = ['x_minus', 'x_plus', 'y_minus', 'y_plus'] + marker_ids = [] + for name in marker_names: + marker_ids.append(all_marker_ids[name] if name in all_marker_ids else -1) + + # Run the time loop in python to vary the heat flux. + dt = driver.GetUnsteadyTimeStep() + + iHEATSOLVER = driver.GetSolverIndices()['HEAT'] + Source = driver.UserDefinedSource(iHEATSOLVER) + + + for time_iter in range(driver.GetNumberTimeIter()): + # Custom heat flux. + #ApplyHeatFlux(time_iter * dt, driver, marker_ids) + + # set the source term, per point + for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()): + # add source term: + S = HeatSource(time_iter * dt, driver, i_node) + Source.Set(i_node, 0, S) + + + driver.Preprocess(time_iter) + + # Run one time iteration. + driver.Run() + driver.Postprocess() + driver.Update() + + # Monitor the solver and output solution to file if required. + driver.Monitor(time_iter) + driver.Output(time_iter) + + # Get the final average temperature. + avg_temperature = driver.GetOutputValue('AVG_TEMPERATURE') + + # Finalize the solver and exit cleanly. + driver.Finalize() + + return avg_temperature + + +def main(): + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + avg_temperature = RunPrimal(0.1) + +if __name__ == '__main__': + main() From 41c2fad7e544d0cb3e419a32f30594795b66c046 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 6 Jan 2026 22:38:17 +0100 Subject: [PATCH 04/13] cleanup --- TestCases/parallel_regression.py | 18 +++++++----------- TestCases/py_wrapper/custom_heat_source/run.py | 5 ++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 532ffd520f4d..808afd67b68a 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1535,17 +1535,13 @@ def main(): test_list.append(pywrapper_zimont) # Heat solver unsteady with source - pywrapper_Unst_Heat_AD = TestCase('pywrapper_Unst_Heat_Source') - pywrapper_Unst_Heat_AD.cfg_dir = "py_wrapper/custom_heat_source" - pywrapper_Unst_Heat_AD.cfg_file = "run.py" - pywrapper_Unst_Heat_AD.test_iter = 100 - pywrapper_Unst_Heat_AD.test_vals = [0.776365, 0.776430, 1.000003] - pywrapper_Unst_Heat_AD.command = TestCase.Command("mpirun -n 2", "python", "run.py") - pywrapper_Unst_Heat_AD.timeout = 1600 - pywrapper_Unst_Heat_AD.tol = 0.00001 - pywrapper_Unst_Heat_AD.new_output = False - test_list.append(pywrapper_Unst_Heat_AD) - pass_list.append(pywrapper_Unst_Heat_AD.run_test()) + pywrapper_Unst_Heat_Source = TestCase('pywrapper_Unst_Heat_Source') + pywrapper_Unst_Heat_Source.cfg_dir = "py_wrapper/custom_heat_source" + pywrapper_Unst_Heat_Source.cfg_file = "run.py" + pywrapper_Unst_Heat_Source.test_iter = 100 + pywrapper_Unst_Heat_Source.test_vals = [0.776365, 0.776430, 1.000003] + pywrapper_Unst_Heat_Source.command = TestCase.Command("mpirun -n 2", "python", "run.py") + test_list.append(pywrapper_Unst_Heat_Source) ############################################## ### Method of Manufactured Solutions (MMS) ### ############################################## diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index 9dffe5a15532..9081b19c7d45 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -80,7 +80,6 @@ def HeatSource(time, driver, iPoint): """Applies a source in the lower left quadrant for a period of time.""" allCoords = driver.Coordinates() - iHEATSOLVER = driver.GetSolverIndices()['HEAT'] coord = allCoords.Get(iPoint) x = coord[0] y = coord[1] @@ -161,9 +160,9 @@ def RunPrimal(size): def main(): comm = MPI.COMM_WORLD - rank = comm.Get_rank() + #rank = comm.Get_rank() - avg_temperature = RunPrimal(0.1) + RunPrimal(0.1) if __name__ == '__main__': main() From 98d97a243048b3b31514dc756ceeb990661b6420 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 7 Jan 2026 08:25:12 +0100 Subject: [PATCH 05/13] update heatsource regression --- TestCases/parallel_regression.py | 15 ++++++++------ .../py_wrapper/custom_heat_source/run.py | 20 ++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 808afd67b68a..edd26a073e7f 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1534,14 +1534,17 @@ def main(): pywrapper_zimont.command = TestCase.Command("mpirun -np 2", "python", "run.py") test_list.append(pywrapper_zimont) - # Heat solver unsteady with source - pywrapper_Unst_Heat_Source = TestCase('pywrapper_Unst_Heat_Source') - pywrapper_Unst_Heat_Source.cfg_dir = "py_wrapper/custom_heat_source" - pywrapper_Unst_Heat_Source.cfg_file = "run.py" - pywrapper_Unst_Heat_Source.test_iter = 100 - pywrapper_Unst_Heat_Source.test_vals = [0.776365, 0.776430, 1.000003] + + # Heat solver unsteady with source + pywrapper_Unst_Heat_Source = TestCase('pywrapper_Unst_Heat_Source') + pywrapper_Unst_Heat_Source.cfg_dir = "py_wrapper/custom_heat_source" + pywrapper_Unst_Heat_Source.cfg_file = "run.py" + pywrapper_Unst_Heat_Source.test_iter = 10 + pywrapper_Unst_Heat_Source.unsteady = True + pywrapper_Unst_Heat_Source.test_vals = [0.776365, 0.776430, 1.000003] pywrapper_Unst_Heat_Source.command = TestCase.Command("mpirun -n 2", "python", "run.py") test_list.append(pywrapper_Unst_Heat_Source) + ############################################## ### Method of Manufactured Solutions (MMS) ### ############################################## diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index 9081b19c7d45..11e524317437 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -24,8 +24,9 @@ # You should have received a copy of the GNU Lesser General Public # License along with SU2. If not, see . -import pysu2ad from mpi4py import MPI +import sys +import pysu2 # imports the SU2 wrapped module common_settings = """ SOLVER= HEAT_EQUATION @@ -104,21 +105,16 @@ def RunPrimal(size): if rank == 0: with open('config_unsteady.cfg', 'w') as f: f.write(common_settings.replace('__SIZE__', str(size)) + primal_settings) + print("\n------------------------------ Begin Solver -----------------------------\n") + sys.stdout.flush() + comm.Barrier() - # Initialize the primal driver of SU2, this includes solver preprocessing. + # Initialize the corresponding driver of SU2, this includes solver preprocessing try: - driver = pysu2ad.CSinglezoneDriver('config_unsteady.cfg', 1, comm) + driver = pysu2.CSinglezoneDriver("config_unsteady.cfg", 1, comm); except TypeError as exception: - print('A TypeError occured in pysu2ad.CSinglezoneDriver : ', exception) - raise - - # Get the ID of the markers where the heat flux is applied. - all_marker_ids = driver.GetMarkerIndices() - marker_names = ['x_minus', 'x_plus', 'y_minus', 'y_plus'] - marker_ids = [] - for name in marker_names: - marker_ids.append(all_marker_ids[name] if name in all_marker_ids else -1) + print('A TypeError occured in pysu2.CDriver : ',exception) # Run the time loop in python to vary the heat flux. dt = driver.GetUnsteadyTimeStep() From 19ec229126e0a21a8d9a61a3080db5b3b589878f Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 7 Jan 2026 09:21:24 +0100 Subject: [PATCH 06/13] add regression values --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index edd26a073e7f..07a72635302e 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1541,7 +1541,7 @@ def main(): pywrapper_Unst_Heat_Source.cfg_file = "run.py" pywrapper_Unst_Heat_Source.test_iter = 10 pywrapper_Unst_Heat_Source.unsteady = True - pywrapper_Unst_Heat_Source.test_vals = [0.776365, 0.776430, 1.000003] + pywrapper_Unst_Heat_Source.test_vals = [-5.235402, 300.010000, 300.000000] pywrapper_Unst_Heat_Source.command = TestCase.Command("mpirun -n 2", "python", "run.py") test_list.append(pywrapper_Unst_Heat_Source) From ebd51f19b80d20e96878ad5e5a911f46f5d9a2d3 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 09:57:00 +0100 Subject: [PATCH 07/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index 11e524317437..097e87eb3f29 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -112,7 +112,7 @@ def RunPrimal(size): # Initialize the corresponding driver of SU2, this includes solver preprocessing try: - driver = pysu2.CSinglezoneDriver("config_unsteady.cfg", 1, comm); + driver = pysu2.CSinglezoneDriver("config_unsteady.cfg", 1, comm) except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) From b4400faa04b6096842f5f0308cfa16588b33efc6 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 09:58:21 +0100 Subject: [PATCH 08/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 1 - 1 file changed, 1 deletion(-) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index 097e87eb3f29..ece061f628f7 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -156,7 +156,6 @@ def RunPrimal(size): def main(): comm = MPI.COMM_WORLD - #rank = comm.Get_rank() RunPrimal(0.1) From 037641b955d91a84537fac98e32578f72f0f0775 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 09:58:33 +0100 Subject: [PATCH 09/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 1 - 1 file changed, 1 deletion(-) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index ece061f628f7..200fff94dee5 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -155,7 +155,6 @@ def RunPrimal(size): def main(): - comm = MPI.COMM_WORLD RunPrimal(0.1) From a7471ca6678fed9baf6307b9df1afceec43e925d Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 11:30:56 +0100 Subject: [PATCH 10/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 1 + 1 file changed, 1 insertion(+) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index 200fff94dee5..008249fe5a9b 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -115,6 +115,7 @@ def RunPrimal(size): driver = pysu2.CSinglezoneDriver("config_unsteady.cfg", 1, comm) except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) + raise # Run the time loop in python to vary the heat flux. dt = driver.GetUnsteadyTimeStep() From 76331efaeb694a4e9f9a5c825a977ae06b189e05 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 13:09:02 +0100 Subject: [PATCH 11/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index 008249fe5a9b..cd097b848d06 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ## \file run.py -# \brief Unsteady adjoint heat transfer case with custom heat flux. +# \brief Unsteady heat transfer case with custom source term. # \version 8.3.0 "Harrier" # # SU2 Project Website: https://su2code.github.io From 4dce74017c1558a7332e2f075bb67b3c57f02145 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 13:09:53 +0100 Subject: [PATCH 12/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index cd097b848d06..eeb73724a67d 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -125,9 +125,6 @@ def RunPrimal(size): for time_iter in range(driver.GetNumberTimeIter()): - # Custom heat flux. - #ApplyHeatFlux(time_iter * dt, driver, marker_ids) - # set the source term, per point for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()): # add source term: From a2caf628c20353f1795025a66bcf06dcd0ad3a15 Mon Sep 17 00:00:00 2001 From: Nijso Date: Wed, 7 Jan 2026 13:10:54 +0100 Subject: [PATCH 13/13] Apply suggestion from @bigfooted --- TestCases/py_wrapper/custom_heat_source/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/py_wrapper/custom_heat_source/run.py b/TestCases/py_wrapper/custom_heat_source/run.py index eeb73724a67d..563278aff0c7 100644 --- a/TestCases/py_wrapper/custom_heat_source/run.py +++ b/TestCases/py_wrapper/custom_heat_source/run.py @@ -96,7 +96,7 @@ def HeatSource(time, driver, iPoint): def RunPrimal(size): """ - Run the heat solver with a custom heat (function of time) flux on all boundaries. + Run the heat solver with a custom heat source. Returns the final average boundary temperature. """ comm = MPI.COMM_WORLD