Skip to content
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

Small cleanup of NEMO solver #1488

Merged
merged 10 commits into from
Jan 20, 2022
Merged

Small cleanup of NEMO solver #1488

merged 10 commits into from
Jan 20, 2022

Conversation

WallyMaier
Copy link
Contributor

@WallyMaier WallyMaier commented Jan 12, 2022

Proposed Changes

This PR cleans up some functions in NEMO. removing some unused code, adding comments, etc.
I plan to do some more cleanup for the PR, but this should impact the functioning of the code at all.

Future work will:
1.) Update boundary conditions to a working state (Supersonic Inlet, inlet, etc.)
2.) Make use of CharacPrimVar() for further code integration
3.) Remove dependency of conserved variables in numerical schemes

Comment on lines 81 to 82


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

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

Important change, I know :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect! Hahah ill change this. The main motivation for doing this is because I keep running into inconsistencies within branches!

Copy link
Member

Choose a reason for hiding this comment

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

clang-format is your friend...

@WallyMaier WallyMaier changed the title [WIP] Cleanup of NEMO solver Small cleanup of NEMO solver Jan 17, 2022
@WallyMaier WallyMaier marked this pull request as ready for review January 17, 2022 22:58

/*--- Allocate the value at the outlet ---*/
V_outlet = GetCharacPrimVar(val_marker, iVertex);
Copy link
Contributor Author

@WallyMaier WallyMaier Jan 18, 2022

Choose a reason for hiding this comment

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

U_domain is interesting. We need it for CNEMONumerics InviscidProjFlux/Jacs....working on it

Here were are allocating using GetCharacPrimVar.

@WallyMaier WallyMaier changed the title Small cleanup of NEMO solver [WIP] Small cleanup of NEMO solver Jan 18, 2022
su2double *U_domain = new su2double[nVar]; su2double *U_outlet = new su2double[nVar];
su2double *V_domain = new su2double[nPrimVar]; su2double *V_outlet = new su2double[nPrimVar];
su2double *U_domain;
su2double *U_outlet = new su2double[nVar];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, I can't do something without the regression values changing:
su2double *U_outlet; U_outlet = nodes->GetSolution(iPoint); for (iVar =0 ....) U_outlet[iVar]=0.0;

Any ideas?

Copy link
Member

Choose a reason for hiding this comment

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

That would write over the solution at iPoint since GetSolution returns a pointer, that's where the "const everything" guideline comes from.
const su2double* U_outlet = nodes->GetSolution(iPoint);
With that said, maybe that is what you are trying to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh. My idea was to initialize the U_outlet vector with the 'new' command.

Ideally this problem goes away once I break the reliance of the conserved variables in some of the numerical schemes.

@WallyMaier WallyMaier changed the title [WIP] Small cleanup of NEMO solver Small cleanup of NEMO solver Jan 19, 2022
@@ -45,7 +45,7 @@ class CNEMOCompOutput final: public CFlowOutput {
* \brief Constructor of the class
* \param[in] config - Definition of the particular problem.
*/
CNEMOCompOutput(CConfig *config, unsigned short nDim);
CNEMOCompOutput(const CConfig *config, unsigned short nDim);
Copy link
Member

Choose a reason for hiding this comment

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

👍

SU2_CFD/src/output/CNEMOCompOutput.cpp Outdated Show resolved Hide resolved
su2double *U_domain = new su2double[nVar]; su2double *U_outlet = new su2double[nVar];
su2double *V_domain = new su2double[nPrimVar]; su2double *V_outlet = new su2double[nPrimVar];
su2double *U_domain;
su2double *U_outlet = new su2double[nVar];
Copy link
Member

Choose a reason for hiding this comment

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

That would write over the solution at iPoint since GetSolution returns a pointer, that's where the "const everything" guideline comes from.
const su2double* U_outlet = nodes->GetSolution(iPoint);
With that said, maybe that is what you are trying to do?

@WallyMaier WallyMaier merged commit 648cf4c into develop Jan 20, 2022
@WallyMaier WallyMaier deleted the nemo_cleanup branch January 20, 2022 17:55
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