Implicit solver for inviscid NEMO problems#1399
Conversation
|
This pull request introduces 7 alerts when merging 88e9e9f into b1a47bb - view on LGTM.com new alerts:
|
| Jacobian_i[nSpecies+nDim][nSpecies+iDim] += cte*dPdU_i[nSpecies+iDim]; | ||
| Jacobian_i[nSpecies+nDim][nSpecies+nDim] += cte*(1+dPdU_i[nSpecies+nDim]); |
There was a problem hiding this comment.
This type of repetition of the indices is not ideal for new NEMO developers I imagine. Probably worth keeping it in mind for the future.
There was a problem hiding this comment.
Agree. Ill make a note of this in the next NEMO meeting.
pcarruscag
left a comment
There was a problem hiding this comment.
Don't forget to fix the LGTM warnings
| MolarFrac[iSpecies] = (rhos[iSpecies] / MolarMass[iSpecies]) / conc; | ||
|
|
||
| /*--- Compute Eve and Eve* ---*/ | ||
| eve_eq = ComputeSpeciesEve(T, true); |
There was a problem hiding this comment.
Maybe I missed it, are these private vars? It looks like the declaration was removed.
There was a problem hiding this comment.
Yes, the only live in CSU2TCLib. They are declared in the hpp and resized early in the file.
| % | ||
| % Courant-Friedrichs-Lewy condition of the finest grid | ||
| CFL_NUMBER= 0.5 | ||
| CFL_NUMBER= 3 |
There was a problem hiding this comment.
Is this a new test case, or did you change the old one? We should probably have one each for implicit and explicit, to cover all bases.
There was a problem hiding this comment.
This is just an updated case. I'm not so sure that an implicit and explicit case are necessary, since the residuals are still used in the the implicit case.
|
Nice job Wally! Thanks for pulling this together, I know this was a lot of changes in one PR, but all necessary to get implicit working. |
| if (implicit) { | ||
| for (auto jVar = 0; jVar < nVar; jVar++){ | ||
| if (residual.jacobian_i[iVar][jVar] != residual.jacobian_i[iVar][jVar]) ERR = true; | ||
| if ((jac_j) && (residual.jacobian_j[iVar][jVar] != residual.jacobian_j[iVar][jVar])) ERR = true; |
There was a problem hiding this comment.
| if ((jac_j) && (residual.jacobian_j[iVar][jVar] != residual.jacobian_j[iVar][jVar])) ERR = true; | |
| if (jac_j && std::isnan(SU2_TYPE::GetValue(residual.jacobian_j[iVar][jVar]))) ERR = true; |
|
|
||
| ws = fluidmodel->ComputeNetProductionRates(); | ||
| /*---Compute Prodcution/destruction terms ---*/ | ||
| ws = fluidmodel->ComputeNetProductionRates(implicit, V_i, eve_i, Cvve_i, |
There was a problem hiding this comment.
Do you need ws as a member variable or can you const auto& here? Same question for other vectors I saw in the numerics classes.
There was a problem hiding this comment.
I can const auto. Ill look for other places to const auto in the numerics classes. I plan to go through the viscous portion in the portion.
| } | ||
|
|
||
| void CNEMOGas::ComputedPdU(su2double *V, vector<su2double>& val_eves, su2double *val_dPdU){ | ||
| void CNEMOGas::ComputedPdU(const su2double *V, const vector<su2double>& val_eves, su2double *val_dPdU){ |
Proposed Changes
This introduces the implicit solver for the Euler solver with SU2-NEMO. I created this branch/PR for a clean commit history version.
This PR also does some general cleanup (declaring variables, use of geometry toolbox) to be more consistent in the SU2 style.
Related Work
This is based on the previous draft PR #1356. And in general work continued from other NEMO cleanups #1343 and #1347.
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.