Skip to content

Commit 7a57336

Browse files
authored
INCINLET_USENORMALS uses normal of inlet boundary for velocity inlets in addition to pressure inlets (#1643)
* bugfix for incinlet_usenormals - now also used for velocity inlets
1 parent f15fe75 commit 7a57336

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,10 +2199,17 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
21992199
Flow_Dir = Inlet_FlowDir[val_marker][iVertex];
22002200
Flow_Dir_Mag = GeometryToolbox::Norm(nDim, Flow_Dir);
22012201

2202-
/*--- Store the unit flow direction vector. ---*/
2202+
/*--- Store the unit flow direction vector.
2203+
If requested, use the local boundary normal (negative),
2204+
instead of the prescribed flow direction in the config. ---*/
22032205

2204-
for (iDim = 0; iDim < nDim; iDim++)
2205-
UnitFlowDir[iDim] = Flow_Dir[iDim]/Flow_Dir_Mag;
2206+
if (config->GetInc_Inlet_UseNormal()) {
2207+
for (iDim = 0; iDim < nDim; iDim++)
2208+
UnitFlowDir[iDim] = -Normal[iDim]/Area;
2209+
} else {
2210+
for (iDim = 0; iDim < nDim; iDim++)
2211+
UnitFlowDir[iDim] = Flow_Dir[iDim]/Flow_Dir_Mag;
2212+
}
22062213

22072214
/*--- Retrieve solution at this boundary node. ---*/
22082215

@@ -2278,14 +2285,6 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
22782285

22792286
Vel_Mag = sqrt((P_total - P_domain)/(0.5*nodes->GetDensity(iPoint)));
22802287

2281-
/*--- If requested, use the local boundary normal (negative),
2282-
instead of the prescribed flow direction in the config. ---*/
2283-
2284-
if (config->GetInc_Inlet_UseNormal()) {
2285-
for (iDim = 0; iDim < nDim; iDim++)
2286-
UnitFlowDir[iDim] = -Normal[iDim]/Area;
2287-
}
2288-
22892288
/*--- Compute the delta change in velocity in each direction. ---*/
22902289

22912290
for (iDim = 0; iDim < nDim; iDim++)

0 commit comments

Comments
 (0)