-
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 13 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 |
---|---|---|
|
@@ -77,6 +77,16 @@ 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()}; | ||
//! Layer Thickness | ||
double layer_thickness_{std::numeric_limits<double>::max()}; | ||
//! P Spring Coefficient | ||
double p_spring_coeff_{std::numeric_limits<double>::max()}; | ||
//! S Spring Coefficient | ||
double s_spring_coeff_{std::numeric_limits<double>::max()}; | ||
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. Remove all these lines as it is not good to store layer thickness in the material. Should be computed at the nodes. |
||
}; // LinearElastic class | ||
} // namespace mpm | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,9 +9,34 @@ 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) { | ||||||||||||||
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
|
||||||||||||||
// 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_); | ||||||||||||||
|
||||||||||||||
// Calculate spring coefficients | ||||||||||||||
layer_thickness_ = | ||||||||||||||
material_properties.at("layer_thickness").template get<double>(); | ||||||||||||||
p_spring_coeff_ = constrained_modulus / layer_thickness_; | ||||||||||||||
s_spring_coeff_ = shear_modulus / layer_thickness_; | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
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
|
||||||||||||||
|
||||||||||||||
kks32 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
properties_ = material_properties; | ||||||||||||||
// Set elastic tensor | ||||||||||||||
this->compute_elastic_tensor(); | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,19 @@ 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; | ||
jmaterial["layer_thickness"] = 10000; | ||
|
||
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); | ||
|
||
REQUIRE(material->template property<double>("layer_thickness") == | ||
Approx(jmaterial["layer_thickness"]).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.