Skip to content

Commit b49318e

Browse files
authored
Merge pull request #2506 from su2code/names_inlet_profile
Merging consistent names for the variables of the inlet profile
2 parents 9a88b25 + 44bb5c5 commit b49318e

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

SU2_CFD/src/solvers/CSolver.cpp

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,38 +3619,42 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
36193619
columnValue << setprecision(15);
36203620
columnValue << std::scientific;
36213621

3622-
su2double p_total, t_total;
3623-
const su2double* flow_dir = nullptr;
3622+
// Set the variables to store the flow variables. For a subsonic inlet the total conditions
3623+
// are stored in p_value and t_value and the flow direction in flow_dir_or_vel, while for a
3624+
// supersonic inlet the static conditions are stored in p_value and t_value and the flow
3625+
// velocity in flow_dir_or_vel.
3626+
su2double p_value, t_value;
3627+
const su2double* flow_dir_or_vel = nullptr;
36243628

36253629
if (KIND_MARKER == INLET_FLOW) {
3626-
p_total = config->GetInletPtotal(Marker_Tag);
3627-
t_total = config->GetInletTtotal(Marker_Tag);
3628-
flow_dir = config->GetInletFlowDir(Marker_Tag);
3630+
p_value = config->GetInletPtotal(Marker_Tag);
3631+
t_value = config->GetInletTtotal(Marker_Tag);
3632+
flow_dir_or_vel = config->GetInletFlowDir(Marker_Tag);
36293633
} else if (KIND_MARKER == SUPERSONIC_INLET) {
3630-
p_total = config->GetInlet_Pressure(Marker_Tag);
3631-
t_total = config->GetInlet_Temperature(Marker_Tag);
3632-
flow_dir = config->GetInlet_Velocity(Marker_Tag);
3634+
p_value = config->GetInlet_Pressure(Marker_Tag);
3635+
t_value = config->GetInlet_Temperature(Marker_Tag);
3636+
flow_dir_or_vel = config->GetInlet_Velocity(Marker_Tag);
36333637
} else {
36343638
SU2_MPI::Error("Unsupported type of inlet.", CURRENT_FUNCTION);
36353639
}
3636-
columnValue << t_total << "\t" << p_total <<"\t";
3640+
columnValue << t_value << "\t" << p_value << "\t";
36373641
for (unsigned short iDim = 0; iDim < nDim; iDim++) {
3638-
columnValue << flow_dir[iDim] <<"\t";
3642+
columnValue << flow_dir_or_vel[iDim] << "\t";
36393643
}
36403644

3641-
columnName << "# COORD-X " << setw(24) << "COORD-Y " << setw(24);
3642-
if(nDim==3) columnName << "COORD-Z " << setw(24);
3645+
columnName << left << setw(24) << "# COORD-X" << left << setw(24) << "COORD-Y";
3646+
if (nDim == 3) columnName << left << setw(24) << "COORD-Z";
36433647

36443648
if (KIND_MARKER == SUPERSONIC_INLET) {
3645-
columnName << "TEMPERATURE" << setw(24) << "PRESSURE " << setw(24);
3649+
columnName << left << setw(24) << "TEMPERATURE" << left << setw(24) << "PRESSURE";
36463650
} else if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) {
36473651
switch (config->GetKind_Inlet()) {
36483652
/*--- compressible conditions ---*/
36493653
case INLET_TYPE::TOTAL_CONDITIONS:
3650-
columnName << "TEMPERATURE" << setw(24) << "PRESSURE " << setw(24);
3654+
columnName << left << setw(24) << "TOTAL_TEMPERATURE" << left << setw(24) << "TOTAL_PRESSURE";
36513655
break;
36523656
case INLET_TYPE::MASS_FLOW:
3653-
columnName << "DENSITY " << setw(24) << "VELOCITY " << setw(24);
3657+
columnName << left << setw(24) << "DENSITY" << left << setw(24) << "VELOCITY";
36543658
break;
36553659
default:
36563660
SU2_MPI::Error("Unsupported INLET_TYPE.", CURRENT_FUNCTION);
@@ -3660,30 +3664,36 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
36603664
switch (config->GetKind_Inc_Inlet(Marker_Tag)) {
36613665
/*--- incompressible conditions ---*/
36623666
case INLET_TYPE::VELOCITY_INLET:
3663-
columnName << "TEMPERATURE" << setw(24) << "VELOCITY " << setw(24);
3667+
columnName << left << setw(24) << "TEMPERATURE " << left << setw(24) << "VELOCITY";
36643668
break;
36653669
case INLET_TYPE::PRESSURE_INLET:
3666-
columnName << "TEMPERATURE" << setw(24) << "PRESSURE " << setw(24);
3670+
columnName << left << setw(24) << "TEMPERATURE" << left << setw(24) << "PRESSURE";
36673671
break;
36683672
default:
36693673
SU2_MPI::Error("Unsupported INC_INLET_TYPE.", CURRENT_FUNCTION);
36703674
break;
36713675
}
36723676
}
36733677

3674-
columnName << "NORMAL-X " << setw(24) << "NORMAL-Y " << setw(24);
3675-
if(nDim==3) columnName << "NORMAL-Z " << setw(24);
3678+
if (KIND_MARKER == SUPERSONIC_INLET) {
3679+
columnName << left << setw(24) << "VELOCITY-X" << left << setw(24) << "VELOCITY-Y";
3680+
if (nDim == 3) columnName << left << setw(24) << "VELOCITY-Z";
3681+
} else {
3682+
columnName << left << setw(24) << "NORMAL-X" << left << setw(24) << "NORMAL-Y";
3683+
if (nDim == 3) columnName << left << setw(24) << "NORMAL-Z";
3684+
}
36763685

36773686
switch (TurbModelFamily(config->GetKind_Turb_Model())) {
3678-
case TURB_FAMILY::NONE: break;
3687+
case TURB_FAMILY::NONE:
3688+
break;
36793689
case TURB_FAMILY::SA:
36803690
/*--- 1-equation turbulence model: SA ---*/
3681-
columnName << "NU_TILDE " << setw(24);
3691+
columnName << left << setw(24) << "NU_TILDE";
36823692
columnValue << config->GetNuFactor_FreeStream() * config->GetViscosity_FreeStream() / config->GetDensity_FreeStream() <<"\t";
36833693
break;
36843694
case TURB_FAMILY::KW:
36853695
/*--- 2-equation turbulence model (SST) ---*/
3686-
columnName << "TKE " << setw(24) << "DISSIPATION" << setw(24);
3696+
columnName << left << setw(24) << "TKE" << left << setw(24) << "DISSIPATION";
36873697
columnValue << config->GetTke_FreeStream() << "\t" << config->GetOmega_FreeStream() <<"\t";
36883698
break;
36893699
}
@@ -3692,22 +3702,22 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
36923702
case SPECIES_MODEL::NONE: break;
36933703
case SPECIES_MODEL::SPECIES_TRANSPORT:
36943704
for (unsigned short iVar = 0; iVar < nVar_Species; iVar++) {
3695-
columnName << "SPECIES_" + std::to_string(iVar) + " " << setw(24);
3705+
columnName << left << setw(24) << "SPECIES_" + std::to_string(iVar);
36963706
columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[iVar] << "\t";
36973707
}
36983708
break;
36993709
case SPECIES_MODEL::FLAMELET: {
37003710
const auto& flamelet_config_options = config->GetFlameletParsedOptions();
37013711
/*--- 2-equation flamelet model ---*/
3702-
columnName << "PROGRESSVAR" << setw(24) << "ENTHALPYTOT" << setw(24);
3703-
columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[0] << "\t" << config->GetInlet_SpeciesVal(Marker_Tag)[1]<<"\t";
3712+
columnName << left << setw(24) << "PROGRESSVAR" << left << setw(24) << "ENTHALPYTOT";
3713+
columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[0] << "\t" << config->GetInlet_SpeciesVal(Marker_Tag)[1] <<"\t";
37043714
/*--- auxiliary species transport equations ---*/
37053715
for (unsigned short iReactant = 0; iReactant < flamelet_config_options.n_user_scalars; iReactant++) {
3706-
columnName << flamelet_config_options.user_scalar_names[iReactant] << setw(24);
3716+
columnName << left << setw(24) << flamelet_config_options.user_scalar_names[iReactant];
37073717
columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[flamelet_config_options.n_control_vars + iReactant] << "\t";
37083718
}
3709-
}
37103719
break;
3720+
}
37113721
}
37123722

37133723
columnNames.push_back(columnName.str());

0 commit comments

Comments
 (0)