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

Add Absorbing Boundary #692 #703

Closed
wants to merge 7 commits into from
Closed

Conversation

cgeudeker
Copy link
Contributor

@cgeudeker cgeudeker commented Dec 15, 2020

Describe the PR
Adding an absorbing boundary for earthquake simulations.

Related Issues/PRs
Part 2 of #692 (Most of the below information can be found here)

Additional context
Dashpots provide normal and shear traction along boundaries to dissipate the ground motion. Traction values are computed according to the following equations from Lysmer and Kuhlemeyer (1969).

traction

Traction values are included in the governing equation for calculating acceleration. The direction input refers to the normal direction.

bool assign_absorbing_constraint(unsigned dir, double pwave_v, double swave_v);

@codecov
Copy link

codecov bot commented Dec 15, 2020

Codecov Report

Merging #703 (7210c21) into develop (c9630b3) will increase coverage by 12.87%.
The diff coverage is 99.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop     #703       +/-   ##
============================================
+ Coverage    83.91%   96.78%   +12.87%     
============================================
  Files          169      130       -39     
  Lines        34176    25934     -8242     
============================================
- Hits         28676    25098     -3578     
+ Misses        5500      836     -4664     
Impacted Files Coverage Δ
include/node.h 100.00% <ø> (ø)
include/node_base.h 100.00% <ø> (ø)
include/node.tcc 95.99% <96.15%> (ø)
tests/node_test.cc 99.79% <100.00%> (ø)
...cbgeo/project/include/materials/linear_elastic.tcc
.../project/tests/materials/modified_cam_clay_test.cc
/home/cbgeo/project/tests/mesh_test_2d.cc
/home/cbgeo/project/include/io/io_mesh_ascii.tcc
/home/cbgeo/project/tests/nodal_properties_test.cc
/home/cbgeo/project/include/node.tcc
... and 293 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9630b3...7210c21. Read the comment docs.

@jgiven100
Copy link
Collaborator

@kks32 Maybe this would be a good PR to start pushing to a new earthquake branch?

Copy link
Contributor

@kks32 kks32 left a comment

Choose a reason for hiding this comment

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

@cgeudeker Thanks for your first PR. Nice work!

If the boundary nodes are only supported by the Lysmer-Kuhlmeyer dashpots, it would result in creep because of the stresses from the soil body and will continue to deform. I would suggest adding a spring + dashpot to avoid this effect similar to a Kelvin-Voigt type boundary. Thanks for the unit test. However, I suggest a benchmark problem, create a linear elastic solid block supported on just the dashpots on one end and free on the other. At the free surface, apply an instantaneous vertical load and see what happens to the displacements at the dashpot end, you'll notice creep. This issue needs to be fixed to be able to use a good absorbing boundary.

@@ -299,6 +308,10 @@ class Node : public NodeBase<Tdim> {
Eigen::Matrix<double, Tdim, Tnphases> acceleration_;
//! Velocity constraints
std::map<unsigned, double> velocity_constraints_;
//! Absorbing Constraints
std::tuple<unsigned, double, double> absorbing_constraints_;
//! Absorbing Traction
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable is not needed

@@ -201,6 +201,15 @@ class Node : public NodeBase<Tdim> {
//! Apply velocity constraints
void apply_velocity_constraints() override;

//! Assign absorbing constraint
//! \param[in] pwave_v P-wave velocity
Copy link
Contributor

Choose a reason for hiding this comment

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

p-wave and s-wave should be material properties too, not nodal properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, so I've been able to understand and make most of your other suggestions barring this one. How would I be able to access these values from the material properties? I had thought it would be through property_handle_ but I'm currently getting an error about segmentation violation when I run ./mpmtest and it calls the function where I do this. Perhaps this is the right method but I need to initialize the properties somewhere. Thanks for your help

static_cast<unsigned>(dir), static_cast<double>(pwave_v),
static_cast<double>(swave_v));
} else
throw std::runtime_error("Constraint direction is out of bounds");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please be specific on the constraint

@@ -346,6 +350,62 @@ void mpm::Node<Tdim, Tdof, Tnphases>::apply_velocity_constraints() {
}
}

//! Assign absorbing constraints
template <unsigned Tdim, unsigned Tdof, unsigned Tnphases>
bool mpm::Node<Tdim, Tdof, Tnphases>::assign_absorbing_constraint(
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change the function to void

unsigned dir, double pwave_v, double swave_v) {
bool status = true;
try {
if (dir < Tdim) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check this condition as assert


// Calculate Traction Forces
if (dir == dir_n) {
traction = -velocity * mass_density * pwave_v;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest adding a dimensionless damping co-efficient.

// Create Traction Value
double traction;

for (unsigned dir = 0; dir < Tdim; ++dir) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of a for loop create an Eigen::Matrix<double, Tdim, 1> wave_velocity = swave_velocity and set the normal direction to pwave_velocity then use a cwiseProduct to do the multiplication so you don't need a for loop.

Copy link
Contributor

Choose a reason for hiding this comment

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

You probably need absorbing boundaries on all phases

node->apply_absorbing_constraint();

// Define traction variables
double traction_normal;
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to predefine variables

@@ -683,6 +683,93 @@ TEST_CASE("Node is checked for 2D case", "[node][2D]") {
// TODO Assert: REQUIRE_NOTHROW(node->update_external_force(false, 1,
// force_bad));

SECTION("Check absorbing constraint") {
// Set external force to 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use an already existing function, so you don't have to redefine and check all the momenta and forces?

@kks32 kks32 self-assigned this Dec 16, 2020
@ezrayst
Copy link
Contributor

ezrayst commented Dec 16, 2020

Hi @kks32, thanks so much for your thoughtful comments! Really appreciate it. We are making the benchmark as well, but do you have a reference to a problem? I am struggling to make a problem because the answer is not quite analytical. In addition, does it mean you do not want the unit test (I hope you still want it :P). Thanks once again!

@kks32
Copy link
Contributor

kks32 commented Dec 16, 2020

Hi @ezrayst What benchmark problem are you creating? Could you please elaborate.
It would be good to see the results of an elastic bar subjected to an instantaneous load, like you mentioned in #692

I was thinking a linear elastic rectangular block which is 1 m thick and 1 m long supported on dashpots. Apply an instantaneous load and see how the displacement gets damped. You can compare the results against (a) fixed displacement boundary (in this case the stress will get doubled, once the wave reflects), (b) dashpot-alone, I expect this to creep, and (c) spring-dashpot system.

@kks32
Copy link
Contributor

kks32 commented Mar 2, 2021

Closing this PR as #703 supersedes this PR.

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

Successfully merging this pull request may close these issues.

4 participants