diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 4777616f550..9af86068724 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -5589,9 +5589,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Define some variables for flamelet model. ---*/ if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { /*--- The controlling variables are progress variable, total enthalpy, and optionally mixture fraction ---*/ - //n_control_vars = nSpecies - n_user_scalars; if (n_control_vars != (nSpecies - n_user_scalars)) - SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", CURRENT_FUNCTION); + SU2_MPI::Error("Number of initial species incompatible with number of controlling variables and user scalars.", CURRENT_FUNCTION); /*--- We can have additional user defined transported scalars ---*/ n_scalars = n_control_vars + n_user_scalars; } @@ -5599,6 +5598,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE && GetBounded_Scalar()) { SU2_MPI::Error("BOUNDED_SCALAR discretization can only be used for incompressible problems.", CURRENT_FUNCTION); } + } void CConfig::SetMarkers(SU2_COMPONENT val_software) { diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 489bacb8a49..7adac5cf4c3 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -6879,10 +6879,11 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short val_marker) { unsigned short iDim; unsigned long iVertex, iPoint; - su2double P_Total, T_Total, Velocity[MAXNDIM], Velocity2, H_Total, Temperature, Riemann, + su2double P_Total, T_Total, Velocity[MAXNDIM], Velocity2, H_Total, Riemann, Pressure, Density, Energy, Flow_Dir[MAXNDIM], Mach2, SoundSpeed2, SoundSpeed_Total2, Vel_Mag, alpha, aa, bb, cc, dd, Area, UnitNormal[MAXNDIM], Normal[MAXNDIM]; su2double *V_inlet, *V_domain; + su2double Temperature; const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const su2double Two_Gamma_M1 = 2.0 / Gamma_Minus_One; @@ -6920,7 +6921,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_domain = nodes->GetPrimitive(iPoint); - /*--- Build the fictitious intlet state based on characteristics ---*/ + /*--- Build the fictitious inlet state based on characteristics ---*/ /*--- Subsonic inflow: there is one outgoing characteristic (u-c), @@ -7095,8 +7096,8 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, if (tkeNeeded) Energy += GetTke_Inf(); /*--- Primitive variables, using the derived quantities ---*/ - - V_inlet[0] = Pressure / ( Gas_Constant * Density); + Temperature = Pressure / ( Gas_Constant * Density); + V_inlet[0] = Temperature; for (iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+1] = Vel_Mag*Flow_Dir[iDim]; V_inlet[nDim+1] = Pressure; @@ -7110,6 +7111,68 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, break; } + /*--- Check if the inlet node is shared with a viscous wall. ---*/ + + if (geometry->nodes->GetViscousBoundary(iPoint)) { + + switch (Kind_Inlet) { + + /*--- Total properties have been specified at the inlet. ---*/ + + case INLET_TYPE::TOTAL_CONDITIONS: { + + /*--- Impose the wall velocity from the interior wall node. ---*/ + + Velocity2 = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + V_inlet[iDim+1] = nodes->GetVelocity(iPoint,iDim); + Velocity2 += V_inlet[iDim+1] * V_inlet[iDim+1]; + } + + /*--- Match the pressure, density and energy at the wall. ---*/ + + Pressure = nodes->GetPressure(iPoint); + Density = Pressure / (Gas_Constant * Temperature); + Energy = Pressure / (Density*Gamma_Minus_One) + 0.5 * Velocity2; + + if (tkeNeeded) Energy += GetTke_Inf(); + + V_inlet[nDim+1] = Pressure; + V_inlet[nDim+2] = Density; + V_inlet[nDim+3] = Energy + Pressure / Density; + break; + } + + case INLET_TYPE::MASS_FLOW: { + + /*--- Impose the wall velocity from the interior wall node. ---*/ + + Velocity2 = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + V_inlet[iDim+1] = nodes->GetVelocity(iPoint,iDim); + Velocity2 += V_inlet[iDim+1] * V_inlet[iDim+1]; + } + + Pressure = nodes->GetPressure(iPoint); + Density = nodes->GetDensity(iPoint); + Temperature = Pressure / ( Gas_Constant * Density); + Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; + if (tkeNeeded) Energy += GetTke_Inf(); + + V_inlet[0] = Temperature; + V_inlet[nDim+1] = Pressure; + V_inlet[nDim+2] = Density; + V_inlet[nDim+3] = Energy + Pressure / Density; + + break; + } + + default: + SU2_MPI::Error("Unsupported INLET_TYPE.", CURRENT_FUNCTION); + break; + + } + } /*--- Set various quantities in the solver class ---*/ conv_numerics->SetPrimitive(V_domain, V_inlet); diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 23ccc566755..6c705f3a131 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -139,8 +139,8 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.485957, -7.612048, -0.000000, 2.085796] - poiseuille_profile.test_vals_aarch64 = [-12.485957, -7.612048, -0.000000, 2.085796] + poiseuille_profile.test_vals = [-12.485991, -7.613038, -0.000000, 2.085796] + poiseuille_profile.test_vals_aarch64 = [-12.494717, -7.711274, -0.000000, 2.085796] test_list.append(poiseuille_profile) # 2D Rotational Periodic diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index d6aee618cb9..d397f7b8236 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -311,7 +311,7 @@ def main(): flatplate_udobj.cfg_dir = "user_defined_functions" flatplate_udobj.cfg_file = "lam_flatplate.cfg" flatplate_udobj.test_iter = 20 - flatplate_udobj.test_vals = [-6.664134, -1.190073, -0.954366, 0.000641, -0.000633, 0.000548, -0.001181, 596.940000, 300.020000, 296.920000, 22.201000, 0.525750, 37.278000, 2.347900] + flatplate_udobj.test_vals = [-6.663514, -1.189436, -0.954938, 0.000644, -0.000635, 0.000549, -0.001183, 596.930000, 300.010000, 296.920000, 22.187000, 0.527090, 37.284000, 2.354200] test_list.append(flatplate_udobj) # Laminar cylinder (steady) @@ -344,8 +344,8 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.483967, -7.577331, -0.000000, 2.085796] - poiseuille_profile.test_vals_aarch64 = [-12.483967, -7.577331, -0.000000, 2.085796] + poiseuille_profile.test_vals = [-12.483988, -7.577838, -0.000000, 2.085796] + poiseuille_profile.test_vals_aarch64 = [-12.492864, -7.671632, -0.000000, 2.085796] test_list.append(poiseuille_profile) ########################## @@ -1023,7 +1023,7 @@ def main(): flatplate_unsteady.cfg_dir = "navierstokes/flatplate" flatplate_unsteady.cfg_file = "lam_flatplate_unst.cfg" flatplate_unsteady.test_iter = 3 - flatplate_unsteady.test_vals = [0.000008, -8.876477, -8.249920, -6.294138, -5.468911, -3.398657, 0.002075, -0.324341] + flatplate_unsteady.test_vals = [-8.876870, -8.250064, -6.293918, -5.469416, -3.398952, 0.002075, -0.324126] flatplate_unsteady.unsteady = True test_list.append(flatplate_unsteady) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index af50a43b1da..a6fc9598e1d 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -524,7 +524,7 @@ def main(): pywrapper_wavy_wall_steady.cfg_dir = "py_wrapper/wavy_wall" pywrapper_wavy_wall_steady.cfg_file = "run_steady.py" pywrapper_wavy_wall_steady.test_iter = 100 - pywrapper_wavy_wall_steady.test_vals = [-1.360044, 2.580709, -2.892473] + pywrapper_wavy_wall_steady.test_vals = [-1.359409, 2.580816, -2.892697] pywrapper_wavy_wall_steady.command = TestCase.Command("mpirun -n 2", "python", "run_steady.py") pywrapper_wavy_wall_steady.timeout = 1600 pywrapper_wavy_wall_steady.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index e5825f786e1..00720a44f83 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -198,8 +198,8 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.485974, -7.612341, -0.000000, 2.085796] - poiseuille_profile.test_vals_aarch64 = [-12.485974, -7.612341, -0.000000, 2.085796] + poiseuille_profile.test_vals = [-12.485982, -7.613005, -0.000000, 2.085796] + poiseuille_profile.test_vals_aarch64 = [-12.494684, -7.711379, -0.000000, 2.085796] #last 4 columns test_list.append(poiseuille_profile) ########################## @@ -1614,7 +1614,7 @@ def main(): pywrapper_custom_inlet.cfg_dir = "py_wrapper/custom_inlet" pywrapper_custom_inlet.cfg_file = "lam_flatplate.cfg" pywrapper_custom_inlet.test_iter = 20 - pywrapper_custom_inlet.test_vals = [-4.120494, -1.540195, -3.566114, 1.342509, -0.748827, 0.161349, -0.013214, 0.516000, -0.529220] + pywrapper_custom_inlet.test_vals = [-4.120437, -1.540129, -3.563086, 1.342567, -0.748783, 0.161976, -0.012959, 0.516320, -0.529280] pywrapper_custom_inlet.command = TestCase.Command(exec = "python", param = "run.py") pywrapper_custom_inlet.timeout = 1600 pywrapper_custom_inlet.tol = 0.0001