-
Notifications
You must be signed in to change notification settings - Fork 849
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
Fix for axisymmetric terms in NEMO + general NEMO updates #1326
Conversation
@@ -3582,14 +3582,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i | |||
SU2_MPI::Error("AUSMPW+ is extremely unstable. Feel free to fix me!", CURRENT_FUNCTION); | |||
} | |||
|
|||
if (GetGasModel() == "ARGON" && GetKind_FluidModel() == SU2_NONEQ){ | |||
SU2_MPI::Error("ARGON is not working with SU2_NONEQ fluid model!", CURRENT_FUNCTION); |
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.
These are now working.
@@ -5023,7 +5015,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i | |||
/*--- Specifying a deforming surface requires a mesh deformation solver. ---*/ | |||
if (GetSurface_Movement(DEFORMING)) Deform_Mesh = true; | |||
|
|||
if (GetGasModel() == "ARGON") monoatomic = true; | |||
if (GetGasModel() == "ARGON") {monoatomic = true;} |
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.
Prevents some issues with unintialized jumps
-TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][0])); | ||
+v*TWO3*(2*PrimVar_Grad_i[1][1]-PrimVar_Grad_i[1][0] | ||
-v*yinv+U_i[0]*turb_ke_i)) | ||
+total_conductivity_i*PrimVar_Grad_i[0][1]) |
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.
@FlorianDm should this value be "-total_conductivity_i*PrimVar"?
The term appears as "-qy" in the literature. Where "qy" is defined as "-k dt/du"
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.
Indeed I believe it should actually be +k dT/dy then. Thanks for spotting this. The test case i made breaks so I will rerun it with this branch
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.
Ok so I reran the test case with this branch. I guess I should wait until this PR is to be merged to push the changes in the regression files to the TestCases repo so any other open PRs don't get failed regressions
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.
or is the rest ready to go? If it may take a while maybe I better do the fix now in another PR in concert with the TestCases changes so it can be merged straight away as a simple fix and then you just merge the latest develop in here.. let me know what you think is best
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.
@FlorianDm Glad you could confirm! This PR should be done on Monday/Tuesday (hopefully) and Ill update the regression tests. However, if you want to go ahead to address it case before then, thats fine as well!
@@ -324,10 +324,6 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ | |||
break; | |||
} | |||
|
|||
//Auxiliary variables for post-processment |
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.
removing repeated line
@@ -1670,23 +1665,23 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contai | |||
|
|||
/*--- Species diffusion coefficients ---*/ | |||
visc_numerics->SetDiffusionCoeff(nodes->GetDiffusionCoeff(iPoint), | |||
node_infty->GetDiffusionCoeff(0) ); | |||
nodes->GetDiffusionCoeff(iPoint)); |
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.
This is more consistent with the baseline SU2.
for (iPoint = 0; iPoint < nPoint; iPoint++) { | ||
su2double yCoord = geometry->nodes->GetCoord(iPoint, 1); | ||
su2double yVelocity = nodes->GetVelocity(iPoint,1); | ||
su2double xVelocity = nodes->GetVelocity(iPoint,0); | ||
su2double Total_Viscosity = nodes->GetLaminarViscosity(iPoint) + nodes->GetEddyViscosity(iPoint); | ||
|
||
if (yCoord > EPS){ | ||
su2double nu_v_on_y = Total_Viscosity*yVelocity/yCoord; | ||
nodes->SetAuxVar(iPoint, 0, nu_v_on_y); | ||
nodes->SetAuxVar(iPoint, 1, nu_v_on_y*yVelocity); | ||
nodes->SetAuxVar(iPoint, 2, nu_v_on_y*xVelocity); | ||
} | ||
} | ||
|
||
/*--- Compute the auxiliary variable gradient with GG or WLS. ---*/ | ||
if (config->GetKind_Gradient_Method() == GREEN_GAUSS) { | ||
SetAuxVar_Gradient_GG(geometry, config); | ||
} | ||
if (config->GetKind_Gradient_Method() == WEIGHTED_LEAST_SQUARES) { | ||
SetAuxVar_Gradient_LS(geometry, config); | ||
} |
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.
Move this to CFVMFlowSolverBase.inl and share it between CEulerSolver and CNEMOEulerSolver please (the bug is in CEuler solver, not here)
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.
Could you explain why this would go in .inl and not .hpp? Just for future reference? Is it because the function is identical and not a template? And if thats the case, should I make it a template and include the incompressible portion of the code?
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.
Yes, the logic is more or less: if the method does not have to be a template then it is declared in the .hpp and implemented in .inl of CFVMSolverBase.
If it has to be a template, or you want it to be "inlineable", then it has to go in the .hpp.
But both files are headers, the only thing that changes is the "visibility", e.g. CEulerSolver includes the hpp but not the inl.
At the moment the inl is included by the NS solvers, at the top of the associated .cpp's you'll see
/*--- Explicit instantiation of the parent class of CIncEulerSolver,
* to spread the compilation over two cpp files. ---*/
template class CFVMFlowSolverBase<CIncEulerVariable, ENUM_REGIME::INCOMPRESSIBLE>;
That also means that if you change something in the .inl only the NS solvers recompile, but not the Euler solvers (which sounded like a good idea because e.g. CEulerSolver is a reasonably large file).
The incompressible version looks different enough to be either its own method or left as is.
My rule of thumb for such master versions is not to have physics-based conditionals in there (e.g. "if compressible"), if necessary, that type of detail should be provided from the outside, and not already present in the body of the "master" version.
In other words, we want those versions to be generic in the sense they allow externally provided specialization, not in the sense they already try to cover all possible options.
I hope this makes some sense.
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.
Done!
Everything is up-to-date. I just need to update the TestCase folder....not sure what that order is... |
@@ -227,7 +227,7 @@ def main(): | |||
axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" | |||
axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" | |||
axi_rans_air_nozzle.test_iter = 10 | |||
axi_rans_air_nozzle.test_vals = [-12.094937, -6.622043, -8.814412, -2.393288] | |||
axi_rans_air_nozzle.test_vals = [-6.348077, -0.827162, -2.241982, 2.313210] |
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.
Just to clarify, the way I had done the regressions was with RESTART=YES in the config file where the restart file in TestCases solution_flow.dat was already converged to rho<1e-12 so it would just do 10 iterations and then those values I took. I see you did it differently since the values are only at 1e-6. I guess it does not matter but just wanted to clarify
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.
@FlorianDm, thanks for the clarification. I only updated the values in the regression test, so it still should be a restart. I could make an update to the current solution, or change the cfg to RESTART=NO. Though I was dumb and already pushed the changes in the TestCases...I dont this to sit broken, so I may just put in another small PR
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.
The order is to merge into testcases first just before merging this branch (then you can manually trigger the tests to re-run).
Proposed Changes
-This work is focused on fixing some of the axisymmetric loop structures within NEMO, which prevented residual evolution. This also changes a viscous planar wedge regression to an axisymmetric case.
-Code updates to make NEMO more-in-line with SU2 code style. i.e. variable declarations, SU2 MPI errors, etc.
-Fixes bug in vibrational-electronic functionality for CSU2TCLib
-Updating ionization/nheavy loops so CSU2TCLib and CMutationTCLib are consistent.
Related Work
This addresses/builds on #1106 #1205
PR Checklist