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 shear and compression wave velocities to Linear Elastic Material Properties for #692 #705

Merged
merged 19 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/materials/linear_elastic.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class LinearElastic : public Material<Tdim> {
double poisson_ratio_{std::numeric_limits<double>::max()};
//! Bulk modulus
double bulk_modulus_{std::numeric_limits<double>::max()};
//! S-Wave Velocity
double s_wave_velocity_{std::numeric_limits<double>::max()};
//! P-Wave Velocity
double p_wave_velocity_{std::numeric_limits<double>::max()};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! S-Wave Velocity
double s_wave_velocity_{std::numeric_limits<double>::max()};
//! P-Wave Velocity
double p_wave_velocity_{std::numeric_limits<double>::max()};
//! Compressional Wave Velocity
double vp_{std::numeric_limits<double>::max()};
//! Shear wave Velocity
double vs_{std::numeric_limits<double>::max()};

}; // LinearElastic class
} // namespace mpm

Expand Down
19 changes: 19 additions & 0 deletions include/materials/linear_elastic.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,28 @@ mpm::LinearElastic<Tdim>::LinearElastic(unsigned id,
material_properties.at("youngs_modulus").template get<double>();
poisson_ratio_ =
material_properties.at("poisson_ratio").template get<double>();

// Calculate bulk modulus
bulk_modulus_ = youngs_modulus_ / (3.0 * (1. - 2. * poisson_ratio_));

// Special material properties
if (material_properties.contains("earthquake")) {
bool earthquake =
material_properties.at("earthquake").template get<bool>();

if (earthquake) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Special material properties
if (material_properties.contains("earthquake")) {
bool earthquake =
material_properties.at("earthquake").template get<bool>();
if (earthquake) {

// Calculate constrained and shear modulus
double constrained_modulus =
youngs_modulus_ * (1. - poisson_ratio_) /
((1. + poisson_ratio_) * (1. - 2. * poisson_ratio_));
double shear_modulus = youngs_modulus_ / (2.0 * (1. + poisson_ratio_));

// Calculate wave velocities
p_wave_velocity_ = sqrt(constrained_modulus / density_);
s_wave_velocity_ = sqrt(shear_modulus / density_);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}


properties_ = material_properties;
// Set elastic tensor
this->compute_elastic_tensor();
Expand Down
9 changes: 9 additions & 0 deletions tests/materials/linear_elastic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ TEST_CASE("LinearElastic is checked in 2D", "[material][linear_elastic][2D]") {
REQUIRE(stress(4) == Approx(0.00000000000000e+00).epsilon(Tolerance));
REQUIRE(stress(5) == Approx(0.00000000000000e+00).epsilon(Tolerance));
}

SECTION("LinearElastic check properties earthquake") {
unsigned id = 0;
jmaterial["earthquake"] = true;

auto material =
Copy link
Contributor

Choose a reason for hiding this comment

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

Check in 3D too

Factory<mpm::Material<Dim>, unsigned, const Json&>::instance()->create(
"LinearElastic2D", std::move(id), jmaterial);
}
}

//! Check linearelastic class in 3D
Expand Down