Skip to content

Addition of species diffusion term to surface heat flux#1383

Merged
jtneedels merged 21 commits intodevelopfrom
feature_NEMO_Jhs
Oct 3, 2021
Merged

Addition of species diffusion term to surface heat flux#1383
jtneedels merged 21 commits intodevelopfrom
feature_NEMO_Jhs

Conversation

@jtneedels
Copy link
Copy Markdown
Contributor

Proposed Changes

  • Addition of species diffusion terms to surface energy balance in NEMO, important for highly dissociated flows
  • Addition of vector for s species, "enthalpys", to variable to store values accessed in solver.
  • General cleanup/commenting of the NEMO heat flux computation in CFVMFlowSolverBase.inl.

Related Work

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 the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • 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.

@jtneedels jtneedels requested review from WallyMaier and pcarruscag and removed request for pcarruscag September 29, 2021 00:04
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 29, 2021

This pull request introduces 1 alert when merging ffa2836 into 6338bff - view on LGTM.com

new alerts:

  • 1 for Comparison of narrow type with wide type in loop condition

Signed-off-by: jtneedels <[email protected]>
Signed-off-by: jtneedels <[email protected]>
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 29, 2021

This pull request introduces 1 alert when merging b14d3a5 into 6338bff - view on LGTM.com

new alerts:

  • 1 for Comparison of narrow type with wide type in loop condition

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 29, 2021

This pull request fixes 2 alerts when merging d10a6c3 into 057da5b - view on LGTM.com

fixed alerts:

  • 2 for Comparison of narrow type with wide type in loop condition

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 30, 2021

This pull request fixes 2 alerts when merging 8e311ad into 057da5b - view on LGTM.com

fixed alerts:

  • 2 for Comparison of narrow type with wide type in loop condition

Copy link
Copy Markdown
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

LGTM code-wise

Comment on lines +2599 to +2604
for (iDim = 0; iDim < nDim; iDim++) {
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) {
dYsn = Grad_PrimVar[RHOS_INDEX+iSpecies][iDim]/rho*UnitNormal[iDim];
sumJhs += rho*Ds[iSpecies]*dYsn*hs[iSpecies];
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Clean this up please, you're dividing by rho, then multiplying on the line below.
And use the geometry toolbox for dot products with the unit normal, saves the loop over nDim (which is in the wrong order, should be inside the species loop).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll do the same for the compressible and incompressible heat fluxes as well. It looks like there are a lot of iDim loops that can be replaced in friction forces. I can open a separate PR to replace those, would that be a good idea?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to fix all of them (unless you really want to of course) not introducing new ones is enough :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haha sounds good, I'll do those two since it's quick. Is the benefit to using GeometryToolbox for dot products because it reduces lines of code, and should be faster since its an inline function?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside from cleanup / expressiveness (i.e. reading a word instead of code), we gain some safety by being able to:
const su2double a = GeometryToolbox::Something(...)
Instead of having to allow a to be modified.
On the performance side, one of the main sources of inefficiency in SU2 is that the compilers "don't know" that loops over nDim, nVar, nSpecies, are super small, and they often make them inefficient by applying optimizations that are only profitable for large loops.
By encapsulating those loops over nDim we have a single place where we can inform the compilers (via all sorts of compiler-specific directives or in the limit by stating "nDim is 2 or 3") we are not doing this yet.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 30, 2021

This pull request fixes 2 alerts when merging 2f8e7e3 into 58c580b - view on LGTM.com

fixed alerts:

  • 2 for Comparison of narrow type with wide type in loop condition

@jtneedels jtneedels requested a review from pcarruscag October 3, 2021 03:58
@jtneedels jtneedels requested a review from WallyMaier October 3, 2021 04:23
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Oct 3, 2021

This pull request fixes 2 alerts when merging c5044a2 into 58c580b - view on LGTM.com

fixed alerts:

  • 2 for Comparison of narrow type with wide type in loop condition

Copy link
Copy Markdown
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

Thanks for the additional cleanup 👍

@pr-triage pr-triage bot removed the PR: unreviewed label Oct 3, 2021
@jtneedels jtneedels merged commit d1e3568 into develop Oct 3, 2021
@jtneedels jtneedels deleted the feature_NEMO_Jhs branch October 3, 2021 15:30
@pr-triage pr-triage bot added the PR: merged label Oct 3, 2021
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.

3 participants