Skip to content

Commit f3181de

Browse files
committed
Optimize variable declaration
1 parent 7dbe215 commit f3181de

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,11 @@ void CFlowOutput::Set_NearfieldInverseDesign(CSolver *solver, const CGeometry *g
794794

795795
ofstream EquivArea_file, FuncGrad_file;
796796
unsigned short iMarker = 0;
797-
su2double Gamma, auxXCoord, auxYCoord, auxZCoord, InverseDesign = 0.0, DeltaX, Coord_i, Coord_j, jp1Coord, *Coord = nullptr, MeanFuntion,
798-
*Face_Normal = nullptr, auxArea, auxPress, Mach, Beta, R_Plane, Pressure_Inf, factor,
799-
jFunction, jp1Function;
797+
su2double auxXCoord, auxYCoord, auxZCoord, InverseDesign = 0.0, DeltaX,
798+
Coord_i, Coord_j, jp1Coord, *Coord = nullptr, MeanFunction,
799+
*Face_Normal = nullptr, auxArea, auxPress, jFunction, jp1Function;
800800
unsigned long jVertex, iVertex, iPoint, nVertex_NearField = 0, auxPoint,
801-
auxDomain;
801+
auxDomain;
802802
unsigned short iPhiAngle;
803803
ofstream NearFieldEA_file; ifstream TargetEA_file;
804804

@@ -809,13 +809,13 @@ void CFlowOutput::Set_NearfieldInverseDesign(CSolver *solver, const CGeometry *g
809809
su2double AoA = -(config->GetAoA()*PI_NUMBER/180.0);
810810
su2double EAScaleFactor = config->GetEA_ScaleFactor(); // The EA Obj. Func. should be ~ force based Obj. Func.
811811

812-
Mach = config->GetMach();
813-
Gamma = config->GetGamma();
814-
Beta = sqrt(Mach*Mach-1.0);
815-
R_Plane = fabs(config->GetEA_IntLimit(2));
816-
Pressure_Inf = config->GetPressure_FreeStreamND();
812+
const su2double Mach = config->GetMach();
813+
const su2double Gamma = config->GetGamma();
814+
const su2double Beta = sqrt(Mach*Mach-1.0);
815+
const su2double R_Plane = fabs(config->GetEA_IntLimit(2));
816+
const su2double Pressure_Inf = config->GetPressure_FreeStreamND();
817817

818-
factor = 4.0*sqrt(2.0*Beta*R_Plane) / (Gamma*Pressure_Inf*Mach*Mach);
818+
const su2double factor = 4.0*sqrt(2.0*Beta*R_Plane) / (Gamma*Pressure_Inf*Mach*Mach);
819819

820820
if (rank == MASTER_NODE) cout << "Writing Equivalent Area files." << endl ;
821821

@@ -1057,8 +1057,8 @@ void CFlowOutput::Set_NearfieldInverseDesign(CSolver *solver, const CGeometry *g
10571057
jp1Function = factor*(Pressure_PhiAngle[iPhiAngle][jVertex+1] - Pressure_Inf)*sqrt(Coord_i-jp1Coord);
10581058

10591059
DeltaX = (jp1Coord-Coord_j);
1060-
MeanFuntion = 0.5*(jp1Function + jFunction);
1061-
EquivArea_PhiAngle[iPhiAngle][iVertex] += DeltaX * MeanFuntion;
1060+
MeanFunction = 0.5*(jp1Function + jFunction);
1061+
EquivArea_PhiAngle[iPhiAngle][iVertex] += DeltaX * MeanFunction;
10621062
}
10631063
}
10641064
}

0 commit comments

Comments
 (0)