Add local timestep + CFL as volume output by j-signorelli · Pull Request #2060 · su2code/SU2

Oh interesting, just to be fully complete here's what made me think that:

1.I have a well-converged steady-state solution and outputted the minimum DT's for each cell when running with a CFL=1.0, no adaptive. I was unable to restart this for an unsteady one with no changes in BCs without using a DT orders-of-magnitude smaller.

  1. When I run /Tutorials/compressible_flow/Turbulent_OneraM6 with MIN_DELTA_TIME set as a screen output, I get orders-of-magnitude different final timestep when I run with REF_DIMENSIONALIZATION= DIMENSIONAL instead of FREESTREAM_VEL_EQ_ONE.

  2. When I run SU2_CFD -d on the /Tutorials/compressible_flow/Unsteady_NACA0012 example using FREESTREAM_VEL_EQ_ONE I see the attached image below, which appears to nondimensionalize using length/velocity.

Unsteady_NACA0012_SU2CFDd

  1. I also looked briefly at the code it appeared that the calculations were using nondimensional values; here's what I looked at:

Setting of local timestep:

if (Vol != 0.0) {
su2double Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint);
if(viscous) {
su2double dt_visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol / nodes->GetMax_Lambda_Visc(iPoint);
Local_Delta_Time = min(Local_Delta_Time, dt_visc);
}
minDt = min(minDt, Local_Delta_Time);
maxDt = max(maxDt, Local_Delta_Time);
nodes->SetDelta_Time(iPoint, min(Local_Delta_Time, config->GetMax_DeltaTime()));
}
else {
nodes->SetDelta_Time(iPoint,0.0);
}
}

Calculation of Lambda's:

auto jPoint = geometry->nodes->GetPoint(iPoint,iNeigh);
auto iEdge = geometry->nodes->GetEdge(iPoint,iNeigh);
auto Normal = geometry->edges->GetNormal(iEdge);
auto Area2 = GeometryToolbox::SquaredNorm(nDim, Normal);
/*--- Mean Values ---*/
su2double Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal));
su2double Mean_SoundSpeed = soundSpeed(*nodes, iPoint, jPoint) * sqrt(Area2);
/*--- Adjustment for grid movement ---*/
if (dynamic_grid) {
const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint);
const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint);
for (unsigned short iDim = 0; iDim < nDim; iDim++)
Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim];
}
/*--- Inviscid contribution ---*/
su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed;
nodes->AddMax_Lambda_Inv(iPoint,Lambda);
/*--- Viscous contribution ---*/
if (!viscous) continue;
Lambda = lambdaVisc(*nodes, iPoint, jPoint) * Area2;
nodes->AddMax_Lambda_Visc(iPoint, Lambda);

GetProjVel:

/*!
* \brief Get the projected velocity in a unitary vector direction (compressible solver).
* \param[in] val_vector - Direction of projection.
* \return Value of the projected velocity.
*/
inline su2double GetProjVel(unsigned long iPoint, const su2double *val_vector) const final {
su2double ProjVel = 0.0;
for (unsigned long iDim = 0; iDim < nDim; iDim++)
ProjVel += Primitive(iPoint,iDim+indices.Velocity())*val_vector[iDim];
return ProjVel;
}

Then at this point admittedly I just assumed that the MatrixType Primitive of CEulerVariable was indeed nondimensional. I am not familiar with where/when data is stored/updated throughout SU2 as nondimensional v dimensional.