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

Wrong spanwise sections calculation in Turbomachinery simulation #2203

Open
LorenzoFabris opened this issue Jan 18, 2024 · 4 comments
Open
Labels

Comments

@LorenzoFabris
Copy link

LorenzoFabris commented Jan 18, 2024

Describe the bug
A general centrifugal compressor multi-zone case is simulated.

image

The computational domain is composed by the following zones (for this case, no return channel geometry is included):

  1. Inlet channel
  2. Impeller
  3. Diffuser
  4. Cavity

The code prints out the following error:

Error in "virtual void CPhysicalGeometry::ComputeNSpan(CConfig*, short unsigned int, short unsigned int, bool)":
-------------------------------------------------------------------------
 At the moment only turbomachinery with the same amount of span-wise section can be simulated
nSpan inflow 0, nSpan outflow 57
------------------------------ Error Exit -------------------------------

However, spanwise nodes are indeed 57 (checked manually and on Autogrid).

A possible solution is indicated here, but it is not a definitive one as it's dependent on the spanwise nodes number hard-coding.
Different SU2 version were tested, both on Win10 and Ubuntu 20.04, but the issue persisted only to be resolved similarly to the way showed here below.

Additional files
error.txt -> SU2 initialization up to the error

Bug report checklist

Desktop:

  • OS: UBUNTU 20.04 / Windows 10
  • C++ compiler and version: g++ 9.4.0 / gcc 8.1.0
  • MPI implementation and version: Open MPI 4.1.5
  • SU2 Version: v7.3.0 - v7.4.0 - v7.5.0 - v7.5.1 - v8.0.0 - v8.0.0 new_turbo_outputs

Thank you in advance for your help.

@bigfooted
Copy link
Contributor

I am not so familiar with turbomachinery but it looks like all spanwisesection initialization is done in CPhysicalGeometry.cpp. I think it initializes in the function ComputeNSpan. This function is called in CDriver like this:

geometry[iZone][INST_0][MESH_0]->ComputeNSpan(config[iZone], iZone, INFLOW, true);
geometry[iZone][INST_0][MESH_0]->ComputeNSpan(config[iZone], iZone, OUTFLOW, true);

So you should get an initialized value for inflow and outflow.
Maybe you can check what is going on there and see if this function does what is expected.

@LorenzoFabris
Copy link
Author

LorenzoFabris commented Jan 19, 2024

I am not so familiar with turbomachinery but it looks like all spanwisesection initialization is done in CPhysicalGeometry.cpp. I think it initializes in the function ComputeNSpan. This function is called in CDriver like this:

geometry[iZone][INST_0][MESH_0]->ComputeNSpan(config[iZone], iZone, INFLOW, true);
geometry[iZone][INST_0][MESH_0]->ComputeNSpan(config[iZone], iZone, OUTFLOW, true);

So you should get an initialized value for inflow and outflow. Maybe you can check what is going on there and see if this function does what is expected.

Hi Nijso! Thanks for your suggestion.
Indeed, CPhysicalGeometry.cpp is where the initialization is done. I'll also report this to the SU2 Turbo Group, to check whether we can find a solution.

Currently I just hardcoded a section of that script as follows:

.
.
if(marker_flag == OUTFLOW){
	nSpanWiseSections[INFLOW - 1] = 57;
	nSpanWiseSections[OUTFLOW - 1] = 57; 
      if(nSpanWiseSections[INFLOW -1] != nSpanWiseSections[OUTFLOW - 1]){
        char buf[100];
        SPRINTF(buf, "nSpan inflow %u, nSpan outflow %u", nSpanWiseSections[INFLOW], nSpanWiseSections[OUTFLOW]);
        SU2_MPI::Error(string(" At the moment only turbomachinery with the same amount of span-wise section can be simulated\n") + buf, CURRENT_FUNCTION);
      }
      else{
        config->SetnSpanWiseSections(nSpanWiseSections[OUTFLOW -1]);
      }
    }

  }

}
void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) {
.
.
.

This modification was firstly suggested by @MKursatUzuner but I'm pasting it in here to have another source in case the topic opened in CFD Online gets deleted.

@joshkellyjak
Copy link
Contributor

Adding here for future reference, I have also encountered this before and ususally it is a mesh issue, I have solved this by regenerating my mesh and running the .cgns to .su2 conversion again and this resolved the issue. I have also experienced an issue where the NSpan is calculated is much larger (maybe max value of unisgned short I'm not sure). @LorenzoFabris if you notice this issue with any meshes try regenerating but keep the original and we can try and determine the difference between the two? I will also keep an eye out for this problem and do the same.

@LorenzoFabris
Copy link
Author

Adding here for future reference, I have also encountered this before and ususally it is a mesh issue, I have solved this by regenerating my mesh and running the .cgns to .su2 conversion again and this resolved the issue. I have also experienced an issue where the NSpan is calculated is much larger (maybe max value of unisgned short I'm not sure). @LorenzoFabris if you notice this issue with any meshes try regenerating but keep the original and we can try and determine the difference between the two? I will also keep an eye out for this problem and do the same.

Sure, we'll keep an eye on that.
I also noticed that the wrong set up of MARKER_TURBOMACHINERY leads to similar error (though this is not the case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants