Skip to content

Commit

Permalink
INCINLET_USENORMALS uses normal of inlet boundary for velocity inlets…
Browse files Browse the repository at this point in the history
… in addition to pressure inlets (#1643)

* bugfix for incinlet_usenormals - now also used for velocity inlets
  • Loading branch information
bigfooted authored May 23, 2022
1 parent f15fe75 commit 7a57336
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions SU2_CFD/src/solvers/CIncEulerSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2199,10 +2199,17 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
Flow_Dir = Inlet_FlowDir[val_marker][iVertex];
Flow_Dir_Mag = GeometryToolbox::Norm(nDim, Flow_Dir);

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

for (iDim = 0; iDim < nDim; iDim++)
UnitFlowDir[iDim] = Flow_Dir[iDim]/Flow_Dir_Mag;
if (config->GetInc_Inlet_UseNormal()) {
for (iDim = 0; iDim < nDim; iDim++)
UnitFlowDir[iDim] = -Normal[iDim]/Area;
} else {
for (iDim = 0; iDim < nDim; iDim++)
UnitFlowDir[iDim] = Flow_Dir[iDim]/Flow_Dir_Mag;
}

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

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

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

/*--- If requested, use the local boundary normal (negative),
instead of the prescribed flow direction in the config. ---*/

if (config->GetInc_Inlet_UseNormal()) {
for (iDim = 0; iDim < nDim; iDim++)
UnitFlowDir[iDim] = -Normal[iDim]/Area;
}

/*--- Compute the delta change in velocity in each direction. ---*/

for (iDim = 0; iDim < nDim; iDim++)
Expand Down

0 comments on commit 7a57336

Please sign in to comment.