Skip to content

Commit 476cd96

Browse files
authored
Merge pull request #1027 from su2code/feature_actuatordisk_variableload
Feature actuator disk with variable load. Addition of a new actuator disk model with a variable load and swirl distributions along disk radius. Test case available in TestCases/rans/actuatordisk_variable_load/
2 parents 0e3fad6 + febb957 commit 476cd96

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. */
@@ -4709,6 +4710,12 @@ class CConfig {
47094710
*/
47104711
string GetInlet_FileName(void) const { return Inlet_Filename; }
47114712

4713+
/*!
4714+
* \brief Get name of the input file for the specified actuator disk.
4715+
* \return Name of the input file for the specified actuator disk.
4716+
*/
4717+
string GetActDisk_FileName(void) const { return ActDisk_FileName; }
4718+
47124719
/*!
47134720
* \brief Get the tolerance used for matching two points on a specified inlet
47144721
* \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
@@ -1403,6 +1403,9 @@ void CConfig::SetConfig_Options() {
14031403
nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet,
14041404
ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega);
14051405

1406+
/*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/
1407+
addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat"));
1408+
14061409
/*!\brief INLET_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Inlet_Map \endlink \n DEFAULT: TOTAL_CONDITIONS \ingroup Config*/
14071410
addEnumOption("INLET_TYPE", Kind_Inlet, Inlet_Map, TOTAL_CONDITIONS);
14081411
/*!\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*/
@@ -6895,6 +6898,13 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
68956898
BoundaryTable.PrintFooter();
68966899
}
68976900

6901+
if (nMarker_ActDiskOutlet != 0) {
6902+
if (GetKind_ActDisk() == VARIABLE_LOAD) {
6903+
cout << endl << "Actuator disk with variable load." << endl;
6904+
cout << "Actuator disk data read from file: " << GetActDisk_FileName() << endl;
6905+
}
6906+
}
6907+
68986908
}
68996909

69006910
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
@@ -155,6 +155,17 @@ class CEulerSolver : public CSolver {
155155
**Inlet_Ttotal = nullptr, /*!< \brief Value of the Total T. */
156156
***Inlet_FlowDir = nullptr; /*!< \brief Value of the Flow Direction. */
157157

158+
su2activevector
159+
ActDisk_R; /*!< \brief Value of the actuator disk Radius. */
160+
su2activematrix
161+
ActDisk_C, /*!< \brief Value of the actuator disk Center. */
162+
ActDisk_Axis; /*!< \brief Value of the actuator disk Axis. */
163+
su2double
164+
**ActDisk_Fa, /*!< \brief Value of the actuator disk Axial Force per Unit Area. */
165+
**ActDisk_Fx, /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */
166+
**ActDisk_Fy, /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */
167+
**ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */
168+
158169
su2double
159170
Total_ComboObj = 0.0, /*!< \brief Total 'combo' objective for all monitored boundaries */
160171
Total_CL_Prev = 0.0, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */
@@ -358,6 +369,16 @@ class CEulerSolver : public CSolver {
358369
void SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container,
359370
CConfig *config, unsigned short iMesh, bool Output);
360371

372+
/*!
373+
* \brief Read the actuator disk input file for the VARIABLE_LOAD type.
374+
* \param[in] geometry - Geometrical definition of the problem.
375+
* \param[in] solver_container - Container vector with all the solutions.
376+
* \param[in] config - Definition of the particular problem.
377+
* \param[in] iMesh - current mesh level for the multigrid.
378+
* \param[in] Output - boolean to determine whether to print output.
379+
*/
380+
void ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_container,
381+
CConfig *config, unsigned short iMesh, bool Output);
361382
/*!
362383
* \brief Compute the max eigenvalue.
363384
* \param[in] geometry - Geometrical definition of the problem.
@@ -775,6 +796,24 @@ class CEulerSolver : public CSolver {
775796
unsigned short val_marker,
776797
bool val_inlet_surface) final;
777798

799+
/*!
800+
* \brief Impose an actuator disk with variable load boundary condition.
801+
* \param[in] geometry - Geometrical definition of the problem.
802+
* \param[in] solver_container - Container vector with all the solutions.
803+
* \param[in] conv_numerics - Description of the numerical method.
804+
* \param[in] visc_numerics - Description of the numerical method.
805+
* \param[in] config - Definition of the particular problem.
806+
* \param[in] val_marker - Surface marker where the boundary condition is applied.
807+
* \param[in] val_inlet_surface - Boolean for whether val_marker is an inlet
808+
*/
809+
void BC_ActDisk_VariableLoad(CGeometry *geometry,
810+
CSolver **solver_container,
811+
CNumerics *conv_numerics,
812+
CNumerics *visc_numerics,
813+
CConfig *config,
814+
unsigned short val_marker,
815+
bool val_inlet_surface);
816+
778817
/*!
779818
* \brief Impose the interface boundary condition using the residual.
780819
* \param[in] geometry - Geometrical definition of the problem.
@@ -2057,6 +2096,90 @@ class CEulerSolver : public CSolver {
20572096
DonorGlobalIndex[val_marker][val_vertex] = val_index;
20582097
}
20592098

2099+
/*!
2100+
* \brief Value of the characteristic global index at the boundaries.
2101+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2102+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2103+
* \return Value of the axial force per unit area.
2104+
*/
2105+
inline su2double GetActDisk_Fa(unsigned short val_marker,
2106+
unsigned long val_vertex) const {
2107+
return ActDisk_Fa[val_marker][val_vertex];
2108+
}
2109+
2110+
/*!
2111+
* \brief Value of the characteristic global index at the boundaries.
2112+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2113+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2114+
* \return Value of the axial force per unit area.
2115+
*/
2116+
inline void SetActDisk_Fa(unsigned short val_marker,
2117+
unsigned long val_vertex,
2118+
su2double val_fa) { ActDisk_Fa[val_marker][val_vertex] = val_fa; }
2119+
2120+
/*!
2121+
* \brief Value of the characteristic global index at the boundaries.
2122+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2123+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2124+
* \return Value of the x component of the radial and tangential forces per unit area resultant.
2125+
*/
2126+
inline su2double GetActDisk_Fx(unsigned short val_marker,
2127+
unsigned long val_vertex) const {
2128+
return ActDisk_Fx[val_marker][val_vertex];
2129+
}
2130+
2131+
/*!
2132+
* \brief Value of the characteristic global index at the boundaries.
2133+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2134+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2135+
* \return Value of the x component of the radial and tangential forces per unit area resultant.
2136+
*/
2137+
inline void SetActDisk_Fx(unsigned short val_marker,
2138+
unsigned long val_vertex,
2139+
su2double val_fx) { ActDisk_Fx[val_marker][val_vertex] = val_fx; }
2140+
2141+
/*!
2142+
* \brief Value of the characteristic global index at the boundaries.
2143+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2144+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2145+
* \return Value of the y component of the radial and tangential forces per unit area resultant.
2146+
*/
2147+
inline su2double GetActDisk_Fy(unsigned short val_marker,
2148+
unsigned long val_vertex) const {
2149+
return ActDisk_Fy[val_marker][val_vertex];
2150+
}
2151+
2152+
/*!
2153+
* \brief Value of the characteristic global index at the boundaries.
2154+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2155+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2156+
* \return Value of the y component of the radial and tangential forces per unit area resultant.
2157+
*/
2158+
inline void SetActDisk_Fy(unsigned short val_marker,
2159+
unsigned long val_vertex,
2160+
su2double val_fy) { ActDisk_Fy[val_marker][val_vertex] = val_fy; }
2161+
2162+
/*!
2163+
* \brief Value of the characteristic global index at the boundaries.
2164+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2165+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2166+
* \return Value of the z component of the radial and tangential forces per unit area resultant.
2167+
*/
2168+
inline su2double GetActDisk_Fz(unsigned short val_marker,
2169+
unsigned long val_vertex) const {
2170+
return ActDisk_Fz[val_marker][val_vertex];
2171+
}
2172+
2173+
/*!
2174+
* \brief Value of the characteristic global index at the boundaries.
2175+
* \param[in] val_marker - Surface marker where the coefficient is computed.
2176+
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
2177+
* \return Value of the z component of the radial and tangential forces per unit area resultant.
2178+
*/
2179+
inline void SetActDisk_Fz(unsigned short val_marker,
2180+
unsigned long val_vertex,
2181+
su2double val_fz) { ActDisk_Fz[val_marker][val_vertex] = val_fz; }
2182+
20602183
/*!
20612184
* \brief Value of the characteristic global index at the boundaries.
20622185
* \param[in] val_marker - Surface marker where the coefficient is computed.

0 commit comments

Comments
 (0)