-
Notifications
You must be signed in to change notification settings - Fork 85
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
Changes from 18 commits
32fdba3
2360285
10c6415
cee7b4e
04e38ef
7e7ebfc
7210c21
e1a3c2e
917cdbc
59bcff1
d1e42ef
dbf0023
3b431c3
b392949
1187ad0
de75919
8f98064
2c44bee
30ef52e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,10 +9,22 @@ 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_)); | ||||||||||
|
||||||||||
// 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_); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
properties_ = material_properties; | ||||||||||
|
||||||||||
kks32 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
// Set elastic tensor | ||||||||||
this->compute_elastic_tensor(); | ||||||||||
} catch (Json::exception& except) { | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -71,8 +71,6 @@ TEST_CASE("LinearElastic is checked in 2D", "[material][linear_elastic][2D]") { | |||||
Approx(jmaterial["density"]).epsilon(Tolerance)); | ||||||
REQUIRE(material->template property<double>("youngs_modulus") == | ||||||
Approx(jmaterial["youngs_modulus"]).epsilon(Tolerance)); | ||||||
REQUIRE(material->template property<double>("poisson_ratio") == | ||||||
Approx(jmaterial["poisson_ratio"]).epsilon(Tolerance)); | ||||||
|
||||||
// Check if state variable is initialised | ||||||
SECTION("State variable is initialised") { | ||||||
|
@@ -147,6 +145,22 @@ 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["p_wave_velocity"] = 116.023870223; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an incorrect text, you can't pass the values of p_wave and s_wave velocity and check if that's correct. |
||||||
jmaterial["s_wave_velocity"] = 62.0173672946; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
auto material = | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||||||
|
||||||
// Get P-Wave and S-Wave Velocities | ||||||
REQUIRE(material->template property<double>("p_wave_velocity") == | ||||||
Approx(jmaterial["p_wave_velocity"]).epsilon(Tolerance)); | ||||||
REQUIRE(material->template property<double>("s_wave_velocity") == | ||||||
Approx(jmaterial["s_wave_velocity"]).epsilon(Tolerance)); | ||||||
} | ||||||
} | ||||||
|
||||||
//! Check linearelastic class in 3D | ||||||
|
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.