Skip to content

Commit 18eedfa

Browse files
authored
Merge branch 'develop' into cleanup_flow_solver_duplication
2 parents 69dbeba + 476cd96 commit 18eedfa

11 files changed

Lines changed: 977 additions & 6 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ class CConfig {
227227
bool Inlet_From_File; /*!< \brief True if the inlet profile is to be loaded from a file. */
228228
string Inlet_Filename; /*!< \brief Filename specifying an inlet profile. */
229229
su2double Inlet_Matching_Tol; /*!< \brief Tolerance used when matching a point to a point from the inlet file. */
230+
string ActDisk_FileName; /*!< \brief Filename specifying an actuator disk. */
230231

231232
string *Marker_Euler, /*!< \brief Euler wall markers. */
232233
*Marker_FarField, /*!< \brief Far field markers. */
@@ -4702,6 +4703,12 @@ class CConfig {
47024703
*/
47034704
string GetInlet_FileName(void) const { return Inlet_Filename; }
47044705

4706+
/*!
4707+
* \brief Get name of the input file for the specified actuator disk.
4708+
* \return Name of the input file for the specified actuator disk.
4709+
*/
4710+
string GetActDisk_FileName(void) const { return ActDisk_FileName; }
4711+
47054712
/*!
47064713
* \brief Get the tolerance used for matching two points on a specified inlet
47074714
* \return Tolerance used for matching a point to a specified inlet

Common/include/option_structure.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,8 @@ enum ACTDISK_TYPE {
13811381
NET_THRUST = 3, /*!< \brief User specifies the Net thrust. */
13821382
DRAG_MINUS_THRUST = 4, /*!< \brief User specifies the D-T. */
13831383
MASSFLOW = 5, /*!< \brief User specifies the massflow. */
1384-
POWER = 6 /*!< \brief User specifies the power. */
1384+
POWER = 6, /*!< \brief User specifies the power. */
1385+
VARIABLE_LOAD = 7 /*!< \brief User specifies the load distribution. */
13851386
};
13861387
static const MapType<string, ACTDISK_TYPE> ActDisk_Map = {
13871388
MakePair("VARIABLES_JUMP", VARIABLES_JUMP)
@@ -1390,6 +1391,7 @@ static const MapType<string, ACTDISK_TYPE> ActDisk_Map = {
13901391
MakePair("DRAG_MINUS_THRUST", DRAG_MINUS_THRUST)
13911392
MakePair("MASSFLOW", MASSFLOW)
13921393
MakePair("POWER", POWER)
1394+
MakePair("VARIABLE_LOAD", VARIABLE_LOAD)
13931395
};
13941396

13951397
/*!

Common/src/CConfig.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,9 @@ void CConfig::SetConfig_Options() {
14021402
nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet,
14031403
ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega);
14041404

1405+
/*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/
1406+
addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat"));
1407+
14051408
/*!\brief INLET_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Inlet_Map \endlink \n DEFAULT: TOTAL_CONDITIONS \ingroup Config*/
14061409
addEnumOption("INLET_TYPE", Kind_Inlet, Inlet_Map, TOTAL_CONDITIONS);
14071410
/*!\brief INC_INLET_TYPE \n DESCRIPTION: List of inlet types for incompressible flows. List length must match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. \ingroup Config*/
@@ -6890,6 +6893,13 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
68906893
BoundaryTable.PrintFooter();
68916894
}
68926895

6896+
if (nMarker_ActDiskOutlet != 0) {
6897+
if (GetKind_ActDisk() == VARIABLE_LOAD) {
6898+
cout << endl << "Actuator disk with variable load." << endl;
6899+
cout << "Actuator disk data read from file: " << GetActDisk_FileName() << endl;
6900+
}
6901+
}
6902+
68936903
}
68946904

68956905
bool CConfig::TokenizeString(string & str, string & option_name,

SU2_CFD/include/solvers/CEulerSolver.hpp

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
6868
**ActDisk_DeltaP = nullptr, /*!< \brief Value of the Delta P. */
6969
**ActDisk_DeltaT = nullptr; /*!< \brief Value of the Delta T. */
7070

71+
su2activevector
72+
ActDisk_R; /*!< \brief Value of the actuator disk Radius. */
73+
su2activematrix
74+
ActDisk_C, /*!< \brief Value of the actuator disk Center. */
75+
ActDisk_Axis; /*!< \brief Value of the actuator disk Axis. */
76+
su2double
77+
**ActDisk_Fa, /*!< \brief Value of the actuator disk Axial Force per Unit Area. */
78+
**ActDisk_Fx, /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */
79+
**ActDisk_Fy, /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */
80+
**ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */
81+
7182
su2double
7283
Total_CL_Prev = 0.0, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */
7384
Total_SolidCD = 0.0, /*!< \brief Total drag coefficient for all the boundaries. */
@@ -219,6 +230,16 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
219230
void SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container,
220231
CConfig *config, unsigned short iMesh, bool Output);
221232

233+
/*!
234+
* \brief Read the actuator disk input file for the VARIABLE_LOAD type.
235+
* \param[in] geometry - Geometrical definition of the problem.
236+
* \param[in] solver_container - Container vector with all the solutions.
237+
* \param[in] config - Definition of the particular problem.
238+
* \param[in] iMesh - current mesh level for the multigrid.
239+
* \param[in] Output - boolean to determine whether to print output.
240+
*/
241+
void ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_container,
242+
CConfig *config, unsigned short iMesh, bool Output);
222243
/*!
223244
* \brief Compute the max eigenvalue.
224245
* \param[in] geometry - Geometrical definition of the problem.
@@ -507,6 +528,24 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
507528
unsigned short val_marker,
508529
bool val_inlet_surface) final;
509530

531+
/*!
532+
* \brief Impose an actuator disk with variable load boundary condition.
533+
* \param[in] geometry - Geometrical definition of the problem.
534+
* \param[in] solver_container - Container vector with all the solutions.
535+
* \param[in] conv_numerics - Description of the numerical method.
536+
* \param[in] visc_numerics - Description of the numerical method.
537+
* \param[in] config - Definition of the particular problem.
538+
* \param[in] val_marker - Surface marker where the boundary condition is applied.
539+
* \param[in] val_inlet_surface - Boolean for whether val_marker is an inlet
540+
*/
541+
void BC_ActDisk_VariableLoad(CGeometry *geometry,
542+
CSolver **solver_container,
543+
CNumerics *conv_numerics,
544+
CNumerics *visc_numerics,
545+
CConfig *config,
546+
unsigned short val_marker,
547+
bool val_inlet_surface);
548+
510549
/*!
511550
* \brief Impose the interface boundary condition using the residual.
512551
* \param[in] geometry - Geometrical definition of the problem.
@@ -1065,6 +1104,90 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
10651104
DonorGlobalIndex[val_marker][val_vertex] = val_index;
10661105
}
10671106

1107+
/*!
1108+
* \brief Value of the characteristic global index at the boundaries.
1109+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1110+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1111+
* \return Value of the axial force per unit area.
1112+
*/
1113+
inline su2double GetActDisk_Fa(unsigned short val_marker,
1114+
unsigned long val_vertex) const {
1115+
return ActDisk_Fa[val_marker][val_vertex];
1116+
}
1117+
1118+
/*!
1119+
* \brief Value of the characteristic global index at the boundaries.
1120+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1121+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1122+
* \return Value of the axial force per unit area.
1123+
*/
1124+
inline void SetActDisk_Fa(unsigned short val_marker,
1125+
unsigned long val_vertex,
1126+
su2double val_fa) { ActDisk_Fa[val_marker][val_vertex] = val_fa; }
1127+
1128+
/*!
1129+
* \brief Value of the characteristic global index at the boundaries.
1130+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1131+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1132+
* \return Value of the x component of the radial and tangential forces per unit area resultant.
1133+
*/
1134+
inline su2double GetActDisk_Fx(unsigned short val_marker,
1135+
unsigned long val_vertex) const {
1136+
return ActDisk_Fx[val_marker][val_vertex];
1137+
}
1138+
1139+
/*!
1140+
* \brief Value of the characteristic global index at the boundaries.
1141+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1142+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1143+
* \return Value of the x component of the radial and tangential forces per unit area resultant.
1144+
*/
1145+
inline void SetActDisk_Fx(unsigned short val_marker,
1146+
unsigned long val_vertex,
1147+
su2double val_fx) { ActDisk_Fx[val_marker][val_vertex] = val_fx; }
1148+
1149+
/*!
1150+
* \brief Value of the characteristic global index at the boundaries.
1151+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1152+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1153+
* \return Value of the y component of the radial and tangential forces per unit area resultant.
1154+
*/
1155+
inline su2double GetActDisk_Fy(unsigned short val_marker,
1156+
unsigned long val_vertex) const {
1157+
return ActDisk_Fy[val_marker][val_vertex];
1158+
}
1159+
1160+
/*!
1161+
* \brief Value of the characteristic global index at the boundaries.
1162+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1163+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1164+
* \return Value of the y component of the radial and tangential forces per unit area resultant.
1165+
*/
1166+
inline void SetActDisk_Fy(unsigned short val_marker,
1167+
unsigned long val_vertex,
1168+
su2double val_fy) { ActDisk_Fy[val_marker][val_vertex] = val_fy; }
1169+
1170+
/*!
1171+
* \brief Value of the characteristic global index at the boundaries.
1172+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1173+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1174+
* \return Value of the z component of the radial and tangential forces per unit area resultant.
1175+
*/
1176+
inline su2double GetActDisk_Fz(unsigned short val_marker,
1177+
unsigned long val_vertex) const {
1178+
return ActDisk_Fz[val_marker][val_vertex];
1179+
}
1180+
1181+
/*!
1182+
* \brief Value of the characteristic global index at the boundaries.
1183+
* \param[in] val_marker - Surface marker where the coefficient is computed.
1184+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
1185+
* \return Value of the z component of the radial and tangential forces per unit area resultant.
1186+
*/
1187+
inline void SetActDisk_Fz(unsigned short val_marker,
1188+
unsigned long val_vertex,
1189+
su2double val_fz) { ActDisk_Fz[val_marker][val_vertex] = val_fz; }
1190+
10681191
/*!
10691192
* \brief Value of the characteristic global index at the boundaries.
10701193
* \param[in] val_marker - Surface marker where the coefficient is computed.

0 commit comments

Comments
 (0)