-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
Description
Favre stress on forced reset at a restart is polluted with nans due to a divide by zero:
const double rhoAOld = (currentTimeFilter_*rhoAk - rhok*dt)/oldTimeFilter;
double uiAOld = (currentTimeFilter_*rhoAk*uiA - rhok*ui*dt)/oldTimeFilter/rhoAOld;
Above, rhoAOld is zero due to the fact that the current filter and time step are the same. Moreover, a forced reset would note that rhoAk and rhok are the same value:
const double rhok = rho[k];
const double rhoAk = rhoA[k];
with
const std::string densityAName = "density_ra_" + averageBlockName;
stk::mesh::FieldBase *density = metaData.get_field(stk::topology::NODE_RANK, "density");
stk::mesh::FieldBase *densityA = metaData.get_field(stk::topology::NODE_RANK, densityAName);
const double *rho = (double*)stk::mesh::field_data(*density, b);
const double *rhoA = (double*)stk::mesh::field_data(*densityA, b);
It is not clear to me why an initial run is sane...