Repository navigation
Add the case for the P1 radiation with a python heat source tutorial - #90
pragyaangaur wants to merge 2 commits into
Conversation
This adds run.py for the tutorial on the P1 radiation model and PYTHON_CUSTOM_SOURCE. The script heats a square air cavity with an elliptical source set from python and runs with or without the P1 model, depending on the absorption coefficient given as its argument.
|
Hi @pragyaangaur can you also put this in a regression test in su2, we have a tutorials.py regression script for this. |
bigfooted
left a comment
There was a problem hiding this comment.
Thanks, the setup is correct: the source units, the energy index, the owned-node count and the MPI handling all check out. I ran run.py on 4 ranks:
| k (1/m) | its | rms[h] | T_max (K) | TOTAL_HEATFLUX (W/m) | source (W/m) |
|---|---|---|---|---|---|
| 0 | 946 | -9.04 | 325.69 | 15.808 | 15.708 |
| 1 | 5610 | -9.00 | 324.57 | 14.961 | 15.708 |
| 10 | 8000 (limit) | -8.25 | 319.58 | 10.913, still drifting | 15.708 |
At k=0 the balance closes to 0.6%, which comes from sampling the ellipse at the nodes. With radiation on it does not close: TOTAL_HEATFLUX is conduction only, and the P1 wall flux Theta*(4 sigma Tw^4 - G) is not reported anywhere.
Action points:
- SU2 (separate PR): make
TOTAL_HEATFLUX(and the per-markerHEATFLUX) include the P1 radiative wall flux when radiation is active. After that, the script's energy balance should close for every k. - k=10 does not converge within 8000 iterations, and the heat flux is still changing. Fix the settings (CFL,
CFL_NUMBER_RAD, linear solver) or drop k=10 from the tutorial. Also addRMS_RAD_ENERGYtoCONV_FIELD, since the P1 residual stays around -5 while rms[h] reaches -9. - Make the case runnable from
TestCases/tutorials.py.TestCaseedits ITER in acfg_fileon disk and passes that file name asargv[1], sofloat(sys.argv[1])crashes, and the generated cfg would overwrite the edited one anyway. Ship acavity.cfg, take its path from argv, and pass the absorption coefficient as a second argument (as inpy_wrapper/custom_source_buoyancy). Then add a k=1 test with a smalltest_iter, checking the RMS residuals includingRMS_RAD_ENERGY. - Tutorial text: state that kL = 0.05 and 0.5 are for demonstration only, since real air is essentially transparent. Also explain the 0.6% gap at k=0.
The script now reads the config file from its first argument, as TestCase passes it, and takes an optional absorption coefficient as a second argument, for which it writes a copy of the config. The case converges on both the enthalpy and the P1 residual, and the run with an absorption coefficient of 10 1/m is dropped because the segregated coupling makes it converge very slowly.
|
Thanks for the careful review. I have addressed all four points.
|
This adds
multiphysics/P1_radiation_python/run.py, the case for a new tutorial on the website. The script heats a square air cavity with a rotated elliptical source applied throughPYTHON_CUSTOM_SOURCEand runs it with or without the P1 radiation model, depending on the absorption coefficient given as its argument. The configuration is written by the script and the mesh is generated by SU2 withMESH_FORMAT= RECTANGLE, so no other files are needed.The tutorial page is in a companion pull request on su2code.github.io. It follows the suggestion in su2code/SU2#3021. I ran the script with absorption coefficients of 0, 1 and 10 1/m on SU2 develop, both serially and on 4 MPI ranks.