-
Notifications
You must be signed in to change notification settings - Fork 844
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
[WIP] Feature turbomachinery restruct singlezone #1316
Conversation
Conflicts: SU2_CFD/include/solvers/CEulerSolver.hpp SU2_CFD/src/integration_time.cpp SU2_CFD/src/iteration_structure.cpp SU2_CFD/src/meson.build SU2_CFD/src/solvers/CEulerSolver.cpp SU2_CFD/src/solvers/CNSSolver.cpp
…e screen output iterations
…://github.com/su2code/SU2 into feature_turbomachinery_restruct_singlezone
…ery boundary value table added for priting, printing frequency is still hard coded, to be fixed in future
…ing Plane under process. Turbine and Compressor calcualtion if statement added
…e performance is not computer for all blades. This needs to be identified and implemented
…ixed and turbo span calculation to be fixed.
…. Mutizone is still crashing... investigation in progress
…is working. Need to revisit the performance computation next week to fix the calcualtions
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.
Thank you @salvovitale and @NAnand-TUD this is a tremendous step forward, I cannot wait to delete some legacy parts of SU2.
Just a heads up, you have some changes to codi and meson.
Common/src/CConfig.cpp
Outdated
@@ -1499,6 +1499,9 @@ void CConfig::SetConfig_Options() { | |||
/*!\brief TURBOMACHINERY_KIND \n DESCRIPTION: types of turbomachynery architecture. | |||
\n OPTIONS: see \link TurboMachinery_Map \endlink \n Default: AXIAL */ | |||
addEnumListOption("TURBOMACHINERY_KIND",nTurboMachineryKind, Kind_TurboMachinery, TurboMachinery_Map); | |||
/*!\brief TURBOMACHINERY_KIND \n DESCRIPTION: types of turbomachynery Performance Calculations. | |||
\n OPTIONS: see \link TurboPerfKind_Map \endlink \n Default: TURBINE */ | |||
addEnumListOption("TURBO_PERF_KIND", nTurboMachineryKind, Kind_TurboPerf=0, TurboPerfKind_Map); |
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 does the =0 do?
if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))){ | ||
nSpan++; | ||
if ((jVertex != -1) && (PeriodicBoundary == ((val_iZone) + 1)) && nodes->GetDomain(iPoint)) { | ||
nSpan++; |
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.
Was my fix of this function incorrect?
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.
There were a lot of differences in this file, so I tried to stick to the algorithm the was working than to have more uncertainty.
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.
I could argue the same, since I went out of my way to debug this problem for this user #1219 when no one else did. So, if it is all the same, put it back.
* \file iteration_structure.hpp | ||
* \brief Headers of the iteration classes used by SU2_CFD. |
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 and the associated .cpp were split into separate files. You will need to delete and commit.
SU2_CFD/include/objectives/turbomachinery/CTurbomachineryPerformance.hpp
Outdated
Show resolved
Hide resolved
solver_container[FinestMesh][FLOW_SOL]->TurboAverageProcess(solver_container[FinestMesh], geometry[FinestMesh],config,INFLOW); | ||
solver_container[FinestMesh][FLOW_SOL]->TurboAverageProcess(solver_container[FinestMesh], geometry[FinestMesh], config, OUTFLOW); | ||
|
||
/*--- Gather Inflow and Outflow quantities on the Master Node to compute performance ---*/ | ||
|
||
solver_container[FinestMesh][FLOW_SOL]->GatherInOutAverageValues(config, geometry[FinestMesh]); | ||
|
||
/* --- compute turboperformance for each stage and the global machine ---*/ | ||
//TODO: for multi-zone turbo this should be move to the last zone ---*/ | ||
solver_container[FinestMesh][FLOW_SOL]->ComputeTurboPerformance(config, geometry[FinestMesh]); | ||
} |
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 these be wrapped by a single method? Just to reduce the number of virtual methods in CSolver (less virtual boilerplate to maintain)
if (config[ZONE_0]->GetBoolTurbomachinery() && config[val_iZone]->GetSinglezone_Driver()){ | ||
|
||
/*--- Turbomachinery Performance Computation ---*/ | ||
if (val_iZone == config[ZONE_0]->GetnZone()-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.
Why not just ZONE_0 ? You want the last? (but there single zone driver only does one 🤔 )
rampFreq = SU2_TYPE::Int(config_container[ZONE_0]->GetRampOutletPressure_Coeff(1)); | ||
finalRamp_Iter = SU2_TYPE::Int(config_container[ZONE_0]->GetRampOutletPressure_Coeff(2)); |
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.
At some point you may want a more expressive way to do this, for example create a small struct for "ramps" so that you can access things by name (e.g. frequency) we have the same problem with adaptive CFL params.
auto velocity = primitiveState.GetVelocity(); | ||
Velocity.assign(velocity.begin(), velocity.end()); |
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 is for these types of things that returning const &
is more efficient.
auto enthalpyOutIs = FluidModel.GetStaticEnergy() + OutletState.GetPressure() / FluidModel.GetDensity(); | ||
auto tangVel = primitives.GetOutletPrimitiveState().GetTangVelocity(); | ||
auto relVelOutIs2 = 2 * (OutletState.GetRothalpy() - enthalpyOutIs) + tangVel * tangVel; |
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.
Don't use auto for the return of computations with su2doubles, causes AD problems, use su2double explicitly.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions. |
Proposed Changes
This branch includes steady state turbomachinery features like multi-zone mixing plane, pressure ramps and rotations ramps essential for convergence. In additions, multi-zone performance computations with screen output is also implemented here.
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.
*Please note, this is a draft pull request. I wish to get more comments on the section of code which are working like, mixing plane and performance computations. Config, tutorial and comments will be updated follow soon after.