Skip to content

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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Density update #186

wants to merge 31 commits into from

Conversation

streeve
Copy link
Collaborator

@streeve streeve commented Feb 5, 2025

Blocked by #142, and #200

Adds a density update using plastic strain

@streeve streeve requested a review from pabloseleson February 5, 2025 14:57
@streeve streeve self-assigned this Feb 5, 2025
@streeve streeve mentioned this pull request Feb 27, 2025
5 tasks
Kokkos::parallel_reduce( policy, neigh_max, local_max_neighbors );
Kokkos::fence();
return local_max_neighbors;
neighbor.iterate( exec_space{}, weighted_volume, particles,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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 );
Copy link
Collaborator

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.

Copy link
Collaborator Author

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 )
Copy link
Collaborator

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?

Copy link
Collaborator Author

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,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>
Copy link
Collaborator

@pabloseleson pabloseleson Apr 10, 2025

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?

Copy link
Collaborator Author

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 );
Copy link
Collaborator

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?

Copy link
Collaborator Author

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();
Copy link
Collaborator

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.

Copy link
Collaborator Author

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 ) );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where "forceCoeff" written?

Copy link
Collaborator Author

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 ) );
Copy link
Collaborator

@pabloseleson pabloseleson Apr 10, 2025

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.

Copy link
Collaborator Author

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

const double xi, const double vol,
const double ) const
{
return coeff * s * xi * vol;
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

{
// 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)
Copy link
Collaborator

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)?

Copy link
Collaborator Author

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

{
// Update density using plastic dilatation.
// Note that this assumes zero initial plastic dilatation.
rho_current( i ) = Kokkos::min( rho( i ) * Kokkos::exp( theta_i ),
Copy link
Collaborator

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.

KOKKOS_INLINE_FUNCTION
auto currentC( const int i ) const
{
// Initial relative density for relative density factor (HARDCODED)
Copy link
Collaborator

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"];
Copy link
Collaborator

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.

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

Successfully merging this pull request may close these issues.

2 participants