14 #if !defined(CALCULATE_ADHESION_FORCE_INCLUDED )
15 #define CALCULATE_ADHESION_FORCE_INCLUDED
28 #include <pybind11/pybind11.h>
35 #include "utilities/geometry_utilities.h"
121 double pi = 3.14159265359;
123 double theta, sign_force, theta_rad, cos_t;
128 for(ModelPart::NodesContainerType::iterator
im = ThisModelPart.
NodesBegin() ;
132 if ((
im->FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0)
134 nu0[0] =
im->FastGetSolutionStepValue( NORMAL_TRIPLE_POINT_X);
135 nu0[1] =
im->FastGetSolutionStepValue( NORMAL_TRIPLE_POINT_Y);
137 theta =
im->FastGetSolutionStepValue(CONTACT_ANGLE);
138 theta_rad = (theta)*
pi/180.0;
139 cos_t = cos(theta_rad);
140 cos_t = sqrt(cos_t*cos_t);
141 vel[0] =
im->FastGetSolutionStepValue(VELOCITY_X);
142 vel[1] =
im->FastGetSolutionStepValue(VELOCITY_Y);
143 if (
vel[0] != 0.0 &&
vel[1] != 0.0)
150 n_tp[0] =
im->FastGetSolutionStepValue( NORMAL_TRIPLE_POINT_X);
151 n_tp[1] =
im->FastGetSolutionStepValue( NORMAL_TRIPLE_POINT_Y);
154 im->FastGetSolutionStepValue(ADHESION_FORCE_X) = -sign_force*
gamma*cos_t*(
im->FastGetSolutionStepValue(NODAL_LENGTH))*nu0[0];
155 im->FastGetSolutionStepValue(ADHESION_FORCE_Y) = -sign_force*
gamma*cos_t*(
im->FastGetSolutionStepValue(NODAL_LENGTH))*nu0[1];
156 im->FastGetSolutionStepValue(ADHESION_FORCE_Z) = 0.0;
160 im->FastGetSolutionStepValue(ADHESION_FORCE_X) = 0.0;
161 im->FastGetSolutionStepValue(ADHESION_FORCE_Y) = 0.0;
162 im->FastGetSolutionStepValue(ADHESION_FORCE_Z) = 0.0;
175 void Vector3D(
const double x0,
const double y0,
const double z0,
185 return sqrt(
a[0]*
a[0] +
a[1]*
a[1]);
190 return sqrt(
a[0]*
a[0] +
a[1]*
a[1] +
a[2]*
a[2]);
218 for (
unsigned int i = 0;
i < 3;
i++)
226 return (
a[0]*
b[0] +
a[1]*
b[1]);
229 double fsign(
const double&
a,
const double&
b)
232 if(
c*
c < 0.00000000000000001)
254 std::string
Info()
const override
256 return "CalculateAdhesionForce";
262 rOStream <<
"CalculateAdhesionForce";
380 rOStream << std::endl;
Short class definition.
Definition: calculate_adhesion_force.h:77
std::string Info() const override
Turn back information as a string.
Definition: calculate_adhesion_force.h:254
CalculateAdhesionForce()
Default constructor.
Definition: calculate_adhesion_force.h:91
double DotProduct2D(const array_1d< double, 2 > &a, const array_1d< double, 2 > &b)
Definition: calculate_adhesion_force.h:224
void CalculateAdhesionForce3D(ModelPart &ThisModelPart)
Definition: calculate_adhesion_force.h:116
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_adhesion_force.h:260
void Vector2D(const double x0, const double y0, const double x1, const double y1, array_1d< double, 2 > &r01)
Definition: calculate_adhesion_force.h:169
double SumVecs3D(const array_1d< double, 3 > &a, const array_1d< double, 3 > &b, array_1d< double, 3 > &c)
Definition: calculate_adhesion_force.h:216
KRATOS_CLASS_POINTER_DEFINITION(CalculateAdhesionForce)
Pointer definition of PushStructureProcess.
void Vector3D(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, array_1d< double, 3 > &r01)
Definition: calculate_adhesion_force.h:175
double Norm2D(const array_1d< double, 2 > &a)
Definition: calculate_adhesion_force.h:183
double Norm3D(const array_1d< double, 3 > &a)
Definition: calculate_adhesion_force.h:188
~CalculateAdhesionForce() override
Destructor.
Definition: calculate_adhesion_force.h:96
array_1d< double, 3 > NormalizeVec3D(array_1d< double, 3 > &input)
Definition: calculate_adhesion_force.h:204
array_1d< double, 2 > NormalizeVec2D(array_1d< double, 2 > &input)
Definition: calculate_adhesion_force.h:193
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: calculate_adhesion_force.h:266
double fsign(const double &a, const double &b)
Definition: calculate_adhesion_force.h:229
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
im
Definition: GenerateCN.py:100
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
input
Definition: generate_frictional_mortar_condition.py:435
x1
Definition: generate_frictional_mortar_condition.py:121
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
float gamma
Definition: generate_two_fluid_navier_stokes.py:131
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
vel
Definition: pure_conduction.py:76
integer i
Definition: TensorModule.f:17
double precision, public pi
Definition: TensorModule.f:16