@@ -985,6 +985,10 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_
985985
986986 SetBeta_Parameter (geometry, solver_container, config, iMesh);
987987
988+ /* --- Update the pressure range in the domain for target outflow mass flow rate. ---*/
989+
990+ SetRangePressure (geometry, solver_container, config, iMesh);
991+
988992 /* --- Compute properties needed for mass flow BCs. ---*/
989993
990994 if (outlet) {
@@ -1974,6 +1978,46 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co
19741978
19751979}
19761980
1981+ void CIncEulerSolver::SetRangePressure (CGeometry *geometry, CSolver **solver_container,
1982+ CConfig *config, unsigned short iMesh) {
1983+ static su2double MinP, MaxP;
1984+
1985+ if (iMesh == MESH_0) {
1986+ SU2_OMP_MASTER {
1987+ MinP = std::numeric_limits<su2double>::max ();
1988+ MaxP = std::numeric_limits<su2double>::lowest ();
1989+ }
1990+ END_SU2_OMP_MASTER
1991+ su2double minP = std::numeric_limits<su2double>::max ();
1992+ su2double maxP = std::numeric_limits<su2double>::lowest ();
1993+
1994+ SU2_OMP_FOR_STAT (omp_chunk_size)
1995+ for (auto iPoint = 0ul ; iPoint < nPoint; iPoint++) {
1996+ minP = min (minP, nodes->GetPressure (iPoint));
1997+ maxP = max (maxP, nodes->GetPressure (iPoint));
1998+ }
1999+ END_SU2_OMP_FOR
2000+
2001+ SU2_OMP_CRITICAL {
2002+ MinP = min (MinP, minP);
2003+ MaxP = max (MaxP, maxP);
2004+ }
2005+ END_SU2_OMP_CRITICAL
2006+
2007+ BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS
2008+ {
2009+ minP = MinP;
2010+ SU2_MPI::Allreduce (&minP, &MinP, 1 , MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm ());
2011+ maxP = MaxP;
2012+ SU2_MPI::Allreduce (&maxP, &MaxP, 1 , MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm ());
2013+
2014+ config->SetRangePressure (MinP,MaxP);
2015+ }
2016+ END_SU2_OMP_SAFE_GLOBAL_ACCESS
2017+ }
2018+
2019+ }
2020+
19772021void CIncEulerSolver::SetPreconditioner (const CConfig *config, unsigned long iPoint,
19782022 su2double delta, su2activematrix& Preconditioner) const {
19792023
@@ -2556,10 +2600,14 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
25562600
25572601 dP = 0.5 *Density_Avg*(mDot_Old *mDot_Old - mDot_Target *mDot_Target )/((Density_Avg*Area_Outlet)*(Density_Avg*Area_Outlet));
25582602
2559- /* --- Update the new outlet pressure. Note that we use damping
2560- here to improve stability/convergence. ---*/
2603+ su2double P_domain_min = config->GetRangePressure (0 );
2604+
2605+ /* --- Do not relax when dP is relatively small compared to the pressure range dp = (P-P_min). ---*/
2606+
2607+ if (abs (dP) < abs (Damping * (P_domain-P_domain_min)))
2608+ Damping = 1.0 ;
25612609
2562- P_Outlet = P_domain + Damping* dP;
2610+ P_Outlet = P_domain + Damping * dP;
25632611
25642612 /* --- The pressure is prescribed at the outlet. ---*/
25652613
0 commit comments