Skip to content

Commit 205b1a8

Browse files
authored
Merge branch 'develop' into patch-1
2 parents f771718 + db166ba commit 205b1a8

42 files changed

Lines changed: 1159 additions & 488 deletions

Some content is hidden

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

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*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.*
1313

1414
- [ ] I am submitting my contribution to the develop branch.
15-
- [ ] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
15+
- [ ] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
1616
- [ ] My contribution is commented and consistent with SU2 style.
1717
- [ ] I have added a test case that demonstrates my contribution, if necessary.
1818
- [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

Common/include/CConfig.hpp

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ class CConfig {
254254
*Marker_Outlet, /*!< \brief Outlet flow markers. */
255255
*Marker_Isothermal, /*!< \brief Isothermal wall markers. */
256256
*Marker_HeatFlux, /*!< \brief Constant heat flux wall markers. */
257+
*Marker_RoughWall, /*!< \brief Constant heat flux wall markers. */
257258
*Marker_EngineInflow, /*!< \brief Engine Inflow flow markers. */
258259
*Marker_EngineExhaust, /*!< \brief Engine Exhaust flow markers. */
259260
*Marker_Clamped, /*!< \brief Clamped markers. */
@@ -308,6 +309,7 @@ class CConfig {
308309
su2double *Outlet_Pressure; /*!< \brief Specified back pressures (static) for outlet boundaries. */
309310
su2double *Isothermal_Temperature; /*!< \brief Specified isothermal wall temperatures (static). */
310311
su2double *Heat_Flux; /*!< \brief Specified wall heat fluxes. */
312+
su2double *Roughness_Height; /*!< \brief Equivalent sand grain roughness for the marker according to config file. */
311313
su2double *Displ_Value; /*!< \brief Specified displacement for displacement boundaries. */
312314
su2double *Load_Value; /*!< \brief Specified force for load boundaries. */
313315
su2double *Damper_Constant; /*!< \brief Specified constant for damper boundaries. */
@@ -555,6 +557,8 @@ class CConfig {
555557
*Kind_Inc_Outlet,
556558
*Kind_Data_Riemann,
557559
*Kind_Data_Giles; /*!< \brief Kind of inlet boundary treatment. */
560+
unsigned short *Kind_Wall; /*!< \brief Type of wall treatment. */
561+
unsigned short nWall_Types; /*!< \brief Number of wall treatment types listed. */
558562
unsigned short nInc_Inlet; /*!< \brief Number of inlet boundary treatment types listed. */
559563
unsigned short nInc_Outlet; /*!< \brief Number of inlet boundary treatment types listed. */
560564
su2double Inc_Inlet_Damping; /*!< \brief Damping factor applied to the iterative updates to the velocity at a pressure inlet in incompressible flow. */
@@ -918,7 +922,8 @@ class CConfig {
918922
nMarkerPitching_Ampl, /*!< \brief Number of values provided for pitching amplitude of marker. */
919923
nMarkerPitching_Phase, /*!< \brief Number of values provided for pitching phase offset of marker. */
920924
nMarkerPlunging_Omega, /*!< \brief Number of values provided for angular frequency of marker. */
921-
nMarkerPlunging_Ampl; /*!< \brief Number of values provided for plunging amplitude of marker. */
925+
nMarkerPlunging_Ampl, /*!< \brief Number of values provided for plunging amplitude of marker. */
926+
nRough_Wall; /*!< \brief Number of rough walls. */
922927
su2double *Omega_HB; /*!< \brief Frequency for Harmonic Balance Operator (in rad/s). */
923928
unsigned short
924929
nOmega_HB, /*!< \brief Number of frequencies in Harmonic Balance Operator. */
@@ -991,7 +996,9 @@ class CConfig {
991996
DV_Penalty; /*!< \brief Penalty weight to add a constraint to the total amount of stiffness. */
992997
unsigned long Nonphys_Points, /*!< \brief Current number of non-physical points in the solution. */
993998
Nonphys_Reconstr; /*!< \brief Current number of non-physical reconstructions for 2nd-order upwinding. */
994-
bool ParMETIS; /*!< \brief Boolean for activating ParMETIS mode (while testing). */
999+
su2double ParMETIS_tolerance; /*!< \brief Load balancing tolerance for ParMETIS. */
1000+
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
1001+
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
9951002
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
9961003
bool DiscreteAdjoint, /*!< \brief AD-based discrete adjoint mode. */
9971004
FullTape; /*!< \brief Full tape mode for coupled discrete adjoints. */
@@ -1077,7 +1084,8 @@ class CConfig {
10771084
default_body_force[3], /*!< \brief Default body force vector for the COption class. */
10781085
default_nacelle_location[5], /*!< \brief Location of the nacelle. */
10791086
default_hs_axes[3], /*!< \brief Default principal axes (x, y, z) of the ellipsoid containing the heat source. */
1080-
default_hs_center[3]; /*!< \brief Default position of the center of the heat source. */
1087+
default_hs_center[3], /*!< \brief Default position of the center of the heat source. */
1088+
default_roughness[1];
10811089

10821090
unsigned short Riemann_Solver_FEM; /*!< \brief Riemann solver chosen for the DG method. */
10831091
su2double Quadrature_Factor_Straight; /*!< \brief Factor applied during quadrature of elements with a constant Jacobian. */
@@ -2924,6 +2932,12 @@ class CConfig {
29242932
*/
29252933
unsigned short GetnMarker_HeatFlux(void) const { return nMarker_HeatFlux; }
29262934

2935+
/*!
2936+
* \brief Get the total number of rough markers.
2937+
* \return Total number of heat flux markers.
2938+
*/
2939+
unsigned short GetnRoughWall(void) const { return nRough_Wall; }
2940+
29272941
/*!
29282942
* \brief Get the total number of objectives in kind_objective list
29292943
* \return Total number of objectives in kind_objective list
@@ -5004,6 +5018,11 @@ class CConfig {
50045018
*/
50055019
unsigned short GetKind_ActDisk(void) const { return Kind_ActDisk; }
50065020

5021+
/*!
5022+
* \brief Set the kind of wall - rough or smooth.
5023+
*/
5024+
void SetKindWall(string val_marker, unsigned short val_kindwall);
5025+
50075026
/*!
50085027
* \brief Get the number of sections.
50095028
* \return Number of sections
@@ -6754,6 +6773,13 @@ class CConfig {
67546773
*/
67556774
su2double* GetWallFunction_DoubleInfo(string val_marker);
67566775

6776+
/*!
6777+
* \brief Get the type of wall and roughness height on a wall boundary (Heatflux or Isothermal).
6778+
* \param[in] val_index - Index corresponding to the boundary.
6779+
* \return The wall type and roughness height.
6780+
*/
6781+
pair<unsigned short, su2double> GetWallRoughnessProperties(string val_marker) const;
6782+
67576783
/*!
67586784
* \brief Get the target (pressure, massflow, etc) at an engine inflow boundary.
67596785
* \param[in] val_index - Index corresponding to the engine inflow boundary.
@@ -9360,6 +9386,21 @@ class CConfig {
93609386
*/
93619387
unsigned long GetEdgeColoringGroupSize(void) const { return edgeColorGroupSize; }
93629388

9389+
/*!
9390+
* \brief Get the ParMETIS load balancing tolerance.
9391+
*/
9392+
passivedouble GetParMETIS_Tolerance() const { return SU2_TYPE::GetValue(ParMETIS_tolerance); }
9393+
9394+
/*!
9395+
* \brief Get the ParMETIS load balancing weight for points.
9396+
*/
9397+
long GetParMETIS_PointWeight() const { return ParMETIS_pointWgt; }
9398+
9399+
/*!
9400+
* \brief Get the ParMETIS load balancing weight for edges
9401+
*/
9402+
long GetParMETIS_EdgeWeight() const { return ParMETIS_edgeWgt; }
9403+
93639404
/*!
93649405
* \brief Find the marker index (if any) that is part of a given interface pair.
93659406
* \param[in] iInterface - Number of the interface pair being tested, starting at 0.

Common/include/fem/fem_geometry_structure.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ class CMeshFEM_DG: public CMeshFEM {
880880
* \brief Set the send receive boundaries of the grid.
881881
* \param[in] config - Definition of the particular problem.
882882
*/
883-
void SetSendReceive(CConfig *config) override;
883+
void SetSendReceive(const CConfig *config) override;
884884

885885
/*!
886886
* \brief Set the local index that correspond with the global numbering index.

Common/include/geometry/CGeometry.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ class CGeometry {
137137

138138
#if defined(HAVE_MPI) && defined(HAVE_PARMETIS)
139139
vector<vector<unsigned long> > adj_nodes; /*!< \brief Vector of vectors holding each node's adjacency during preparation for ParMETIS. */
140-
idx_t *adjacency{nullptr}; /*!< \brief Local adjacency array to be input into ParMETIS for partitioning (idx_t is a ParMETIS type defined in their headers). */
141-
idx_t *xadj{nullptr}; /*!< \brief Index array that points to the start of each node's adjacency in CSR format (needed to interpret the adjacency array). */
140+
vector<idx_t> adjacency; /*!< \brief Local adjacency array to be input into ParMETIS for partitioning (idx_t is a ParMETIS type defined in their headers). */
141+
vector<idx_t> xadj; /*!< \brief Index array that points to the start of each node's adjacency in CSR format (needed to interpret the adjacency array). */
142142
#endif
143143

144144
/*--- Turbomachinery variables ---*/
@@ -769,7 +769,7 @@ class CGeometry {
769769
* \brief A virtual member.
770770
* \param[in] config - Definition of the particular problem.
771771
*/
772-
inline virtual void SetColorGrid_Parallel(CConfig *config) {}
772+
inline virtual void SetColorGrid_Parallel(const CConfig *config) {}
773773

774774
/*!
775775
* \brief A virtual member.
@@ -789,7 +789,7 @@ class CGeometry {
789789
* \param[in] config - Definition of the particular problem.
790790
* \param[in] val_domain - Number of domains for parallelization purposes.
791791
*/
792-
inline virtual void SetSendReceive(CConfig *config) {}
792+
inline virtual void SetSendReceive(const CConfig *config) {}
793793

794794
/*!
795795
* \brief A virtual member.

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "meshreader/CMeshReaderFVM.hpp"
3232
#include "../toolboxes/C2DContainer.hpp"
3333

34+
3435
/*!
3536
* \class CPhysicalGeometry
3637
* \brief Class for reading a defining the primal grid which is read from the grid file in .su2 or .cgns format.
@@ -105,6 +106,9 @@ class CPhysicalGeometry final : public CGeometry {
105106
unsigned long *Elem_ID_BoundTria_Linear{nullptr};
106107
unsigned long *Elem_ID_BoundQuad_Linear{nullptr};
107108

109+
vector<int> GlobalMarkerStorageDispl;
110+
vector<su2double> GlobalRoughness_Height;
111+
108112
public:
109113
/*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/
110114
using CGeometry::SetVertex;
@@ -160,22 +164,22 @@ class CPhysicalGeometry final : public CGeometry {
160164
* \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + coloring.
161165
* \param[in] config - Definition of the particular problem.
162166
*/
163-
void DistributeColoring(CConfig *config, CGeometry *geometry);
167+
void DistributeColoring(const CConfig *config, CGeometry *geometry);
164168

165169
/*!
166170
* \brief Distribute the grid points, including ghost points, across all ranks based on a ParMETIS coloring.
167171
* \param[in] config - Definition of the particular problem.
168172
* \param[in] geometry - Geometrical definition of the problem.
169173
*/
170-
void DistributePoints(CConfig *config, CGeometry *geometry);
174+
void DistributePoints(const CConfig *config, CGeometry *geometry);
171175

172176
/*!
173177
* \brief Distribute the connectivity for a single volume element type across all ranks based on a ParMETIS coloring.
174178
* \param[in] config - Definition of the particular problem.
175179
* \param[in] geometry - Geometrical definition of the problem.
176180
* \param[in] Elem_Type - VTK index of the element type being distributed.
177181
*/
178-
void DistributeVolumeConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type);
182+
void DistributeVolumeConnectivity(const CConfig *config, CGeometry *geometry, unsigned short Elem_Type);
179183

180184
/*!
181185
* \brief Distribute the connectivity for a single surface element type in all markers across all ranks based on a ParMETIS coloring.
@@ -269,21 +273,17 @@ class CPhysicalGeometry final : public CGeometry {
269273
* \brief Routine to sort the adjacency for ParMETIS for graph partitioning in parallel.
270274
* \param[in] config - Definition of the particular problem.
271275
*/
272-
void SortAdjacency(CConfig *config);
276+
void SortAdjacency(const CConfig *config);
273277

274278
/*!
275279
* \brief Set the send receive boundaries of the grid.
276-
* \param[in] geometry - Geometrical definition of the problem.
277280
* \param[in] config - Definition of the particular problem.
278-
* \param[in] val_domain - Number of domains for parallelization purposes.
279281
*/
280-
void SetSendReceive(CConfig *config) override;
282+
void SetSendReceive(const CConfig *config) override;
281283

282284
/*!
283285
* \brief Set the send receive boundaries of the grid.
284-
* \param[in] geometry - Geometrical definition of the problem.
285286
* \param[in] config - Definition of the particular problem.
286-
* \param[in] val_domain - Number of domains for parallelization purposes.
287287
*/
288288
void SetBoundaries(CConfig *config) override;
289289

@@ -369,7 +369,7 @@ class CPhysicalGeometry final : public CGeometry {
369369
* \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph partitioning in parallel.
370370
* \param[in] config - Definition of the particular problem.
371371
*/
372-
void PrepareAdjacency(CConfig *config);
372+
void PrepareAdjacency(const CConfig *config);
373373

374374
/*!
375375
* \brief Find repeated nodes between two elements to identify the common face.
@@ -529,7 +529,7 @@ class CPhysicalGeometry final : public CGeometry {
529529
* \brief Set the domains for grid grid partitioning using ParMETIS.
530530
* \param[in] config - Definition of the particular problem.
531531
*/
532-
void SetColorGrid_Parallel(CConfig *config) override;
532+
void SetColorGrid_Parallel(const CConfig *config) override;
533533

534534
/*!
535535
* \brief Set the domains for FEM grid partitioning using ParMETIS.
@@ -804,4 +804,9 @@ class CPhysicalGeometry final : public CGeometry {
804804
}
805805
}
806806

807+
/*!
808+
* \brief Set roughness values for markers in a global array.
809+
*/
810+
void SetGlobalMarkerRoughness(const CConfig* config);
811+
807812
};

Common/include/geometry/dual_grid/CPoint.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class CPoint {
8585
su2activevector SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */
8686
su2activevector Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */
8787
su2activevector MaxLength; /*!< \brief The maximum cell-center to cell-center length. */
88+
su2activevector RoughnessHeight; /*!< \brief Roughness of the nearest wall. */
8889

8990
su2matrix<int> AD_InputIndex; /*!< \brief Indices of Coord variables in the adjoint vector. */
9091
su2matrix<int> AD_OutputIndex; /*!< \brief Indices of Coord variables in the adjoint vector after having been updated. */
@@ -400,6 +401,20 @@ class CPoint {
400401
*/
401402
inline su2double GetWall_Distance(unsigned long iPoint) const { return Wall_Distance(iPoint); }
402403

404+
/*!
405+
* \brief Set the value of the distance to the nearest wall.
406+
* \param[in] iPoint - Index of the point.
407+
* \param[in] distance - Value of the distance.
408+
*/
409+
inline void SetRoughnessHeight(unsigned long iPoint, su2double roughheight) { RoughnessHeight(iPoint) = roughheight; }
410+
411+
/*!
412+
* \brief Get the value of the distance to the nearest wall.
413+
* \param[in] iPoint - Index of the point.
414+
* \return Value of the distance to the nearest wall.
415+
*/
416+
inline su2double GetRoughnessHeight(unsigned long iPoint) const { return RoughnessHeight(iPoint); }
417+
403418
/*!
404419
* \brief Set the value of the distance to a sharp edge.
405420
* \param[in] iPoint - Index of the point.

Common/include/geometry/dual_grid/CTurboVertex.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class CTurboVertex final : public CVertex {
117117
* \brief get global index for ordered span-wise turbovertex.
118118
*/
119119
inline int GetGlobalVertexIndex(void) const {return GlobalIndex;}
120-
120+
121121
/*!
122122
* \brief set angular coord.
123123
*/

Common/include/mpi_structure.hpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,16 @@
5050
#include <medi/medi.hpp>
5151
using namespace medi;
5252

53+
#include <codi/externals/codiMpiTypes.hpp>
54+
5355
class CMediMPIWrapper;
5456
typedef CMediMPIWrapper SU2_MPI;
5557

56-
#if defined CODI_REVERSE_TYPE
57-
#include <codi/externals/codiMediPackTypes.hpp>
58-
#if CODI_PRIMAL_INDEX_TAPE
59-
typedef CoDiPackToolPrimalRestore<su2double> MediTool;
60-
#else
61-
typedef CoDiPackTool<su2double> MediTool;
62-
#endif // defined CODI_REVERSE_TYPE
63-
#elif defined CODI_FORWARD_TYPE
64-
#include <codi/externals/codiForwardMediPackTypes.hpp>
65-
typedef CoDiPackForwardTool<su2double> MediTool;
66-
#endif // defined CODI_FORWARD_TYPE
67-
#define AMPI_ADOUBLE ((medi::MpiTypeInterface*)MediTool::MPI_TYPE)
58+
typedef CoDiMpiTypes<su2double> MediTypes;
59+
typedef MediTypes::Tool MediTool;
60+
61+
extern MediTypes* mediTypes;
62+
#define AMPI_ADOUBLE ((medi::MpiTypeInterface*)mediTypes->MPI_TYPE)
6863

6964
#else
7065
class CBaseMPIWrapper;
@@ -417,7 +412,7 @@ class CBaseMPIWrapper {
417412
void *recvbuf, int recvcnt, Datatype recvtype, Comm comm);
418413

419414
static void Allgatherv(void *sendbuf, int sendcnt, Datatype sendtype,
420-
void *recvbuf, int recvcnt, int *displs, Datatype recvtype, Comm comm);
415+
void *recvbuf, int *recvcnt, int *displs, Datatype recvtype, Comm comm);
421416

422417
static void Sendrecv(void *sendbuf, int sendcnt, Datatype sendtype,
423418
int dest, int sendtag, void *recvbuf, int recvcnt,

Common/include/mpi_structure.inl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ inline passivedouble CBaseMPIWrapper::Wtime(void) {
286286

287287
inline void CMediMPIWrapper::Init(int *argc, char ***argv) {
288288
AMPI_Init(argc,argv);
289-
MediTool::init();
289+
mediTypes = new MediTypes();
290290
AMPI_Comm_rank(convertComm(currentComm), &Rank);
291291
AMPI_Comm_size(convertComm(currentComm), &Size);
292292

@@ -298,7 +298,7 @@ inline void CMediMPIWrapper::Init(int *argc, char ***argv) {
298298

299299
inline void CMediMPIWrapper::Init_thread(int *argc, char ***argv, int required, int* provided) {
300300
AMPI_Init_thread(argc,argv,required,provided);
301-
MediTool::init();
301+
mediTypes = new MediTypes();
302302
AMPI_Comm_rank(convertComm(currentComm), &Rank);
303303
AMPI_Comm_size(convertComm(currentComm), &Size);
304304

@@ -310,7 +310,7 @@ inline void CMediMPIWrapper::Init_thread(int *argc, char ***argv, int required,
310310

311311
inline void CMediMPIWrapper::Init_AMPI(void) {
312312
AMPI_Init_common();
313-
MediTool::init();
313+
mediTypes = new MediTypes();
314314
}
315315

316316
inline void CMediMPIWrapper::SetComm(Comm newComm){
@@ -391,6 +391,8 @@ inline void CMediMPIWrapper::Comm_size(Comm comm, int *size){
391391

392392
inline void CMediMPIWrapper::Finalize(){
393393
if( winMinRankErrorInUse ) MPI_Win_free(&winMinRankError);
394+
395+
delete mediTypes;
394396
AMPI_Finalize();
395397
}
396398

@@ -612,7 +614,7 @@ inline void CBaseMPIWrapper::Scatter(void *sendbuf, int sendcnt, Datatype sendty
612614
}
613615

614616
inline void CBaseMPIWrapper::Allgatherv(void *sendbuf, int sendcnt, Datatype sendtype,
615-
void *recvbuf, int recvcnt, int *displs, Datatype recvtype, Comm comm){
617+
void *recvbuf, int *recvcnt, int *displs, Datatype recvtype, Comm comm){
616618
CopyData(sendbuf, recvbuf, sendcnt, sendtype);
617619
}
618620

Common/include/option_structure.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,18 @@ static const MapType<string, ACTDISK_TYPE> ActDisk_Map = {
13941394
MakePair("VARIABLE_LOAD", VARIABLE_LOAD)
13951395
};
13961396

1397+
/*!
1398+
* \brief types of wall boundary condition - smooth or rough
1399+
*/
1400+
enum WALL_TYPE {
1401+
SMOOTH = 1, /*!< \brief Smooth wall */
1402+
ROUGH = 2, /*!< \brief Rough wall */
1403+
};
1404+
static const MapType<string, WALL_TYPE> WallType_Map = {
1405+
MakePair("SMOOTH", SMOOTH)
1406+
MakePair("ROUGH", ROUGH)
1407+
};
1408+
13971409
/*!
13981410
* \brief Types of geometric entities based on VTK nomenclature
13991411
*/

0 commit comments

Comments
 (0)