diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index 63b99ddbfd6..1ec97b9a8c0 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -1696,16 +1696,16 @@ void CAdjEulerSolver::Inviscid_Sensitivity(CGeometry *geometry, CSolver **solver } SoundSpeed = solver_container[FLOW_SOL]->GetNodes()->GetSoundSpeed(iPoint); - if (Vn0) { - /*TODO: MDO compatible*/ - Sens_BPress[iMarker]+=Psi[nDim+1]*(SoundSpeed*SoundSpeed-Vn*Vn)/(Vn*Gamma_Minus_One); - if (config->GetKind_ObjFunc()==SURFACE_STATIC_PRESSURE) - Sens_BPress[iMarker]+=1; - if (config->GetKind_ObjFunc()==SURFACE_TOTAL_PRESSURE) { - for (iDim=0; iDim 0) { + /*--- Sensitivity contribution for MDO compatibility. ---*/ + Sens_BPress[iMarker] += Psi[nDim + 1] * (SoundSpeed * SoundSpeed - Vn * Vn) / (Vn * Gamma_Minus_One); + if (config->GetKind_ObjFunc() == SURFACE_STATIC_PRESSURE) + Sens_BPress[iMarker] += 1.0; + if (config->GetKind_ObjFunc() == SURFACE_TOTAL_PRESSURE) { + for (iDim = 0; iDim < nDim; iDim++) + Sens_BPress[iMarker] += 0.5 * Velocity[iDim] * Velocity[iDim] / (Vn * Vn); + } } - } } Total_Sens_BPress+= Sens_BPress[iMarker] * scale * factor; } diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 99be4b04cc4..48bd57602ab 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2264,6 +2264,7 @@ void CSolver::SetGridVel_Gradient(CGeometry *geometry, const CConfig *config) co true, gridVel, 0, nDim, 0, gridVelGrad, rmatrix); } + void CSolver::SetSolution_Limiter(CGeometry *geometry, const CConfig *config) { const auto kindLimiter = config->GetKind_SlopeLimit(); @@ -3383,7 +3384,6 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo position = text_line.find ("ITER=",0); if (position != string::npos) { - // TODO: 'ITER=' has 5 chars, not 9! text_line.erase (0,9); InnerIter_ = atoi(text_line.c_str()); } @@ -3440,7 +3440,6 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo position = text_line.find ("STREAMWISE_PERIODIC_PRESSURE_DROP=",0); if (position != string::npos) { - // Erase the name from the line, 'STREAMWISE_PERIODIC_PRESSURE_DROP=' has 34 chars. text_line.erase (0,34); SPPressureDrop_ = atof(text_line.c_str()); } diff --git a/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp b/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp index a1163faa751..a41153e9f9e 100644 --- a/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp +++ b/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp @@ -480,13 +480,15 @@ void CSpeciesFlameletSolver::BC_Isothermal_Wall_Generic(CGeometry* geometry, CSo su2double dist_ij = sqrt(dist_ij_2); /*--- Compute the normal gradient in temperature using Twall. ---*/ - ///TODO: Account for preferential diffusion in computation of the heat flux su2double dTdn = -(flowNodes->GetTemperature(Point_Normal) - temp_wall) / dist_ij; + ///TODO: Account for preferential diffusion in computation of the heat flux + /*--- Get thermal conductivity. ---*/ su2double thermal_conductivity = flowNodes->GetThermalConductivity(iPoint); + /*--- Apply a weak boundary condition for the energy equation. Compute the residual due to the prescribed heat flux. ---*/