-
Notifications
You must be signed in to change notification settings - Fork 14
Density update #186
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
base: main
Are you sure you want to change the base?
Density update #186
Conversation
stores list, handles iteration, and broken bonds
Kokkos::parallel_reduce( policy, neigh_max, local_max_neighbors ); | ||
Kokkos::fence(); | ||
return local_max_neighbors; | ||
neighbor.iterate( exec_space{}, weighted_volume, particles, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "neighbor.iterate" do? What is the difference with iterateLinear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the neighbor PR (200)
, fracture_type( force.getBrokenBonds() ) | ||
HeatTransfer( const model_type model ) | ||
: base_type( typename base_type::model_type( | ||
PMB{}, NoFracture{}, model.delta, model.K, model.temperature, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed to use "NoFracture" for HeatTransfer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no longer be necessary
public: | ||
using list_type = | ||
Cabana::VerletList<MemorySpace, Cabana::FullNeighborTag, | ||
Cabana::VerletLayout2D, Cabana::TeamOpTag>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it mean VerletLayout2D for a 3D code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not refer to spatial dimension, but to the layout of the neighbor list itself
const std::string label ) const | ||
{ | ||
auto policy = makePolicy<ExecSpace>( particles ); | ||
Kokkos::parallel_for( label, policy, functor ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between parallel_for and neighbor_parallel_for?
I assume this would explain the difference between iterate and iterateLinear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct
auto list() const { return _neigh_list; } | ||
|
||
template <typename ParticleType> | ||
void update( ParticleType& particles, const double cutoff ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this update function for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebuild neighbors
|
||
// Only rebuild neighbor list as needed. | ||
template <class ParticleType> | ||
void update( const ParticleType& particles, const double search_radius, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this update function for contact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
{ | ||
} | ||
|
||
template <class ParticleType, class ParallelType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where was all this deleted part moved to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Dilatation class
{ | ||
fracture_type::prenotch( exec_space, particles, prenotch, _neigh_list ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where was all this deleted part moved to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate - The new Dilatation class
auto model = _model; | ||
const auto vol = particles.sliceVolume(); | ||
const auto nofail = particles.sliceNoFail(); | ||
auto theta = particles.sliceDilatation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we incorporate dilatation here for the densification model. Please note that the dilatation for densification should be the "plastic dilatation", i.e, the dilatation computed with the plastic stretch not the elastic stretch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is what's computed for the PMB. For the LPS we will need to consider this
// Else if statement is only for performance. | ||
else if ( mu( i, n ) > 0 ) | ||
{ | ||
const double coeff = model.forceCoeff( i, n, s, vol( j ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where "forceCoeff" written?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the models
|
||
model.thermalStretch( s, i, j ); | ||
|
||
model.updateDensity( i, theta( i ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we update density here inside the force? The density is not needed for the force calculation.
BTW, I didn't see this density update for the NoFracture case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we need to update density? There's no reason to do it in a separate loop
src/force_models/CabanaPD_PMB.hpp
Outdated
const double xi, const double vol, | ||
const double ) const | ||
{ | ||
return coeff * s * xi * vol; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this use the plastic stretch? I believe that should be s_p.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you're referring to the variable name - up to you
src/force_models/CabanaPD_PMB.hpp
Outdated
{ | ||
// Update density using plastic dilatation. | ||
// Note that this assumes zero initial plastic dilatation. | ||
rho( i ) = rho0 * Kokkos::exp( theta_i ); // exp(theta_i - theta_i_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this use the plastic dilatation (as opposed the elastic dilatation)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, the variable passed here is plastic, but maybe the variable name is what's confusing
src/force_models/CabanaPD_PMB.hpp
Outdated
{ | ||
// Update density using plastic dilatation. | ||
// Note that this assumes zero initial plastic dilatation. | ||
rho_current( i ) = Kokkos::min( rho( i ) * Kokkos::exp( theta_i ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried changing this to "rho_current( i ) = 10.0;" and I do not see that being output. So, I believe the reference density is output instead both for reference and current density.
… BC is not important
KOKKOS_INLINE_FUNCTION | ||
auto currentC( const int i ) const | ||
{ | ||
// Initial relative density for relative density factor (HARDCODED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we may consider inputing the initial relative density from the JSON file, I noticed an issue if the actual initial relative density equals D0
|
||
// Impose separate density values for powder and container particles. | ||
double W = inputs["wall_thickness"]; | ||
double D0 = inputs["powder_initial_relative_density"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I call this D0, but it may not be the same as the D0 used in the PMB model for initial relative density due to the issue described there.
Blocked by #142, and #200
Adds a density update using plastic strain