16 #if !defined(KRATOS_SURFACE_TENSION_H_INCLUDED)
17 #define KRATOS_SURFACE_TENSION_H_INCLUDED
37 #include <pybind11/pybind11.h>
52 #include "utilities/geometry_utilities.h"
88 template<
unsigned int TDim,
89 unsigned int TNumNodes = TDim + 1 >
173 Element(NewId, pGeometry, pProperties)
199 PropertiesType::Pointer pProperties)
const override
202 return Kratos::make_shared< SurfaceTension<TDim, TNumNodes> >(NewId,
GetGeometry().
Create(ThisNodes), pProperties);
208 GeometryType::Pointer pGeom,
209 PropertiesType::Pointer pProperties)
const override
211 return Kratos::make_shared< SurfaceTension<TDim, TNumNodes> >(NewId, pGeom, pProperties);
228 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
231 if (rLeftHandSideMatrix.size1() != LocalSize)
232 rLeftHandSideMatrix.
resize(LocalSize, LocalSize,
false);
248 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
250 if (rLeftHandSideMatrix.size1() != LocalSize)
251 rLeftHandSideMatrix.
resize(LocalSize, LocalSize,
false);
269 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
272 if (rRightHandSideVector.size() != LocalSize)
273 rRightHandSideVector.
resize(LocalSize,
false);
291 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
300 double TauOne, TauTwo;
301 this->
CalculateTau(TauOne,TauTwo,AdvVel,ElemSize,Density,Viscosity,rCurrentProcessInfo);
303 this->
AddProjectionToRHS(rRightHandSideVector, AdvVel, Density, TauOne, TauTwo,
N, DN_DX, Area,rCurrentProcessInfo[DELTA_TIME]);
317 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
320 if (rMassMatrix.size1() != LocalSize)
321 rMassMatrix.
resize(LocalSize, LocalSize,
false);
323 rMassMatrix =
ZeroMatrix(LocalSize, LocalSize);
336 double Coeff = Density * Area / TNumNodes;
343 if (rCurrentProcessInfo[OSS_SWITCH] != 1)
353 double TauOne, TauTwo;
354 this->
CalculateTau(TauOne,TauTwo,AdvVel,ElemSize,Density,Viscosity,rCurrentProcessInfo);
374 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
378 if (rDampingMatrix.size1() != LocalSize)
379 rDampingMatrix.
resize(LocalSize, LocalSize,
false);
401 double TauOne, TauTwo;
402 this->
CalculateTau(TauOne,TauTwo,AdvVel,ElemSize,Density,Viscosity,rCurrentProcessInfo);
410 if constexpr (TDim < 3)
416 int node_indx_wrong = 5;
417 for(
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
419 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(MEAN_CURVATURE_2D) != 0.0)
421 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(IS_BOUNDARY) < 0.1)
422 node_indx_wrong = iNode;
424 if(
k > 2 && node_indx_wrong != 5)
426 this->
GetGeometry()[node_indx_wrong].FastGetSolutionStepValue(MEAN_CURVATURE_2D) = 0.0;
429 for(
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
431 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0 || this->
GetGeometry()[iNode].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
433 node_indx[
k] = iNode;
447 int node_indx_wrong = 5;
448 for(
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
450 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(MEAN_CURVATURE_3D) != 0.0)
452 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(IS_BOUNDARY) < 0.1)
453 node_indx_wrong = iNode;
455 if(
k > 2 && node_indx_wrong != 5)
457 this->
GetGeometry()[node_indx_wrong].FastGetSolutionStepValue(MEAN_CURVATURE_3D) = 0.0;
460 for(
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
462 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(IS_FREE_SURFACE) > 0.999 || this->
GetGeometry()[iNode].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
464 node_indx[
k] = iNode;
475 for(
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
477 if(this->
GetGeometry()[iNode].FastGetSolutionStepValue(IS_WATER) == 0.0)
482 if constexpr (TDim < 3 && k > 2)
489 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
492 for (
unsigned int d = 0;
d < TDim; ++
d)
494 U[LocalIndex] = rVel[
d];
497 U[LocalIndex] = this->
GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE);
501 noalias(rRightHandSideVector) -=
prod(rDampingMatrix, U);
525 if (rVariable == ERROR_RATIO)
528 this->
SetValue(ERROR_RATIO,rOutput);
530 else if (rVariable == NODAL_AREA)
539 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
542 this->
GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += Area *
N[
i];
564 if (rVariable == ADVPROJ)
582 double ElementalMassRes(0);
586 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
589 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
593 for (
unsigned int d = 0;
d < TDim; ++
d)
594 rAdvProj[
d] +=
N[
i] * ElementalMomRes[
d];
596 this->
GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ) +=
N[
i] * ElementalMassRes;
597 this->
GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += Area *
N[
i];
603 rOutput = ElementalMomRes;
605 else if (rVariable == SUBSCALE_VELOCITY)
623 double ElementalMassRes(0.0);
627 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
634 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
641 for (
unsigned int d = 0;
d < TDim; ++
d)
642 rMomRHS[
d] +=
N[
i] * ElementalMomRes[
d];
644 rMassRHS +=
N[
i] * ElementalMassRes;
647 this->
GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += Area *
N[
i];
650 for(
unsigned int j = 0;
j < TNumNodes; ++
j)
652 for(
unsigned int d = 0;
d < TDim; ++
d)
653 rMomRHS[
d] -= Weight * this->
GetGeometry()[
j].FastGetSolutionStepValue(ADVPROJ)[
d];
654 rMassRHS -= Weight * this->
GetGeometry()[
j].FastGetSolutionStepValue(DIVPROJ);
656 for(
unsigned int d = 0;
d < TDim; ++
d)
657 rMomRHS[
d] -= Weight * this->
GetGeometry()[
i].FastGetSolutionStepValue(ADVPROJ)[
d];
658 rMassRHS -= Weight * this->
GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ);
665 rOutput = ElementalMomRes;
729 std::vector<double>& rValues,
732 if (rVariable == TAUONE || rVariable == TAUTWO || rVariable == MU || rVariable == TAU)
749 double TauOne, TauTwo;
750 this->
CalculateTau(TauOne,TauTwo,AdvVel,ElemSize,Density,Viscosity,rCurrentProcessInfo);
753 rValues.resize(1,
false);
754 if (rVariable == TAUONE)
758 else if (rVariable == TAUTWO)
762 else if (rVariable == MU)
764 rValues[0] = Viscosity;
766 else if (rVariable == TAU)
769 rValues[0] = Viscosity*NormS;
772 else if (rVariable == EQ_STRAIN_RATE)
779 rValues.resize(1,
false);
782 else if(rVariable == SUBSCALE_PRESSURE)
799 double TauOne, TauTwo;
800 this->
CalculateTau(TauOne,TauTwo,AdvVel,ElemSize,Density,Viscosity,rCurrentProcessInfo);
803 for(
unsigned int i=0;
i < TNumNodes;
i++)
805 for(
unsigned int d = 0;
d < TDim;
d++)
806 DivU -= DN_DX(
i,
d) * this->
GetGeometry()[
i].FastGetSolutionStepValue(VELOCITY)[
d];
809 rValues.resize(1,
false);
810 rValues[0] = TauTwo * DivU;
811 if(rCurrentProcessInfo[OSS_SWITCH]==1)
814 for(
unsigned int i=0;
i < TNumNodes;
i++)
816 Proj +=
N[
i]*this->
GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ);
818 rValues[0] -= TauTwo*Proj;
821 else if (rVariable == NODAL_AREA && TDim == 3)
829 J(0,0) = X1[0]-X0[0];
830 J(0,1) =
X2[0]-X0[0];
831 J(0,2) = X3[0]-X0[0];
832 J(1,0) =
X1[1]-X0[1];
833 J(1,1) =
X2[1]-X0[1];
834 J(1,2) = X3[1]-X0[1];
835 J(2,0) =
X1[2]-X0[2];
836 J(2,1) =
X2[2]-X0[2];
837 J(2,2) = X3[2]-X0[2];
839 double DetJ =
J(0,0)*(
J(1,1)*
J(2,2) -
J(1,2)*
J(2,1) ) +
J(0,1)*(
J(1,2)*
J(2,0) -
J(1,0)*
J(2,2) ) +
J(0,2)*(
J(1,0)*
J(2,1) -
J(1,1)*
J(2,0) );
840 rValues.resize(1,
false);
843 else if (rVariable == ERROR_RATIO)
845 rValues.resize(1,
false);
850 rValues.resize(1,
false);
858 rValues[0] = const_this->
GetValue(rVariable);
870 std::vector<Vector>& rValues,
876 std::vector<Matrix>& rValues,
903 if(ErrorCode != 0)
return ErrorCode;
931 if (this->
GetGeometry().WorkingSpaceDimension() == 2)
954 std::string
Info()
const override
956 std::stringstream buffer;
957 buffer <<
"SurfaceTension #" <<
Id();
964 rOStream <<
"SurfaceTension" << TDim <<
"D";
1012 const double ElemSize,
1013 const double Density,
1014 const double Viscosity,
1018 double AdvVelNorm = 0.0;
1019 for (
unsigned int d = 0;
d < TDim; ++
d)
1020 AdvVelNorm += rAdvVel[
d] * rAdvVel[
d];
1022 AdvVelNorm = sqrt(AdvVelNorm);
1024 double InvTau = Density * ( rCurrentProcessInfo[DYNAMIC_TAU] / rCurrentProcessInfo[DELTA_TIME] + 2.0*AdvVelNorm / ElemSize ) + 4.0*Viscosity/ (ElemSize * ElemSize);
1025 TauOne = 1.0 / InvTau;
1026 TauTwo = Viscosity + 0.5 * Density * ElemSize * AdvVelNorm;
1042 const double ElemSize,
1043 const double Density,
1044 const double Viscosity)
1047 double AdvVelNorm = 0.0;
1048 for (
unsigned int d = 0;
d < TDim; ++
d)
1049 AdvVelNorm += rAdvVel[
d] * rAdvVel[
d];
1051 AdvVelNorm = sqrt(AdvVelNorm);
1053 double InvTau = 2.0*Density*AdvVelNorm / ElemSize + 4.0*Viscosity/ (ElemSize * ElemSize);
1054 TauOne = 1.0 / InvTau;
1059 const double Density,
1061 const double Weight)
1063 double Coef = Density * Weight;
1071 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
1073 for (
unsigned int d = 0;
d < TDim; ++
d)
1075 F[LocalIndex++] += Coef * rShapeFunc[iNode] * BodyForce[
d];
1084 const double Density,
1085 const double TauOne,
1086 const double TauTwo,
1089 const double Weight,
1090 const double DeltaTime = 1.0)
1092 const unsigned int BlockSize = TDim + 1;
1098 double DivProj = 0.0;
1105 unsigned int FirstRow = 0;
1107 for (
unsigned int i = 0;
i < TNumNodes;
i++)
1109 for (
unsigned int d = 0;
d < TDim;
d++)
1111 RHS[FirstRow+
d] -= Weight * (Density * AGradN[
i] * MomProj[
d] + rShapeDeriv(
i,
d) * DivProj);
1112 RHS[FirstRow+TDim] -= Weight * rShapeDeriv(
i,
d) * MomProj[
d];
1114 FirstRow += BlockSize;
1128 unsigned int DofIndex = 0;
1129 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
1131 for (
unsigned int d = 0;
d < TDim; ++
d)
1133 rLHSMatrix(DofIndex, DofIndex) += Mass;
1142 const double Density,
1143 const double Weight)
1145 const unsigned int BlockSize = TDim + 1;
1147 double Coef = Density * Weight;
1148 unsigned int FirstRow(0), FirstCol(0);
1152 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1155 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1158 K = Coef * rShapeFunc[
i] * rShapeFunc[
j];
1160 for (
unsigned int d = 0;
d < TDim; ++
d)
1162 rLHSMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1165 FirstCol += BlockSize;
1168 FirstRow += BlockSize;
1188 const double Density,
1190 const double TauOne,
1193 const double Weight)
1195 const unsigned int BlockSize = TDim + 1;
1197 double Coef = Weight * TauOne;
1198 unsigned int FirstRow(0), FirstCol(0);
1206 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1209 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1212 K = Coef * Density * AGradN[
i] * Density * rShapeFunc[
j];
1214 for (
unsigned int d = 0;
d < TDim; ++
d)
1216 rLHSMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1218 rLHSMatrix(FirstRow + TDim, FirstCol +
d) += Coef * Density * rShapeDeriv(
i,
d) * rShapeFunc[
j];
1221 FirstCol += BlockSize;
1224 FirstRow += BlockSize;
1232 const double Density,
1233 const double Viscosity,
1235 const double TauOne,
1236 const double TauTwo,
1239 const double Weight)
1241 const unsigned int BlockSize = TDim + 1;
1248 unsigned int FirstRow(0), FirstCol(0);
1249 double K, G, PDivV,
L, qF;
1253 BodyForce *= Density;
1255 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1257 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1262 K = Density * rShapeFunc[
i] * AGradN[
j];
1264 K += TauOne * Density * AGradN[
i] * Density * AGradN[
j];
1270 for (
unsigned int m = 0;
m < TDim; ++
m)
1276 G = TauOne * Density * AGradN[
i] * rShapeDeriv(
j,
m);
1277 PDivV = rShapeDeriv(
i,
m) * rShapeFunc[
j];
1280 rDampingMatrix(FirstRow +
m, FirstCol + TDim) += Weight * (G - PDivV);
1282 rDampingMatrix(FirstCol + TDim, FirstRow +
m) += Weight * (G + PDivV);
1285 L += rShapeDeriv(
i,
m) * rShapeDeriv(
j,
m);
1287 for (
unsigned int n = 0;
n < TDim; ++
n)
1290 rDampingMatrix(FirstRow +
m, FirstCol +
n) += Weight * TauTwo * rShapeDeriv(
i,
m) * rShapeDeriv(
j,
n);
1296 for (
unsigned int d = 0;
d < TDim; ++
d)
1297 rDampingMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1300 rDampingMatrix(FirstRow + TDim, FirstCol + TDim) += Weight * TauOne *
L;
1304 FirstCol += BlockSize;
1309 for (
unsigned int d = 0;
d < TDim; ++
d)
1311 rDampRHS[FirstRow +
d] += Weight * TauOne * Density * AGradN[
i] * BodyForce[
d];
1312 qF += rShapeDeriv(
i,
d) * BodyForce[
d];
1314 rDampRHS[FirstRow + TDim] += Weight * TauOne * qF;
1317 FirstRow += BlockSize;
1322 this->
AddViscousTerm(rDampingMatrix,rShapeDeriv,Viscosity*Weight);
1333 const double gamma = rCurrentProcessInfo[SURFACE_TENSION_COEF];
1342 double dt = rCurrentProcessInfo[DELTA_TIME];
1344 double theta_s = rCurrentProcessInfo[CONTACT_ANGLE_STATIC];
1345 double pi = 3.14159265359;
1346 theta_s = theta_s*
pi/180.0;
1347 double sin_t = sin(theta_s);
1348 double cos_t = cos(theta_s);
1353 for(
unsigned int i = 0;
i < 3;
i++){
1354 if((this->
GetGeometry()[
i].FastGetSolutionStepValue(IS_BOUNDARY) == 0.0) || (this->
GetGeometry()[
i].FastGetSolutionStepValue(IS_FREE_SURFACE) == 0.0))
1355 this->
GetGeometry()[
i].FastGetSolutionStepValue(MEAN_CURVATURE_2D) = 0.0;
1359 double flag_surf = 0.0;
1360 flag_surf += this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1361 flag_surf += this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1362 flag_surf += this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1363 double flag_trip = 0.0;
1364 flag_trip += (this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1365 flag_trip += (this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1366 flag_trip += (this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1367 double flag_struct = 0.0;
1368 flag_struct += (this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1369 flag_struct += (this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1370 flag_struct += (this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1375 double avg_curv = 0.0;
1391 if(flag_trip > 0 && (this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT))*1000 == 0.0)
1400 if(flag_trip == 0.0)
1402 if(flag_struct == 0.0)
1404 for(
int i = 0;
i < 3;
i++)
1406 avg_curv += 0.333333333333*(this->
GetGeometry()[
i].FastGetSolutionStepValue(MEAN_CURVATURE_2D));
1408 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_2D) > avg_curv)
1414 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_2D) > avg_curv)
1420 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_2D) > avg_curv)
1429 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1432 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_2D) > 1.0)
1443 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1446 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_2D) > 1.0)
1457 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1460 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_2D) > 1.0)
1475 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
1478 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1489 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
1492 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1503 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
1506 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1522 An1[0] = this->
GetGeometry()[ii].FastGetSolutionStepValue(NORMAL_X);
1523 An1[1] = this->
GetGeometry()[ii].FastGetSolutionStepValue(NORMAL_Y);
1524 double norm1 = sqrt(An1[0]*An1[0] + An1[1]*An1[1]);
1526 An2[0] = this->
GetGeometry()[jj].FastGetSolutionStepValue(NORMAL_X);
1527 An2[1] = this->
GetGeometry()[jj].FastGetSolutionStepValue(NORMAL_Y);
1528 double norm2 = sqrt(An2[0]*An2[0] + An2[1]*An2[1]);
1539 double dl = sqrt(x12[0]*x12[0] + x12[1]*x12[1]);
1542 double curv1 = this->
GetGeometry()[ii].FastGetSolutionStepValue(MEAN_CURVATURE_2D);
1543 double curv2 = this->
GetGeometry()[jj].FastGetSolutionStepValue(MEAN_CURVATURE_2D);
1563 if(this->
GetGeometry()[ii].FastGetSolutionStepValue(IS_STRUCTURE) == 0.0)
1566 rRightHandSideVector[3*ii] -= 0.5*
gamma*curv1*An1[0]*dl;
1567 rRightHandSideVector[3*ii+1] -= 0.5*
gamma*curv1*An1[1]*dl;
1570 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_X) = -
gamma*curv1*An1[0]*dl;
1571 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_Y) = -
gamma*curv1*An1[1]*dl;
1576 if (this->
GetGeometry()[ii].FastGetSolutionStepValue(NORMAL_X) > 0.0)
1589 if (this->
GetGeometry()[ii].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
1593 rRightHandSideVector[3*ii] -= coef*
gamma*(
m[0]-x12[0]);
1594 rRightHandSideVector[3*ii+1] -= coef*
gamma*(
m[1]-x12[1]);
1595 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_X) = -coef*
gamma*(
m[0] - x12[0]);
1600 double v_clx = this->
GetGeometry()[ii].FastGetSolutionStepValue(VELOCITY_X);
1601 double v_cly = this->
GetGeometry()[ii].FastGetSolutionStepValue(VELOCITY_Y);
1604 mu = this->
GetGeometry()[ii].FastGetSolutionStepValue(VISCOSITY);
1607 double v_clx_abs = fabs (v_clx);
1608 double v_cly_abs = fabs (v_cly) ;
1610 double cap_x =
mu * v_clx_abs /
gamma;
1611 double cap_y =
mu * v_cly_abs /
gamma;
1621 double cap = sqrt((cap_x * cap_x) + (cap_y * cap_y));
1637 this->
GetGeometry()[ii].FastGetSolutionStepValue(VELOCITY_X) = 0.0;
1643 rRightHandSideVector[3*jj] -= 0.5*
gamma*curv2*An2[0]*dl;
1644 rRightHandSideVector[3*jj+1] -= 0.5*
gamma*curv2*An2[1]*dl;
1647 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_X) = -
gamma*curv2*An2[0]*dl;
1648 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_Y) = -
gamma*curv2*An2[1]*dl;
1650 rDampingMatrix(3*ii,3*ii) += msWorkMatrix(ii,ii);
1651 rDampingMatrix(3*ii+1,3*ii+1) += msWorkMatrix(ii,ii);
1653 rDampingMatrix(3*ii,3*jj) += msWorkMatrix(ii,jj);
1654 rDampingMatrix(3*ii+1,3*jj+1) += msWorkMatrix(ii,jj);
1656 rDampingMatrix(3*jj,3*ii) += msWorkMatrix(jj,ii);
1657 rDampingMatrix(3*jj+1,3*ii+1) += msWorkMatrix(jj,ii);
1659 rDampingMatrix(3*jj,3*jj) += msWorkMatrix(jj,jj);
1660 rDampingMatrix(3*jj+1,3*jj+1) += msWorkMatrix(jj,jj);
1663 if(
k > 2 && this->
GetGeometry()[kk].FastGetSolutionStepValue(IS_STRUCTURE) == 0.0)
1666 An3[0] = this->
GetGeometry()[kk].FastGetSolutionStepValue(NORMAL_X);
1667 An3[1] = this->
GetGeometry()[kk].FastGetSolutionStepValue(NORMAL_Y);
1668 double norm3 = sqrt(An3[0]*An3[0] + An3[1]*An3[1]);
1670 double curv3 = this->
GetGeometry()[kk].FastGetSolutionStepValue(MEAN_CURVATURE_2D);
1678 double dl1 = sqrt(x31[0]*x31[0] + x31[1]*x31[1]);
1681 double dl2 = sqrt(x32[0]*x32[0] + x32[1]*x32[1]);
1685 rRightHandSideVector[3*kk] -=
gamma*curv3*An3[0]*dl;
1686 rRightHandSideVector[3*kk+1] -=
gamma*curv3*An3[1]*dl;
1691 rDampingMatrix(3*kk,3*kk) += msWorkMatrix(kk,kk);
1692 rDampingMatrix(3*kk+1,3*kk+1) += msWorkMatrix(kk,kk);
1699 for(
unsigned int i = 0;
i < 3;
i++)
1701 if(this->
GetGeometry()[
i].FastGetSolutionStepValue(IS_BOUNDARY) == 0.0)
1703 this->
GetGeometry()[
i].FastGetSolutionStepValue(FORCE_X) = 0.0;
1704 this->
GetGeometry()[
i].FastGetSolutionStepValue(FORCE_Y) = 0.0;
1705 this->
GetGeometry()[
i].FastGetSolutionStepValue(FORCE_Z) = 0.0;
1714 double dt = rCurrentProcessInfo[DELTA_TIME];
1715 double gamma = rCurrentProcessInfo[SURFACE_TENSION_COEF];
1716 double theta_s = rCurrentProcessInfo[CONTACT_ANGLE_STATIC];
1719 double flag_surf = 0.0;
1720 flag_surf += this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1721 flag_surf += this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1722 flag_surf += this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1723 flag_surf += this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(IS_FREE_SURFACE);
1724 double flag_trip = 0.0;
1725 flag_trip += (this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1726 flag_trip += (this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1727 flag_trip += (this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1728 flag_trip += (this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0);
1729 double flag_struct = 0.0;
1730 flag_struct += (this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1731 flag_struct += (this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1732 flag_struct += (this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1733 flag_struct += (this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(IS_STRUCTURE) != 0.0);
1739 double avg_curv = 0.0;
1758 if ((this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0)
1764 if ((this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0)
1773 if ((this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT))*1000 == 0.0)
1780 if ((this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT))*1000 == 0.0)
1794 if(flag_trip == 0.0)
1797 if(flag_struct == 0.0)
1800 for(
int i = 0;
i < 4;
i++)
1802 avg_curv += 0.25*(this->
GetGeometry()[
i].FastGetSolutionStepValue(MEAN_CURVATURE_3D));
1804 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > avg_curv)
1811 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > avg_curv)
1818 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > avg_curv)
1825 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > avg_curv)
1836 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1839 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1842 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1847 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1853 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1856 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1861 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1867 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1870 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1875 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1884 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1887 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1890 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1895 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1901 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1904 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1909 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1915 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1918 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1923 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1932 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1935 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1938 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1943 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1949 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1952 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1957 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1963 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1966 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1971 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1980 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
1983 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1986 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1991 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
1997 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
2000 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
2005 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
2011 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
2014 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
2019 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(MEAN_CURVATURE_3D) > 1.0)
2032 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2035 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2038 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
2049 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2052 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
2063 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2066 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
2079 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2082 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2085 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
2096 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2099 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
2112 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2115 if(this->
GetGeometry()[node_indx[3]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2118 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
2134 if(this->
GetGeometry()[node_indx[0]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2137 if(this->
GetGeometry()[node_indx[1]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2140 if(this->
GetGeometry()[node_indx[2]].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2176 double fsign1 = this->
GetGeometry()[ii].FastGetSolutionStepValue(CONTACT_ANGLE) - theta_s;
2178 double fsign2 = this->
GetGeometry()[jj].FastGetSolutionStepValue(CONTACT_ANGLE) - theta_s;
2180 double fsign3 = this->
GetGeometry()[kk].FastGetSolutionStepValue(CONTACT_ANGLE) - theta_s;
2188 for(
unsigned int i_node = 0; i_node < 4; ++i_node)
2190 vec_temp = this->
GetGeometry()[i_node].FastGetSolutionStepValue(NORMAL);
2192 temp = -(vec_temp[2]);
2193 if (
temp > 0.99 && this->
GetGeometry()[i_node].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2194 this->
GetGeometry()[i_node].FastGetSolutionStepValue(TRIPLE_POINT) = 0.0;
2198 double curv1 = this->
GetGeometry()[ii].FastGetSolutionStepValue(MEAN_CURVATURE_3D);
2199 double curv2 = this->
GetGeometry()[jj].FastGetSolutionStepValue(MEAN_CURVATURE_3D);
2200 double curv3 = this->
GetGeometry()[kk].FastGetSolutionStepValue(MEAN_CURVATURE_3D);
2202 double nlen1 = this->
GetGeometry()[ii].FastGetSolutionStepValue(NODAL_LENGTH);
2203 double nlen2 = this->
GetGeometry()[jj].FastGetSolutionStepValue(NODAL_LENGTH);
2204 double nlen3 = this->
GetGeometry()[kk].FastGetSolutionStepValue(NODAL_LENGTH);
2220 double area_tr = 0.5*
Norm3D(cprod);
2231 msWorkMatrix = 0.333333333333 *
gamma * area_tr *
prod(msDN_Dx,
trans(msDN_Dx)) *
dt;
2233 double coef_i = 0.333333333333;
2234 double coef_j = 0.333333333333;
2235 double coef_k = 0.333333333333;
2240 rRightHandSideVector[4*ii] -= coef_i*
gamma*curv1*An1[0]*area_tr;
2241 rRightHandSideVector[4*ii+1] -= coef_i*
gamma*curv1*An1[1]*area_tr;
2242 rRightHandSideVector[4*ii+2] -= coef_i*
gamma*curv1*An1[2]*area_tr;
2243 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_X) = -coef_i*
gamma*curv1*An1[0]*area_tr;
2244 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_Y) = -coef_i*
gamma*curv1*An1[1]*area_tr;
2245 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_Z) = -coef_i*
gamma*curv1*An1[2]*area_tr;
2247 rRightHandSideVector[4*jj] -= coef_j*
gamma*curv2*An2[0]*area_tr;
2248 rRightHandSideVector[4*jj+1] -= coef_j*
gamma*curv2*An2[1]*area_tr;
2249 rRightHandSideVector[4*jj+2] -= coef_j*
gamma*curv2*An2[2]*area_tr;
2250 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_X) = -coef_j*
gamma*curv2*An2[0]*area_tr;
2251 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_Y) = -coef_j*
gamma*curv2*An2[1]*area_tr;
2252 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_Z) = -coef_j*
gamma*curv2*An2[2]*area_tr;
2254 rRightHandSideVector[4*kk] -= coef_k*
gamma*curv3*An3[0]*area_tr;
2255 rRightHandSideVector[4*kk+1] -= coef_k*
gamma*curv3*An3[1]*area_tr;
2256 rRightHandSideVector[4*kk+2] -= coef_k*
gamma*curv3*An3[2]*area_tr;
2257 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_X) = -coef_k*
gamma*curv3*An3[0]*area_tr;
2258 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_Y) = -coef_k*
gamma*curv3*An3[1]*area_tr;
2259 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_Z) = -coef_k*
gamma*curv3*An3[2]*area_tr;
2265 if(this->
GetGeometry()[ii].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2268 rRightHandSideVector[4*ii] -= coef_i*beta*fsign1*(
gamma*
m1[0]*nlen1);
2269 rRightHandSideVector[4*ii+1] -= coef_i*beta*fsign1*(
gamma*
m1[1]*nlen1);
2270 rRightHandSideVector[4*ii+2] -= coef_i*beta*fsign1*(
gamma*
m1[2]*nlen1);
2271 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE) = -coef_i*beta*fsign1*(
gamma*
m1*nlen1);
2275 rDampingMatrix(4*ii,4*ii) += 0.5*
gamma*
dt*msN[ii]*msN[ii]*nlen1 - msWorkMatrix(ii,ii);
2276 rDampingMatrix(4*ii+1,4*ii+1) += 0.5*
gamma*
dt*msN[ii]*msN[ii]*nlen1 - msWorkMatrix(ii,ii);
2277 rDampingMatrix(4*ii+2,4*ii+2) += 0.5*
gamma*
dt*msN[ii]*msN[ii]*nlen1 - msWorkMatrix(ii,ii);
2278 rDampingMatrix(4*ii,4*jj) += 0.5*
gamma*
dt*msN[ii]*msN[jj]*0.5*(nlen1 + nlen2) - msWorkMatrix(ii,jj);
2279 rDampingMatrix(4*ii+1,4*jj+1) += 0.5*
gamma*
dt*msN[ii]*msN[jj]*0.5*(nlen1 + nlen2) - msWorkMatrix(ii,jj);
2280 rDampingMatrix(4*ii+2,4*jj+2) += 0.5*
gamma*
dt*msN[ii]*msN[jj]*0.5*(nlen1 + nlen2) - msWorkMatrix(ii,jj);
2284 rRightHandSideVector[4*ii] -= coef_i*beta*
gamma*curv1*An1[0]*area_tr;
2285 rRightHandSideVector[4*ii+1] -= coef_i*beta*
gamma*curv1*An1[1]*area_tr;
2286 rRightHandSideVector[4*ii+2] -= coef_i*beta*
gamma*curv1*An1[2]*area_tr;
2287 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_X) = -coef_i*beta*
gamma*curv1*An1[0]*area_tr;
2288 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_Y) = -coef_i*beta*
gamma*curv1*An1[1]*area_tr;
2289 this->
GetGeometry()[ii].FastGetSolutionStepValue(FORCE_Z) = -coef_i*beta*
gamma*curv1*An1[2]*area_tr;
2293 if(this->
GetGeometry()[jj].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2296 rRightHandSideVector[4*jj] -= coef_j*beta*fsign2*(
gamma*m2[0]*nlen2);
2297 rRightHandSideVector[4*jj+1] -= coef_j*beta*fsign2*(
gamma*m2[1]*nlen2);
2298 rRightHandSideVector[4*jj+2] -= coef_j*beta*fsign2*(
gamma*m2[2]*nlen2);
2299 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE) = -coef_j*beta*fsign2*(
gamma*m2*nlen2);
2301 rDampingMatrix(4*jj,4*jj) += 0.5*
gamma*
dt*msN[jj]*msN[jj]*nlen2 - msWorkMatrix(jj,jj);
2302 rDampingMatrix(4*jj+1,4*jj+1) += 0.5*
gamma*
dt*msN[jj]*msN[jj]*nlen2 - msWorkMatrix(jj,jj);
2303 rDampingMatrix(4*jj+2,4*jj+2) += 0.5*
gamma*
dt*msN[jj]*msN[jj]*nlen2 - msWorkMatrix(jj,jj);
2304 rDampingMatrix(4*jj,4*ii) += 0.5*
gamma*
dt*msN[jj]*msN[ii]*0.5*(nlen1 + nlen2) - msWorkMatrix(jj,ii);
2305 rDampingMatrix(4*jj+1,4*ii+1) += 0.5*
gamma*
dt*msN[jj]*msN[ii]*0.5*(nlen1 + nlen2) - msWorkMatrix(jj,ii);
2306 rDampingMatrix(4*jj+2,4*ii+2) += 0.5*
gamma*
dt*msN[jj]*msN[ii]*0.5*(nlen1 + nlen2) - msWorkMatrix(jj,ii);
2310 rRightHandSideVector[4*jj] -= coef_j*beta*
gamma*curv2*An2[0]*area_tr;
2311 rRightHandSideVector[4*jj+1] -= coef_j*beta*
gamma*curv2*An2[1]*area_tr;
2312 rRightHandSideVector[4*jj+2] -= coef_j*beta*
gamma*curv2*An2[2]*area_tr;
2313 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_X) = -coef_j*beta*
gamma*curv2*An2[0]*area_tr;
2314 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_Y) = -coef_j*beta*
gamma*curv2*An2[1]*area_tr;
2315 this->
GetGeometry()[jj].FastGetSolutionStepValue(FORCE_Z) = -coef_j*beta*
gamma*curv2*An2[2]*area_tr;
2319 if(this->
GetGeometry()[kk].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2322 rRightHandSideVector[4*kk] -= coef_k*beta*fsign3*(
gamma*m3[0]*nlen3);
2323 rRightHandSideVector[4*kk+1] -= coef_k*beta*fsign3*(
gamma*m3[1]*nlen3);
2324 rRightHandSideVector[4*kk+2] -= coef_k*beta*fsign3*(
gamma*m3[2]*nlen3);
2325 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_X) = -coef_k*beta*fsign3*(
gamma*m3[0]*nlen3);
2326 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_Y) = -coef_k*beta*fsign3*(
gamma*m3[1]*nlen3);
2327 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_Z) = -coef_k*beta*fsign3*(
gamma*m3[2]*nlen3);
2331 rRightHandSideVector[4*kk] -= coef_k*beta*
gamma*curv3*An3[0]*area_tr;
2332 rRightHandSideVector[4*kk+1] -= coef_k*beta*
gamma*curv3*An3[1]*area_tr;
2333 rRightHandSideVector[4*kk+2] -= coef_k*beta*
gamma*curv3*An3[2]*area_tr;
2334 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_X) = -coef_k*beta*
gamma*curv3*An3[0]*area_tr;
2335 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_Y) = -coef_k*beta*
gamma*curv3*An3[1]*area_tr;
2336 this->
GetGeometry()[kk].FastGetSolutionStepValue(FORCE_Z) = -coef_k*beta*
gamma*curv3*An3[2]*area_tr;
2341 rDampingMatrix(4*ii,4*ii) += msWorkMatrix(ii,ii);
2342 rDampingMatrix(4*ii+1,4*ii+1) += msWorkMatrix(ii,ii);
2343 rDampingMatrix(4*ii+2,4*ii+2) += msWorkMatrix(ii,ii);
2345 rDampingMatrix(4*ii,4*jj) += msWorkMatrix(ii,jj);
2346 rDampingMatrix(4*ii+1,4*jj+1) += msWorkMatrix(ii,jj);
2347 rDampingMatrix(4*ii+2,4*jj+2) += msWorkMatrix(ii,jj);
2349 rDampingMatrix(4*ii,4*kk) += msWorkMatrix(ii,kk);
2350 rDampingMatrix(4*ii+1,4*kk+1) += msWorkMatrix(ii,kk);
2351 rDampingMatrix(4*ii+2,4*kk+2) += msWorkMatrix(ii,kk);
2353 rDampingMatrix(4*jj,4*ii) += msWorkMatrix(jj,ii);
2354 rDampingMatrix(4*jj+1,4*ii+1) += msWorkMatrix(jj,ii);
2355 rDampingMatrix(4*jj+2,4*ii+2) += msWorkMatrix(jj,ii);
2357 rDampingMatrix(4*kk,4*ii) += msWorkMatrix(kk,ii);
2358 rDampingMatrix(4*kk+1,4*ii+1) += msWorkMatrix(kk,ii);
2359 rDampingMatrix(4*kk+2,4*ii+2) += msWorkMatrix(kk,ii);
2361 rDampingMatrix(4*jj,4*jj) += msWorkMatrix(jj,jj);
2362 rDampingMatrix(4*jj+1,4*jj+1) += msWorkMatrix(jj,jj);
2363 rDampingMatrix(4*jj+2,4*jj+2) += msWorkMatrix(jj,jj);
2365 rDampingMatrix(4*jj,4*kk) += msWorkMatrix(jj,kk);
2366 rDampingMatrix(4*jj+1,4*kk+1) += msWorkMatrix(jj,kk);
2367 rDampingMatrix(4*jj+2,4*kk+2) += msWorkMatrix(jj,kk);
2369 rDampingMatrix(4*kk,4*jj) += msWorkMatrix(kk,jj);
2370 rDampingMatrix(4*kk+1,4*jj+1) += msWorkMatrix(kk,jj);
2371 rDampingMatrix(4*kk+2,4*jj+2) += msWorkMatrix(kk,jj);
2373 rDampingMatrix(4*kk,4*kk) += msWorkMatrix(kk,kk);
2374 rDampingMatrix(4*kk+1,4*kk+1) += msWorkMatrix(kk,kk);
2375 rDampingMatrix(4*kk+2,4*kk+2) += msWorkMatrix(kk,kk);
2378 if(
k > 3 && ll != 8)
2383 double fsign4 = this->
GetGeometry()[ll].FastGetSolutionStepValue(CONTACT_ANGLE) - theta_s;
2384 fsign4 = fsign4/abs(fsign4);
2386 int num_neighs_l = 0;
2388 for (
unsigned int i = 0;
i < neighb_l.
size();
i++)
2390 if (neighb_l[
i].FastGetSolutionStepValue(IS_BOUNDARY) != 0.0)
2393 double coef_l = 0.333333333333;
2395 double curv4 = this->
GetGeometry()[ll].FastGetSolutionStepValue(MEAN_CURVATURE_3D);
2396 double nlen4 = this->
GetGeometry()[ll].FastGetSolutionStepValue(NODAL_LENGTH);
2399 if(this->
GetGeometry()[ll].FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
2402 rRightHandSideVector[4*ll] -= coef_l*beta*fsign4*(
gamma*m4[0]*nlen4);
2403 rRightHandSideVector[4*ll+1] -= coef_l*beta*fsign4*(
gamma*m4[1]*nlen4);
2404 rRightHandSideVector[4*ll+2] -= coef_l*beta*fsign4*(
gamma*m4[2]*nlen4);
2405 this->
GetGeometry()[ll].FastGetSolutionStepValue(FORCE_X) = -coef_l*beta*fsign4*(
gamma*m4[0]*nlen4);
2406 this->
GetGeometry()[ll].FastGetSolutionStepValue(FORCE_Y) = -coef_l*beta*fsign4*(
gamma*m4[1]*nlen4);
2407 this->
GetGeometry()[ll].FastGetSolutionStepValue(FORCE_Z) = -coef_l*beta*fsign4*(
gamma*m4[2]*nlen4);
2411 rRightHandSideVector[4*ll] -= coef_l*beta*
gamma*curv4*An4[0]*area_tr;
2412 rRightHandSideVector[4*ll+1] -= coef_l*beta*
gamma*curv4*An4[1]*area_tr;
2413 rRightHandSideVector[4*ll+2] -= coef_l*beta*
gamma*curv4*An4[2]*area_tr;
2414 this->
GetGeometry()[ll].FastGetSolutionStepValue(FORCE) = -coef_l*beta*
gamma*curv4*An4*area_tr;
2436 double u1 = this->
GetGeometry()[0].FastGetSolutionStepValue(VELOCITY_X);
2437 double v1 = this->
GetGeometry()[0].FastGetSolutionStepValue(VELOCITY_Y);
2438 double u2 = this->
GetGeometry()[1].FastGetSolutionStepValue(VELOCITY_X);
2439 double v2 = this->
GetGeometry()[1].FastGetSolutionStepValue(VELOCITY_Y);
2440 double u3 = this->
GetGeometry()[2].FastGetSolutionStepValue(VELOCITY_X);
2441 double v3 = this->
GetGeometry()[2].FastGetSolutionStepValue(VELOCITY_Y);
2443 double x13 =
x1 - x3;
2444 double x23 =
x2 - x3;
2445 double y13 = y1 - y3;
2446 double y23 = y2 - y3;
2448 double du_dx = (0.5/Area)*(y23*(
u1 - u3) - y13*(
u2 - u3));
2449 double du_dy = (0.5/Area)*(-x23*(
u1 - u3) + x13*(
u2 - u3));
2450 double dv_dx = (0.5/Area)*(y23*(v1 - v3) - y13*(v2 - v3));
2451 double dv_dy = (0.5/Area)*(-x23*(v1 - v3) + x13*(y2 - y3));
2454 for(
unsigned int i = 0;
i < TNumNodes; ++
i)
2459 this->
GetGeometry()[
i].FastGetSolutionStepValue(VISCOUS_STRESSX_X) +=
mu * ( 2*du_dx );
2460 this->
GetGeometry()[
i].FastGetSolutionStepValue(VISCOUS_STRESSY_X) +=
mu * ( du_dy + dv_dx );
2461 this->
GetGeometry()[
i].FastGetSolutionStepValue(VISCOUS_STRESSX_Y) +=
mu * ( dv_dx + du_dy );
2462 this->
GetGeometry()[
i].FastGetSolutionStepValue(VISCOUS_STRESSY_Y) +=
mu * ( 2*dv_dy );
2473 const double Density,
2475 double& rElementalMassRes,
2478 const double Weight)
2485 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
2491 const double& rPressure = this->
GetGeometry()[
i].FastGetSolutionStepValue(PRESSURE);
2494 for (
unsigned int d = 0;
d < TDim; ++
d)
2496 rElementalMomRes[
d] += Weight * (Density * (rShapeFunc[
i] * rBodyForce[
d] - AGradN[
i] * rVelocity[
d]) - rShapeDeriv(
i,
d) * rPressure);
2497 rElementalMassRes -= Weight * rShapeDeriv(
i,
d) * rVelocity[
d];
2513 const double Density,
2517 const double Weight)
2524 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
2531 const double& rPressure = this->
GetGeometry()[
i].FastGetSolutionStepValue(PRESSURE);
2534 for (
unsigned int d = 0;
d < TDim; ++
d)
2536 rElementalMomRes[
d] += Weight * (Density * (rShapeFunc[
i] * (rBodyForce[
d] - rAcceleration[
d]) - AGradN[
i] * rVelocity[
d]) - rShapeDeriv(
i,
d) * rPressure);
2552 const double Density,
2556 const double Weight)
2563 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
2570 const double& rPressure = this->
GetGeometry()[
i].FastGetSolutionStepValue(PRESSURE);
2573 for (
unsigned int d = 0;
d < TDim; ++
d)
2575 rElementalMomRes[
d] += Weight * (Density * (rShapeFunc[
i] * rBodyForce[
d] - AGradN[
i] * rVelocity[
d]) - rShapeDeriv(
i,
d) * rPressure);
2576 rElementalMomRes[
d] -= Weight * rShapeFunc[
i] * rProjection[
d];
2603 const double Csmag = (
static_cast< const SurfaceTension<TDim> *
>(
this) )->GetValue(C_SMAGORINSKY);
2604 double Viscosity = 0.0;
2610 double LengthScale = Csmag*ElemSize;
2611 LengthScale *= LengthScale;
2612 Viscosity += 2.0*LengthScale*StrainRate;
2615 return Density*Viscosity;
2644 rAdvVel = rShapeFunc[0] * (rGeom[0].FastGetSolutionStepValue(VELOCITY) - rGeom[0].FastGetSolutionStepValue(MESH_VELOCITY));
2645 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
2646 rAdvVel += rShapeFunc[iNode] * (rGeom[iNode].FastGetSolutionStepValue(VELOCITY) - rGeom[iNode].FastGetSolutionStepValue(MESH_VELOCITY));
2659 const std::size_t Step)
2663 rAdvVel = rShapeFunc[0] * (rGeom[0].FastGetSolutionStepValue(VELOCITY, Step) - rGeom[0].FastGetSolutionStepValue(MESH_VELOCITY, Step));
2664 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
2665 rAdvVel += rShapeFunc[iNode] * (rGeom[iNode].FastGetSolutionStepValue(VELOCITY, Step) - rGeom[iNode].FastGetSolutionStepValue(MESH_VELOCITY, Step));
2681 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
2684 rResult[iNode] = rVelocity[0] * rShapeDeriv(iNode, 0);
2685 for (
unsigned int d = 1;
d < TDim; ++
d)
2686 rResult[iNode] += rVelocity[
d] * rShapeDeriv(iNode,
d);
2706 rResult = rShapeFunc[0] * rGeom[0].FastGetSolutionStepValue(rVariable);
2707 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
2708 rResult += rShapeFunc[iNode] * rGeom[iNode].FastGetSolutionStepValue(rVariable);
2727 rResult = rShapeFunc[0] * rGeom[0].FastGetSolutionStepValue(rVariable);
2728 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
2729 rResult += rShapeFunc[iNode] * rGeom[iNode].FastGetSolutionStepValue(rVariable);
2752 const double Weight);
2767 const double Weight)
2774 const unsigned int BlockSize = TDim + 1;
2775 const unsigned int StrainSize = (TDim*TNumNodes)/2;
2777 vector<unsigned int> aux(TDim*TNumNodes);
2778 for(
unsigned int i=0;
i<TNumNodes;
i++)
2780 int base_index = TDim*
i;
2781 int aux_index = BlockSize*
i;
2782 for(
unsigned int j=0;
j<TDim;
j++)
2784 aux[base_index+
j] = aux_index+
j;
2788 for(
unsigned int k=0;
k< StrainSize;
k++)
2790 for(
unsigned int l=0;
l< StrainSize;
l++)
2792 const double Ckl =
C(
k,
l);
2793 for (
unsigned int i = 0;
i < TDim*TNumNodes; ++
i)
2795 const double Bki=
B(
k,
i);
2796 for (
unsigned int j = 0;
j < TDim*TNumNodes; ++
j)
2798 rDampingMatrix(aux[
i],aux[
j]) += Bki*Ckl*
B(
l,
j);
2809 const double Weight)
2815 for (
unsigned int n = 0;
n < TNumNodes;
n++)
2818 for (
unsigned int i = 0;
i < TDim;
i++)
2819 for (
unsigned int j = 0;
j < TDim;
j++)
2820 GradU(
i,
j) += rDN_DX(
n,
j)*rVel[
i];
2825 Delta[0] = std::fabs(rGeom[TNumNodes-1].
X()-rGeom[0].
X());
2826 Delta[1] = std::fabs(rGeom[TNumNodes-1].
Y()-rGeom[0].
Y());
2827 Delta[2] = std::fabs(rGeom[TNumNodes-1].
Z()-rGeom[0].
Z());
2829 for (
unsigned int n = 1;
n < TNumNodes;
n++)
2831 double hx = std::fabs(rGeom[
n].
X()-rGeom[
n-1].
X());
2832 if (hx > Delta[0]) Delta[0] = hx;
2833 double hy = std::fabs(rGeom[
n].
Y()-rGeom[
n-1].
Y());
2834 if (hy > Delta[1]) Delta[1] = hy;
2835 double hz = std::fabs(rGeom[
n].
Z()-rGeom[
n-1].
Z());
2836 if (hz > Delta[2]) Delta[2] = hz;
2839 double AvgDeltaSq = Delta[0];
2840 for (
unsigned int d = 1;
d < TDim;
d++)
2841 AvgDeltaSq *= Delta[
d];
2842 AvgDeltaSq = std::pow(AvgDeltaSq,2./TDim);
2844 Delta[0] = Delta[0]*Delta[0]/12.0;
2845 Delta[1] = Delta[1]*Delta[1]/12.0;
2846 Delta[2] = Delta[2]*Delta[2]/12.0;
2850 for (
unsigned int i = 0;
i < TDim;
i++)
2851 for (
unsigned int j = 0;
j < TDim;
j++)
2852 for (
unsigned int d = 0;
d < TDim;
d++)
2853 G(
i,
j) += Delta[
d]*GradU(
i,
d)*GradU(
j,
d);
2856 double GijSij = 0.0;
2857 for (
unsigned int i = 0;
i < TDim;
i++)
2858 for (
unsigned int j = 0;
j < TDim;
j++)
2859 GijSij += 0.5*G(
i,
j)*( GradU(
i,
j) + GradU(
j,
i) );
2864 double Gkk = G(0,0);
2865 for (
unsigned int d = 1;
d < TDim;
d++)
2869 const double Ce = 1.0;
2872 double ksgs = -4*AvgDeltaSq*GijSij/(Ce*Ce*Gkk);
2875 unsigned int RowIndex = 0;
2876 unsigned int ColIndex = 0;
2878 for (
unsigned int i = 0;
i < TNumNodes;
i++)
2880 for (
unsigned int j = 0;
j < TNumNodes;
j++)
2882 for (
unsigned int d = 0;
d < TDim;
d++)
2884 double Aux = rDN_DX(
i,
d) * Delta[0] * G(
d,0)*rDN_DX(
j,0);
2885 for (
unsigned int k = 1;
k < TDim;
k++)
2886 Aux += rDN_DX(
i,
d) *Delta[
k] * G(
d,
k)*rDN_DX(
j,
k);
2887 rDampingMatrix(RowIndex+
d,ColIndex+
d) += Weight * 2.0*ksgs * Aux;
2917 const double Viscosity);
2948 if ( rProcessInfo[OSS_SWITCH] != 1 )
2951 ElementalMomRes *= TauOne;
2956 ElementalMomRes *= TauOne;
2960 double ErrorRatio(0.0);
2964 for (
unsigned int i = 0;
i < TDim; ++
i)
2966 ErrorRatio += ElementalMomRes[
i] * ElementalMomRes[
i];
2969 ErrorRatio = sqrt(ErrorRatio*Area);
2997 c[0] =
a[1]*
b[2] -
a[2]*
b[1];
2998 c[1] =
a[2]*
b[0] -
a[0]*
b[2];
2999 c[2] =
a[0]*
b[1] -
a[1]*
b[0];
3005 return sqrt(
a[0]*
a[0] +
a[1]*
a[1]);
3010 return sqrt(
a[0]*
a[0] +
a[1]*
a[1] +
a[2]*
a[2]);
3036 return (
a[0]*
b[0] +
a[1]*
b[1]);
3041 return (
a[0]*
b[0] +
a[1]*
b[1] +
a[2]*
b[2]);
3079 void save(
Serializer& rSerializer)
const override
3135 template<
unsigned int TDim,
3136 unsigned int TNumNodes >
3144 template<
unsigned int TDim,
3145 unsigned int TNumNodes >
3150 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:904
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometrical_object.h:248
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
void SetValue(const TVariableType &rThisVariable, typename TVariableType::Type const &rValue)
Definition: geometrical_object.h:238
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
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 object defines an indexed object.
Definition: indexed_object.h:54
IndexType Id() const
Definition: indexed_object.h:107
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
A stabilized element for the incompressible Navier-Stokes equations, utilizing lagrangian_Eulerian ap...
Definition: surface_tension.h:91
double ElementSize(const double)
Return an estimate for the element size h, used to calculate the stabilization parameters.
virtual void GetAdvectiveVel(array_1d< double, 3 > &rAdvVel, const array_1d< double, TNumNodes > &rShapeFunc, const std::size_t Step)
Write the advective velocity evaluated at this point to an array.
Definition: surface_tension.h:2657
void GetValueOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Empty implementation of unused CalculateOnIntegrationPoints overloads to avoid compilation warning.
Definition: surface_tension.h:869
void AddIntegrationPointVelocityContribution(MatrixType &rDampingMatrix, VectorType &rDampRHS, const double Density, const double Viscosity, const array_1d< double, 3 > &rAdvVel, const double TauOne, const double TauTwo, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Add a the contribution from a single integration point to the velocity contribution.
Definition: surface_tension.h:1230
Properties PropertiesType
Definition: surface_tension.h:109
void Calculate(const Variable< double > &rVariable, double &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Implementation of Calculate to compute an error estimate.
Definition: surface_tension.h:521
void EquationIdVector(EquationIdVectorType &rResult, ProcessInfo &rCurrentProcessInfo) override
Provides the global indices for each one of this element's local rows.
SurfaceTension(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: surface_tension.h:172
void CalculateLumpedMassMatrix(MatrixType &rLHSMatrix, const double Mass)
Add lumped mass matrix.
Definition: surface_tension.h:1125
double Norm3D(const array_1d< double, 3 > &a)
Definition: surface_tension.h:3008
array_1d< double, TNumNodes > ShapeFunctionsType
Definition: surface_tension.h:131
virtual void EvaluateInPoint(array_1d< double, 3 > &rResult, const Variable< array_1d< double, 3 > > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc)
Write the value of a variable at a point inside the element to a double.
Definition: surface_tension.h:2721
virtual void AddProjectionToRHS(VectorType &RHS, const array_1d< double, 3 > &rAdvVel, const double Density, const double TauOne, const double TauTwo, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight, const double DeltaTime=1.0)
Add OSS projection terms to the RHS.
Definition: surface_tension.h:1082
virtual double EffectiveViscosity(double Density, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX, double ElemSize, const ProcessInfo &rProcessInfo)
EffectiveViscosity Calculate the viscosity at given integration point, using Smagorinsky if enabled.
Definition: surface_tension.h:2597
void NormalizeVec3D(array_1d< double, 3 > &input)
Definition: surface_tension.h:3023
void ApplySurfaceTensionContribution3D(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const array_1d< double, 4 > &node_indx, const int &k, const ProcessInfo &rCurrentProcessInfo)
Definition: surface_tension.h:1711
array_1d< double, 2 > Vector2D(const double x0, const double y0, const double x1, const double y1)
Definition: surface_tension.h:2977
std::vector< std::size_t > EquationIdVectorType
Definition: surface_tension.h:125
void ApplySurfaceTensionContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const array_1d< double, 3 > &node_indx, const int &k, const ProcessInfo &rCurrentProcessInfo)
Add the surface tension term to the velocity contribution.
Definition: surface_tension.h:1330
Vector VectorType
Definition: surface_tension.h:117
virtual void AddMomentumRHS(VectorType &F, const double Density, const array_1d< double, TNumNodes > &rShapeFunc, const double Weight)
Add the momentum equation contribution to the RHS (body forces)
Definition: surface_tension.h:1058
double Norm2D(const array_1d< double, 2 > &a)
Definition: surface_tension.h:3003
Matrix MatrixType
Definition: surface_tension.h:119
void AddMassStabTerms(MatrixType &rLHSMatrix, const double Density, const array_1d< double, 3 > &rAdvVel, const double TauOne, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Add mass-like stabilization terms to LHS.
Definition: surface_tension.h:1187
IndexedObject BaseType
base type: an IndexedObject that automatically has a unique number
Definition: surface_tension.h:100
Node NodeType
definition of node type (default is: Node)
Definition: surface_tension.h:103
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: surface_tension.h:129
void AddConsistentMassMatrixContribution(MatrixType &rLHSMatrix, const array_1d< double, TNumNodes > &rShapeFunc, const double Density, const double Weight)
Definition: surface_tension.h:1140
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(SurfaceTension)
Pointer definition of SurfaceTension.
array_1d< double, 3 > CrossProduct3D(const array_1d< double, 3 > &a, const array_1d< double, 3 > &b)
Definition: surface_tension.h:2994
void ASGSMomResidual(const array_1d< double, 3 > &rAdvVel, const double Density, array_1d< double, 3 > &rElementalMomRes, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Assemble the contribution from an integration point to the element's residual.
Definition: surface_tension.h:2512
SurfaceTension(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: surface_tension.h:162
double ConsistentMassCoef(const double Area)
SurfaceTension(IndexType NewId=0)
Default constuctor.
Definition: surface_tension.h:144
double DotProduct3D(const array_1d< double, 3 > &a, const array_1d< double, 3 > &b)
Definition: surface_tension.h:3039
void OSSMomResidual(const array_1d< double, 3 > &rAdvVel, const double Density, array_1d< double, 3 > &rElementalMomRes, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Assemble the contribution from an integration point to the element's residual.
Definition: surface_tension.h:2551
void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, ProcessInfo &rCurrentProcessInfo) override
Computes the local contribution associated to 'new' velocity and pressure values.
Definition: surface_tension.h:370
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: surface_tension.h:962
void GetDofList(DofsVectorType &rElementalDofList, ProcessInfo &rCurrentProcessInfo) override
Returns a list of the element's Dofs.
double SubscaleErrorEstimate(const ProcessInfo &rProcessInfo)
Definition: surface_tension.h:2922
double EquivalentStrainRate(const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX) const
EquivalentStrainRate Calculate the second invariant of the strain rate tensor GammaDot = (2SijSij)^0....
array_1d< double, 3 > Vector3D(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1)
Definition: surface_tension.h:2985
void GetSecondDerivativesVector(Vector &Values, int Step=0) override
Returns ACCELERATION_X, ACCELERATION_Y, (ACCELERATION_Z,) 0 for each node.
void GetValueOnIntegrationPoints(const Variable< array_1d< double, 3 > > &rVariable, std::vector< array_1d< double, 3 > > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Obtain an array_1d<double,3> elemental variable, evaluated on gauss points.
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: surface_tension.h:207
void GetConvectionOperator(array_1d< double, TNumNodes > &rResult, const array_1d< double, 3 > &rVelocity, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv)
Write the convective operator evaluated at this point (for each nodal funciton) to an array.
Definition: surface_tension.h:2676
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: surface_tension.h:127
void GetValueOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Obtain a double elemental variable, evaluated on gauss points.
Definition: surface_tension.h:728
void AddBTransCB(MatrixType &rDampingMatrix, BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Adds the contribution of the viscous term to the momentum equation (alternate).
Definition: surface_tension.h:2765
void AddViscousStress2D()
Add the viscous stress to air domain in two dimensions.
Definition: surface_tension.h:2422
std::string Info() const override
Turn back information as a string.
Definition: surface_tension.h:954
void AddProjectionResidualContribution(const array_1d< double, 3 > &rAdvVel, const double Density, array_1d< double, 3 > &rElementalMomRes, double &rElementalMassRes, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Assemble the contribution from an integration point to the element's residual.
Definition: surface_tension.h:2472
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and OSS projection terms.
Definition: surface_tension.h:224
void GetValueOnIntegrationPoints(const Variable< array_1d< double, 6 > > &rVariable, std::vector< array_1d< double, 6 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Empty implementation of unused CalculateOnIntegrationPoints overloads to avoid compilation warning.
Definition: surface_tension.h:863
void ModulatedGradientDiffusion(MatrixType &rDampingMatrix, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX, const double Weight)
Definition: surface_tension.h:2807
void CalculateB(BoundedMatrix< double,(TDim *TNumNodes)/2, TDim *TNumNodes > &rB, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv)
Calculate the strain rate matrix.
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: surface_tension.h:198
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: surface_tension.h:115
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: surface_tension.h:112
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, ProcessInfo &rCurrentProcessInfo) override
Returns a zero matrix of appropiate size (provided for compatibility with scheme)
Definition: surface_tension.h:245
int Check(const ProcessInfo &rCurrentProcessInfo) override
Checks the input and that all required Kratos variables have been registered.
Definition: surface_tension.h:897
double DotProduct2D(const array_1d< double, 2 > &a, const array_1d< double, 2 > &b)
Definition: surface_tension.h:3034
void FinalizeNonLinearIteration(ProcessInfo &rCurrentProcessInfo) override
Definition: surface_tension.h:504
virtual void CalculateTau(double &TauOne, double &TauTwo, const array_1d< double, 3 > &rAdvVel, const double ElemSize, const double Density, const double Viscosity, const ProcessInfo &rCurrentProcessInfo)
Calculate Stabilization parameters.
Definition: surface_tension.h:1009
virtual void CalculateC(BoundedMatrix< double,(TDim *TNumNodes)/2,(TDim *TNumNodes)/2 > &rC, const double Viscosity)
Calculate a matrix that provides the stress given the strain rate.
virtual void EvaluateInPoint(double &rResult, const Variable< double > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc)
Write the value of a variable at a point inside the element to a double.
Definition: surface_tension.h:2700
std::size_t IndexType
Definition: surface_tension.h:121
std::size_t SizeType
Definition: surface_tension.h:123
void NormalizeVec2D(array_1d< double, 2 > &input)
Definition: surface_tension.h:3013
void CalculateMassMatrix(MatrixType &rMassMatrix, ProcessInfo &rCurrentProcessInfo) override
Computes local contributions to the mass matrix.
Definition: surface_tension.h:315
BoundedMatrix< double, TNumNodes, TDim > ShapeFunctionDerivativesType
Definition: surface_tension.h:132
void CalculateRightHandSide(VectorType &rRightHandSideVector, ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and projections to the RHS.
Definition: surface_tension.h:266
~SurfaceTension() override
Destructor.
Definition: surface_tension.h:177
void Calculate(const Variable< array_1d< double, 3 > > &rVariable, array_1d< double, 3 > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Implementation of Calculate to compute the local OSS projections.
Definition: surface_tension.h:560
void GetValueOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Empty implementation of unused CalculateOnIntegrationPoints overloads to avoid compilation warning.
Definition: surface_tension.h:875
SurfaceTension(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: surface_tension.h:153
virtual void CalculateStaticTau(double &TauOne, const array_1d< double, 3 > &rAdvVel, const double ElemSize, const double Density, const double Viscosity)
Calculate momentum stabilization parameter (without time term).
Definition: surface_tension.h:1040
void GetAdvectiveVel(array_1d< double, 3 > &rAdvVel, const array_1d< double, TNumNodes > &rShapeFunc)
Write the advective velocity evaluated at this point to an array.
Definition: surface_tension.h:2639
virtual void AddViscousTerm(MatrixType &rDampingMatrix, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Adds the contribution of the viscous term to the momentum equation.
void GetFirstDerivativesVector(Vector &Values, int Step=0) override
Returns VELOCITY_X, VELOCITY_Y, (VELOCITY_Z,) PRESSURE for each node.
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_CHECK_DOF_IN_NODE(TheVariable, TheNode)
Definition: checks.h:176
#define KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
Definition: checks.h:171
dt
Definition: DEM_benchmarks.py:173
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
rho
Definition: generate_droplet_dynamics.py:86
u2
Definition: generate_frictional_mortar_condition.py:76
input
Definition: generate_frictional_mortar_condition.py:435
x2
Definition: generate_frictional_mortar_condition.py:122
mu
Definition: generate_frictional_mortar_condition.py:127
u1
Definition: generate_frictional_mortar_condition.py:75
X2
Definition: generate_frictional_mortar_condition.py:120
x1
Definition: generate_frictional_mortar_condition.py:121
X1
Definition: generate_frictional_mortar_condition.py:119
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
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
F
Definition: hinsberg_optimization.py:144
float zeta_dissapative_BM
Definition: lagrangian_droplet_test.py:134
float zeta_dissapative_SM
Definition: lagrangian_droplet_test.py:135
float zeta_dissapative_JM
this is for sessile droplets####
Definition: lagrangian_droplet_test.py:133
def load(f)
Definition: ode_solve.py:307
int L
Definition: ode_solve.py:390
int d
Definition: ode_solve.py:397
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
int m
Definition: run_marine_rain_substepping.py:8
J
Definition: sensitivityMatrix.py:58
N
Definition: sensitivityMatrix.py:29
K
Definition: sensitivityMatrix.py:73
B
Definition: sensitivityMatrix.py:76
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17
subroutine m1(phi, M)
Definition: TensorModule.f:789
double precision, public pi
Definition: TensorModule.f:16