Skip to content

Commit ead1817

Browse files
authored
remove globally declared variables (#2595)
1 parent d2481dd commit ead1817

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ class CAvgGradCorrected_NEMO : public CNEMONumerics {
103103
*Mean_Eve, /*!< \brief Mean value of eve. */
104104
*Mean_Cvve, /*!< \brief Mean value of cvve. */
105105
Edge_Vector[MAXNDIM]={0.0}, /*!< \brief Vector from point i to point j. */
106-
*Proj_Mean_GradPrimVar_Edge, /*!< \brief Inner product of the Mean gradient and the edge vector. */
107106
*Mean_Diffusion_Coeff, /*!< \brief Mean value of the species diffusion coefficient. */
108107
Mean_Laminar_Viscosity, /*!< \brief Mean value of the viscosity. */
109108
Mean_Eddy_Viscosity, /*!< \brief Mean value of the eddy viscosity. */

SU2_CFD/include/numerics/flow/flow_diffusion.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ class CAvgGrad_Base : public CNumerics {
6363
Mean_TauWall, /*!< \brief Mean wall shear stress (wall functions). */
6464
TauWall_i, TauWall_j, /*!< \brief Wall shear stress at point i and j (wall functions). */
6565
dist_ij_2, /*!< \brief Length of the edge and face, squared */
66-
Edge_Vector[MAXNDIM] = {0.0}, /*!< \brief Vector from point i to point j. */
67-
*Proj_Mean_GradPrimVar_Edge = nullptr; /*!< \brief Inner product of the Mean gradient and the edge vector. */
66+
Edge_Vector[MAXNDIM] = {0.0}; /*!< \brief Vector from point i to point j. */
6867

6968
su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */
7069
su2double** Jacobian_j = nullptr; /*!< \brief The Jacobian w.r.t. point j after computation. */

SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ CAvgGradCorrected_NEMO::CAvgGradCorrected_NEMO(unsigned short val_nDim,
218218
for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++)
219219
Mean_GradPrimVar[iVar] = new su2double [nDim];
220220

221-
Proj_Mean_GradPrimVar_Edge = new su2double[nPrimVarGrad];
222221

223222
Flux = new su2double[nVar];
224223
Jacobian_i = new su2double* [nVar];
@@ -245,7 +244,6 @@ CAvgGradCorrected_NEMO::~CAvgGradCorrected_NEMO() {
245244
delete [] Mean_GradPrimVar[iVar];
246245
delete [] Mean_GradPrimVar;
247246

248-
delete [] Proj_Mean_GradPrimVar_Edge;
249247

250248
delete [] Flux;
251249

@@ -323,9 +321,9 @@ CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig
323321

324322
/*--- Projection of the mean gradient in the direction of the edge ---*/
325323
for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) {
326-
Proj_Mean_GradPrimVar_Edge[iVar] = GeometryToolbox::DotProduct(nDim, Mean_GradPrimVar[iVar], Edge_Vector);
324+
su2double Proj_Mean_GradPrimVar_Edge = GeometryToolbox::DotProduct(nDim, Mean_GradPrimVar[iVar], Edge_Vector);
327325
for (auto iDim = 0ul; iDim < nDim; iDim++) {
328-
Mean_GradPrimVar[iVar][iDim] -= (Proj_Mean_GradPrimVar_Edge[iVar] -
326+
Mean_GradPrimVar[iVar][iDim] -= (Proj_Mean_GradPrimVar_Edge -
329327
(PrimVar_j[iVar]-PrimVar_i[iVar]))*Edge_Vector[iDim] / dist_ij_2;
330328
}
331329
}

SU2_CFD/src/numerics/flow/flow_diffusion.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ CAvgGrad_Base::CAvgGrad_Base(unsigned short val_nDim,
5050
for (iVar = 0; iVar < nPrimVar; iVar++)
5151
Mean_GradPrimVar[iVar] = new su2double [nDim];
5252

53-
Proj_Mean_GradPrimVar_Edge = new su2double[val_nPrimVar];
5453

5554
tau_jacobian_i = new su2double* [nDim];
5655
for (iDim = 0; iDim < nDim; iDim++) {
@@ -78,7 +77,6 @@ CAvgGrad_Base::~CAvgGrad_Base() {
7877
delete [] Mean_GradPrimVar;
7978
}
8079

81-
delete [] Proj_Mean_GradPrimVar_Edge;
8280

8381
if (tau_jacobian_i != nullptr) {
8482
for (unsigned short iDim = 0; iDim < nDim; iDim++) {
@@ -107,12 +105,12 @@ void CAvgGrad_Base::CorrectGradient(su2double** GradPrimVar,
107105
const su2double val_dist_ij_2,
108106
const unsigned short val_nPrimVar) {
109107
for (unsigned short iVar = 0; iVar < val_nPrimVar; iVar++) {
110-
Proj_Mean_GradPrimVar_Edge[iVar] = 0.0;
108+
su2double Proj_Mean_GradPrimVar_Edge = 0.0;
111109
for (unsigned short iDim = 0; iDim < nDim; iDim++) {
112-
Proj_Mean_GradPrimVar_Edge[iVar] += GradPrimVar[iVar][iDim]*val_edge_vector[iDim];
110+
Proj_Mean_GradPrimVar_Edge += GradPrimVar[iVar][iDim]*val_edge_vector[iDim];
113111
}
114112
for (unsigned short iDim = 0; iDim < nDim; iDim++) {
115-
GradPrimVar[iVar][iDim] -= (Proj_Mean_GradPrimVar_Edge[iVar] -
113+
GradPrimVar[iVar][iDim] -= (Proj_Mean_GradPrimVar_Edge -
116114
(val_PrimVar_j[iVar]-val_PrimVar_i[iVar]))*val_edge_vector[iDim] / val_dist_ij_2;
117115
}
118116
}

0 commit comments

Comments
 (0)