Skip to content

Commit 99fece9

Browse files
authored
Merge branch 'develop' into py_wrapper_moving_wall
2 parents c4a781d + da0c951 commit 99fece9

59 files changed

Lines changed: 369 additions & 145 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/change-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
id: extract_branch
1717
- name: Change the version number
1818
run: |
19-
SU2_PY/change_version_number.py -v ${GITHUB_REF##*/release_v} -r Blackbird -y
19+
SU2_PY/change_version_number.py -v ${GITHUB_REF##*/release_v} -r Harrier -y
2020
- name: Commit files
2121
run: |
2222
git config --local user.email "action@github.com"

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Thomas D. Economon
132132
Tim Albring
133133
TobiKattmann
134134
Trent Lukaczyk
135+
Vinzenz Götz
135136
VivaanKhatri
136137
Wally Maier
137138
Y. Chandukrishna

Common/include/code_config.hpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,30 @@ FORCEINLINE Out su2staticcast_p(In ptr) {
9898
#if defined(HAVE_OMP)
9999
using su2double = codi::RealReverseIndexOpenMPGen<double, double>;
100100
#else
101-
#if defined(CODI_INDEX_TAPE)
101+
#if defined(CODI_JACOBIAN_LINEAR_TAPE)
102+
using su2double = codi::RealReverse;
103+
#elif defined(CODI_JACOBIAN_REUSE_TAPE)
104+
using su2double = codi::RealReverseIndexGen<double, double, codi::ReuseIndexManager<int> >;
105+
#elif defined(CODI_JACOBIAN_MULTIUSE_TAPE)
102106
using su2double = codi::RealReverseIndex;
103-
// #elif defined(CODI_PRIMAL_TAPE)
104-
// using su2double = codi::RealReversePrimal;
105-
// #elif defined(CODI_PRIMAL_INDEX_TAPE)
106-
// using su2double = codi::RealReversePrimalIndex;
107+
#elif defined(CODI_PRIMAL_LINEAR_TAPE)
108+
using su2double = codi::RealReversePrimal;
109+
#elif defined(CODI_PRIMAL_REUSE_TAPE)
110+
using su2double = codi::RealReversePrimalIndexGen<double, double, codi::ReuseIndexManager<int> >;
111+
#elif defined(CODI_PRIMAL_MULTIUSE_TAPE)
112+
using su2double = codi::RealReversePrimalIndex;
107113
#else
108-
using su2double = codi::RealReverse;
114+
#error "Please define a CoDiPack tape."
109115
#endif
110116
#endif
117+
118+
#if defined(HAVE_OMP) || defined(CODI_JACOBIAN_REUSE_TAPE) || defined(CODI_JACOBIAN_MULTIUSE_TAPE) || \
119+
defined(CODI_PRIMAL_REUSE_TAPE) || defined(CODI_PRIMAL_MULTIUSE_TAPE)
120+
#define CODI_INDEX_REUSE
121+
#endif
111122
#elif defined(CODI_FORWARD_TYPE) // forward mode AD
112123
#include "codi.hpp"
113124
using su2double = codi::RealForward;
114-
115125
#else // primal / direct / no AD
116126
using su2double = double;
117127
#endif

Common/include/toolboxes/printing_toolbox.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include <iostream>
2929
#include <iomanip>
30+
#include <cstdint>
3031
#include <vector>
3132
#include <string>
3233
#include <sstream>

Common/src/CConfig.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3226,41 +3226,41 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) {
32263226

32273227
void CConfig::SetHeader(SU2_COMPONENT val_software) const{
32283228

3229-
if ((iZone == 0) && (rank == MASTER_NODE)){
3230-
cout << endl << "-------------------------------------------------------------------------" << endl;
3231-
cout << "| ___ _ _ ___ |" << endl;
3232-
cout << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |" << endl;
3233-
cout << "| \\__ \\ |_| |/ / |" << endl;
3229+
if ((iZone == 0) && (rank == MASTER_NODE)) {
3230+
cout << "\n";
3231+
cout << "-------------------------------------------------------------------------\n";
3232+
cout << "| ___ _ _ ___ |\n";
3233+
cout << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |\n";
3234+
cout << "| \\__ \\ |_| |/ / |\n";
32343235
switch (val_software) {
3235-
case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break;
3236-
case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |" << endl; break;
3237-
case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |" << endl; break;
3238-
case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |" << endl; break;
3239-
case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |" << endl; break;
3240-
}
3241-
3242-
cout << "| |" << endl;
3243-
cout <<"-------------------------------------------------------------------------" << endl;
3244-
cout << "| SU2 Project Website: https://su2code.github.io |" << endl;
3245-
cout << "| |" << endl;
3246-
cout << "| The SU2 Project is maintained by the SU2 Foundation |" << endl;
3247-
cout << "| (http://su2foundation.org) |" << endl;
3248-
cout <<"-------------------------------------------------------------------------" << endl;
3249-
cout << "| Copyright 2012-2023, SU2 Contributors |" << endl;
3250-
cout << "| |" << endl;
3251-
cout << "| SU2 is free software; you can redistribute it and/or |" << endl;
3252-
cout << "| modify it under the terms of the GNU Lesser General Public |" << endl;
3253-
cout << "| License as published by the Free Software Foundation; either |" << endl;
3254-
cout << "| version 2.1 of the License, or (at your option) any later version. |" << endl;
3255-
cout << "| |" << endl;
3256-
cout << "| SU2 is distributed in the hope that it will be useful, |" << endl;
3257-
cout << "| but WITHOUT ANY WARRANTY; without even the implied warranty of |" << endl;
3258-
cout << "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |" << endl;
3259-
cout << "| Lesser General Public License for more details. |" << endl;
3260-
cout << "| |" << endl;
3261-
cout << "| You should have received a copy of the GNU Lesser General Public |" << endl;
3262-
cout << "| License along with SU2. If not, see <http://www.gnu.org/licenses/>. |" << endl;
3263-
cout <<"-------------------------------------------------------------------------" << endl;
3236+
case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; break;
3237+
case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |\n"; break;
3238+
case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |\n"; break;
3239+
case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |\n"; break;
3240+
case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |\n"; break;
3241+
}
3242+
cout << "| |\n";
3243+
cout << "-------------------------------------------------------------------------\n";
3244+
cout << "| SU2 Project Website: https://su2code.github.io |\n";
3245+
cout << "| |\n";
3246+
cout << "| The SU2 Project is maintained by the SU2 Foundation |\n";
3247+
cout << "| (http://su2foundation.org) |\n";
3248+
cout << "-------------------------------------------------------------------------\n";
3249+
cout << "| Copyright 2012-2023, SU2 Contributors |\n";
3250+
cout << "| |\n";
3251+
cout << "| SU2 is free software; you can redistribute it and/or |\n";
3252+
cout << "| modify it under the terms of the GNU Lesser General Public |\n";
3253+
cout << "| License as published by the Free Software Foundation; either |\n";
3254+
cout << "| version 2.1 of the License, or (at your option) any later version. |\n";
3255+
cout << "| |\n";
3256+
cout << "| SU2 is distributed in the hope that it will be useful, |\n";
3257+
cout << "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n";
3258+
cout << "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |\n";
3259+
cout << "| Lesser General Public License for more details. |\n";
3260+
cout << "| |\n";
3261+
cout << "| You should have received a copy of the GNU Lesser General Public |\n";
3262+
cout << "| License along with SU2. If not, see <http://www.gnu.org/licenses/>. |\n";
3263+
cout << "-------------------------------------------------------------------------" << endl;
32643264
}
32653265

32663266
}

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CDriverBase {
5454
UsedTime; /*!< \brief Elapsed time between Start and Stop point of the timer. */
5555

5656
unsigned long TimeIter;
57-
57+
unsigned short selected_iZone = ZONE_0; /*!< \brief Selected zone for the driver. Defaults to ZONE_0 */
5858
unsigned short iMesh, /*!< \brief Iterator on mesh levels. */
5959
iZone, /*!< \brief Iterator on zones. */
6060
nZone, /*!< \brief Total number of zones in the problem. */
@@ -227,7 +227,7 @@ class CDriverBase {
227227
SU2_MPI::Error("Initial coordinates are only available with DEFORM_MESH= YES", CURRENT_FUNCTION);
228228
}
229229
auto* coords =
230-
const_cast<su2activematrix*>(solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord());
230+
const_cast<su2activematrix*>(solver_container[selected_iZone][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord());
231231
return CPyWrapperMatrixView(*coords, "InitialCoordinates", true);
232232
}
233233

@@ -241,7 +241,7 @@ class CDriverBase {
241241
if (iMarker >= GetNumberMarkers()) SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION);
242242

243243
auto* coords =
244-
const_cast<su2activematrix*>(solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord());
244+
const_cast<su2activematrix*>(solver_container[selected_iZone][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord());
245245
return CPyWrapperMarkerMatrixView(*coords, main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker),
246246
"MarkerInitialCoordinates", true);
247247
}
@@ -549,6 +549,17 @@ class CDriverBase {
549549
main_geometry->SetCustomBoundaryHeatFlux(iMarker, iVertex, WallHeatFlux);
550550
}
551551

552+
/*!
553+
* \brief Selects zone to be used for Driver operation
554+
* \param[in] iZone - Zone identifier.
555+
*/
556+
inline void SelectZone(unsigned short iZone) {
557+
if (iZone >= nZone) SU2_MPI::Error("Zone index out of range", CURRENT_FUNCTION);
558+
selected_iZone = iZone;
559+
main_geometry = geometry_container[selected_iZone][INST_0][MESH_0];
560+
main_config = config_container[selected_iZone];
561+
}
562+
552563
/*!
553564
* \brief Get the wall normal heat flux at a vertex on a specified marker of the flow or heat solver.
554565
* \note This can be the output of a heat or flow solver in a CHT setting.
@@ -696,7 +707,7 @@ class CDriverBase {
696707
if (iMarker < std::numeric_limits<unsigned short>::max() && iMarker > GetNumberMarkers()) {
697708
SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION);
698709
}
699-
auto* solver = solver_container[ZONE_0][INST_0][MESH_0][iSolver];
710+
auto* solver = solver_container[selected_iZone][INST_0][MESH_0][iSolver];
700711
if (solver == nullptr) SU2_MPI::Error("The selected solver does not exist.", CURRENT_FUNCTION);
701712
return solver;
702713
}

SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,9 @@ void CDiscAdjMultizoneDriver::SetAdjObjFunction() {
786786

787787
void CDiscAdjMultizoneDriver::ComputeAdjoints(unsigned short iZone, bool eval_transfer) {
788788

789-
#if defined(CODI_INDEX_TAPE) || defined(HAVE_OPDI)
789+
#if defined(CODI_INDEX_REUSE)
790790
if (nZone > 1 && rank == MASTER_NODE) {
791-
std::cout << "WARNING: Index AD types do not support multiple zones." << std::endl;
791+
std::cout << "WARNING: AD types that reuse indices do not support multiple zones." << std::endl;
792792
}
793793
#endif
794794

SU2_CFD/src/drivers/CDriverBase.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ vector<passivedouble> CDriverBase::GetMarkerVertexNormals(unsigned short iMarker
391391
}
392392

393393
void CDriverBase::CommunicateMeshDisplacements() {
394-
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->InitiateComms(main_geometry, main_config, MESH_DISPLACEMENTS);
395-
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->CompleteComms(main_geometry, main_config, MESH_DISPLACEMENTS);
394+
solver_container[selected_iZone][INST_0][MESH_0][MESH_SOL]->InitiateComms(main_geometry, main_config, MESH_DISPLACEMENTS);
395+
solver_container[selected_iZone][INST_0][MESH_0][MESH_SOL]->CompleteComms(main_geometry, main_config, MESH_DISPLACEMENTS);
396396
}
397397

398398
map<string, unsigned short> CDriverBase::GetSolverIndices() const {
399399
map<string, unsigned short> indexMap;
400400
for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) {
401-
const auto* solver = solver_container[ZONE_0][INST_0][MESH_0][iSol];
401+
const auto* solver = solver_container[selected_iZone][INST_0][MESH_0][iSol];
402402
if (solver != nullptr) {
403403
if (solver->GetSolverName().empty()) SU2_MPI::Error("Solver name was not defined.", CURRENT_FUNCTION);
404404
indexMap[solver->GetSolverName()] = iSol;
@@ -408,7 +408,7 @@ map<string, unsigned short> CDriverBase::GetSolverIndices() const {
408408
}
409409

410410
std::map<string, unsigned short> CDriverBase::GetFEASolutionIndices() const {
411-
if (solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL] == nullptr) {
411+
if (solver_container[selected_iZone][INST_0][MESH_0][FEA_SOL] == nullptr) {
412412
SU2_MPI::Error("The FEA solver does not exist.", CURRENT_FUNCTION);
413413
}
414414
const auto nDim = main_geometry->GetnDim();
@@ -429,7 +429,7 @@ std::map<string, unsigned short> CDriverBase::GetFEASolutionIndices() const {
429429
}
430430

431431
map<string, unsigned short> CDriverBase::GetPrimitiveIndices() const {
432-
if (solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL] == nullptr) {
432+
if (solver_container[selected_iZone][INST_0][MESH_0][FLOW_SOL] == nullptr) {
433433
SU2_MPI::Error("The flow solver does not exist.", CURRENT_FUNCTION);
434434
}
435435
return PrimitiveNameToIndexMap(CPrimitiveIndices<unsigned short>(

SU2_CFD/src/output/CFlowCompOutput.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
218218
AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density");
219219
AddVolumeOutput("MOMENTUM-X", "Momentum_x", "SOLUTION", "x-component of the momentum vector");
220220
AddVolumeOutput("MOMENTUM-Y", "Momentum_y", "SOLUTION", "y-component of the momentum vector");
221+
221222
if (nDim == 3)
222223
AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector");
223224
AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy");
@@ -237,6 +238,11 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
237238
AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature");
238239
AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number");
239240
AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient");
241+
AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector");
242+
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector");
243+
244+
if (nDim == 3)
245+
AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector");
240246

241247
// Datadriven fluid model
242248
if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){
@@ -330,6 +336,11 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv
330336

331337
const su2double factor = solver[FLOW_SOL]->GetReferenceDynamicPressure();
332338
SetVolumeOutputValue("PRESSURE_COEFF", iPoint, (Node_Flow->GetPressure(iPoint) - solver[FLOW_SOL]->GetPressure_Inf())/factor);
339+
SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetVelocity(iPoint, 0));
340+
SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetVelocity(iPoint, 1));
341+
if (nDim == 3){
342+
SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetVelocity(iPoint, 2));
343+
}
333344

334345
if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){
335346
SetVolumeOutputValue("EXTRAPOLATION", iPoint, Node_Flow->GetDataExtrapolation(iPoint));

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ void CFlowOutput::LoadHistoryDataScalar(const CConfig* config, const CSolver* co
12391239

12401240
void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){
12411241
/*--- Only place outputs of the "SOLUTION" group here. ---*/
1242-
1242+
12431243
switch (TurbModelFamily(config->GetKind_Turb_Model())) {
12441244
case TURB_FAMILY::SA:
12451245
AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart-Allmaras variable");
@@ -2594,13 +2594,13 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo
25942594
ofstream file;
25952595
file.open(fileName);
25962596

2597-
file << "\n-------------------------------------------------------------------------\n";
2597+
file << "\n";
2598+
file << "-------------------------------------------------------------------------\n";
25982599
file << "| ___ _ _ ___ |\n";
25992600
file << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |\n";
26002601
file << "| \\__ \\ |_| |/ / |\n";
26012602
file << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n";
26022603
file << "| |\n";
2603-
// file << "| Local date and time: " << dt << " |\n";
26042604
file << "-------------------------------------------------------------------------\n";
26052605
file << "| SU2 Project Website: https://su2code.github.io |\n";
26062606
file << "| |\n";

0 commit comments

Comments
 (0)