@@ -1226,11 +1226,11 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont
12261226 checked. Pressure is the dynamic pressure (can be negative). ---*/
12271227
12281228 if (config->GetEnergy_Equation ()) {
1229- bool neg_temperature_i = (Primitive_i[nDim+ 1 ] < 0.0 );
1230- bool neg_temperature_j = (Primitive_j[nDim+ 1 ] < 0.0 );
1229+ bool neg_temperature_i = (Primitive_i[prim_idx. Temperature () ] < 0.0 );
1230+ bool neg_temperature_j = (Primitive_j[prim_idx. Temperature () ] < 0.0 );
12311231
1232- bool neg_density_i = (Primitive_i[nDim+ 2 ] < 0.0 );
1233- bool neg_density_j = (Primitive_j[nDim+ 2 ] < 0.0 );
1232+ bool neg_density_i = (Primitive_i[prim_idx. Density () ] < 0.0 );
1233+ bool neg_density_j = (Primitive_j[prim_idx. Density () ] < 0.0 );
12341234
12351235 nodes->SetNon_Physical (iPoint, neg_density_i || neg_temperature_i);
12361236 nodes->SetNon_Physical (jPoint, neg_density_j || neg_temperature_j);
@@ -2035,27 +2035,27 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain
20352035 /* --- Recompute and store the velocity in the primitive variable vector. ---*/
20362036
20372037 for (iDim = 0 ; iDim < nDim; iDim++)
2038- V_infty[iDim+1 ] = GetVelocity_Inf (iDim);
2038+ V_infty[iDim+prim_idx. Velocity () ] = GetVelocity_Inf (iDim);
20392039
20402040 /* --- Far-field pressure set to static pressure (0.0). ---*/
20412041
2042- V_infty[0 ] = GetPressure_Inf ();
2042+ V_infty[prim_idx. Pressure () ] = GetPressure_Inf ();
20432043
20442044 /* --- Dirichlet condition for temperature at far-field (if energy is active). ---*/
20452045
2046- V_infty[nDim+ 1 ] = GetTemperature_Inf ();
2046+ V_infty[prim_idx. Temperature () ] = GetTemperature_Inf ();
20472047
20482048 /* --- Store the density. ---*/
20492049
2050- V_infty[nDim+ 2 ] = GetDensity_Inf ();
2050+ V_infty[prim_idx. Density () ] = GetDensity_Inf ();
20512051
20522052 /* --- Beta coefficient stored at the node ---*/
20532053
2054- V_infty[nDim+ 3 ] = nodes->GetBetaInc2 (iPoint);
2054+ V_infty[prim_idx. Beta () ] = nodes->GetBetaInc2 (iPoint);
20552055
20562056 /* --- Cp is needed for Temperature equation. ---*/
20572057
2058- V_infty[nDim+ 7 ] = nodes->GetSpecificHeatCp (iPoint);
2058+ V_infty[prim_idx. CpTotal () ] = nodes->GetSpecificHeatCp (iPoint);
20592059
20602060 /* --- Set various quantities in the numerics class ---*/
20612061
@@ -2084,9 +2084,9 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain
20842084
20852085 /* --- Set transport properties at infinity. ---*/
20862086
2087- V_infty[nDim+ 4 ] = nodes->GetLaminarViscosity (iPoint);
2088- V_infty[nDim+ 5 ] = nodes->GetEddyViscosity (iPoint);
2089- V_infty[nDim+ 6 ] = nodes->GetThermalConductivity (iPoint);
2087+ V_infty[prim_idx. LaminarViscosity () ] = nodes->GetLaminarViscosity (iPoint);
2088+ V_infty[prim_idx. EddyViscosity () ] = nodes->GetEddyViscosity (iPoint);
2089+ V_infty[prim_idx. ThermalConductivity () ] = nodes->GetThermalConductivity (iPoint);
20902090
20912091 /* --- Set the normal vector and the coordinates ---*/
20922092
@@ -2185,7 +2185,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
21852185
21862186 /* --- Neumann condition for dynamic pressure ---*/
21872187
2188- V_inlet[0 ] = nodes->GetPressure (iPoint);
2188+ V_inlet[prim_idx. Pressure () ] = nodes->GetPressure (iPoint);
21892189
21902190 /* --- The velocity is either prescribed or computed from total pressure. ---*/
21912191
@@ -2202,11 +2202,11 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22022202 /* --- Store the velocity in the primitive variable vector. ---*/
22032203
22042204 for (iDim = 0 ; iDim < nDim; iDim++)
2205- V_inlet[iDim+1 ] = Vel_Mag*UnitFlowDir[iDim];
2205+ V_inlet[iDim+prim_idx. Velocity () ] = Vel_Mag*UnitFlowDir[iDim];
22062206
22072207 /* --- Dirichlet condition for temperature (if energy is active) ---*/
22082208
2209- V_inlet[nDim+ 1 ] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref ();
2209+ V_inlet[prim_idx. Temperature () ] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref ();
22102210
22112211 break ;
22122212
@@ -2224,10 +2224,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22242224
22252225 /* --- Check for back flow through the inlet. ---*/
22262226
2227- Vn = 0.0 ;
2228- for (iDim = 0 ; iDim < nDim; iDim++) {
2229- Vn += V_domain[iDim+1 ]*(-1.0 *Normal[iDim]/Area);
2230- }
2227+ Vn = -GeometryToolbox::DotProduct (nDim, &V_domain[prim_idx.Velocity ()], Normal) / Area;
22312228
22322229 /* --- If the local static pressure is larger than the specified
22332230 total pressure or the velocity is directed upstream, we have a
@@ -2239,16 +2236,16 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22392236
22402237 /* --- Back flow: use the prescribed P_total as static pressure. ---*/
22412238
2242- V_inlet[0 ] = Inlet_Ptotal[val_marker][iVertex]/config->GetPressure_Ref ();
2239+ V_inlet[prim_idx. Pressure () ] = Inlet_Ptotal[val_marker][iVertex]/config->GetPressure_Ref ();
22432240
22442241 /* --- Neumann condition for velocity. ---*/
22452242
22462243 for (iDim = 0 ; iDim < nDim; iDim++)
2247- V_inlet[iDim+1 ] = V_domain[iDim+1 ];
2244+ V_inlet[iDim+prim_idx. Velocity () ] = V_domain[iDim+prim_idx. Velocity () ];
22482245
22492246 /* --- Neumann condition for the temperature. ---*/
22502247
2251- V_inlet[nDim+ 1 ] = nodes->GetTemperature (iPoint);
2248+ V_inlet[prim_idx. Temperature () ] = nodes->GetTemperature (iPoint);
22522249
22532250 } else {
22542251
@@ -2267,17 +2264,17 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22672264 /* --- Compute the delta change in velocity in each direction. ---*/
22682265
22692266 for (iDim = 0 ; iDim < nDim; iDim++)
2270- dV[iDim] = Vel_Mag*UnitFlowDir[iDim] - V_domain[iDim+1 ];
2267+ dV[iDim] = Vel_Mag*UnitFlowDir[iDim] - V_domain[iDim+prim_idx. Velocity () ];
22712268
22722269 /* --- Update the velocity in the primitive variable vector.
22732270 Note we use damping here to improve stability/convergence. ---*/
22742271
22752272 for (iDim = 0 ; iDim < nDim; iDim++)
2276- V_inlet[iDim+1 ] = V_domain[iDim+1 ] + Damping*dV[iDim];
2273+ V_inlet[iDim+prim_idx. Velocity () ] = V_domain[iDim+prim_idx. Velocity () ] + Damping*dV[iDim];
22772274
22782275 /* --- Dirichlet condition for temperature (if energy is active) ---*/
22792276
2280- V_inlet[nDim+ 1 ] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref ();
2277+ V_inlet[prim_idx. Temperature () ] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref ();
22812278
22822279 }
22832280
@@ -2292,15 +2289,15 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22922289 construction, or will be set fixed implicitly by the temperature
22932290 and equation of state. ---*/
22942291
2295- V_inlet[nDim+ 2 ] = nodes->GetDensity (iPoint);
2292+ V_inlet[prim_idx. Density () ] = nodes->GetDensity (iPoint);
22962293
22972294 /* --- Beta coefficient from the config file ---*/
22982295
2299- V_inlet[nDim+ 3 ] = nodes->GetBetaInc2 (iPoint);
2296+ V_inlet[prim_idx. Beta () ] = nodes->GetBetaInc2 (iPoint);
23002297
23012298 /* --- Cp is needed for Temperature equation. ---*/
23022299
2303- V_inlet[nDim+ 7 ] = nodes->GetSpecificHeatCp (iPoint);
2300+ V_inlet[prim_idx. CpTotal () ] = nodes->GetSpecificHeatCp (iPoint);
23042301
23052302 /* --- Set various quantities in the solver class ---*/
23062303
@@ -2329,9 +2326,9 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
23292326
23302327 /* --- Set transport properties at the inlet ---*/
23312328
2332- V_inlet[nDim+ 4 ] = nodes->GetLaminarViscosity (iPoint);
2333- V_inlet[nDim+ 5 ] = nodes->GetEddyViscosity (iPoint);
2334- V_inlet[nDim+ 6 ] = nodes->GetThermalConductivity (iPoint);
2329+ V_inlet[prim_idx. LaminarViscosity () ] = nodes->GetLaminarViscosity (iPoint);
2330+ V_inlet[prim_idx. EddyViscosity () ] = nodes->GetEddyViscosity (iPoint);
2331+ V_inlet[prim_idx. ThermalConductivity () ] = nodes->GetThermalConductivity (iPoint);
23352332
23362333 /* --- Set the normal vector and the coordinates ---*/
23372334
@@ -2430,12 +2427,12 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
24302427
24312428 /* --- The pressure is prescribed at the outlet. ---*/
24322429
2433- V_outlet[0 ] = P_Outlet;
2430+ V_outlet[prim_idx. Pressure () ] = P_Outlet;
24342431
24352432 /* --- Neumann condition for the velocity. ---*/
24362433
24372434 for (iDim = 0 ; iDim < nDim; iDim++) {
2438- V_outlet[iDim+1 ] = nodes->GetVelocity (iPoint,iDim);
2435+ V_outlet[iDim+prim_idx. Velocity () ] = nodes->GetVelocity (iPoint,iDim);
24392436 }
24402437
24412438 break ;
@@ -2469,12 +2466,12 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
24692466
24702467 /* --- The pressure is prescribed at the outlet. ---*/
24712468
2472- V_outlet[0 ] = P_Outlet;
2469+ V_outlet[prim_idx. Pressure () ] = P_Outlet;
24732470
24742471 /* --- Neumann condition for the velocity ---*/
24752472
24762473 for (iDim = 0 ; iDim < nDim; iDim++) {
2477- V_outlet[iDim+1 ] = nodes->GetVelocity (iPoint,iDim);
2474+ V_outlet[iDim+prim_idx. Velocity () ] = nodes->GetVelocity (iPoint,iDim);
24782475 }
24792476
24802477 break ;
@@ -2483,21 +2480,21 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
24832480
24842481 /* --- Neumann condition for the temperature. ---*/
24852482
2486- V_outlet[nDim+ 1 ] = nodes->GetTemperature (iPoint);
2483+ V_outlet[prim_idx. Temperature () ] = nodes->GetTemperature (iPoint);
24872484
24882485 /* --- Access density at the interior node. This is either constant by
24892486 construction, or will be set fixed implicitly by the temperature
24902487 and equation of state. ---*/
24912488
2492- V_outlet[nDim+ 2 ] = nodes->GetDensity (iPoint);
2489+ V_outlet[prim_idx. Density () ] = nodes->GetDensity (iPoint);
24932490
24942491 /* --- Beta coefficient from the config file ---*/
24952492
2496- V_outlet[nDim+ 3 ] = nodes->GetBetaInc2 (iPoint);
2493+ V_outlet[prim_idx. Beta () ] = nodes->GetBetaInc2 (iPoint);
24972494
24982495 /* --- Cp is needed for Temperature equation. ---*/
24992496
2500- V_outlet[nDim+ 7 ] = nodes->GetSpecificHeatCp (iPoint);
2497+ V_outlet[prim_idx. CpTotal () ] = nodes->GetSpecificHeatCp (iPoint);
25012498
25022499 /* --- Set various quantities in the solver class ---*/
25032500
@@ -2527,9 +2524,9 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
25272524
25282525 /* --- Set transport properties at the outlet. ---*/
25292526
2530- V_outlet[nDim+ 4 ] = nodes->GetLaminarViscosity (iPoint);
2531- V_outlet[nDim+ 5 ] = nodes->GetEddyViscosity (iPoint);
2532- V_outlet[nDim+ 6 ] = nodes->GetThermalConductivity (iPoint);
2527+ V_outlet[prim_idx. LaminarViscosity () ] = nodes->GetLaminarViscosity (iPoint);
2528+ V_outlet[prim_idx. EddyViscosity () ] = nodes->GetEddyViscosity (iPoint);
2529+ V_outlet[prim_idx. ThermalConductivity () ] = nodes->GetThermalConductivity (iPoint);
25332530
25342531 /* --- Set the normal vector and the coordinates ---*/
25352532
@@ -2878,7 +2875,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config,
28782875 AxiFactor = 1.0 ;
28792876 }
28802877
2881- Density = V_outlet[nDim+ 2 ];
2878+ Density = V_outlet[prim_idx. Density () ];
28822879
28832880 Velocity2 = 0.0 ; Area = 0.0 ; MassFlow = 0.0 ;
28842881
0 commit comments