Skip to content

Commit

Permalink
Merge branch 'develop' into tutorial_bend_Design
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfooted authored Jan 26, 2025
2 parents 68f5ac5 + a6067c5 commit ac31189
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
[submodule "subprojects/MLPCpp"]
path = subprojects/MLPCpp
url = https://github.com/EvertBunschoten/MLPCpp.git
[submodule "externals/FADO"]
path = externals/FADO
url = https://github.com/pcarruscag/FADO.git
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Thomas D. Economon
Tim Albring
TobiKattmann
Trent Lukaczyk
Vikram Bharadwaj
Vinzenz Götz
VivaanKhatri
Wally Maier
Expand Down
7 changes: 0 additions & 7 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class CConfig {
su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */
su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */
su2double StartTime;
unsigned short SmoothNumGrid; /*!< \brief Smooth the numerical grid. */
bool ContinuousAdjoint, /*!< \brief Flag to know if the code is solving an adjoint problem. */
Viscous, /*!< \brief Flag to know if the code is solving a viscous problem. */
EquivArea, /*!< \brief Flag to know if the code is going to compute and plot the equivalent area. */
Expand Down Expand Up @@ -6338,12 +6337,6 @@ class CConfig {
*/
bool GetAxisymmetric(void) const { return Axisymmetric; }

/*!
* \brief Get information about there is a smoothing of the grid coordinates.
* \return <code>TRUE</code> if there is smoothing of the grid coordinates; otherwise <code>FALSE</code>.
*/
unsigned short GetSmoothNumGrid(void) const { return SmoothNumGrid; }

/*!
* \brief Subtract one to the index of the finest grid (full multigrid strategy).
* \return Change the index of the finest grid.
Expand Down
8 changes: 0 additions & 8 deletions Common/include/geometry/CGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,14 +913,6 @@ class CGeometry {
*/
inline virtual void SetMultiGridWallTemperature(const CGeometry* fine_grid, unsigned short val_marker) {}

/*!
* \brief A virtual member.
* \param[in] val_nSmooth - Number of smoothing iterations.
* \param[in] val_smooth_coeff - Relaxation factor.
* \param[in] config - Definition of the particular problem.
*/
inline virtual void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) {}

/*!
* \brief A virtual member.
* \param[in] fine_grid - Geometrical definition of the child grid (for multigrid).
Expand Down
8 changes: 0 additions & 8 deletions Common/include/geometry/CPhysicalGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,6 @@ class CPhysicalGeometry final : public CGeometry {
void DetermineTimeLevelElements(CConfig* config, const vector<CFaceOfElement>& localFaces,
map<unsigned long, CUnsignedShort2T>& mapExternalElemIDToTimeLevel);

/*!
* \brief Do an implicit smoothing of the grid coordinates.
* \param[in] val_nSmooth - Number of smoothing iterations.
* \param[in] val_smooth_coeff - Relaxation factor.
* \param[in] config - Definition of the particular problem.
*/
void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) override;

/*!
* \brief Compute 3 grid quality metrics: orthogonality angle, dual cell aspect ratio, and dual cell volume ratio.
* \param[in] config - Definition of the particular problem.
Expand Down
25 changes: 2 additions & 23 deletions Common/include/geometry/dual_grid/CPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,14 +771,14 @@ class CPoint {
}

/*!
* \brief Get the value of the old coordinates for implicit smoothing.
* \brief Get the value of the old coordinates.
* \param[in] iPoint - Index of the point.
* \return Old coordinates at a point.
*/
inline su2double* GetCoord_Old(unsigned long iPoint) { return Coord_Old[iPoint]; }

/*!
* \brief Set the value of the vector <i>Coord_Old</i> for implicit smoothing.
* \brief Set the value of the vector <i>Coord_Old</i>.
* \param[in] iPoint - Index of the point.
* \param[in] coord_old - Value of the coordinates.
*/
Expand All @@ -791,27 +791,6 @@ class CPoint {
*/
void SetCoord_Old();

/*!
* \brief Get the value of the summed coordinates for implicit smoothing.
* \param[in] iPoint - Index of the point.
* \return Sum of coordinates at a point.
*/
inline su2double* GetCoord_Sum(unsigned long iPoint) { return Coord_Sum[iPoint]; }

/*!
* \brief Add the value of the coordinates to the <i>Coord_Sum</i> vector for implicit smoothing.
* \param[in] iPoint - Index of the point.
* \param[in] coord_sum - Value of the coordinates to add.
*/
inline void AddCoord_Sum(unsigned long iPoint, const su2double* coord_sum) {
for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_Sum(iPoint, iDim) += coord_sum[iDim];
}

/*!
* \brief Initialize the vector <i>Coord_Sum</i>.
*/
void SetCoord_SumZero();

/*!
* \brief Get the value of the grid velocity at the point.
* \param[in] iPoint - Index of the point.
Expand Down
5 changes: 0 additions & 5 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2264,9 +2264,6 @@ void CConfig::SetConfig_Options() {
/* DESCRIPTION: Value to move motion origins (1 or 0) */
addUShortListOption("MOVE_MOTION_ORIGIN", nMoveMotion_Origin, MoveMotion_Origin);

/* DESCRIPTION: Before each computation, implicitly smooth the nodal coordinates */
addUnsignedShortOption("SMOOTH_GEOMETRY", SmoothNumGrid, 0);

/*!\par CONFIG_CATEGORY: Aeroelastic Simulation (Typical Section Model) \ingroup Config*/
/*--- Options related to aeroelastic simulations using the Typical Section Model) ---*/
/* DESCRIPTION: The flutter speed index (modifies the freestream condition) */
Expand Down Expand Up @@ -6877,8 +6874,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {

cout << endl <<"--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl;

if (SmoothNumGrid) cout << "There are some smoothing iterations on the grid coordinates." << endl;

if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) ||
(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) ||
Expand Down
64 changes: 0 additions & 64 deletions Common/src/geometry/CPhysicalGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7417,70 +7417,6 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig* config) const {
}
}

void CPhysicalGeometry::SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) {
unsigned short iSmooth, nneigh, iMarker;
su2double *Coord_Old, *Coord_Sum, *Coord, *Coord_i, *Coord_j, Position_Plane = 0.0;
unsigned long iEdge, iPoint, jPoint, iVertex;
su2double eps = 1E-6;
bool NearField = false;

Coord = new su2double[nDim];

nodes->SetCoord_Old();

/*--- Jacobi iterations ---*/
for (iSmooth = 0; iSmooth < val_nSmooth; iSmooth++) {
nodes->SetCoord_SumZero();

/*--- Loop over Interior edges ---*/
for (iEdge = 0; iEdge < nEdge; iEdge++) {
iPoint = edges->GetNode(iEdge, 0);
Coord_i = nodes->GetCoord(iPoint);

jPoint = edges->GetNode(iEdge, 1);
Coord_j = nodes->GetCoord(jPoint);

/*--- Accumulate nearest neighbor Coord to Res_sum for each variable ---*/
nodes->AddCoord_Sum(iPoint, Coord_j);
nodes->AddCoord_Sum(jPoint, Coord_i);
}

/*--- Loop over all mesh points (Update Coords with averaged sum) ---*/
for (iPoint = 0; iPoint < nPoint; iPoint++) {
nneigh = nodes->GetnPoint(iPoint);
Coord_Sum = nodes->GetCoord_Sum(iPoint);
Coord_Old = nodes->GetCoord_Old(iPoint);

if (nDim == 2) {
Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh));
Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh));
if ((NearField) && ((Coord_Old[1] > Position_Plane - eps) && (Coord_Old[1] < Position_Plane + eps)))
Coord[1] = Coord_Old[1];
}

if (nDim == 3) {
Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh));
Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh));
Coord[2] = (Coord_Old[2] + val_smooth_coeff * Coord_Sum[2]) / (1.0 + val_smooth_coeff * su2double(nneigh));
if ((NearField) && ((Coord_Old[2] > Position_Plane - eps) && (Coord_Old[2] < Position_Plane + eps)))
Coord[2] = Coord_Old[2];
}

nodes->SetCoord(iPoint, Coord);
}

/*--- Copy boundary values ---*/
for (iMarker = 0; iMarker < nMarker; iMarker++)
for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) {
iPoint = vertex[iMarker][iVertex]->GetNode();
Coord_Old = nodes->GetCoord_Old(iPoint);
nodes->SetCoord(iPoint, Coord_Old);
}
}

delete[] Coord;
}

bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short& face_first_elem,
unsigned short& face_second_elem) {
if (first_elem == second_elem) return false;
Expand Down
8 changes: 0 additions & 8 deletions Common/src/geometry/dual_grid/CPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig* config) {

Vertex.resize(npoint);

/*--- For smoothing the numerical grid coordinates ---*/
if (config->GetSmoothNumGrid()) {
Coord_Old.resize(npoint, nDim) = su2double(0.0);
Coord_Sum.resize(npoint, nDim) = su2double(0.0);
}

/*--- Storage of grid velocities for dynamic meshes. ---*/

if (config->GetDynamic_Grid()) {
Expand Down Expand Up @@ -190,5 +184,3 @@ void CPoint::SetCoord_Old() {
assert(Coord_Old.size() == Coord.size());
parallelCopy(Coord.size(), Coord.data(), Coord_Old.data());
}

void CPoint::SetCoord_SumZero() { parallelSet(Coord_Sum.size(), 0.0, Coord_Sum.data()); }
10 changes: 6 additions & 4 deletions SU2_CFD/src/output/COutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ void COutput::SetHistoryOutput(CGeometry *geometry,
unsigned long TimeIter,
unsigned long OuterIter,
unsigned long InnerIter) {

curTimeIter = TimeIter;
curTimeIter = TimeIter;
curAbsTimeIter = max(TimeIter, config->GetStartWindowIteration()) - config->GetStartWindowIteration();
curOuterIter = OuterIter;
curInnerIter = InnerIter;
Expand Down Expand Up @@ -273,7 +272,7 @@ void COutput::SetHistoryOutput(CGeometry ****geometry, CSolver *****solver, CCon

void COutput::SetMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){

curTimeIter = TimeIter;
curTimeIter = TimeIter;
curAbsTimeIter = max(TimeIter, driver_config->GetStartWindowIteration()) - driver_config->GetStartWindowIteration();
curOuterIter = OuterIter;

Expand Down Expand Up @@ -389,6 +388,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
/*--- File writer that will later be used to write the file to disk. Created below in the "switch" ---*/
CFileWriter *fileWriter = nullptr;

/*--- Set current time iter even if history file is not written ---*/
curTimeIter = config->GetTimeIter();

/*--- If it is still present, strip the extension (suffix) from the filename ---*/
const auto lastindex = fileName.find_last_of('.');
fileName = fileName.substr(0, lastindex);
Expand Down Expand Up @@ -476,7 +478,7 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
extension = CSU2MeshFileWriter::fileExt;

if (fileName.empty())
fileName = volumeFilename;
fileName = config->GetFilename(volumeFilename, "", curTimeIter);

if (!config->GetWrt_Volume_Overwrite())
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/solvers/CTurbSASolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta
Res_Wall = coeff*RoughWallBC*Area;
LinSysRes.SubtractBlock(iPoint, &Res_Wall);

su2double Jacobian_i = (laminar_viscosity*Area)/(0.03*Roughness_Height*sigma);
su2double Jacobian_i = (laminar_viscosity /density *Area)/(0.03*Roughness_Height*sigma);
Jacobian_i += 2.0*RoughWallBC*Area/sigma;
if (implicit) Jacobian.AddVal2Diag(iPoint, -Jacobian_i);
}
Expand Down
2 changes: 2 additions & 0 deletions SU2_PY/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ install_data(['FSI_tools/__init__.py',
install_data(['SU2_Nastran/__init__.py',
'SU2_Nastran/pysu2_nastran.py'],
install_dir: join_paths(get_option('bindir'), 'SU2_Nastran'))

install_subdir(['../externals/FADO'], install_dir: get_option('bindir'))
1 change: 1 addition & 0 deletions externals/FADO
Submodule FADO added at ce7ee0
11 changes: 11 additions & 0 deletions meson_scripts/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def init_submodules(
own_mpp=True,
own_cool=True,
own_mel=True,
own_fado=True,
own_mlpcpp=True,
):

Expand All @@ -71,6 +72,8 @@ def init_submodules(
github_repo_coolprop = "https://github.com/CoolProp/CoolProp"
sha_version_mel = "46205ab019e5224559091375a6d71aabae6bc5b9"
github_repo_mel = "https://github.com/pcarruscag/MEL"
sha_version_fado = "ce7ee018e4e699af5028d69baa1939fea290e18a"
github_repo_fado = "https://github.com/pcarruscag/FADO"
sha_version_mlpcpp = "6865a58b22f21a92977839d9c93eae9522402f55"
github_repo_mlpcpp = "https://github.com/EvertBunschoten/MLPCpp"

Expand All @@ -82,6 +85,7 @@ def init_submodules(
mpp_name = "Mutationpp"
coolprop_name = "CoolProp"
mel_name = "MEL"
fado_name = "FADO"
mlpcpp_name = "MLPCpp"

base_path = cur_dir + os.path.sep + "externals" + os.path.sep
Expand All @@ -91,6 +95,7 @@ def init_submodules(
alt_name_meson = base_path + "meson"
alt_name_ninja = base_path + "ninja"
alt_name_mel = base_path + "mel"
alt_name_fado = base_path + "FADO"
alt_name_mpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "Mutationpp"
alt_name_coolprop = cur_dir + os.path.sep + "subprojects" + os.path.sep + "CoolProp"
alt_name_mlpcpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "MLPCpp"
Expand Down Expand Up @@ -123,6 +128,8 @@ def init_submodules(
submodule_status(alt_name_coolprop, sha_version_coolprop)
if own_mel:
submodule_status(alt_name_mel, sha_version_mel)
if own_fado:
submodule_status(alt_name_fado, sha_version_fado)
if own_mlpcpp:
submodule_status(alt_name_mlpcpp, sha_version_mlpcpp)
# Otherwise download the zip file from git
Expand Down Expand Up @@ -157,6 +164,10 @@ def init_submodules(
)
if own_mel:
download_module(mel_name, alt_name_mel, github_repo_mel, sha_version_mel)
if own_fado:
download_module(
fado_name, alt_name_fado, github_repo_fado, sha_version_fado
)
if own_mlpcpp:
download_module(
mlpcpp_name, alt_name_mlpcpp, github_repo_mlpcpp, sha_version_mlpcpp
Expand Down
6 changes: 6 additions & 0 deletions preconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def run(
own_mpp=True,
own_cool=True,
own_mel=True,
own_fado=True,
own_mlpcpp=True,
):

Expand All @@ -94,6 +95,7 @@ def run(
own_mpp=own_mpp,
own_cool=own_cool,
own_mel=own_mel,
own_fado=own_fado,
own_mlpcpp=own_mlpcpp,
)

Expand Down Expand Up @@ -137,6 +139,9 @@ def run(
parser.add_argument(
"--no-mel", help="do not download own copy of MEL", action="store_false"
)
parser.add_argument(
"--no-fado", help="do not download own copy of FADO", action="store_false"
)
parser.add_argument(
"--no-mlpcpp",
help="do not download copy of MLpCpp",
Expand All @@ -152,5 +157,6 @@ def run(
own_mpp=args.no_mpp,
own_cool=args.no_coolprop,
own_mel=args.no_mel,
own_fado=args.no_fado,
own_mlpcpp=args.no_mlpcpp,
)

0 comments on commit ac31189

Please sign in to comment.