@@ -1026,7 +1026,6 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short
10261026
10271027 bool unsteady = (config->GetTime_Marching () != TIME_MARCHING::STEADY);
10281028 bool viscous = config->GetViscous ();
1029- bool dynamic_grid = config->GetGrid_Movement ();
10301029 bool gravity = config->GetGravityForce ();
10311030 bool turbulent = false ;
10321031 bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model () == TURB_MODEL::SST));
@@ -1428,27 +1427,11 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai
14281427 unsigned short iDim, jDim, iSpecies, iVar, jVar;
14291428 unsigned long iPoint, iVertex;
14301429
1431- su2double *Normal = nullptr , Area, UnitNormal[3 ], *NormalArea,
1432- **Jacobian_b, **DubDu,
1433- rho, cs, P, rhoE, rhoEve, conc, *u, *dPdU;
1430+ /* --- Allocate the necessary vector structures ---*/
1431+ su2double Normal[MAXNDIM] = {0.0 }, UnitNormal[MAXNDIM] = {0.0 };
14341432
14351433 bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
14361434
1437- /* --- Allocate arrays ---*/
1438- Normal = new su2double[nDim];
1439- NormalArea = new su2double[nDim];
1440- Jacobian_b = new su2double*[nVar];
1441- DubDu = new su2double*[nVar];
1442- u = new su2double[nDim];
1443-
1444- for (iVar = 0 ; iVar < nVar; iVar++) {
1445- Jacobian_b[iVar] = new su2double[nVar];
1446- DubDu[iVar] = new su2double[nVar];
1447- }
1448-
1449- /* --- Get species molar mass ---*/
1450- auto & Ms = FluidModel->GetSpeciesMolarMass ();
1451-
14521435 /* --- Loop over all the vertices on this boundary (val_marker) ---*/
14531436 for (iVertex = 0 ; iVertex < geometry->nVertex [val_marker]; iVertex++) {
14541437 iPoint = geometry->vertex [val_marker][iVertex]->GetNode ();
@@ -1460,15 +1443,14 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai
14601443 geometry->vertex [val_marker][iVertex]->GetNormal (Normal);
14611444
14621445 /* --- Calculate parameters from the geometry ---*/
1463- Area = GeometryToolbox::Norm (nDim, Normal);
1446+ su2double Area = GeometryToolbox::Norm (nDim, Normal);
14641447
14651448 for (iDim = 0 ; iDim < nDim; iDim++){
1466- NormalArea[iDim] = -Normal[iDim];
14671449 UnitNormal[iDim] = -Normal[iDim]/Area;
14681450 }
14691451
14701452 /* --- Retrieve the pressure on the vertex ---*/
1471- P = nodes->GetPressure (iPoint);
1453+ su2double P = nodes->GetPressure (iPoint);
14721454
14731455 /* --- Apply the flow-tangency b.c. to the convective flux ---*/
14741456 for (iSpecies = 0 ; iSpecies < nSpecies; iSpecies++)
@@ -1485,25 +1467,30 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai
14851467 /* --- If using implicit time-stepping, calculate b.c. contribution to Jacobian ---*/
14861468 if (implicit) {
14871469
1470+ /* --- Allocate arrays needed for implicit solver ---*/
1471+ su2double Velocity[MAXNDIM] = {0.0 };
1472+
1473+ /* --- Get species molar mass ---*/
1474+ auto & Ms = FluidModel->GetSpeciesMolarMass ();
1475+
14881476 /* --- Initialize Jacobian ---*/
14891477 for (iVar = 0 ; iVar < nVar; iVar++)
14901478 for (jVar = 0 ; jVar < nVar; jVar++)
14911479 Jacobian_i[iVar][jVar] = 0.0 ;
14921480
14931481 /* --- Calculate state i ---*/
1494- rho = nodes->GetDensity (iPoint);
1495- rhoE = nodes->GetSolution (iPoint,nSpecies+nDim);
1496- rhoEve = nodes->GetSolution (iPoint,nSpecies+nDim+1 );
1497- dPdU = nodes->GetdPdU (iPoint);
1482+ su2double rho = nodes->GetDensity (iPoint);
1483+ su2double rhoE = nodes->GetSolution (iPoint,nSpecies+nDim);
1484+ su2double rhoEve = nodes->GetSolution (iPoint,nSpecies+nDim+1 );
1485+ auto dPdU = nodes->GetdPdU (iPoint);
14981486 for (iDim = 0 ; iDim < nDim; iDim++)
1499- u [iDim] = nodes->GetVelocity (iPoint,iDim);
1487+ Velocity [iDim] = nodes->GetVelocity (iPoint,iDim);
15001488
1501- conc = 0.0 ;
1489+ su2double conc = 0.0 ;
15021490 for (iSpecies = 0 ; iSpecies < nSpecies; iSpecies++) {
1503- cs = nodes->GetMassFraction (iPoint,iSpecies);
1491+ su2double cs = nodes->GetMassFraction (iPoint,iSpecies);
15041492 conc += cs * rho/Ms[iSpecies];
15051493
1506- // ///// NEW //////
15071494 for (iDim = 0 ; iDim < nDim; iDim++) {
15081495 Jacobian_i[nSpecies+iDim][iSpecies] = dPdU[iSpecies] * UnitNormal[iDim];
15091496 Jacobian_i[iSpecies][nSpecies+iDim] = cs * UnitNormal[iDim];
@@ -1512,7 +1499,7 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai
15121499
15131500 for (iDim = 0 ; iDim < nDim; iDim++) {
15141501 for (jDim = 0 ; jDim < nDim; jDim++) {
1515- Jacobian_i[nSpecies+iDim][nSpecies+jDim] = u [iDim]*UnitNormal[jDim]
1502+ Jacobian_i[nSpecies+iDim][nSpecies+jDim] = Velocity [iDim]*UnitNormal[jDim]
15161503 + dPdU[nSpecies+jDim]*UnitNormal[iDim];
15171504 }
15181505 Jacobian_i[nSpecies+iDim][nSpecies+nDim] = dPdU[nSpecies+nDim] *UnitNormal[iDim];
@@ -1533,17 +1520,6 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai
15331520 }
15341521 }
15351522 }
1536- delete [] Normal;
1537- delete [] NormalArea;
1538- delete [] u;
1539-
1540- for (iVar = 0 ; iVar < nVar; iVar++) {
1541- delete [] Jacobian_b[iVar];
1542- delete [] DubDu[iVar];
1543- }
1544-
1545- delete [] Jacobian_b;
1546- delete [] DubDu;
15471523}
15481524
15491525void CNEMOEulerSolver::BC_Far_Field (CGeometry *geometry, CSolver **solver_container,
@@ -1553,7 +1529,7 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contai
15531529 unsigned short iDim;
15541530 unsigned long iVertex, iPoint, Point_Normal;
15551531
1556- su2double *V_infty, *V_domain, *U_domain,*U_infty ;
1532+ su2double *V_infty, *V_domain, *U_infty, *U_domain ;
15571533
15581534 /* --- Set booleans from configuration parameters ---*/
15591535 bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
@@ -1566,6 +1542,9 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contai
15661542 for (iVertex = 0 ; iVertex < geometry->nVertex [val_marker]; iVertex++) {
15671543 iPoint = geometry->vertex [val_marker][iVertex]->GetNode ();
15681544
1545+ /* --- Allocate the value at the infinity ---*/
1546+ V_infty = GetCharacPrimVar (val_marker, iVertex);
1547+
15691548 /* --- Check if the node belongs to the domain (i.e, not a halo node) ---*/
15701549 if (geometry->nodes ->GetDomain (iPoint)) {
15711550
@@ -1954,8 +1933,9 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container
19541933 bool gravity = config->GetGravityForce ();
19551934 bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
19561935
1957- su2double *U_domain = new su2double[nVar]; su2double *U_outlet = new su2double[nVar];
1958- su2double *V_domain = new su2double[nPrimVar]; su2double *V_outlet = new su2double[nPrimVar];
1936+ su2double *U_domain;
1937+ su2double *U_outlet = new su2double[nVar];
1938+ su2double *V_domain, *V_outlet;
19591939 su2double *Normal = new su2double[nDim];
19601940 su2double *Ys = new su2double[nSpecies];
19611941
@@ -1973,6 +1953,9 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container
19731953 for (iVertex = 0 ; iVertex < geometry->nVertex [val_marker]; iVertex++) {
19741954 iPoint = geometry->vertex [val_marker][iVertex]->GetNode ();
19751955
1956+ /* --- Allocate the value at the outlet ---*/
1957+ V_outlet = GetCharacPrimVar (val_marker, iVertex);
1958+
19761959 /* --- Check if the node belongs to the domain (i.e., not a halo node) ---*/
19771960 if (geometry->nodes ->GetDomain (iPoint)) {
19781961
@@ -1987,8 +1970,8 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container
19871970 UnitNormal[iDim] = Normal[iDim]/Area;
19881971
19891972 /* --- Current solution at this boundary node ---*/
1990- for (iVar = 0 ; iVar < nVar; iVar++) U_domain[iVar] = nodes->GetSolution (iPoint, iVar );
1991- for (iVar = 0 ; iVar < nPrimVar; iVar++) V_domain[iVar] = nodes->GetPrimitive (iPoint, iVar );
1973+ U_domain = nodes->GetSolution (iPoint);
1974+ V_domain = nodes->GetPrimitive (iPoint);
19921975
19931976 /* --- Initialize solution at outlet ---*/
19941977 for (iVar = 0 ; iVar < nVar; iVar++) U_outlet[iVar] = 0.0 ;
@@ -2178,10 +2161,7 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container
21782161 }
21792162
21802163 /* --- Free locally allocated memory ---*/
2181- delete [] U_domain;
21822164 delete [] U_outlet;
2183- delete [] V_domain;
2184- delete [] V_outlet;
21852165 delete [] Normal;
21862166 delete [] Ys;
21872167
@@ -2406,7 +2386,6 @@ void CNEMOEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solve
24062386 su2double *U_outlet, *U_domain;
24072387
24082388 bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
2409- bool dynamic_grid = config->GetGrid_Movement ();
24102389 string Marker_Tag = config->GetMarker_All_TagBound (val_marker);
24112390
24122391 su2double *Normal = new su2double[nDim];
@@ -2427,6 +2406,7 @@ void CNEMOEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solve
24272406 U_domain = nodes->GetSolution (iPoint);
24282407
24292408 /* --- Allocate the value at the outlet ---*/
2409+ V_outlet = GetCharacPrimVar (val_marker, iVertex);
24302410 V_outlet = V_domain;
24312411 U_outlet = U_domain;
24322412
0 commit comments