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] Changes of sliding plane for turbomachinery #2173

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

FabianYan2010
Copy link

Adaption of the interpolation method NearestNeighbor to turbomachinery applications when rotating frame is used.

Proposed Changes

If the flow is solved in a rotating frame, the grid is not actutally rotating. But the interpolation for a sliding interface should be done with an actually rotated boundary. The proposed changes add the function of rotating grid points on the boundary of a zone solved in rotating frame before the interpolation is executed. Currently, this is only implemented in CNearestneighbor class, other interpolation method should be changed as well in the near future.

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.

  • [ yes ] I am submitting my contribution to the develop branch.
  • [ yes ] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • [ yes ] 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.

@bigfooted bigfooted changed the base branch from master to develop November 21, 2023 14:32
@bigfooted
Copy link
Contributor

Our working branch is 'develop', so you should have started from that and also merge into it. Every 6 months or so we then make the current develop into master. I changed the target branch to develop, and also updated your branch with current develop.
Can you have a look at the failed check for clang-format coding style and format the changed file accordingly?
https://su2code.github.io/docs_v7/Style-Guide/

@pcarruscag
Copy link
Member

If the mesh is not moving, why are you rotating the search coordinates?

@bigfooted
Copy link
Contributor

Should we close this pull request?

@FabianYan2010
Copy link
Author

If the mesh is not moving, why are you rotating the search coordinates?

I'm so sorry for the belated response! I was trying to debug and test the new feature and to give a proper pull-request.
As for the question:
Because we are using rotating frame for rotor. In rotating frame we consider the rotating effect by adding source terms in governing equations so that the mesh movement is spared. But when we transfer data between rotor and stator for unsteady simulation, the rotor side has to be rotated to match the reality. The rotor is actually rotating, so as the flow phenomena, like rotor wakes passing through the interface. Otherwise, we will see non-rotating wakes in the stator frame of reference. Every time step, the matching grid points between two sides need to be updated as well.

@FabianYan2010
Copy link
Author

Our working branch is 'develop', so you should have started from that and also merge into it. Every 6 months or so we then make the current develop into master. I changed the target branch to develop, and also updated your branch with current develop. Can you have a look at the failed check for clang-format coding style and format the changed file accordingly? https://su2code.github.io/docs_v7/Style-Guide/

Thanks a lot! It's very much appreciated. I have implemented the clang-format according to the guide and force formatting all files by using 'pre-commit run -a'. I think the new commits should be conformed to the coding style but not sure if the previous commit is also changed.

@pcarruscag
Copy link
Member

That's not consistent with any code I know, when using the MRF approach you either get frozen rotor or mixing plane interfaces. If you want a more accurate simulation you move the mesh and update the interfaces, there are several advantages to not dealing with the MRF source terms. There are also practical aspects of not updating the interface when doing transient MRF, for example it lets you handle interfaces that are not cylindrical, people use this to model car wheels.
MRF is also less restrictive for time step size than moving mesh, but if you move the interface you bring some of the moving mesh restrictions to MRF. So my impression is that this strategy combines some of the downsides of both approaches...

@FabianYan2010
Copy link
Author

Thanks for your comments! Except for mixing plane and frozen rotor, sliding plane is also pretty common in turbomachinery simulation, it is indeed implemented in some, if not all, in-house codes.
MRF is quite useful in turbomachinery simulation, expecially when we deal with transient simulation. Actually it is really rare to move the rotor mesh like in reality. One reason is that MRF is more efficient and accurate. Otherwise, you introduce new disturbance into the transient flow field every physical time step, which is not good. Because when you rotate the mesh, the velocity direction of each grid point inherited from last time step is not rotated. To make it more clear, you will have a flow going towards casing instead of parallel to, at the start of next physical time step. So you need more pseudo time steps to get a proper velocity variable. As a result, you get a zig-zag shape in the residual history.
I'm not actually moving the interface. The rotor mesh is not rotated, so as the interface at rotor zone. I'm just virtually rotating the rotor interface to find the new matching points between rotor and stator for each physical time step, so that the variable could be passed across the interface. In other words, only the passing variables are actually rotated. If I understand it correctly, there is no additional moving mesh restriction introduced here.

@pcarruscag
Copy link
Member

Updating the interface creates relative motion and thus you have blade-passing frequencies to resolve, which require more detail to resolve than just rotation.
If you want this as a different option that's fine, but it's not going to be the default.

FabianYan2010 and others added 5 commits May 13, 2024 15:44
So we merge the mods on it to its real destination.

Merge branch 'master' into turbo_features_fabian
…ull-annulus) computation restarted from a single-passage solution
@bigfooted bigfooted changed the title Changes of sliding plane for turbomachinery [WIP] Changes of sliding plane for turbomachinery May 31, 2024

if (iPoint_Local > -1) {

for (iVar = 0; iVar < Restart_Vars[1]; iVar++)

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition High

Comparison between
iVar
of type unsigned short and
call to operator[]
of wider type reference.

for (iVar = 0; iVar < Restart_Vars[1]; iVar++)
Restart_Data[counter*Restart_Vars[1] + iVar] = SU2_TYPE::GetValue(PrintingToolbox::stod(point_line[iVar+1]));
for (iVar = 0; iVar < Restart_Vars[1]; iVar++)

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition High

Comparison between
iVar
of type unsigned short and
call to operator[]
of wider type reference.

unsigned short nDim = target_geometry->GetnDim();

su2double Theta, Phi, Psi, cosTheta, sinTheta, cosPhi, sinPhi, cosPsi, sinPsi;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable cosTheta is not used.

unsigned short nDim = target_geometry->GetnDim();

su2double Theta, Phi, Psi, cosTheta, sinTheta, cosPhi, sinPhi, cosPsi, sinPsi;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable sinTheta is not used.

unsigned short nDim = target_geometry->GetnDim();

su2double Theta, Phi, Psi, cosTheta, sinTheta, cosPhi, sinPhi, cosPsi, sinPsi;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable cosPhi is not used.
Comment on lines +848 to +850
//bool Fullannulus = false;
//if (geometry[MESH_0]->GetnPassages() == geometry[MESH_0]->GetnPassages_FullAnnu())
// Fullannulus = true;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
long PsgIndx_RemPer;
unsigned long GlobalIndx_FullAnnu;
unsigned long nPsgPoint_RemPer = geometry->GetGlobal_nPsgPoint_RemPer();
//bool Fullannulus = false;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -2858,37 +2858,92 @@

Restart_Data.resize(Restart_Vars[1]*geometry->GetnPointDomain());

/*--- Read all lines in the restart file and extract data. ---*/
//bool FullAnnu_Transform = 1;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
counter++;
}

//cout<<"iPoint_Local "<<iPoint_Local<<", GlobalIndx_FullAnnu "<<GlobalIndx_FullAnnu<<endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +141 to +143
//bool Fullannulus = false;
//if (geometry[MESH_0]->GetnPassages() == geometry[MESH_0]->GetnPassages_FullAnnu())
// Fullannulus = true;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
chuanxiang yan added 2 commits June 3, 2024 12:34
…teral element on sliding interfaces ( previously, it works only for triangles), which is very common in turbomachinery applications.
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.

@FabianYan2010 can you separate the different features you are working on into different PRs please? I think I count 4 quite large ones already.

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.

None yet

3 participants