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

Fix output names of unsteady simulation #2418

Merged
merged 8 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions SU2_CFD/include/output/COutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ class COutput {
*/
void SetMultizoneHistoryOutput(COutput** output, CConfig **config, CConfig *driver_config,
unsigned long TimeIter, unsigned long OuterIter);

/*!
* \brief Sets the current time iteration
* \param[in] timeIter - the current time iteration
*/
inline void SetCurTimeIter(unsigned long val_curTimeIter) {curTimeIter = val_curTimeIter;}

/*!
* \brief Sets the volume output filename
Expand Down
4 changes: 4 additions & 0 deletions SU2_CFD/src/drivers/CMultizoneDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ void CMultizoneDriver::Corrector(unsigned short val_iZone) {

bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) {

// Set the current time iter for the multizone problem
bool unsteady = config_container[ZONE_0]->GetTime_Domain();
if (unsteady) driver_output->SetCurTimeIter(config_container[ZONE_0]->GetTimeIter());

/*--- Update the residual for the all the zones. ---*/

for (iZone = 0; iZone < nZone; iZone++) {
Expand Down
2 changes: 2 additions & 0 deletions SU2_CFD/src/iteration/CFluidIteration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ void CFluidIteration::Solve(COutput* output, CIntegration**** integration, CGeom
/*--- Boolean to determine if we are running a static or dynamic case ---*/
bool steady = !config[val_iZone]->GetTime_Domain();

if (!steady) output->SetCurTimeIter(config[val_iZone]->GetTimeIter());

unsigned long Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter();
bool StopCalc = false;

Expand Down
4 changes: 1 addition & 3 deletions SU2_CFD/src/output/COutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ void COutput::SetHistoryOutput(CGeometry *geometry,
unsigned long OuterIter,
unsigned long InnerIter) {

curTimeIter = TimeIter;
curAbsTimeIter = max(TimeIter, config->GetStartWindowIteration()) - config->GetStartWindowIteration();
curOuterIter = OuterIter;
curInnerIter = InnerIter;
Expand Down Expand Up @@ -273,7 +272,6 @@ void COutput::SetHistoryOutput(CGeometry ****geometry, CSolver *****solver, CCon

void COutput::SetMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){

curTimeIter = TimeIter;
curAbsTimeIter = max(TimeIter, driver_config->GetStartWindowIteration()) - driver_config->GetStartWindowIteration();
curOuterIter = OuterIter;

Expand Down Expand Up @@ -476,7 +474,7 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
extension = CSU2MeshFileWriter::fileExt;

if (fileName.empty())
fileName = volumeFilename;
fileName = config->GetFilename(volumeFilename, "", curTimeIter);

if (!config->GetWrt_Volume_Overwrite())
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);
Expand Down
Loading