Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
spdomin opened this issue Feb 25, 2021 · 1 comment
Open

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

spdomin opened this issue Feb 25, 2021 · 1 comment
Assignees
Labels

Comments

@spdomin
Copy link
Contributor

spdomin commented Feb 25, 2021

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

@spdomin spdomin added the bug label Feb 25, 2021
@spdomin spdomin self-assigned this Feb 25, 2021
@spdomin
Copy link
Contributor Author

spdomin commented Feb 25, 2021

A clue:

 // avoid computing stresses when when oldTimeFilter is not zero
 // this will occur only on a first time step of a new simulation
 if (oldTimeFilter > 0.0 ) {
    if ( avInfo->computeFavreStress_ ) {
        compute_favre_stress(avInfo->name_, oldTimeFilter, zeroCurrent, dt, s_all_nodes);
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant