Skip to content

Commit 1d8058e

Browse files
authored
Merge pull request #877 from su2code/feature_roughwall
Rough wall boundary condition for SA and SST turbulence models.
2 parents a2da75e + c518c86 commit 1d8058e

22 files changed

Lines changed: 776 additions & 108 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 26 additions & 2 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. */
@@ -1077,7 +1082,8 @@ class CConfig {
10771082
default_body_force[3], /*!< \brief Default body force vector for the COption class. */
10781083
default_nacelle_location[5], /*!< \brief Location of the nacelle. */
10791084
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. */
1085+
default_hs_center[3], /*!< \brief Default position of the center of the heat source. */
1086+
default_roughness[1];
10811087

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

2933+
/*!
2934+
* \brief Get the total number of rough markers.
2935+
* \return Total number of heat flux markers.
2936+
*/
2937+
unsigned short GetnRoughWall(void) const { return nRough_Wall; }
2938+
29272939
/*!
29282940
* \brief Get the total number of objectives in kind_objective list
29292941
* \return Total number of objectives in kind_objective list
@@ -5004,6 +5016,11 @@ class CConfig {
50045016
*/
50055017
unsigned short GetKind_ActDisk(void) const { return Kind_ActDisk; }
50065018

5019+
/*!
5020+
* \brief Set the kind of wall - rough or smooth.
5021+
*/
5022+
void SetKindWall(string val_marker, unsigned short val_kindwall);
5023+
50075024
/*!
50085025
* \brief Get the number of sections.
50095026
* \return Number of sections
@@ -6754,6 +6771,13 @@ class CConfig {
67546771
*/
67556772
su2double* GetWallFunction_DoubleInfo(string val_marker);
67566773

6774+
/*!
6775+
* \brief Get the type of wall and roughness height on a wall boundary (Heatflux or Isothermal).
6776+
* \param[in] val_index - Index corresponding to the boundary.
6777+
* \return The wall type and roughness height.
6778+
*/
6779+
pair<unsigned short, su2double> GetWallRoughnessProperties(string val_marker) const;
6780+
67576781
/*!
67586782
* \brief Get the target (pressure, massflow, etc) at an engine inflow boundary.
67596783
* \param[in] val_index - Index corresponding to the engine inflow boundary.

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 9 additions & 0 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;
@@ -804,4 +808,9 @@ class CPhysicalGeometry final : public CGeometry {
804808
}
805809
}
806810

811+
/*!
812+
* \brief Set roughness values for markers in a global array.
813+
*/
814+
void SetGlobalMarkerRoughness(const CConfig* config);
815+
807816
};

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ class CBaseMPIWrapper {
412412
void *recvbuf, int recvcnt, Datatype recvtype, Comm comm);
413413

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

417417
static void Sendrecv(void *sendbuf, int sendcnt, Datatype sendtype,
418418
int dest, int sendtag, void *recvbuf, int recvcnt,

Common/include/mpi_structure.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ inline void CBaseMPIWrapper::Scatter(void *sendbuf, int sendcnt, Datatype sendty
614614
}
615615

616616
inline void CBaseMPIWrapper::Allgatherv(void *sendbuf, int sendcnt, Datatype sendtype,
617-
void *recvbuf, int recvcnt, int *displs, Datatype recvtype, Comm comm){
617+
void *recvbuf, int *recvcnt, int *displs, Datatype recvtype, Comm comm){
618618
CopyData(sendbuf, recvbuf, sendcnt, sendtype);
619619
}
620620

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)