Skip to content

Commit

Permalink
Merge branch 'develop' into new_turbo_outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfooted authored Nov 12, 2023
2 parents 9ea23be + a8c5e15 commit 70756d9
Show file tree
Hide file tree
Showing 13 changed files with 1,424 additions and 12 deletions.
73 changes: 73 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class CConfig {
nMarker_NearFieldBound, /*!< \brief Number of near field boundary markers. */
nMarker_ActDiskInlet, /*!< \brief Number of actuator disk inlet markers. */
nMarker_ActDiskOutlet, /*!< \brief Number of actuator disk outlet markers. */
nMarker_ActDiskBemInlet, /*!< \brief Number of actuator disk BEM inlet markers. */
nMarker_ActDiskBemOutlet, /*!< \brief Number of actuator disk BEM outlet markers. */
nMarker_Deform_Mesh_Sym_Plane, /*!< \brief Number of markers with symmetric deformation */
nMarker_Deform_Mesh, /*!< \brief Number of deformable markers at the boundary. */
nMarker_Fluid_Load, /*!< \brief Number of markers in which the flow load is computed/employed. */
Expand Down Expand Up @@ -241,6 +243,8 @@ class CConfig {
*Marker_CHTInterface, /*!< \brief Conjugate heat transfer interface markers. */
*Marker_ActDiskInlet, /*!< \brief Actuator disk inlet markers. */
*Marker_ActDiskOutlet, /*!< \brief Actuator disk outlet markers. */
*Marker_ActDiskBemInlet, /*!< \brief Actuator disk BEM inlet markers. */
*Marker_ActDiskBemOutlet, /*!< \brief Actuator disk BEM outlet markers. */
*Marker_Inlet, /*!< \brief Inlet flow markers. */
*Marker_Inlet_Species, /*!< \brief Inlet species markers. */
*Marker_Inlet_Turb, /*!< \brief Inlet turbulent markers. */
Expand Down Expand Up @@ -343,8 +347,16 @@ class CConfig {
su2double *ActDiskOutlet_GrossThrust; /*!< \brief Specified outlet gross thrust for actuator disk. */
su2double *ActDiskOutlet_Force; /*!< \brief Specified outlet force for actuator disk. */
su2double *ActDiskOutlet_Power; /*!< \brief Specified outlet power for actuator disk. */
su2double *ActDiskOutlet_Thrust_BEM; /*!< \brief Specified outlet thrust for actuator disk. */
su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet torque for actuator disk. */
su2double **ActDisk_PressJump,
**ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/
su2double **ActDiskBem_CG[3]; /*!< \brief Specified center for actuator disk BEM.*/
su2double **ActDiskBem_Axis[3]; /*!< \brief Specified axis for actuator disk BEM.*/
su2double BEM_blade_angle; /*!< \brief Propeller blade angle.*/
string BEM_prop_filename; /*!< \brief Propeller filename.*/
unsigned short ActDiskBem_Frequency; /*!< \brief Frequency of updating actuator disk with BEM. */
bool History_File_Append_Flag; /*!< \brief Flag to append history file.*/
su2double *ActDisk_DeltaPress; /*!< \brief Specified pressure delta for actuator disk. */
su2double *ActDisk_DeltaTemp; /*!< \brief Specified temperature delta for actuator disk. */
su2double *ActDisk_TotalPressRatio; /*!< \brief Specified tot. pres. ratio for actuator disk. */
Expand Down Expand Up @@ -1367,6 +1379,10 @@ class CConfig {
unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string* & Marker_ActDiskInlet, string* & Marker_ActDiskOutlet,
su2double** & ActDisk_PressJump, su2double** & ActDisk_TempJump, su2double** & ActDisk_Omega);

void addActDiskBemOption(const string& name,
unsigned short& nMarker_ActDiskBemInlet, unsigned short& nMarker_ActDiskBemOutlet, string*& Marker_ActDiskBemInlet, string*& Marker_ActDiskBemOutlet,
su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z);

void addWallFunctionOption(const string &name, unsigned short &list_size,
string* &string_field, WALL_FUNCTIONS* &val_Kind_WF,
unsigned short** &val_IntInfo_WF, su2double** &val_DoubleInfo_WF);
Expand Down Expand Up @@ -6661,6 +6677,31 @@ class CConfig {
*/
su2double GetActDisk_Omega(const string& val_marker, unsigned short val_index) const;

/*!
* \brief Get the Center of the actuator disk with BEM.
*/
su2double GetActDiskBem_CG(unsigned short iDim, string val_marker, unsigned short val_index) const;

/*!
* \brief Get the axis of the actuator disk with BEM.
*/
su2double GetActDiskBem_Axis(unsigned short iDim, string val_marker, unsigned short val_index) const;

/*!
* \brief Get the frequency of updating the actuator disk with BEM.
*/
const unsigned short& GetActDiskBem_Frequency(void) const { return ActDiskBem_Frequency; }

/*!
* \brief Get the blade angle of the propeller.
*/
su2double GetBEM_blade_angle(void) const { return BEM_blade_angle; }

/*!
* \brief Get the filename of the propeller.
*/
const string& GetBEM_prop_filename(void) const { return BEM_prop_filename; }

/*!
* \brief Get Actuator Disk Outlet for boundary <i>val_marker</i> (actuator disk inlet).
* \return Actuator Disk Outlet from the config information for the marker <i>val_marker</i>.
Expand Down Expand Up @@ -8193,6 +8234,20 @@ class CConfig {
*/
su2double GetActDiskOutlet_Power(const string& val_marker) const;

/*!
* \brief Get the thrust at the actuator disk outlet boundary.
* \param[in] val_marker - Marker corresponding to the outlet (actuator disk) boundary.
* \return The outlet (actuator disk) thrust.
*/
su2double GetActDiskOutlet_Thrust_BEM(string val_marker) const;

/*!
* \brief Get the torque at the actuator disk outlet boundary.
* \param[in] val_marker - Marker corresponding to the outlet boundary.
* \return The outlet (actuator disk) torque.
*/
su2double GetActDiskOutlet_Torque_BEM(string val_marker) const;

/*!
* \brief Get the back pressure (static) at an outlet boundary.
* \param[in] val_index - Index corresponding to the outlet boundary.
Expand Down Expand Up @@ -8228,6 +8283,24 @@ class CConfig {
*/
void SetActDiskOutlet_Power(unsigned short val_marker, su2double val_actdisk_power) { ActDiskOutlet_Power[val_marker] = val_actdisk_power; }

/*!
* \brief Set the thrust at the outlet (actuator disk) boundary.
* \param[in] val_marker - Marker corresponding to the outlet (actuator disk) boundary.
* \param[in] val_actdisk_thrust_bem - Value of the actuator disk thrust.
*/
void SetActDiskOutlet_Thrust_BEM(unsigned short val_marker, su2double val_actdisk_thrust_bem) {
ActDiskOutlet_Thrust_BEM[val_marker] = val_actdisk_thrust_bem;
}

/*!
* \brief Get the back pressure (static) at an outlet boundary.
* \param[in] val_marker - Marker corresponding to the outlet boundary.
* \param[in] val_actdisk_torque_bem - Value of the actuator disk torque.
*/
void SetActDiskOutlet_Torque_BEM(unsigned short val_marker, su2double val_actdisk_torque_bem) {
ActDiskOutlet_Torque_BEM[val_marker] = val_actdisk_torque_bem;
}

/*!
* \brief Get the displacement value at an displacement boundary.
* \param[in] val_index - Index corresponding to the displacement boundary.
Expand Down
4 changes: 3 additions & 1 deletion Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,8 @@ enum ACTDISK_TYPE {
DRAG_MINUS_THRUST = 4, /*!< \brief User specifies the D-T. */
MASSFLOW = 5, /*!< \brief User specifies the massflow. */
POWER = 6, /*!< \brief User specifies the power. */
VARIABLE_LOAD = 7 /*!< \brief User specifies the load distribution. */
VARIABLE_LOAD = 7, /*!< \brief User specifies the load distribution. */
BLADE_ELEMENT = 8 /*!< \brief User specifies to use Blade element method. */
};
static const MapType<std::string, ACTDISK_TYPE> ActDisk_Map = {
MakePair("VARIABLES_JUMP", VARIABLES_JUMP)
Expand All @@ -1881,6 +1882,7 @@ static const MapType<std::string, ACTDISK_TYPE> ActDisk_Map = {
MakePair("MASSFLOW", MASSFLOW)
MakePair("POWER", POWER)
MakePair("VARIABLE_LOAD", VARIABLE_LOAD)
MakePair("BLADE_ELEMENT", BLADE_ELEMENT)
};

/*!
Expand Down
94 changes: 93 additions & 1 deletion Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,19 @@ void CConfig::addActDiskOption(const string & name, unsigned short & nMarker_Act
option_map.insert(pair<string, COptionBase *>(name, val));
}

void CConfig::addActDiskBemOption(const string& name,
unsigned short& nMarker_ActDiskBemInlet, unsigned short& nMarker_ActDiskBemOutlet,
string*& Marker_ActDiskBemInlet, string*& Marker_ActDiskBemOutlet,
su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z) {
assert(option_map.find(name) == option_map.end());
all_options.insert(pair<string, bool>(name, true));
COptionBase* val = new COptionActDisk(name,
nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet,
Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet,
ActDiskBem_X, ActDiskBem_Y, ActDiskBem_Z);
option_map.insert(pair<string, COptionBase *>(name, val));
}

void CConfig::addWallFunctionOption(const string &name, unsigned short &list_size, string* &string_field,
WALL_FUNCTIONS* &val_Kind_WF, unsigned short** &val_IntInfo_WF,
su2double** &val_DoubleInfo_WF) {
Expand Down Expand Up @@ -921,6 +934,9 @@ void CConfig::SetPointersNull() {
ActDiskOutlet_Power = nullptr; ActDiskOutlet_Temperature = nullptr; ActDiskOutlet_TotalTemperature = nullptr;
ActDiskOutlet_MassFlow = nullptr;

ActDiskOutlet_Thrust_BEM = nullptr;
ActDiskOutlet_Torque_BEM = nullptr;

ActDisk_DeltaPress = nullptr; ActDisk_DeltaTemp = nullptr;
ActDisk_TotalPressRatio = nullptr; ActDisk_TotalTempRatio = nullptr; ActDisk_StaticPressRatio = nullptr;
ActDisk_StaticTempRatio = nullptr; ActDisk_NetThrust = nullptr; ActDisk_GrossThrust = nullptr;
Expand Down Expand Up @@ -1523,6 +1539,16 @@ void CConfig::SetConfig_Options() {
nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet,
ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega);

/*!\brief MARKER_ACTDISK_BEM_CG\n DESCRIPTION: Actuator disk CG for blade element momentum (BEM) method. \ingroup Config*/
addActDiskBemOption("MARKER_ACTDISK_BEM_CG",
nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet,
ActDiskBem_CG[0], ActDiskBem_CG[1], ActDiskBem_CG[2]);

/*!\brief MARKER_ACTDISK_BEM_AXIS\n DESCRIPTION: Actuator disk axis for blade element momentum (BEM) method. \ingroup Config*/
addActDiskBemOption("MARKER_ACTDISK_BEM_AXIS",
nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet,
ActDiskBem_Axis[0], ActDiskBem_Axis[1], ActDiskBem_Axis[2]);

/*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/
addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat"));

Expand Down Expand Up @@ -1651,6 +1677,16 @@ void CConfig::SetConfig_Options() {
addBoolOption("SUBSONIC_ENGINE", SubsonicEngine, false);
/* DESCRIPTION: Actuator disk double surface */
addBoolOption("ACTDISK_DOUBLE_SURFACE", ActDisk_DoubleSurface, false);

/* DESCRIPTION: Actuator disk BEM switch for history file appending.*/
addBoolOption("HISTORY_FILE_APPEND", History_File_Append_Flag, false);
/* DESCRIPTION: Propeller blade angle for actuator disk BEM.*/
addDoubleOption("BEM_PROP_BLADE_ANGLE", BEM_blade_angle, 23.9);
/* DESCRIPTION: Propeller file name for actuator disk BEM.*/
addStringOption("BEM_PROP_FILENAME", BEM_prop_filename, string("prop_geom_alfclcd_data.txt"));
/* DESCRIPTION: Frequency for updating actuator disk with BEM.*/
addUnsignedShortOption("BEM_FREQ", ActDiskBem_Frequency, 40);

/* DESCRIPTION: Only half engine is in the computational grid */
addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false);
/* DESCRIPTION: Actuator disk double surface */
Expand Down Expand Up @@ -4978,6 +5014,18 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
SU2_MPI::Error("Vorticity confinement feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows.", CURRENT_FUNCTION);
}

/*--- Actuator disk BEM method for propellers feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows. ---*/

if ((Kind_Solver == MAIN_SOLVER::INC_EULER
|| Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES
|| Kind_Solver == MAIN_SOLVER::INC_RANS
|| Kind_Solver == MAIN_SOLVER::NEMO_EULER
|| Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES
|| Axisymmetric)
&& ActDisk_DoubleSurface) {
SU2_MPI::Error("Actuator disk BEM method for propellers feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows.", CURRENT_FUNCTION);
}

/*--- Check the coefficients for the polynomial models. ---*/

if (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::INC_RANS) {
Expand Down Expand Up @@ -5530,7 +5578,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) {
nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + nMarker_Load +
nMarker_FlowLoad + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load +
nMarker_Clamped + nMarker_Load_Sine + nMarker_Load_Dir + nMarker_Disp_Dir +
nMarker_ActDiskInlet + nMarker_ActDiskOutlet + nMarker_ZoneInterface;
nMarker_ActDiskInlet + nMarker_ActDiskOutlet +
nMarker_ActDiskBemInlet + nMarker_ActDiskBemOutlet +
nMarker_ZoneInterface;

/*--- Add the possible send/receive domains ---*/

Expand Down Expand Up @@ -5685,6 +5735,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) {
ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet] ();
ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet] ();

ActDiskOutlet_Thrust_BEM = new su2double[nMarker_ActDiskOutlet]();
ActDiskOutlet_Torque_BEM = new su2double[nMarker_ActDiskOutlet]();

for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) {
Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskOutlet[iMarker_ActDiskOutlet];
Marker_CfgFile_KindBC[iMarker_CfgFile] = ACTDISK_OUTLET;
Expand Down Expand Up @@ -7601,6 +7654,12 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
}
}

if (nMarker_ActDiskOutlet != 0) {
if (GetKind_ActDisk() == BLADE_ELEMENT) {
cout << endl << "Actuator disk with blade element momentum (BEM) method." << endl;
cout << "Actuator disk BEM method propeller data read from file: " << GetBEM_prop_filename() << endl;
}
}
}

bool CConfig::TokenizeString(string & str, string & option_name,
Expand Down Expand Up @@ -8094,6 +8153,9 @@ CConfig::~CConfig() {
delete[] ActDiskOutlet_Force;
delete[] ActDiskOutlet_Power;

delete[] ActDiskOutlet_Thrust_BEM;
delete[] ActDiskOutlet_Torque_BEM;

delete[] Outlet_MassFlow;
delete[] Outlet_Density;
delete[] Outlet_Area;
Expand Down Expand Up @@ -8679,6 +8741,22 @@ su2double CConfig::GetActDisk_Omega(const string& val_marker, unsigned short val
return ActDisk_Omega[iMarker_ActDisk][val_value];;
}

su2double CConfig::GetActDiskBem_CG(unsigned short iDim, string val_marker, unsigned short val_value) const {
unsigned short iMarker_ActDisk;
for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskBemInlet; iMarker_ActDisk++)
if ((Marker_ActDiskBemInlet[iMarker_ActDisk] == val_marker) ||
(Marker_ActDiskBemOutlet[iMarker_ActDisk] == val_marker)) break;
return ActDiskBem_CG[iDim][iMarker_ActDisk][val_value];
}

su2double CConfig::GetActDiskBem_Axis(unsigned short iDim, string val_marker, unsigned short val_value) const {
unsigned short iMarker_ActDisk;
for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskBemInlet; iMarker_ActDisk++)
if ((Marker_ActDiskBemInlet[iMarker_ActDisk] == val_marker) ||
(Marker_ActDiskBemOutlet[iMarker_ActDisk] == val_marker)) break;
return ActDiskBem_Axis[iDim][iMarker_ActDisk][val_value];
}

su2double CConfig::GetOutlet_MassFlow(const string& val_marker) const {
unsigned short iMarker_Outlet;
for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++)
Expand Down Expand Up @@ -9455,6 +9533,20 @@ su2double CConfig::GetActDiskOutlet_Power(const string& val_marker) const {
return ActDiskOutlet_Power[iMarker_ActDiskOutlet];
}

su2double CConfig::GetActDiskOutlet_Thrust_BEM(string val_marker) const {
unsigned short iMarker_ActDiskOutlet;
for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++)
if (Marker_ActDiskOutlet[iMarker_ActDiskOutlet] == val_marker) break;
return ActDiskOutlet_Thrust_BEM[iMarker_ActDiskOutlet];
}

su2double CConfig::GetActDiskOutlet_Torque_BEM(string val_marker) const {
unsigned short iMarker_ActDiskOutlet;
for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++)
if (Marker_ActDiskOutlet[iMarker_ActDiskOutlet] == val_marker) break;
return ActDiskOutlet_Torque_BEM[iMarker_ActDiskOutlet];
}

su2double CConfig::GetActDiskInlet_Temperature(const string& val_marker) const {
unsigned short iMarker_ActDiskInlet;
for (iMarker_ActDiskInlet = 0; iMarker_ActDiskInlet < nMarker_ActDiskInlet; iMarker_ActDiskInlet++)
Expand Down
Loading

0 comments on commit 70756d9

Please sign in to comment.