Skip to content

Conversation

@bigfooted
Copy link
Contributor

@bigfooted bigfooted commented Dec 22, 2025

Proposed Changes

  • use reference temperature for enthalpy consistenly
  • Write temperature to paraview when energy=off, being consistent with other thermodynamic quantities like viscosity.
  • Fixed a bug when restarting with species.
  • When energy=off, enthalpy field will still be used to compute temperature (necessary for python wrapper)
  • Fixed an MPI bug where viscosity was out of sync when computing non-constant mass diffusivity
  • update python wrapper case. No need to put ENERGY=ON anymore. temperature field is written to paraview

Related Work

small fixes for #2426

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@bigfooted bigfooted changed the title fixe scalar restart, update psi case fix scalar restart, update psi case Dec 22, 2025
@bigfooted bigfooted changed the title fix scalar restart, update psi case Fix scalar restart, update psi case Dec 22, 2025
@bigfooted bigfooted changed the title Fix scalar restart, update psi case [WIP] Fix scalar restart, update psi case Dec 22, 2025
bigfooted and others added 4 commits December 22, 2025 11:22
Co-authored-by: Cristopher Morales <98025159+Cristopher-Morales@users.noreply.github.com>
@bigfooted bigfooted changed the title [WIP] Fix scalar restart, update psi case Fix scalar restart, update psi case Dec 22, 2025
@bigfooted bigfooted changed the title Fix scalar restart, update psi case [WIP] Fix scalar restart, update psi case Dec 22, 2025
@bigfooted bigfooted marked this pull request as draft December 22, 2025 14:23
@bigfooted bigfooted changed the title [WIP] Fix scalar restart, update psi case [WIP] Fix enthalpy related issues Dec 23, 2025
@bigfooted bigfooted changed the title [WIP] Fix enthalpy related issues Fix enthalpy related issues Dec 27, 2025
@bigfooted bigfooted marked this pull request as ready for review December 27, 2025 14:33
Comment on lines 61 to 64
const su2double t_ref = config->GetStandard_RefTemperatureND();
Enthalpy_Ref = 0.0;
su2double t_i = 1.0;
for (int i = 0; i < N; ++i) {
t_i *= t_ref;
t_i *= STD_REF_TEMP;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does non-dimensionalization work here?

su2double t_i = 1.0;
for (int i = 0; i < N; ++i) {
t_i *= STD_REF_TEMP;
t_i *= STD_REF_TEMP / config->GetInc_Temperature_Ref();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a std_ref_temp_nd in CConfig probably makes sense if this will be used a lot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have a temperature_ref and a temperature_init, I think we should re-use that.

Note Cp = Cv, (gamma = 1).*/
Temperature = t;
Enthalpy = Cp * Temperature;
Enthalpy = Cp * (Temperature - STD_REF_TEMP); // Sensible enthalpy relative to STD_REF_TEMP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about here? Is it always dimensional?

Copy link
Contributor Author

@bigfooted bigfooted Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it. I'll introduce Temperature_Ref for enthalpy nondimensionalization upstream of this..

sp_pinArray_2d_dp_hf_tp.test_iter = 25
sp_pinArray_2d_dp_hf_tp.test_vals = [-4.736222, 1.323245, -0.713370, 208.023676]
sp_pinArray_2d_dp_hf_tp.test_vals_aarch64 = [-4.733643, 1.325195, -0.713411, 208.023676]
sp_pinArray_2d_dp_hf_tp.test_vals = [-4.739709, -0.713547, 208.023676

Check failure

Code scanning / CodeQL

Syntax error Error

Syntax Error (in Python 3).

Copilot Autofix

AI about 5 hours ago

In general, to fix this issue we need to correct the malformed list literal so that it is valid Python 3 syntax. That means ensuring all brackets are properly closed and the assignment statement is complete.

The best minimal fix without changing functionality is to add the missing closing ] at the end of the sp_pinArray_2d_dp_hf_tp.test_vals list on line 92. This will make it consistent with the test_vals_aarch64 list on line 93 and with similar test_vals definitions above. No imports, new methods, or other structural changes are required; only the single line 92 in TestCases/tutorials.py needs to be corrected.

Suggested changeset 1
TestCases/tutorials.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py
--- a/TestCases/tutorials.py
+++ b/TestCases/tutorials.py
@@ -89,7 +89,7 @@
     sp_pinArray_2d_dp_hf_tp.cfg_dir   = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic"
     sp_pinArray_2d_dp_hf_tp.cfg_file  = "sp_pinArray_2d_dp_hf_tp.cfg"
     sp_pinArray_2d_dp_hf_tp.test_iter = 25
-    sp_pinArray_2d_dp_hf_tp.test_vals = [-4.739709, -0.713547, 208.023676
+    sp_pinArray_2d_dp_hf_tp.test_vals = [-4.739709, -0.713547, 208.023676]
     sp_pinArray_2d_dp_hf_tp.test_vals_aarch64 = [-4.739709, -0.713547, 208.023676]
     test_list.append(sp_pinArray_2d_dp_hf_tp)
 
EOF
@@ -89,7 +89,7 @@
sp_pinArray_2d_dp_hf_tp.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic"
sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg"
sp_pinArray_2d_dp_hf_tp.test_iter = 25
sp_pinArray_2d_dp_hf_tp.test_vals = [-4.739709, -0.713547, 208.023676
sp_pinArray_2d_dp_hf_tp.test_vals = [-4.739709, -0.713547, 208.023676]
sp_pinArray_2d_dp_hf_tp.test_vals_aarch64 = [-4.739709, -0.713547, 208.023676]
test_list.append(sp_pinArray_2d_dp_hf_tp)

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants