-
Notifications
You must be signed in to change notification settings - Fork 841
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
first release of the turbomachinery capabilities #413
Conversation
…mance not yet parallel
…river and AdjTurboDriver
…nto feature_NRBC3D
* \author S. Vitale | ||
* \version 5.0.0 "Raven" | ||
*/ | ||
class CTurboVertex : public CVertex { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the main reason for not using CVertex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in the description of the pull request, to impose Non reflecting BC and Mixing plane you need to access the boundary information on a span-wise and pitch wise ordered manner. Moreover, you need to convert the velocities in different frame of references w.r.t. the turbomachinery architecture you are simulating. The turboVertex takes care of all of these needs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. thanks!
Common/include/option_structure.hpp
Outdated
@@ -625,13 +625,15 @@ enum ENUM_LIMITER { | |||
VENKATAKRISHNAN = 0, /*!< \brief Slope limiter using Venkatakrisnan method. */ | |||
BARTH_JESPERSEN = 1, /*!< \brief Slope limiter using Barth-Jespersen method. */ | |||
SHARP_EDGES = 2, /*!< \brief Slope limiter using sharp edges. */ | |||
SOLID_WALL_DISTANCE = 3 /*!< \brief Slope limiter using wall distance. */ | |||
SOLID_WALL_DISTANCE = 3, /*!< \brief Slope limiter using wall distance. */ | |||
VAN_ALBADA = 4 /*!< \brief Slope limiter using wall distance. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the description. Have your experimented with this limiter? I think Venkat's limiter was an improvement over the Van Albada. Anyway, it is great to count with another limiter implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a bunch of test-cases in which the Van Albada works much better than the Venkatakrishnan. Usually what happens is that the residuals stall with the Venka, but instead
they keep going down with the Van Albada.
|
||
public: | ||
COptionNRBC(string option_field_name, unsigned short & nMarker_NRBC, string* & Marker_NRBC, unsigned short* & option_field, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NR stands for Non-reflecting? isn't it? Maybe we should be a little more explicit and use something like COptionNonReflectingBC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed everything from NRBC --> Giles_BC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mike is going to be happy :-)
Common/include/option_structure.hpp
Outdated
return badValue(option_value, "NRBC", this->name); | ||
} | ||
istringstream ss_6th(option_value[9*i + 7]); | ||
if (!(ss_6th >> this->relfac1[i])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something wrong with the number os spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Common/src/config_structure.cpp
Outdated
addNRBCOption("MARKER_NRBC", nMarker_NRBC, Marker_NRBC, Kind_Data_NRBC, NRBC_Map, NRBC_Var1, NRBC_Var2, NRBC_FlowDir); | ||
/*!\brief MIXING_PROCESS_TYPE \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries. | ||
/*!\brief MARKER_NRBC \n DESCRIPTION: Riemann boundary marker(s) with the following formats, a unit vector. */ | ||
addNRBCOption("MARKER_NRBC", nMarker_NRBC, Marker_NRBC, Kind_Data_NRBC, NRBC_Map, NRBC_Var1, NRBC_Var2, NRBC_FlowDir, RelaxFactorAverage, RelaxFactorFourier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the description
Common/src/config_structure.cpp
Outdated
/*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup Config*/ | ||
addTurboPerfOption("MARKER_TURBO_PERFORMANCE", nMarker_TurboPerf, Marker_TurboBoundIn, Marker_TurboBoundOut, Kind_TurboPerformance, TurboPerformance_Map); | ||
addTurboPerfOption("MARKER_TURBOMACHINERY", nMarker_Turbomachinery, Marker_TurboBoundIn, Marker_TurboBoundOut); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the description
Common/src/geometry_structure.cpp
Outdated
|
||
#ifdef HAVE_MPI | ||
|
||
MyTotalArea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any change in CPhysicalGeometry::SetCoord_CG? It looks like that the diff tool is not working properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I did not touch that routine. I think the diff tool is confused.
Common/src/geometry_structure.cpp
Outdated
|
||
#ifdef HAVE_MPI | ||
|
||
MyTotalArea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here, are you modifying CPhysicalGeometry::SetBoundControlVolume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
|
||
/*--- Solve the linear system (GMRES with restart) ---*/ | ||
|
||
case RESTARTED_FGMRES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@as before, is there any relevant change in this subroutine? If there is no change, we should check that the diff tool is working properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I did not change this routine. @talbring did you modify this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole switch statement is wrapped in an if condition now, thats all (that is needed for multizone deformations). I dont know why github has problems even here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @talbring for the prompt answer!
SU2_CFD/include/output_structure.hpp
Outdated
@@ -47,7 +47,7 @@ | |||
#include <time.h> | |||
#include <fstream> | |||
|
|||
#include "solver_structure.hpp" | |||
//#include "solver_structure.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for commenting out this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was experimenting some stuff. In truth this header file does not need to be included. For the moment, I have included again.
SU2_CFD/include/solver_structure.hpp
Outdated
virtual void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, | ||
CConfig *config, unsigned short val_marker); | ||
|
||
virtual void PreprocessBC_NonReflecting(CGeometry *geometry, CConfig *config, CNumerics *conv_numerics, unsigned short marker_flag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the fact that you are using NonREflecting instead of NR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now everything is BC_Giles so this one becomes PreprocessBC_Giles.
@@ -947,7 +944,8 @@ class CSolver { | |||
* \param[in] config - Definition of the particular problem. | |||
* \param[in] val_marker - Surface marker where the boundary condition is applied. | |||
*/ | |||
virtual void BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); | |||
virtual void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep... the diff tool is confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very confused! as @talbring suggested, especially for the solver_direct_mean.cpp is better to use another difftoll such as, for example, MELD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the time being... no problem... let's try to do it different next time. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear Salvo, this is a VERY important contribution to SU2. It is very well done and we'll approve it as soon as possible so we can start testing the develop branch after this huge amount of changes.
Obviously, in the future, we should try to divide the contributions in small pull request... otherwise the reviewing process is very complicated. And, we will have some issues with the capabilities of the develop branch after the merging.
Keep up the great work!
Thanks for your generosity sharing your work,
Francisco
PS.- @talbring if we accept this pull request with thousands of changes we should probably take a look at @JSmith36 pull request (I'll review the implementation today). From now on we should try to encourage small pull request.
Salvo: thanks for the pull request, very exciting stuff! I will also add a review soon, but perhaps I will let you comment on some of the review by @fpalacios first. |
@fpalacios, as you already noticed github has problems viewing the diff of solver_direct_mean.cpp correctly. Most of the changes there are just additions. I can suggest to do a local checkout and use a proper difftool. |
Dear @fpalacios , Regarding splitting in smaller pull requests I agree. However, I believe that usually there are 2 kind of pull requests:
While for the type 1 I think is possible to keep pull requests small, for the type 2 this is not always the case. In any case I agree we should always keep the review process in mind. best Salvo |
Just to clarify things, I am not against pull requests with a lot of changes, @fpalacios. For me the problem in #412 is simply the fact that everything is included in one commit. |
|
||
} | ||
|
||
void CTurbomachineryDriver::SetMixingPlane(unsigned short donorZone){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could think about moving the mixing plane into the interpolator_class.
In this way we'll have all the routines that manage the communication between zones in the same place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, in fact the Mixing-Plane interface is already implemented within the Transfer structure, in which we exchange info between zones. However, I did not use the the interpolator_class because it does not occur an interpolation between the nodes of the interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so maybe we should change the name of the class to something else.
Indeed "interpolation" (in a strictly mathematical sense) doesn't actually occur even for the nearest neighbour approach (zones are loosely coupled and the interface is basically treated as a non-homogeneous BC).
Having all the possible way of communicating between zones in the same src would make the code much more clear, and possibly we could avoid creating the new driver class just by modifying the fluid driver a little bit.
By the way, we may do this in a later pull request (so nevermind) I'm just trying to figure out if that would make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I see your point. However the new turbo driver is a child of the new FluidDriver, and only few routines are overwritten:
- the Run() routine because i need to use the iterator container in a slightly different way
- the Monitor() routine in which I implemented ad hoc methods for ramping up the outlet pressure and the rotational speed to facilitate the convergence of multi-stage simulations.
Indeed I could have implemented on the CFluidDriver, but there are two reason why I did not do it:
- I wanted to avoid many if statements to customize the driver
- (and more important) a clear structure of the turbo Driver also facilitate the implementation of his adjoint counterpart.
I' m pretty sure that when the structure is there we can always improve the code with future pull requests, as we have been doing so far. Anyway thanks for your valuable comments Giulio.
regards
Salvo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very interesting discussion. Please, after this pull request, do your best to revisit the issue to be sure that we have the best solution possible. Thanks
Thanks @salvovitale for this contribution, the open-source community is going to appreciate a lot this new capability. In fact, I think it is a perfect timing to prepare a tutorial about turbo machinery in https://github.com/su2code/SU2/wiki/User-Tutorials As you know, the tutorial is a really important step. Otherwise, for an average users, it is difficult to know that this awesome capability is available. And... a large number of users will help us to improve any implementation. Best, |
Dear @fpalacios I agree that one or two tutorials are fundamental to let the users exploit the new capabilities. I will certainly count on the help of the community to make this new feature as much reliable and general as possible. regards Salvo |
This pull request enlarges the capability of SU2 to simulate internal flows in turbomachinery. The flow solver is now capable of performing 3D steady multi-zone simulations via a 3D Non-Reflecting Mixing Plane. The implementation is based on the work done by Saxer and Giles (available at https://doi.org/10.2514/3.23618). To adapt the implementation of Saxer and Giles to an unstructured vertex-based solver such as SU2, a new data structure, called CTurboVertex, was created for the inflow and outflow boundaries. The CTurboVertex class is a child of the class CVertex; thus, it maintains all the standard vertex properties. However, more than a standard vertex, the turboVertex posses:
the possibility of accessing the inflow and outflow boundaries on a span-wise manner (to impose different values of the mixing-plane condition along the blade-height) and on a pitch-wise ordered manner (to compute the Spatial Fourier Transformation of the outgoing characteristics at the boundary for the non-reflectivity).
embedded information on what kind of turbomachinery architecture is being simulated, so that the values of velocity at the boundaries can be imposed using the correct frame of reference.
So in a nutshell the flow solver is now capable of:
The limitations of the turbomachinery capabilities are:
This pull request introduce also some limited design capability for turbomachinery applications. Using the AD tool, it is now available on the suite also a single zone discrete adjoint to compute the sensitivity for 2D/3D turbomachinery blade with respect to certain performance parameters (ENTROPY_GENERATION, TOTAL_PRESSURE_LOSS, KINETIC_ENERGY_LOSS, ecc.). However, the optimization script only works for 2D blades since the FFD and the mesh deformation routines need still to be adapted to handle 3D blades (especially for problem on the deformation of the hub and shroud surfaces).