Skip to content

Commit

Permalink
Merge pull request #12798 from KratosMultiphysics/servol_loading_with…
Browse files Browse the repository at this point in the history
…_periodic_boundary

[DEMApplication] [Fast] Servo-control algorithm with periodic boundaries
  • Loading branch information
ChengshunShang1996 authored Oct 30, 2024
2 parents 5289b98 + 1b0b1af commit ebfd53a
Show file tree
Hide file tree
Showing 17 changed files with 515 additions and 28 deletions.
4 changes: 4 additions & 0 deletions applications/DEMApplication/DEM_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ KRATOS_CREATE_VARIABLE(int, ROTATION_OPTION)
KRATOS_CREATE_VARIABLE(int, VIRTUAL_MASS_OPTION)
KRATOS_CREATE_VARIABLE(int, SEARCH_CONTROL)
KRATOS_CREATE_VARIABLE(bool, IS_TIME_TO_PRINT)
KRATOS_CREATE_VARIABLE(bool, IS_TIME_TO_UPDATE_CONTACT_ELEMENT)
KRATOS_CREATE_VARIABLE(double, COORDINATION_NUMBER)
KRATOS_CREATE_VARIABLE(double, CONTINUUM_SEARCH_RADIUS_AMPLIFICATION_FACTOR)
KRATOS_CREATE_VARIABLE(double, MAX_AMPLIFICATION_RATIO_OF_THE_SEARCH_RADIUS)
Expand Down Expand Up @@ -153,6 +154,7 @@ KRATOS_CREATE_VARIABLE(bool, DELTA_OPTION)
KRATOS_CREATE_VARIABLE(double, SKIN_SPHERE)
KRATOS_CREATE_VARIABLE(int, PROPERTIES_ID)
KRATOS_CREATE_VARIABLE(int, CONTACT_MESH_OPTION)
KRATOS_CREATE_VARIABLE(int, BOUNDING_BOX_SERVO_LOADING_OPTION)
KRATOS_CREATE_VARIABLE(double, MAX_NUMBER_OF_INTACT_BONDS_TO_CONSIDER_A_SPHERE_BROKEN)
//KRATOS_CREATE_VARIABLE(int, FAILURE_CRITERION_OPTION)
KRATOS_CREATE_VARIABLE(int, CONCRETE_TEST_OPTION)
Expand Down Expand Up @@ -612,6 +614,7 @@ void KratosDEMApplication::Register() {
KRATOS_REGISTER_VARIABLE(VIRTUAL_MASS_OPTION)
KRATOS_REGISTER_VARIABLE(SEARCH_CONTROL)
KRATOS_REGISTER_VARIABLE(IS_TIME_TO_PRINT)
KRATOS_REGISTER_VARIABLE(IS_TIME_TO_UPDATE_CONTACT_ELEMENT)
KRATOS_REGISTER_VARIABLE(COORDINATION_NUMBER)
KRATOS_REGISTER_VARIABLE(CONTINUUM_SEARCH_RADIUS_AMPLIFICATION_FACTOR)
KRATOS_REGISTER_VARIABLE(MAX_AMPLIFICATION_RATIO_OF_THE_SEARCH_RADIUS)
Expand Down Expand Up @@ -660,6 +663,7 @@ void KratosDEMApplication::Register() {
KRATOS_REGISTER_VARIABLE(SKIN_SPHERE)
KRATOS_REGISTER_VARIABLE(PROPERTIES_ID)
KRATOS_REGISTER_VARIABLE(CONTACT_MESH_OPTION)
KRATOS_REGISTER_VARIABLE(BOUNDING_BOX_SERVO_LOADING_OPTION)
KRATOS_REGISTER_VARIABLE(MAX_NUMBER_OF_INTACT_BONDS_TO_CONSIDER_A_SPHERE_BROKEN)
//KRATOS_REGISTER_VARIABLE(FAILURE_CRITERION_OPTION)
KRATOS_REGISTER_VARIABLE(CONCRETE_TEST_OPTION)
Expand Down
2 changes: 2 additions & 0 deletions applications/DEMApplication/DEM_application_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ namespace Kratos
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, VIRTUAL_MASS_OPTION)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, SEARCH_CONTROL)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, bool, IS_TIME_TO_PRINT)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, bool, IS_TIME_TO_UPDATE_CONTACT_ELEMENT)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, COORDINATION_NUMBER)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, CONTINUUM_SEARCH_RADIUS_AMPLIFICATION_FACTOR)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, MAX_AMPLIFICATION_RATIO_OF_THE_SEARCH_RADIUS)
Expand Down Expand Up @@ -125,6 +126,7 @@ namespace Kratos

KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, PROPERTIES_ID)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, CONTACT_MESH_OPTION)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, BOUNDING_BOX_SERVO_LOADING_OPTION)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, MAX_NUMBER_OF_INTACT_BONDS_TO_CONSIDER_A_SPHERE_BROKEN)
//KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, FAILURE_CRITERION_OPTION)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, CONCRETE_TEST_OPTION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,11 @@ void SphericParticle::ComputeBallToBallContactForceAndMoment(SphericParticle::Pa
if ((i < (int)mNeighbourElements.size()) && this->Id() < neighbour_iterator_id) {
CalculateOnContactElements(i, LocalContactForce, GlobalContactForce);
}
} else if (r_process_info[IS_TIME_TO_UPDATE_CONTACT_ELEMENT] && r_process_info[CONTACT_MESH_OPTION] == 1) {
unsigned int neighbour_iterator_id = data_buffer.mpOtherParticle->Id();
if ((i < (int)mNeighbourElements.size()) && this->Id() < neighbour_iterator_id) {
CalculateOnContactElements(i, LocalContactForce, GlobalContactForce);
}
}

if (r_process_info[ENERGY_CALCULATION_OPTION]){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ PYBIND11_MODULE(KratosDEMApplication,m)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, AUTOMATIC_SKIN_COMPUTATION)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, SKIN_FACTOR_RADIUS)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, IS_TIME_TO_PRINT)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, IS_TIME_TO_UPDATE_CONTACT_ELEMENT)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, COORDINATION_NUMBER)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, CONTINUUM_SEARCH_RADIUS_AMPLIFICATION_FACTOR)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, MAX_AMPLIFICATION_RATIO_OF_THE_SEARCH_RADIUS)
Expand Down Expand Up @@ -125,6 +126,7 @@ PYBIND11_MODULE(KratosDEMApplication,m)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, COHESIVE_GROUP)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, PROPERTIES_ID)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, CONTACT_MESH_OPTION)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, BOUNDING_BOX_SERVO_LOADING_OPTION)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, MAX_NUMBER_OF_INTACT_BONDS_TO_CONSIDER_A_SPHERE_BROKEN)
//KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, FAILURE_CRITERION_OPTION)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, CONCRETE_TEST_OPTION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ namespace Kratos {
if (is_time_to_print_results && r_process_info[CONTACT_MESH_OPTION] == 1) {
CreateContactElements();
InitializeContactElements();
}else if (r_process_info[IS_TIME_TO_UPDATE_CONTACT_ELEMENT] && r_process_info[CONTACT_MESH_OPTION] == 1) {
CreateContactElements();
InitializeContactElements();
}

//RebuildPropertiesProxyPointers(mListOfSphericParticles);
Expand Down
Loading

0 comments on commit ebfd53a

Please sign in to comment.