Skip to content

Multizone adjoints for turbomachinery - #2446

Open
joshkellyjak wants to merge 122 commits into
developfrom
feature_mz_turbomachinery_adjoint
Open

Multizone adjoints for turbomachinery#2446
joshkellyjak wants to merge 122 commits into
developfrom
feature_mz_turbomachinery_adjoint

Conversation

@joshkellyjak

Copy link
Copy Markdown
Contributor

Proposed Changes

This is a cleaned up PR of the fixes needed for multizone adjoints for turbomachinery from the previous PR of @oleburghardt and I's work.

This hopefully is useable, so if you would like to test and report please feel free to contact me on Slack.

TODO:

  • Fix eddy viscosity tape issue in CNSSolver
  • Add turbomachinery objective functions + constraints
  • Include MZ testcase

Related Work

Now closed PR #2317

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 --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • 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.

Comment thread SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated
Comment thread Common/src/CConfig.cpp Outdated
Comment thread Common/src/CConfig.cpp Outdated
Comment thread SU2_CFD/src/solvers/CDiscAdjSolver.cpp Outdated
Comment thread SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp Fixed
Comment thread SU2_CFD/src/iteration/CTurboIteration.cpp Fixed
Comment thread SU2_CFD/src/solvers/CEulerSolver.cpp Fixed
… to run in quasi-MZ approach. (NEEDS CLEANING)
Comment thread SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp Fixed
Comment thread SU2_CFD/src/integration/CIntegration.cpp Fixed
Comment thread SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp Fixed
Comment thread SU2_CFD/src/drivers/CDriver.cpp Fixed
@joshkellyjak joshkellyjak changed the title [WIP] Multizone adjoints for turbomachinery Multizone adjoints for turbomachinery Jul 22, 2026
Comment thread Common/src/CConfig.cpp
else {
VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250;
}
VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : nOuterIter;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert

Comment on lines +83 to +84
//std::shared_ptr<CTurbomachineryStagePerformance> TurbomachineryStagePerformance; /*!< \brief turbo stage performance calculator. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
//std::shared_ptr<CTurbomachineryStagePerformance> TurbomachineryStagePerformance; /*!< \brief turbo stage performance calculator. */

Comment on lines +154 to +156
inline virtual void RecoverTarget_Span_Endwall(const su2activevector &bcastVariable, unsigned long idx) { }

inline virtual void RecoverTarget_Span(const su2activevector &bcastVariable, unsigned long idx, su2double donorCoeff) { }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rename the new function without the mishmash of underscores please.
Plus documentation and formatting, please.

Comment on lines +151 to +152
AD::SetPreaccOut(Jacobian_i, nVar, nVar);
AD::SetPreaccOut(Jacobian_j, nVar, nVar);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert

inline void SetZeroValues() {
Density = Pressure = Entropy = Enthalpy = Temperature = TotalTemperature = TotalPressure = TotalEnthalpy = 0.0;
AbsFlowAngle = FlowAngle = MassFlow = Rothalpy = TotalRelPressure = 0.0;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
};
}

Comment on lines +190 to +201
/*!
* \brief Allocates the final pointer of MixingState depending on how many donor spans donate to it. That number is stored in MixingStateSpans[val_marker][val_Span].
* \param[in] val_marker - marker index
* \param[in] val_span - vertex index
*/
inline void SetMixingStateStructure(unsigned short val_marker, unsigned long val_span) final {
assert(val_marker < MixingState.size());
assert(val_span < MixingState[val_marker].size());
if( MixingState[val_marker][val_span] != nullptr ) delete [] MixingState[val_marker][val_span];

MixingState[val_marker][val_span] = new su2double[8];
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't wanna know what's going on here, but unfortunately I have to, 🤣
Seems like inner dimension doesn't have to be a pointer at all.
Also, the documentation for both the variable and this function don't match what is being perpetrated here.

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.

5 participants