-
Notifications
You must be signed in to change notification settings - Fork 913
Fix enthalpy related issues #2652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Co-authored-by: Cristopher Morales <98025159+Cristopher-Morales@users.noreply.github.com>
…into fix_restart_scalars
…into fix_restart_scalars
| 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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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..
…into fix_restart_scalars
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R92
| @@ -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) | ||
|
|
Proposed Changes
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.
pre-commit run --allto format old commits.