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

[GeoMechanicsApplication] Revisit and document test element lab #11975

Merged
merged 28 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e03707f
Cleaned up the project parameters files for the triaxial_comp_6n test
rfaasse Jan 19, 2024
bb992a6
First commit for documentation
rfaasse Jan 19, 2024
1282d14
Removed the redundant fixed xy part
rfaasse Jan 22, 2024
9b86554
Minor formatting change in ProjectParameters.json
rfaasse Jan 22, 2024
4579c4b
Expanded on the test documentation
rfaasse Jan 22, 2024
ffac002
Added the expected results to the test documentation
rfaasse Jan 23, 2024
7aa6106
Removed redundant parameters in test
rfaasse Jan 23, 2024
7e42458
Elaborated README.md and fixed mistake after discussion with Wijtze P…
rfaasse Jan 23, 2024
4cca194
Changed structure to have a white background
rfaasse Jan 23, 2024
7353f1f
Added a README for the first Oedometer lab test and removed redundant…
rfaasse Jan 23, 2024
071202f
Added documentation for the second oedometer test
rfaasse Jan 23, 2024
0615dd7
Made comments in line with actual inputs
rfaasse Jan 23, 2024
027f32d
Fixed typ in test comment
rfaasse Jan 23, 2024
f51a519
Fix part of the codacy issues
rfaasse Jan 23, 2024
0857a67
Processing review comments Wijtze Pieter
rfaasse Jan 23, 2024
04fc944
Update README.md
rfaasse Jan 24, 2024
6708568
Processing feedback from testing/documentation meeting
rfaasse Jan 24, 2024
d7cea71
Processing review comments and extending the schematic views of the t…
rfaasse Jan 24, 2024
5893459
Merge remote-tracking branch 'origin/geo/11969-revisit-and-document-t…
rfaasse Jan 24, 2024
b654310
Changed the number of decimals also in the README.md
rfaasse Jan 24, 2024
d3c06fe
Processing review comments
rfaasse Jan 26, 2024
9e857af
Added water pressure bottom BC, since we're using UPw elements
rfaasse Jan 26, 2024
3c75ec4
Added explanation for the discrepancy between the expected linear ela…
rfaasse Jan 26, 2024
77098e6
Reduced size of minus sign in one of the formulas
rfaasse Jan 26, 2024
c0fd16d
Added asserts for different time steps for the non-linear case.
rfaasse Jan 30, 2024
69ffa3b
Fixed typo
rfaasse Jan 30, 2024
3a5b112
Fix case sensitivity for linux of the test
rfaasse Jan 31, 2024
a0ab82b
Removed redundant model parts from process-sub-model-part list
rfaasse Feb 6, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It also has a general `Update` step, which calls the `UpdateVariablesDerivatives
![SchemeStructure.svg](SchemeStructure.svg)
_Class structure of the schemes generated using the SchemeStructure.puml file with PlantUML. Note that the class diagram is simplified and only shows the functions that need emphasis._

The child classes which actually specify which variables are used in the time integration scheme (e.g. the `BackwardEulerUPwScheme` or the `GeneralizedNewmarkTScheme), only fill the lists of first/second order variables.
The child classes which actually specify which variables are used in the time integration scheme (e.g. the `BackwardEulerUPwScheme` or the `GeneralizedNewmarkTScheme`), only fill the lists of first/second order variables.

The exceptions are the `NewmarkQuasistaticUPwScheme`, which has functionality for nodal smoothing (this should be moved to another location) and the damped and dynamic UPw schemes. More info on these can be found in the [Dynamic and damped schemes](#dynamic-and-damped-schemes) section.

Expand All @@ -38,13 +38,13 @@ The time factors are set in the `SetTimeFactors` function, which sets the coeffi
## Generalized Newmark
A bit more involved are the Generalized Newmark schemes. This includes more parameters to tweak and has a more complex set of equations. The functionality described in this section can be found in the `GeneralizedNewmarkScheme` class. This results in the following three equations for updating the scalar and vector derivatives.

First time derivative for scalar variables in `UpdateScalarTimeDerivative`:
First time derivative for scalar variables in `UpdateScalarTimeDerivative`, known as GN11:
$$\dot{x}\_{t + \Delta t} = \frac{x\_{t + \Delta t} - x\_{t} - (1 - \theta) \Delta t \dot{x}\_{t}}{\theta \Delta t}$$

Second time derivative for vector variables in `UpdateVectorSecondTimeDerivative`:
Second time derivative for vector variables in `UpdateVectorSecondTimeDerivative`, known as GN22:
$$\ddot{x}\_{t + \Delta t} = \frac{x\_{t + \Delta t} - x\_{t} - \Delta t \dot{x}\_{t} - (0.5 - \beta)(\Delta t)^{2}\ddot{x}\_{t}}{\beta(\Delta t)^{2}}$$

First time derivative for vector variables in `UpdateVectorFirstTimeDerivative`:
First time derivative for vector variables in `UpdateVectorFirstTimeDerivative`, known as GN22:
$$\dot{x}\_{t + \Delta t} = \dot{x}\_{t} + (1 - \gamma)\Delta t \ddot{x}\_{t} + \gamma \Delta t \ddot{x}\_{t + \Delta t}$$

Note that the order here is the other reversed with respect to the Backward Euler scheme. This is because $\ddot{x}\_{t + \Delta t}$ is used in the equation for $\dot{x}\_{t + \Delta t}$.
Expand Down
34 changes: 23 additions & 11 deletions applications/GeoMechanicsApplication/tests/test_element_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class KratosGeoMechanicsLabElementTests(KratosUnittest.TestCase):
"""
This class contains some element tests, such as triaxial and oedoemter tests
This class contains some element tests, such as triaxial and oedometer tests
"""

def setUp(self):
Expand All @@ -21,7 +21,7 @@ def test_triaxial_comp_6n(self):
Drained compression triaxial test on Mohr-Coulomb model with axisymmetric 2D6N elements
It consistes of two calculation phases:
1) apply confining stress of -100 kPa
2) apply deviatoric stress of 200 kPa
2) apply deviatoric stress of -200 kPa
"""
test_name = 'triaxial_comp_6n'
project_path = test_helper.get_file_path(os.path.join('test_element_lab', test_name))
Expand Down Expand Up @@ -61,14 +61,12 @@ def test_triaxial_comp_6n(self):

def test_oedometer_ULFEM(self):
"""
Oedometer test on Mohr-Coulomb model with 2D6N elements
rfaasse marked this conversation as resolved.
Show resolved Hide resolved
Oedometer test on a linear elastic model with 2D6N elements
"""
test_name = 'oedometer_ULFEM'
project_path = test_helper.get_file_path(os.path.join('test_element_lab', test_name))
simulation = test_helper.run_kratos(project_path)
effective_stresses = test_helper.get_cauchy_stress_tensor(simulation)
displacements = test_helper.get_displacement(simulation)

effective_stresses_xx = [integration_point[0,0] for element in effective_stresses for integration_point in element]
effective_stresses_yy = [integration_point[1,1] for element in effective_stresses for integration_point in element]
effective_stresses_zz = [integration_point[2,2] for element in effective_stresses for integration_point in element]
Expand All @@ -79,14 +77,28 @@ def test_oedometer_ULFEM(self):
self.assertAlmostEqual(-1000000, effective_stresses_yy[idx], 2)
self.assertAlmostEqual(0.0, effective_stresses_zz[idx], 3)

y_displacements = [displacement[1] for displacement in displacements]
top_node_nbrs = [1]
for top_node_nbr in top_node_nbrs:
self.assertAlmostEqual(-0.0909090909516868, y_displacements[top_node_nbr], 6)
top_node_nbrs = [1, 2]
output_file_path = os.path.join(project_path, test_name+'.post.res')
output_reader = test_helper.GiDOutputFileReader()
output_data = output_reader.read_output_from(output_file_path)
displacements = test_helper.GiDOutputFileReader.nodal_values_at_time("DISPLACEMENT", 0.1, output_data, node_ids=top_node_nbrs)
for displacement in displacements:
y_displacement = displacement[1]
self.assertAlmostEqual(-0.00990099, y_displacement, 6)

displacements = test_helper.GiDOutputFileReader.nodal_values_at_time("DISPLACEMENT", 0.7, output_data, node_ids=top_node_nbrs)
for displacement in displacements:
y_displacement = displacement[1]
self.assertAlmostEqual(-0.0654206, y_displacement, 6)

displacements = test_helper.GiDOutputFileReader.nodal_values_at_time("DISPLACEMENT", 1.0, output_data, node_ids=top_node_nbrs)
for displacement in displacements:
y_displacement = displacement[1]
self.assertAlmostEqual(-0.0909090909516868, y_displacement, 6)

def test_oedometer_ULFEM_diff_order(self):
"""
Oedometer test on Mohr-Coulomb model with 2D6N with different order elements
Oedometer test on a linear elastic model with 2D6N with different order elements
"""
test_name = 'oedometer_ULFEM_diff_order'
project_path = test_helper.get_file_path(os.path.join('test_element_lab', test_name))
Expand All @@ -107,7 +119,7 @@ def test_oedometer_ULFEM_diff_order(self):
y_displacements = [displacement[1] for displacement in displacements]
top_node_nbrs = [1]
for top_node_nbr in top_node_nbrs:
self.assertAlmostEqual(-9.999000099991246e-05, y_displacements[top_node_nbr], 6)
self.assertAlmostEqual(-1e-04, y_displacements[top_node_nbr], 6)

if __name__ == '__main__':
KratosUnittest.main()
Loading
Loading