@@ -996,6 +996,10 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_
996996
997997 SetBeta_Parameter (geometry, solver_container, config, iMesh);
998998
999+ /* --- Update the pressure range in the domain for target outflow mass flow rate. ---*/
1000+
1001+ SetRangePressure (geometry, solver_container, config, iMesh);
1002+
9991003 /* --- Compute properties needed for mass flow BCs. ---*/
10001004
10011005 if (outlet) {
@@ -2054,6 +2058,46 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co
20542058
20552059}
20562060
2061+ void CIncEulerSolver::SetRangePressure (CGeometry *geometry, CSolver **solver_container,
2062+ CConfig *config, unsigned short iMesh) {
2063+ static su2double MinP, MaxP;
2064+
2065+ if (iMesh == MESH_0) {
2066+ SU2_OMP_MASTER {
2067+ MinP = std::numeric_limits<su2double>::max ();
2068+ MaxP = std::numeric_limits<su2double>::lowest ();
2069+ }
2070+ END_SU2_OMP_MASTER
2071+ su2double minP = std::numeric_limits<su2double>::max ();
2072+ su2double maxP = std::numeric_limits<su2double>::lowest ();
2073+
2074+ SU2_OMP_FOR_STAT (omp_chunk_size)
2075+ for (auto iPoint = 0ul ; iPoint < nPoint; iPoint++) {
2076+ minP = min (minP, nodes->GetPressure (iPoint));
2077+ maxP = max (maxP, nodes->GetPressure (iPoint));
2078+ }
2079+ END_SU2_OMP_FOR
2080+
2081+ SU2_OMP_CRITICAL {
2082+ MinP = min (MinP, minP);
2083+ MaxP = max (MaxP, maxP);
2084+ }
2085+ END_SU2_OMP_CRITICAL
2086+
2087+ BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS
2088+ {
2089+ minP = MinP;
2090+ SU2_MPI::Allreduce (&minP, &MinP, 1 , MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm ());
2091+ maxP = MaxP;
2092+ SU2_MPI::Allreduce (&maxP, &MaxP, 1 , MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm ());
2093+
2094+ config->SetRangePressure (MinP,MaxP);
2095+ }
2096+ END_SU2_OMP_SAFE_GLOBAL_ACCESS
2097+ }
2098+
2099+ }
2100+
20572101void CIncEulerSolver::SetPreconditioner (const CConfig *config, unsigned long iPoint,
20582102 su2double delta, su2activematrix& Preconditioner) const {
20592103
@@ -2676,10 +2720,14 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
26762720
26772721 dP = 0.5 *Density_Avg*(mDot_Old *mDot_Old - mDot_Target *mDot_Target )/((Density_Avg*Area_Outlet)*(Density_Avg*Area_Outlet));
26782722
2679- /* --- Update the new outlet pressure. Note that we use damping
2680- here to improve stability/convergence. ---*/
2723+ su2double P_domain_min = config->GetRangePressure (0 );
2724+
2725+ /* --- Do not relax when dP is relatively small compared to the pressure range dp = (P-P_min). ---*/
2726+
2727+ if (abs (dP) < abs (Damping * (P_domain-P_domain_min)))
2728+ Damping = 1.0 ;
26812729
2682- P_Outlet = P_domain + Damping* dP;
2730+ P_Outlet = P_domain + Damping * dP;
26832731
26842732 /* --- The pressure is prescribed at the outlet. ---*/
26852733
0 commit comments