7 #ifndef PORE_PRESSURE_COMMUNICATOR_UTILITY_H
8 #define PORE_PRESSURE_COMMUNICATOR_UTILITY_H
23 #include "../../PoromechanicsApplication/poromechanics_application_variables.h"
24 #include "../../DEMApplication/DEM_application_variables.h"
43 delete mpSearchStructure;
55 const int max_results = 10000;
64 for (
int i = 0;
i < (
int)mrDestinationModelPart.
Elements().size();
i++) {
66 property_id = elem_it->GetProperties().Id();
70 const double particle_volume_to_voronoi_volume_factor = 1.0 / (1.0 -
porosity);
73 for (
int i = 0;
i < (
int)mrDestinationModelPart.
Elements().size();
i++) {
75 auto& central_node = elem_it->GetGeometry()[0];
76 const auto& particle_coordinates = central_node.Coordinates();
79 const double particle_mass = particle->
GetMass();
81 bool is_found =
false;
82 Element::Pointer shared_p_element;
83 is_found = mpSearchStructure->FindPointOnMesh(particle_coordinates,
N, shared_p_element, results_begin, max_results, 0.0);
84 double gravity = 9.81;
85 const double well_radius = 0.075;
86 if ((particle_coordinates[0] * particle_coordinates[0] + particle_coordinates[1] * particle_coordinates[1]) < well_radius * well_radius) {
87 noalias(central_node.FastGetSolutionStepValue(EXTERNAL_APPLIED_FORCE)) = -1.0 * particle_coordinates * particle_mass * gravity / well_radius;
88 }
else if (is_found) {
89 const auto& geom = shared_p_element->GetGeometry();
91 for (
size_t j = 0;
j < geom.size();
j++) {
92 noalias(interpolated_gradient_of_pore_pressure) +=
N[
j] * geom[
j].FastGetSolutionStepValue(WATER_PRESSURE_GRADIENT);
94 noalias(central_node.FastGetSolutionStepValue(EXTERNAL_APPLIED_FORCE)) = -1.0 * interpolated_gradient_of_pore_pressure * particle_volume * particle_volume_to_voronoi_volume_factor;
102 virtual std::string
Info()
const {
return "";}
void UpdateSearchDatabase()
Function to construct or update the search database.
Definition: binbased_fast_point_locator.h:139
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
PropertiesType & GetProperties(IndexType PropertiesId, IndexType MeshIndex=0)
Returns the Properties::Pointer corresponding to it's identifier.
Definition: model_part.cpp:710
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
Definition: pore_pressure_communicator_utility.hpp:30
virtual ~PorePressureCommunicatorUtility()
Definition: pore_pressure_communicator_utility.hpp:42
void Initialize()
Definition: pore_pressure_communicator_utility.hpp:46
PorePressureCommunicatorUtility(ModelPart &r_source_model_part, ModelPart &destination_model_part)
Definition: pore_pressure_communicator_utility.hpp:38
virtual void PrintInfo(std::ostream &rOStream) const
Definition: pore_pressure_communicator_utility.hpp:104
virtual void PrintData(std::ostream &rOStream) const
Definition: pore_pressure_communicator_utility.hpp:106
virtual std::string Info() const
Definition: pore_pressure_communicator_utility.hpp:102
void ComputeForceOnParticlesDueToPorePressureGradient()
Definition: pore_pressure_communicator_utility.hpp:51
KRATOS_CLASS_POINTER_DEFINITION(PorePressureCommunicatorUtility)
ModelPart::NodesContainerType::ContainerType::iterator NodesIteratorType
Definition: pore_pressure_communicator_utility.hpp:34
Definition: spheric_particle.h:31
virtual double GetMass()
Definition: spheric_particle.cpp:2209
virtual double CalculateVolume()
Definition: spheric_particle.cpp:2196
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
int j
Definition: quadrature.py:648
N
Definition: sensitivityMatrix.py:29
porosity
Definition: sp_statistics.py:18
integer i
Definition: TensorModule.f:17