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

[WIP] Feature turbomachinery restruct singlezone #1316

Closed
wants to merge 45 commits into from

Conversation

NAnand-TUD
Copy link

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

  • The code now follows the same path as that of fluid driver, CTurbomachineryDriver will be removed after verification. There is some implementation of boost currently, it will be re-coded soon.*

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.

  • [X ] 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.

*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.

salvovitale and others added 30 commits February 8, 2020 23:33
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
…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
Copy link
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.

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/include/option_structure.hpp Outdated Show resolved Hide resolved
@@ -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);
Copy link
Member

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?

Comment on lines -5094 to +5089
if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))){
nSpan++;
if ((jVertex != -1) && (PeriodicBoundary == ((val_iZone) + 1)) && nodes->GetDomain(iPoint)) {
nSpan++;
Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

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.

Comment on lines +2 to +3
* \file iteration_structure.hpp
* \brief Headers of the iteration classes used by SU2_CFD.
Copy link
Member

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.

Comment on lines 700 to 710
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]);
}
Copy link
Member

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)
Copy link
Member

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 🤔 )

Comment on lines +319 to +320
rampFreq = SU2_TYPE::Int(config_container[ZONE_0]->GetRampOutletPressure_Coeff(1));
finalRamp_Iter = SU2_TYPE::Int(config_container[ZONE_0]->GetRampOutletPressure_Coeff(2));
Copy link
Member

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.

Comment on lines 63 to 64
auto velocity = primitiveState.GetVelocity();
Velocity.assign(velocity.begin(), velocity.end());
Copy link
Member

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.

Comment on lines 156 to 158
auto enthalpyOutIs = FluidModel.GetStaticEnergy() + OutletState.GetPressure() / FluidModel.GetDensity();
auto tangVel = primitives.GetOutletPrimitiveState().GetTangVelocity();
auto relVelOutIs2 = 2 * (OutletState.GetRothalpy() - enthalpyOutIs) + tangVel * tangVel;
Copy link
Member

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.

@pcarruscag pcarruscag changed the title Feature turbomachinery restruct singlezone [WIP] Feature turbomachinery restruct singlezone Jul 3, 2021
@stale
Copy link

stale bot commented Mar 2, 2022

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.

@stale stale bot added the stale label Mar 2, 2022
@stale stale bot removed the stale label Apr 4, 2022
@stale
Copy link

stale bot commented Jun 23, 2022

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.

@stale stale bot added the stale label Jun 23, 2022
@stale stale bot closed this Jul 10, 2022
@joshkellyjak joshkellyjak mentioned this pull request Apr 14, 2023
6 tasks
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.

4 participants