Skip to content

Commit 2599029

Browse files
authored
Merge branch 'develop' into feature_MUSCL_ramp
2 parents 4f35fec + dac92cc commit 2599029

28 files changed

+170
-157
lines changed

Common/include/geometry/CGeometry.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*!
1+
/*!
22
* \file CGeometry.hpp
33
* \brief Headers of the main subroutines for creating the geometrical structure.
44
* The subroutines and functions are in the <i>CGeometry.cpp</i> file.
@@ -51,6 +51,7 @@ extern "C" {
5151
#include <climits>
5252
#include <memory>
5353
#include <unordered_map>
54+
#include <cstdint>
5455

5556
#include "primal_grid/CPrimalGrid.hpp"
5657
#include "dual_grid/CDualGrid.hpp"

Common/include/geometry/primal_grid/CPrimalGrid.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
#pragma once
3030

31+
#include <cstdint>
3132
#include <iostream>
3233
#include <vector>
3334
#include <limits>
3435
#include <cstdlib>
35-
#include <limits>
3636
#include <memory>
3737

3838
#include "../../option_structure.hpp"

Common/src/CConfig.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6215,8 +6215,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) {
62156215
}
62166216
}
62176217

6218-
/*--- Idenftification fo Giles Markers ---*/
6219-
// This is seperate from MP and Turbomachinery Markers as all mixing plane markers are Giles,
6218+
/*--- Identification of Giles Markers ---*/
6219+
// This is separate from MP and Turbomachinery Markers as all mixing plane markers are Giles,
62206220
// but not all Giles markers are mixing plane
62216221
for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) {
62226222
Marker_CfgFile_Giles[iMarker_CfgFile] = NO;
@@ -10040,8 +10040,8 @@ void CConfig::SetProfilingCSV() {
1004010040

1004110041
/*--- Allocate and initialize memory ---*/
1004210042

10043-
double *l_min_red = NULL, *l_max_red = NULL, *l_tot_red = NULL, *l_avg_red = NULL;
10044-
int *n_calls_red = NULL;
10043+
double *l_min_red = nullptr, *l_max_red = nullptr, *l_tot_red = nullptr, *l_avg_red = nullptr;
10044+
int *n_calls_red = nullptr;
1004510045
double* l_min = new double[map_size];
1004610046
double* l_max = new double[map_size];
1004710047
double* l_tot = new double[map_size];

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4642,7 +4642,7 @@ void CPhysicalGeometry::SetElement_Connectivity() {
46424642

46434643
if ((elem[iElem]->GetNeighbor_Elements(iFace) == -1) && (iElem < Test_Elem) &&
46444644
FindFace(iElem, Test_Elem, first_elem_face, second_elem_face)) {
4645-
/*--- Localice which faces are sharing both elements ---*/
4645+
/*--- Localize which faces are sharing both elements ---*/
46464646

46474647
elem[iElem]->SetNeighbor_Elements(Test_Elem, first_elem_face);
46484648

@@ -4666,7 +4666,7 @@ void CPhysicalGeometry::SetBoundVolume() {
46664666
CheckVol = false;
46674667

46684668
for (iElem = 0; iElem < nodes->GetnElem(Point); iElem++) {
4669-
/*--- Look for elements surronding that point --*/
4669+
/*--- Look for elements surrounding that point --*/
46704670
cont = 0;
46714671
iElem_Domain = nodes->GetElem(Point, iElem);
46724672
for (iNode_Domain = 0; iNode_Domain < elem[iElem_Domain]->GetnNodes(); iNode_Domain++) {
@@ -4775,10 +4775,10 @@ void CPhysicalGeometry::ComputeNSpan(CConfig* config, unsigned short val_iZone,
47754775
nSpan_loc = 0;
47764776
if (nDim == 2) {
47774777
nSpanWiseSections[marker_flag - 1] = 1;
4778-
// TODO (turbo) make it more genral
4778+
// TODO (turbo) make it more general
47794779
if (marker_flag == OUTFLOW) config->SetnSpanWiseSections(1);
47804780

4781-
/*---Initilize the vector of span-wise values that will be ordered ---*/
4781+
/*---Initialize the vector of span-wise values that will be ordered ---*/
47824782
SpanWiseValue[marker_flag - 1] = new su2double[1];
47834783
for (iSpan = 0; iSpan < 1; iSpan++) {
47844784
SpanWiseValue[marker_flag - 1][iSpan] = 0;
@@ -4792,7 +4792,7 @@ void CPhysicalGeometry::ComputeNSpan(CConfig* config, unsigned short val_iZone,
47924792
if (config->GetMarker_All_TurbomachineryFlag(iMarker) != marker_flag) continue;
47934793

47944794
/*--- loop to find the vertex that ar both of inflow or outflow marker and on the periodic
4795-
* in order to caount the number of Span ---*/
4795+
* in order to count the number of Span ---*/
47964796
for (jMarker = 0; jMarker < nMarker; jMarker++) {
47974797
if (config->GetMarker_All_KindBC(jMarker) != PERIODIC_BOUNDARY) continue;
47984798

SU2_CFD/include/numerics_simd/flow/convection/common.hpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ FORCEINLINE Double umusclProjection(Double grad_proj,
5151
/*--- To maintain proper scaling for edge limiters, the result of ---*/
5252
/*--- this function is 0.5 * dV_ij^kap. ---*/
5353
/*-------------------------------------------------------------------*/
54-
const Double cent = 0.5 * delta;
55-
const Double upw = grad_proj - cent;
56-
return (1.0 - kappa) * upw + (1.0 + kappa) * cent;
54+
return (1.0 - kappa) * grad_proj + kappa * delta;
5755
}
5856

5957
/*!
@@ -221,7 +219,7 @@ FORCEINLINE CPair<ReconVarType> reconstructPrimitives(Int iEdge, Int iPoint, Int
221219
}
222220

223221
if (muscl) {
224-
/*--- Recompute density and enthalpy instead of reconstructing. ---*/
222+
/*--- Reconstruct density and enthalpy without using their gradients. ---*/
225223
constexpr auto nVarGrad = ReconVarType::nVar - 2;
226224
switch (limiterType) {
227225
case LIMITER::NONE:
@@ -234,12 +232,23 @@ FORCEINLINE CPair<ReconVarType> reconstructPrimitives(Int iEdge, Int iPoint, Int
234232
musclPointLimited<nVarGrad>(iPoint, jPoint, vector_ij, limiters, gradients, V, kappa, relax, ramp_val);
235233
break;
236234
}
235+
/*--- Recompute density using the reconstructed pressure and temperature. ---*/
237236
V.i.density() = V.i.pressure() / (gasConst * V.i.temperature());
238237
V.j.density() = V.j.pressure() / (gasConst * V.j.temperature());
239238

239+
/*--- Reconstruct enthalpy using dH/dT = Cp and dH/dv = v. Recomputing enthalpy would cause
240+
* stability issues because we use rho E = rho H - P, which loses its relation to temperature
241+
* if both rho and H are recomputed. This only seems to be an issue for wall-function meshes.
242+
* NOTE: This "one-sided" reconstruction does not lose much of the U-MUSCL benefit, because
243+
* the static enthalpy is linear, and for the KE term we do the equivalent of using the
244+
* average dH/dv, which is exact for quadratic functions. ---*/
240245
const su2double cp = gasConst * gamma / (gamma - 1);
241-
V.i.enthalpy() = cp * V.i.temperature() + 0.5 * squaredNorm<nDim>(V.i.velocity());
242-
V.j.enthalpy() = cp * V.j.temperature() + 0.5 * squaredNorm<nDim>(V.j.velocity());
246+
V.i.enthalpy() += cp * (V.i.temperature() - V1st.i.temperature());
247+
V.j.enthalpy() += cp * (V.j.temperature() - V1st.j.temperature());
248+
for (size_t iDim = 0; iDim < nDim; ++iDim) {
249+
V.i.enthalpy() += 0.5 * (pow(V.i.velocity(iDim), 2) - pow(V1st.i.velocity(iDim), 2));
250+
V.j.enthalpy() += 0.5 * (pow(V.j.velocity(iDim), 2) - pow(V1st.j.velocity(iDim), 2));
251+
}
243252

244253
/*--- Detect a non-physical reconstruction based on negative pressure or density. ---*/
245254
const Double neg_p_or_rho = fmax(fmin(V.i.pressure(), V.j.pressure()) < 0.0,

SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
275275
}
276276

277277
/*!
278-
* \brief Set the current working dimension, if the seperate dimension option is set.
278+
* \brief Set the current working dimension, if the separate dimension option is set.
279279
* \param[in] iDim - the dimension we are currently working in.
280280
*/
281281
inline void SetCurrentDim(unsigned int iDim) {

SU2_CFD/include/variables/CFlowVariable.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626

2727
#pragma once
2828

29+
#include <algorithm>
30+
#include <cstdint>
31+
2932
#include "CVariable.hpp"
3033

3134
/*!

SU2_CFD/src/solvers/CGradientSmoothingSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ CGradientSmoothingSolver::CGradientSmoothingSolver(CGeometry *geometry, CConfig
9393
element_container[GRAD_TERM][EL_PYRAM2] = new CPYRAM6();
9494
}
9595

96-
/*--- For operations on surfaces we initalize the structures for nDim-1 ---*/
96+
/*--- For operations on surfaces we initialize the structures for nDim-1 ---*/
9797
if (config->GetSmoothOnSurface()) {
9898
if (nDim == 2) {
9999
element_container[GRAD_TERM][EL_LINE] = new CLINE();

SU2_CFD/src/variables/CMeshVariable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CMeshVariable::CMeshVariable(unsigned long npoint, unsigned long ndim, CConfig *
3434
/*--- Store the dimensionality of the problem ---*/
3535
nDim = ndim;
3636

37-
/*--- Initalize the variables that will always be there in a problem with moving mesh ---*/
37+
/*--- Initialize the variables that will always be there in a problem with moving mesh ---*/
3838
Mesh_Coord.resize(nPoint,nDim) = su2double(0.0);
3939
WallDistance.resize(nPoint) = su2double(1e-9);
4040

SU2_PY/SU2/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ class DivergenceFailure(EvaluationFailure):
2828
readline.parse_and_bind("bind ^I rl_complete")
2929
else:
3030
readline.parse_and_bind("tab: complete")
31-
except:
32-
pass
31+
except Exception:
32+
pass # readline is optional, continue without it

0 commit comments

Comments
 (0)