Skip to content
11 changes: 10 additions & 1 deletion Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5336,6 +5336,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
"The use of MARKER_INLET_TURBULENT requires the number of entries when SST Model is used \n"
"to be equal to 2 : Turbulent intensity and ratio turbulent to laminar viscosity",
CURRENT_FUNCTION);
if (Marker_Inlet_Turb != nullptr && Kind_Turb_Model == TURB_MODEL::SA && nTurb_Properties != 1)
SU2_MPI::Error(
"The use of MARKER_INLET_TURBULENT requires the number of entries when SA Model is used \n"
"to be equal to 1 : ratio turbulent to laminar viscosity",
CURRENT_FUNCTION);

/*--- Checks for additional species transport. ---*/
if (Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) {
Expand Down Expand Up @@ -8826,7 +8831,11 @@ const su2double* CConfig::GetInlet_TurbVal(string val_marker) const {
for (auto iMarker = 0u; iMarker < nMarker_Inlet_Turb; iMarker++) {
if (Marker_Inlet_Turb[iMarker] == val_marker) return Inlet_TurbVal[iMarker];
}
return TurbIntensityAndViscRatioFreeStream;
if (Kind_Turb_Model == TURB_MODEL::SST) {
return TurbIntensityAndViscRatioFreeStream;
} else {
return &NuFactor_FreeStream;
}
}

su2double CConfig::GetOutlet_Pressure(string val_marker) const {
Expand Down
27 changes: 26 additions & 1 deletion SU2_CFD/src/solvers/CTurbSASolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,32 @@ void CTurbSASolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CN
su2double Inlet_Vars[MAXNVAR];
Inlet_Vars[0] = Inlet_TurbVars[val_marker][iVertex][0];
if (config->GetInlet_Profile_From_File()) {
Inlet_Vars[0] *= config->GetDensity_Ref() / config->GetViscosity_Ref();
Inlet_Vars[0] *= config->GetDensity_Ref() / config->GetViscosity_Ref();
} else {
/*--- Obtain fluid model for computing the nu tilde to impose at the inlet boundary. ---*/
CFluidModel* FluidModel = solver_container[FLOW_SOL]->GetFluidModel();

/*--- Obtain density and laminar viscosity at inlet boundary node ---*/

su2double Density_Inlet;
if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) {
Density_Inlet = V_inlet[prim_idx.Density()];
FluidModel->SetTDState_Prho(V_inlet[prim_idx.Pressure()], Density_Inlet);
} else {
const su2double* Scalar_Inlet = nullptr;
if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) {
Scalar_Inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker));
}
FluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], Scalar_Inlet);
Density_Inlet = FluidModel->GetDensity();
}
const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity();
const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker));
const su2double Nu_Factor = Turb_Properties[0];
Inlet_Vars[0] = Nu_Factor * Laminar_Viscosity_Inlet / Density_Inlet;
if (config->GetSAParsedOptions().bc) {
Inlet_Vars[0] *= 0.005;
}
}

/*--- Load the inlet turbulence variable (uniform by default). ---*/
Expand Down
4 changes: 2 additions & 2 deletions TestCases/hybrid_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def main():
turb_flatplate.cfg_dir = "rans/flatplate"
turb_flatplate.cfg_file = "turb_SA_flatplate.cfg"
turb_flatplate.test_iter = 20
turb_flatplate.test_vals = [-4.157169, -6.737133, -0.176253, 0.057446]
turb_flatplate.test_vals = [-4.157169, -6.736698, -0.176253, 0.057446]
test_list.append(turb_flatplate)

# ONERA M6 Wing
Expand Down Expand Up @@ -495,7 +495,7 @@ def main():
ddes_flatplate.cfg_dir = "ddes/flatplate"
ddes_flatplate.cfg_file = "ddes_flatplate.cfg"
ddes_flatplate.test_iter = 10
ddes_flatplate.test_vals = [-2.714758, -5.883004, -0.215005, 0.023783, -618.160000]
ddes_flatplate.test_vals = [-2.714758, -5.882733, -0.215005, 0.023783, -618.160000]
ddes_flatplate.unsteady = True
test_list.append(ddes_flatplate)

Expand Down
8 changes: 4 additions & 4 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def main():
turb_flatplate.cfg_dir = "rans/flatplate"
turb_flatplate.cfg_file = "turb_SA_flatplate.cfg"
turb_flatplate.test_iter = 20
turb_flatplate.test_vals = [-4.147548, -6.729213, -0.176227, 0.057731]
turb_flatplate.test_vals = [-4.147548, -6.728790, -0.176227, 0.057731]
test_list.append(turb_flatplate)

# Flat plate (compressible) with species inlet
Expand Down Expand Up @@ -953,7 +953,7 @@ def main():
ddes_flatplate.cfg_dir = "ddes/flatplate"
ddes_flatplate.cfg_file = "ddes_flatplate.cfg"
ddes_flatplate.test_iter = 10
ddes_flatplate.test_vals = [-2.714758, -5.883004, -0.215005, 0.023783, -618.160000]
ddes_flatplate.test_vals = [-2.714758, -5.882733, -0.215005, 0.023783, -618.160000]
ddes_flatplate.unsteady = True
test_list.append(ddes_flatplate)

Expand Down Expand Up @@ -1442,12 +1442,12 @@ def main():
species2_primitiveVenturi_mixingmodel_boundedscalar.new_output = True
test_list.append(species2_primitiveVenturi_mixingmodel_boundedscalar)

# 2 species (1 eq) primitive venturi mixing using mixing model including viscosity and thermal conductivity
# 2 species (1 eq) primitive venturi mixing using mixing model including viscosity, thermal conductivity and inlet markers for SA turbulence model
species2_primitiveVenturi_mixingmodel_viscosity = TestCase('species2_primitiveVenturi_mixingmodel_viscosity')
species2_primitiveVenturi_mixingmodel_viscosity.cfg_dir = "species_transport/venturi_primitive_3species"
species2_primitiveVenturi_mixingmodel_viscosity.cfg_file = "species2_primitiveVenturi_mixingmodel_viscosity.cfg"
species2_primitiveVenturi_mixingmodel_viscosity.test_iter = 50
species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-4.725129, -4.311366, -4.610113, -5.833264, 0.552520, -4.945381, 5.000000, -1.834845, 5.000000, -5.496023, 5.000000, -1.733470, 2.277964, 0.972376, 0.608230, 0.697358]
species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-4.843487, -3.585775, -3.486490, -7.560246, -5.094190, 5.000000, -1.898139, 5.000000, -3.329399, 5.000000, -2.113219, 2.482224, 0.974144, 0.607217, 0.900862]
species2_primitiveVenturi_mixingmodel_viscosity.new_output = True
test_list.append(species2_primitiveVenturi_mixingmodel_viscosity)

Expand Down
6 changes: 3 additions & 3 deletions TestCases/serial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def main():
turb_flatplate.cfg_dir = "rans/flatplate"
turb_flatplate.cfg_file = "turb_SA_flatplate.cfg"
turb_flatplate.test_iter = 20
turb_flatplate.test_vals = [-4.157169, -6.737133, -0.176253, 0.057446] #last 4 columns
turb_flatplate.test_vals = [-4.157169, -6.736698, -0.176253, 0.057446] #last 4 columns
turb_flatplate.new_output = True
test_list.append(turb_flatplate)

Expand Down Expand Up @@ -854,7 +854,7 @@ def main():
ddes_flatplate.cfg_dir = "ddes/flatplate"
ddes_flatplate.cfg_file = "ddes_flatplate.cfg"
ddes_flatplate.test_iter = 10
ddes_flatplate.test_vals = [-2.714758, -5.883004, -0.215005, 0.023783, -618.160000]
ddes_flatplate.test_vals = [-2.714758, -5.882733, -0.215005, 0.023783, -618.160000]
ddes_flatplate.unsteady = True
ddes_flatplate.new_output = True
test_list.append(ddes_flatplate)
Expand Down Expand Up @@ -886,7 +886,7 @@ def main():
ls89_sa.cfg_dir = "nicf/LS89"
ls89_sa.cfg_file = "turb_SA_PR.cfg"
ls89_sa.test_iter = 20
ls89_sa.test_vals = [-5.050483, -13.389547, 0.174939, 0.430757] #last 4 columns
ls89_sa.test_vals = [-5.050483, -13.371788, 0.174939, 0.430757] #last 4 columns
ls89_sa.new_output= True
test_list.append(ls89_sa)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
% SU2 configuration file %
% Case description: Species mixing with 2 species, i.e. 1 transport equations %
% Including mixture dependent density, viscosity, thermal %
% conductivity %
% conductivity and different viscosity ratios at the inlets %
% for the SA turbulent model. %
% Author: Cristopher Morales Ubal %
% Institution: Eindhoven University of Technology %
% Date: 2022/06/27 %
Expand All @@ -14,16 +15,16 @@
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
%
SOLVER= INC_RANS
KIND_TURB_MODEL= SST
KIND_TURB_MODEL= SA
%
% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------%
%
INC_DENSITY_MODEL= VARIABLE
INC_DENSITY_INIT= 1.1766
%
INC_VELOCITY_INIT= ( 1.00, 0.0, 0.0 )
INC_VELOCITY_INIT= ( 5.00, 0.0, 0.0 )
%
INC_ENERGY_EQUATION= YES
INC_ENERGY_EQUATION= NO
INC_TEMPERATURE_INIT= 300.0
%
INC_NONDIM= DIMENSIONAL
Expand Down Expand Up @@ -62,11 +63,15 @@ MARKER_SYM= ( axis )
SPECIFIED_INLET_PROFILE= NO
INLET_FILENAME= inlet_venturi.dat
INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET
MARKER_INLET= ( gas_inlet, 400, 1.0, 1.0, 0.0, 0.0,\
air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 )
MARKER_INLET= ( gas_inlet, 300, 5.0, 1.0, 0.0, 0.0,\
air_axial_inlet, 300, 3.0, 0.0, -1.0, 0.0 )
SPECIES_USE_STRONG_BC= NO
MARKER_INLET_SPECIES= (gas_inlet, 1.0, \
air_axial_inlet, 0.6)
air_axial_inlet, 0.6)
%
%
MARKER_INLET_TURBULENT= (gas_inlet, 5.0, \
air_axial_inlet, 3.0)
%
INC_OUTLET_TYPE= PRESSURE_OUTLET
MARKER_OUTLET= ( outlet, 0.0 )
Expand Down Expand Up @@ -128,7 +133,7 @@ CONV_STARTITER= 10
%
MESH_FILENAME= primitiveVenturi.su2
SCREEN_OUTPUT= INNER_ITER WALL_TIME \
RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION RMS_SPECIES_0 RMS_SPECIES_1 \
RMS_RES \
LINSOL_ITER LINSOL_RESIDUAL \
LINSOL_ITER_TURB LINSOL_RESIDUAL_TURB \
LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES \
Expand Down
3 changes: 2 additions & 1 deletion config_template.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ SPATIAL_FOURIER= NO
CATALYTIC_WALL= ( NONE )
%
% Inlet Turbulent boundary marker(s) with the following format:
% (inlet_marker1, TurbIntensity1, RatioTurbLamViscosity1, inlet_marker2, TurbIntensity2, RatioTurbLamViscosity2, ...)
% SA Model: (inlet_marker1, NuFactor1, inlet_marker2, NuFactor2, ...)
% SST Model: (inlet_marker1, TurbIntensity1, RatioTurbLamViscosity1, inlet_marker2, TurbIntensity2, RatioTurbLamViscosity2, ...)
MARKER_INLET_TURBULENT= (inlet1, 0.05, 15, inlet2, 0.02, ...)

% ------------------------ WALL ROUGHNESS DEFINITION --------------------------%
Expand Down