14 #if !defined(CALCULATE_CONTACT_ANGLE_INCLUDED )
15 #define CALCULATE_CONTACT_ANGLE_INCLUDED
28 #include <pybind11/pybind11.h>
35 #include "utilities/geometry_utilities.h"
118 double pi = 3.14159265359;
126 for(ModelPart::NodesContainerType::iterator
im = ThisModelPart.
NodesBegin() ;
130 if ((
im->FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0)
141 for (
unsigned int i = 0;
i < neighb.
size();
i++)
143 if (neighb[
i].FastGetSolutionStepValue(IS_BOUNDARY) != 0.0)
146 if (neighnum < 1
e-15)
171 double norm10 = sqrt(r10[0]*r10[0] + r10[1]*r10[1]);
172 double norm20 = sqrt(r20[0]*r20[0] + r20[1]*r20[1]);
174 double costheta = (r10[0]*r20[0] + r10[1]*r20[1])/(norm10*norm20);
175 theta = acos(costheta)*180.0/
pi;
176 im->FastGetSolutionStepValue(CONTACT_ANGLE) = theta;
184 im->FastGetSolutionStepValue(CONTACT_ANGLE) = 0.0;
239 double pi = 3.14159265359;
240 double theta_eq = ThisModelPart.
GetProcessInfo()[CONTACT_ANGLE_STATIC];
241 double theta_rad = theta_eq*
pi/180.0;
243 for(ModelPart::NodesContainerType::iterator
im = ThisModelPart.
NodesBegin() ;
im != ThisModelPart.
NodesEnd() ;
im++)
245 if (
im->FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
258 double xj, yj, zj, xk, yk, zk;
259 xj = yj = zj = xk = yk = zk = 0.0;
268 normal_geom =
im->FastGetSolutionStepValue(NORMAL_GEOMETRIC);
269 double dot_prod = 0.0;
271 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE) =
ZeroVector(3);
276 int neighnum_caf = 0;
278 double num_faces = 0.0;
281 for (
unsigned int i = 0;
i < neighb_faces.
size();
i++)
286 for (
unsigned int k = 0;
k < neighb_faces[
i].GetGeometry().size();
k++)
288 neighnum_tp += neighb_faces[
i].GetGeometry()[
k].FastGetSolutionStepValue(TRIPLE_POINT);
289 neighnum_caf += neighb_faces[
i].GetGeometry()[
k].FastGetSolutionStepValue(IS_FREE_SURFACE);
294 if (neighnum_caf == 2)
297 for (
unsigned int j = 0;
j < neighb_faces[
i].GetGeometry().size() ;
j++)
299 if (neighb_faces[
i].GetGeometry()[
j].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
304 xj = neighb_faces[
i].GetGeometry()[
j].X();
305 yj = neighb_faces[
i].GetGeometry()[
j].Y();
306 zj = neighb_faces[
i].GetGeometry()[
j].Z();
311 xk = neighb_faces[
i].GetGeometry()[
j].X();
312 yk = neighb_faces[
i].GetGeometry()[
j].Y();
313 zk = neighb_faces[
i].GetGeometry()[
j].Z();
321 if (neighnum_caf == 1)
323 for (
unsigned int j = 0;
j < neighb_faces[
i].GetGeometry().size() ;
j++)
325 if (neighb_faces[
i].GetGeometry()[
j].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
327 xj = neighb_faces[
i].GetGeometry()[
j].X();
328 yj = neighb_faces[
i].GetGeometry()[
j].Y();
329 zj = neighb_faces[
i].GetGeometry()[
j].Z();
331 if (neighb_faces[
i].GetGeometry()[
j].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0 && neighb_faces[
i].GetGeometry()[
j].Id() !=
im->Id())
333 xk = neighb_faces[
i].GetGeometry()[
j].X();
334 yk = neighb_faces[
i].GetGeometry()[
j].Y();
335 zk = neighb_faces[
i].GetGeometry()[
j].Z();
348 normal_tp[0] += cross_prod_ijk[0];
349 normal_tp[1] += cross_prod_ijk[1];
350 normal_tp[2] += cross_prod_ijk[2];
353 theta = acos(cross_prod_ijk[2])*180.0/
pi;
354 im->FastGetSolutionStepValue(CONTACT_ANGLE) += theta;
357 if (neighnum_caf == 1)
358 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE) += rij;
359 if (neighnum_caf == 2)
360 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE) += 0.5*(rij+rik);
364 im->FastGetSolutionStepValue(NORMAL_TRIPLE_POINT_X) = normal_tp[0];
365 im->FastGetSolutionStepValue(NORMAL_TRIPLE_POINT_Y) = normal_tp[1];
366 im->FastGetSolutionStepValue(NORMAL_TRIPLE_POINT_Z) = normal_tp[2];
368 aux[0] = normal_tp[0];
369 aux[1] = normal_tp[1];
372 temp =
im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE);
374 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_X) = cos(asin(
temp[2]))*aux[0];
375 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_Y) = cos(asin(
temp[2]))*aux[1];
378 if (num_faces != 0.0)
379 im->FastGetSolutionStepValue(CONTACT_ANGLE) /= num_faces;
381 if((
im->FastGetSolutionStepValue(CONTACT_ANGLE)) < 90.0)
383 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_X) *= -1.0;
384 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_Y) *= -1.0;
401 void Vector3D(
const double x0,
const double y0,
const double z0,
411 return sqrt(
a[0]*
a[0] +
a[1]*
a[1]);
416 return sqrt(
a[0]*
a[0] +
a[1]*
a[1] +
a[2]*
a[2]);
421 return (
a[0]*
b[0] +
a[1]*
b[1]);
426 return (
a[0]*
b[0] +
a[1]*
b[1] +
a[2]*
b[2]);
431 c[0] =
a[1]*
b[2] -
a[2]*
b[1];
432 c[1] =
a[2]*
b[0] -
a[0]*
b[2];
433 c[2] =
a[0]*
b[1] -
a[1]*
b[0];
569 rOStream << std::endl;
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
size_type size() const
Definition: global_pointers_vector.h:307
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
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: process.h:204
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: process.h:210
#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
x2
Definition: generate_frictional_mortar_condition.py:122
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
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
integer i
Definition: TensorModule.f:17
double precision, public pi
Definition: TensorModule.f:16
e
Definition: run_cpp_mpi_tests.py:31