SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

FAN_FACE_MACH boundary condition does not work

Open davistib opened this issue 2 years ago • 4 comments

Describe the bug

Here is a description of the bug, and possible fix...

Using the FAN_FACE_MACH boundary condition, which is implemented in the CEulerSolver.cpp, the Inflow_Mach_old returned is 0.0, causing the computation of the updated pressure to be incorrect. In practice, this drives the pressure lower and lower until it becomes negative.

To find this, I added debug statements to SU2_CFD/src/solvers/CEulerSolver.cpp where the FAN_FACE_MACH BC logic is to iterate on the outflow pressure.

//     cout << endl << "PRINTING DEBUG INFO FOR FAN_FACE_MACH" << endl;
//     cout << "Rank = " << rank << endl;
//     cout << "Kind_Engine_Inflow = " << Kind_Engine_Inflow << endl;
//     cout << "Target_Inflow_Mach = " << Target_Inflow_Mach << endl;
//     cout << "Inflow_Pressure_old = " << Inflow_Pressure_old << endl;
//     cout << "Inflow_Mach_old = " << Inflow_Mach_old << endl;
//     cout << "Inflow_Pressure_inc = " << Inflow_Pressure_inc << endl;
//     cout << "Inflow_Pressure = " << Inflow_Pressure << endl;

which resulted in the output:

PRINTING DEBUG INFO FOR FAN_FACE_MACH Rank = 1 Kind_Engine_Inflow = 1 Target_Inflow_Mach = 0.64 Inflow_Pressure_old = 2.36396 Inflow_Mach_old = 0 ...

So it seems the main issue is that in the config the Inflow_Mach quantity is never getting updated. I believe this should happen in src/solvers/CEulerSolver.cpp starting at line 2855 if (Engine) { ... . Here, a call to config->SetInflow_Mach(iMarker_Inlet, Inlet_Mach_Total[iMarker_Inlet]); is completely missing.

I'm not familiar with the code base, so I'm not sure if it is supposed to be updated elsewhere. However, inserting that line appears to fix the problem and the above logic around FAN_FACE_MACH begins working as expected.

Reproduce Perhaps the only thing about my problem worth mentioning is it is ran as axisymmetric. I'm running RANS, with the SST model.

Desktop (please complete the following information):

  • OS: [e.g., Linux (Centos 7)]
  • C++ compiler and version: [g++ (GCC) 4.8.5]
  • MPI implementation and version: [e.g., OpenMPI 4.0.1]
  • SU2 Version: [v7.3.1]

davistib avatar Apr 15 '22 00:04 davistib

Thank you for digging into the code. This is one of the obscure features in SU2 that the currently active developers have little knowledge about. I looked around the repo and I think we don't even have an example, do you think you can help setup one? The function you modified seems to be the right place, it would be great if you could open a PR with the fix and a small testcase (~20k elements) that we can then use to get some test coverage of this feature.

pcarruscag avatar Apr 15 '22 09:04 pcarruscag

Thanks for the feedback.

I was not able to find any examples myself either. It looks like this is a feature that has been around for a while, but maybe has gotten lost in some updates.

I will work on setting up a small test case for this and the FAN_FACE_MDOT and submit a PR.

davistib avatar Apr 15 '22 14:04 davistib

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[bot] avatar Jul 10 '22 08:07 stale[bot]

Hi @davistib, any news here? If setting up a small example is proving difficult we'll settle for just the code fix :) thanks.

pcarruscag avatar Jul 10 '22 17:07 pcarruscag

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[bot] avatar Nov 01 '22 23:11 stale[bot]