Skip to content

Commit 2677409

Browse files
committed
add inlet_usenormal
1 parent deece11 commit 2677409

5 files changed

Lines changed: 37 additions & 12 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ class CConfig {
627627
unsigned short nInc_Outlet; /*!< \brief Number of inlet boundary treatment types listed. */
628628
su2double Inc_Inlet_Damping; /*!< \brief Damping factor applied to the iterative updates to the velocity at a pressure inlet in incompressible flow. */
629629
su2double Inc_Outlet_Damping; /*!< \brief Damping factor applied to the iterative updates to the pressure at a mass flow outlet in incompressible flow. */
630-
bool Inc_Inlet_UseNormal; /*!< \brief Flag for whether to use the local normal as the flow direction for an incompressible pressure inlet. */
630+
bool Inlet_UseNormal; /*!< \brief Flag for whether to use the local normal as the flow direction for an (in)compressible pressure inlet. */
631631
su2double Linear_Solver_Error; /*!< \brief Min error of the linear solver for the implicit formulation. */
632632
su2double Deform_Linear_Solver_Error; /*!< \brief Min error of the linear solver for the implicit formulation. */
633633
su2double Linear_Solver_Smoother_Relaxation; /*!< \brief Relaxation factor for iterative linear smoothers. */
@@ -5064,7 +5064,7 @@ class CConfig {
50645064
* \brief Flag for whether the local boundary normal is used as the flow direction for an incompressible pressure inlet.
50655065
* \return <code>FALSE</code> means the prescribed flow direction is used.
50665066
*/
5067-
bool GetInc_Inlet_UseNormal(void) const { return Inc_Inlet_UseNormal;}
5067+
bool Get_Inlet_UseNormal(void) const { return Inlet_UseNormal;}
50685068

50695069
/*!
50705070
* \brief Get the type of incompressible outlet from the list.

Common/src/CConfig.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,8 +1383,10 @@ void CConfig::SetConfig_Options() {
13831383
addDoubleOption("INC_TEMPERATURE_INIT", Inc_Temperature_Init, 288.15);
13841384
/*!\brief INC_NONDIM \n DESCRIPTION: Non-dimensionalization scheme for incompressible flows. \ingroup Config*/
13851385
addEnumOption("INC_NONDIM", Ref_Inc_NonDim, NonDim_Map, INITIAL_VALUES);
1386-
/*!\brief INC_INLET_USENORMAL \n DESCRIPTION: Use the local boundary normal for the flow direction with the incompressible pressure inlet. \ingroup Config*/
1387-
addBoolOption("INC_INLET_USENORMAL", Inc_Inlet_UseNormal, false);
1386+
/*!\brief INLET_USENORMAL \n DESCRIPTION: Use the local boundary normal for the flow direction with the (in)compressible pressure inlet. \ingroup Config*/
1387+
addBoolOption("INLET_USENORMAL", Inlet_UseNormal, false);
1388+
/*--- INC_INLET_USENORMAL is deprecated, we now have INLET_USENORMAL ---*/
1389+
addBoolOption("INC_INLET_USENORMAL", Inlet_UseNormal, false);
13881390
/*!\brief INC_INLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the velocity at a pressure inlet in incompressible flow (0.1 by default). \ingroup Config*/
13891391
addDoubleOption("INC_INLET_DAMPING", Inc_Inlet_Damping, 0.1);
13901392
/*!\brief INC_OUTLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the pressure at a mass flow outlet in incompressible flow (0.1 by default). \ingroup Config*/

SU2_CFD/src/solvers/CEulerSolver.cpp

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6954,8 +6954,18 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
69546954
T_Total = Inlet_Ttotal[val_marker][iVertex];
69556955
const su2double* dir = Inlet_FlowDir[val_marker][iVertex];
69566956
const su2double mag = GeometryToolbox::Norm(nDim, dir);
6957-
for (iDim = 0; iDim < nDim; iDim++) {
6958-
Flow_Dir[iDim] = dir[iDim] / mag;
6957+
6958+
6959+
/*--- Store the unit flow direction vector.
6960+
If requested, use the local boundary normal (negative),
6961+
instead of the prescribed flow direction in the config. ---*/
6962+
6963+
if (config->Get_Inlet_UseNormal()) {
6964+
for (iDim = 0; iDim < nDim; iDim++)
6965+
Flow_Dir[iDim] = -Normal[iDim]/Area;
6966+
} else {
6967+
for (iDim = 0; iDim < nDim; iDim++)
6968+
Flow_Dir[iDim] = dir[iDim]/mag;
69596969
}
69606970

69616971
/*--- Non-dim. the inputs if necessary. ---*/
@@ -6985,9 +6995,9 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
69856995
from the domain interior. ---*/
69866996

69876997
Riemann = 2.0*sqrt(SoundSpeed2)/Gamma_Minus_One;
6988-
for (iDim = 0; iDim < nDim; iDim++)
6998+
for (iDim = 0; iDim < nDim; iDim++) {
69896999
Riemann += Velocity[iDim]*UnitNormal[iDim];
6990-
7000+
}
69917001
/*--- Total speed of sound ---*/
69927002

69937003
SoundSpeed_Total2 = Gamma_Minus_One*(H_Total - (Energy + Pressure/Density)+0.5*Velocity2) + SoundSpeed2;
@@ -7070,10 +7080,21 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
70707080
Vel_Mag = Inlet_Ptotal[val_marker][iVertex];
70717081
const su2double* dir = Inlet_FlowDir[val_marker][iVertex];
70727082
const su2double mag = GeometryToolbox::Norm(nDim, dir);
7073-
for (iDim = 0; iDim < nDim; iDim++) {
7074-
Flow_Dir[iDim] = dir[iDim] / mag;
7083+
7084+
7085+
/*--- Store the unit flow direction vector.
7086+
If requested, use the local boundary normal (negative),
7087+
instead of the prescribed flow direction in the config. ---*/
7088+
7089+
if (config->Get_Inlet_UseNormal()) {
7090+
for (iDim = 0; iDim < nDim; iDim++)
7091+
Flow_Dir[iDim] = -Normal[iDim]/Area;
7092+
} else {
7093+
for (iDim = 0; iDim < nDim; iDim++)
7094+
Flow_Dir[iDim] = dir[iDim]/mag;
70757095
}
70767096

7097+
70777098
/*--- Non-dim. the inputs if necessary. ---*/
70787099

70797100
Density /= config->GetDensity_Ref();

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2295,7 +2295,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22952295
If requested, use the local boundary normal (negative),
22962296
instead of the prescribed flow direction in the config. ---*/
22972297

2298-
if (config->GetInc_Inlet_UseNormal()) {
2298+
if (config->Get_Inlet_UseNormal()) {
22992299
for (iDim = 0; iDim < nDim; iDim++)
23002300
UnitFlowDir[iDim] = -Normal[iDim]/Area;
23012301
} else {

config_template.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,10 @@ INC_INLET_TYPE= VELOCITY_INLET
290290
% Damping coefficient for iterative updates at pressure inlets. (0.1 by default)
291291
INC_INLET_DAMPING= 0.1
292292
%
293-
% Impose inlet velocity magnitude in the direction of the normal of the inlet face
293+
% (Deprecated) Impose inlet velocity magnitude in the direction of the normal of the inlet face
294294
INC_INLET_USENORMAL= NO
295+
% Impose inlet velocity magnitude in the direction of the normal of the inlet face
296+
INLET_USENORMAL= NO
295297
%
296298
% List of outlet types for incompressible flows. List length must
297299
% match number of outlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET

0 commit comments

Comments
 (0)