Skip to content

Favre-averaged stress failure on forced reset at restart #529

@spdomin

Description

@spdomin

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...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions