48 #ifndef MONOLITHIC_DEM_COUPLED_WEAK_H
49 #define MONOLITHIC_DEM_COUPLED_WEAK_H
64 #include "utilities/geometry_utilities.h"
135 template<
unsigned int TDim,
136 unsigned int TNumNodes = TDim + 1 >
227 Element(NewId, pGeometry, pProperties)
253 PropertiesType::Pointer pProperties)
const override
274 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
277 if (rLeftHandSideMatrix.size1() != LocalSize)
278 rLeftHandSideMatrix.
resize(LocalSize, LocalSize,
false);
283 this->CalculateRightHandSide(rRightHandSideVector, rCurrentProcessInfo);
293 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
295 if (rLeftHandSideMatrix.size1() != LocalSize)
296 rLeftHandSideMatrix.
resize(LocalSize, LocalSize,
false);
314 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
317 if (rRightHandSideVector.size() != LocalSize)
318 rRightHandSideVector.
resize(LocalSize,
false);
330 this->EvaluateInPoint(Density, DENSITY,
N);
338 this->CalculateWeights(DN_DXContainer, NContainer, GaussWeights);
339 const SizeType NumGauss = NContainer.size1();
341 for (
SizeType g = 0; g < NumGauss; g++)
343 const double GaussWeight = GaussWeights[g];
345 this->AddMomentumRHS(rRightHandSideVector, Density, Ng, GaussWeight);
348 const double& DeltaTime = rCurrentProcessInfo[DELTA_TIME];
349 static const double arr[] = {0.5,0.5};
350 std::vector<double> SchemeWeights (arr, arr +
sizeof(arr) /
sizeof(arr[0]));
352 this->AddOtherContributionsRHS(rRightHandSideVector,
N, SchemeWeights, DeltaTime);
356 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
359 this->GetAdvectiveVel(AdvVel,
N);
362 this->EvaluateInPoint(KinViscosity, VISCOSITY,
N);
365 this->GetEffectiveViscosity(Density,KinViscosity,
N, DN_DX, Viscosity, rCurrentProcessInfo);
368 double TauOne, TauTwo;
369 this->CalculateTau(TauOne, TauTwo, AdvVel, Area,Density, Viscosity, rCurrentProcessInfo);
371 this->AddProjectionToRHS(rRightHandSideVector, AdvVel, Density, TauOne, TauTwo,
N, DN_DX, Area,rCurrentProcessInfo[DELTA_TIME]);
427 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
430 if (rMassMatrix.size1() != LocalSize)
431 rMassMatrix.
resize(LocalSize, LocalSize,
false);
433 rMassMatrix =
ZeroMatrix(LocalSize, LocalSize);
443 this->EvaluateInPoint(Density, DENSITY,
N);
452 this->CalculateWeights(DN_DXContainer, NContainer, GaussWeights);
453 const SizeType NumGauss = NContainer.size1();
455 for (
SizeType g = 0; g < NumGauss; g++)
457 const double GaussWeight = GaussWeights[g];
460 AddConsistentMassMatrixContribution(rMassMatrix, Ng, Density, GaussWeight);
462 if (rCurrentProcessInfo[OSS_SWITCH] != 1)
465 this->EvaluateInPoint(KinViscosity, VISCOSITY, Ng);
468 this->GetEffectiveViscosity(Density,KinViscosity, Ng, DN_DXg, Viscosity, rCurrentProcessInfo);
473 this->GetAdvectiveVel(AdvVel, Ng);
476 double TauOne, TauTwo;
477 this->CalculateTau(TauOne, TauTwo, AdvVel, Area, Density, Viscosity, rCurrentProcessInfo);
480 this->AddMassStabTerms(rMassMatrix, Density, AdvVel, TauOne, Ng, DN_DXg, GaussWeight);
529 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
533 if (rDampingMatrix.size1() != LocalSize)
534 rDampingMatrix.
resize(LocalSize, LocalSize,
false);
545 double Density, KinViscosity;
546 this->EvaluateInPoint(Density, DENSITY,
N);
547 this->EvaluateInPoint(KinViscosity, VISCOSITY,
N);
550 this->GetEffectiveViscosity(Density,KinViscosity,
N, DN_DX, Viscosity, rCurrentProcessInfo);
554 this->GetAdvectiveVel(AdvVel,
N);
557 double TauOne, TauTwo;
558 this->CalculateTau(TauOne, TauTwo, AdvVel, Area, Density, Viscosity, rCurrentProcessInfo);
572 this->CalculateWeights(DN_DXContainer, NContainer, GaussWeights);
573 const SizeType NumGauss = NContainer.size1();
575 for (
SizeType g = 0; g < NumGauss; g++)
577 const double GaussWeight = GaussWeights[g];
580 this->GetAdvectiveVel(AdvVel, Ng);
581 this->AddIntegrationPointVelocityContribution(rDampingMatrix, rRightHandSideVector, Density, Viscosity, AdvVel, TauOne, TauTwo, Ng, DN_DXg, GaussWeight);
594 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
597 for (
unsigned int d = 0;
d < TDim; ++
d)
599 U[LocalIndex] = rVel[
d];
602 U[LocalIndex] = this->GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE);
606 noalias(rRightHandSideVector) -=
prod(rDampingMatrix, U);
671 if (rVariable == ERROR_RATIO)
680 double Density, KinViscosity;
681 this->EvaluateInPoint(Density, DENSITY,
N);
682 this->EvaluateInPoint(KinViscosity, VISCOSITY,
N);
685 this->GetEffectiveViscosity(Density,KinViscosity,
N, DN_DX, Viscosity, rCurrentProcessInfo);
689 this->GetAdvectiveVel(AdvVel,
N);
696 this->CalculateStaticTau(TauOne, AdvVel, Area,Density, Viscosity);
698 if ( rCurrentProcessInfo[OSS_SWITCH] != 1 )
700 this->ASGSMomResidual(AdvVel,Density,ElementalMomRes,
N,DN_DX,1.0);
701 ElementalMomRes *= TauOne;
705 this->OSSMomResidual(AdvVel,Density,ElementalMomRes,
N,DN_DX,1.0);;
706 ElementalMomRes *= TauOne;
710 double ErrorRatio(0.0);
714 for (
unsigned int i = 0;
i < TDim; ++
i)
716 ErrorRatio += ElementalMomRes[
i] * ElementalMomRes[
i];
719 ErrorRatio = sqrt(ErrorRatio);
720 ErrorRatio /= Density;
721 this->
SetValue(ERROR_RATIO, ErrorRatio);
722 rOutput = ErrorRatio;
724 else if (rVariable == NODAL_AREA)
733 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
735 this->GetGeometry()[
i].SetLock();
736 this->GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += Area *
N[
i];
737 this->GetGeometry()[
i].UnSetLock();
758 if (rVariable == ADVPROJ)
768 this->EvaluateInPoint(Density, DENSITY,
N);
772 this->GetAdvectiveVel(AdvVel,
N);
776 double ElementalMassRes(0);
778 this->AddProjectionResidualContribution(AdvVel, Density, ElementalMomRes, ElementalMassRes,
N, DN_DX, Area);
780 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
783 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
785 this->GetGeometry()[
i].SetLock();
787 for (
unsigned int d = 0;
d < TDim; ++
d)
788 rAdvProj[
d] +=
N[
i] * ElementalMomRes[
d];
790 this->GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ) +=
N[
i] * ElementalMassRes;
791 this->GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += Area *
N[
i];
792 this->GetGeometry()[
i].UnSetLock();
797 rOutput = ElementalMomRes;
799 else if (rVariable == SUBSCALE_VELOCITY)
809 this->EvaluateInPoint(Density, DENSITY,
N);
813 this->GetAdvectiveVel(AdvVel,
N);
817 double ElementalMassRes(0.0);
819 this->AddProjectionResidualContribution(AdvVel, Density, ElementalMomRes, ElementalMassRes,
N, DN_DX, Area);
821 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
826 const double Weight = ConsistentMassCoef(Area);
828 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
830 this->GetGeometry()[
i].SetLock();
834 double& rMassRHS = this->GetGeometry()[
i].GetValue(DIVPROJ);
835 for (
unsigned int d = 0;
d < TDim; ++
d)
836 rMomRHS[
d] +=
N[
i] * ElementalMomRes[
d];
838 rMassRHS +=
N[
i] * ElementalMassRes;
841 this->GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += Area *
N[
i];
844 for(
unsigned int j = 0;
j < TNumNodes; ++
j)
846 for(
unsigned int d = 0;
d < TDim; ++
d)
847 rMomRHS[
d] -= Weight * this->GetGeometry()[
j].FastGetSolutionStepValue(ADVPROJ)[
d];
848 rMassRHS -= Weight * this->GetGeometry()[
j].FastGetSolutionStepValue(DIVPROJ);
850 for(
unsigned int d = 0;
d < TDim; ++
d)
851 rMomRHS[
d] -= Weight * this->GetGeometry()[
i].FastGetSolutionStepValue(ADVPROJ)[
d];
852 rMassRHS -= Weight * this->GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ);
854 this->GetGeometry()[
i].UnSetLock();
859 rOutput = ElementalMomRes;
921 std::vector<double>& rValues,
924 if (rVariable == TAUONE || rVariable == TAUTWO || rVariable == MU)
926 double TauOne, TauTwo;
933 this->GetAdvectiveVel(AdvVel,
N);
935 double Density,KinViscosity;
936 this->EvaluateInPoint(Density, DENSITY,
N);
937 this->EvaluateInPoint(KinViscosity, VISCOSITY,
N);
940 this->GetEffectiveViscosity(Density,KinViscosity,
N, DN_DX, Viscosity, rCurrentProcessInfo);
942 this->CalculateTau(TauOne, TauTwo, AdvVel, Area, Density, Viscosity, rCurrentProcessInfo);
944 rValues.resize(1,
false);
945 if (rVariable == TAUONE)
949 else if (rVariable == TAUTWO)
953 else if (rVariable == MU)
955 rValues[0] = Density * Viscosity;
958 else if(rVariable == SUBSCALE_PRESSURE)
960 double TauOne, TauTwo;
967 this->GetAdvectiveVel(AdvVel,
N);
969 double Density,KinViscosity;
970 this->EvaluateInPoint(Density, DENSITY,
N);
971 this->EvaluateInPoint(KinViscosity, VISCOSITY,
N);
974 this->GetEffectiveViscosity(Density,KinViscosity,
N, DN_DX, Viscosity, rCurrentProcessInfo);
976 this->CalculateTau(TauOne, TauTwo, AdvVel, Area, Density, Viscosity, rCurrentProcessInfo);
979 for(
unsigned int i=0;
i < TNumNodes;
i++)
981 for(
unsigned int d = 0;
d < TDim;
d++)
982 DivU -= DN_DX(
i,
d) * this->GetGeometry()[
i].FastGetSolutionStepValue(VELOCITY)[
d];
987 rValues[0] = TauTwo * DivU;
989 if(rCurrentProcessInfo[OSS_SWITCH]==1)
992 for(
unsigned int i=0;
i < TNumNodes;
i++)
994 Proj +=
N[
i]*this->GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ);
996 rValues[0] -= TauTwo*Proj;
999 else if (rVariable == NODAL_AREA && TDim == 3)
1007 J(0,0) =
X1[0]-X0[0];
1008 J(0,1) =
X2[0]-X0[0];
1009 J(0,2) = X3[0]-X0[0];
1010 J(1,0) =
X1[1]-X0[1];
1011 J(1,1) =
X2[1]-X0[1];
1012 J(1,2) = X3[1]-X0[1];
1013 J(2,0) =
X1[2]-X0[2];
1014 J(2,1) =
X2[2]-X0[2];
1015 J(2,2) = X3[2]-X0[2];
1017 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) );
1018 rValues.resize(1,
false);
1023 rValues.resize(1,
false);
1031 rValues[0] = const_this->
GetValue(rVariable);
1041 std::vector<Vector>& rValues,
1046 std::vector<Matrix>& rValues,
1073 if(ErrorCode != 0)
return ErrorCode;
1081 for(
unsigned int i=0;
i<this->GetGeometry().size(); ++
i) {
1095 if (this->GetGeometry().WorkingSpaceDimension() == 2) {
1096 for (
unsigned int i=0;
i<this->GetGeometry().size(); ++
i) {
1097 KRATOS_ERROR_IF(this->GetGeometry()[
i].
Z() != 0.0) <<
"Node with non-zero Z coordinate found. Id: "<< this->GetGeometry()[
i].Id() << std::endl;
1116 virtual std::string
Info()
const override
1118 std::stringstream buffer;
1119 buffer <<
"MonolithicDEMCoupledWeak #" << Id();
1120 return buffer.str();
1124 virtual void PrintInfo(std::ostream& rOStream)
const override
1126 rOStream <<
"MonolithicDEMCoupledWeak" << TDim <<
"D";
1179 const double Density,
1180 const double KinViscosity,
1184 double AdvVelNorm = 0.0;
1185 for (
unsigned int d = 0;
d < TDim; ++
d)
1186 AdvVelNorm += rAdvVel[
d] * rAdvVel[
d];
1188 AdvVelNorm = sqrt(AdvVelNorm);
1193 const double Element_Size = this->ElementSize(Area);
1200 double lp = sqrt(L0 * Element_Size);
1206 if (
sigma > 0.00001){
1207 TauOne = Element_Size * Element_Size / (c2u *
sigma * lu * lu);
1208 TauTwo = lp * lp *
sigma * c2p;
1211 TauOne = 1.0 / (Density * ( rCurrentProcessInfo[DYNAMIC_TAU] / rCurrentProcessInfo[DELTA_TIME] + 5.6666666666 * KinViscosity / (Element_Size * Element_Size) + 2.0 * AdvVelNorm / Element_Size) );
1212 TauTwo = Density * (KinViscosity + 0.5 * Element_Size * AdvVelNorm);
1241 const double Density,
1242 const double KinViscosity)
1245 double AdvVelNorm = 0.0;
1246 for (
unsigned int d = 0;
d < TDim; ++
d)
1247 AdvVelNorm += rAdvVel[
d] * rAdvVel[
d];
1249 AdvVelNorm = sqrt(AdvVelNorm);
1254 const double Element_Size = this->ElementSize(Area);
1256 TauOne = 1.0 / (Density*(4.0 * KinViscosity / (Element_Size * Element_Size) + 2.0 * AdvVelNorm / Element_Size));
1262 double lp = sqrt(L0 * Element_Size);
1268 if (
sigma > 0.00001){
1269 TauOne = Element_Size * Element_Size / (c2u *
sigma * lu * lu);
1272 TauOne = 1.0 / (Density*(4.0 * KinViscosity / (Element_Size * Element_Size) + 2.0 * AdvVelNorm / Element_Size));
1279 const double Density,
1281 const double Weight)
1283 double Coef = Density * Weight;
1286 this->EvaluateInPoint(BodyForce, BODY_FORCE, rShapeFunc);
1291 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
1293 for (
unsigned int d = 0;
d < TDim; ++
d)
1295 F[LocalIndex++] += Coef * rShapeFunc[iNode] * BodyForce[
d];
1303 const std::vector<double>& TimeSchemeWeights,
1304 const double& DeltaTime)
1307 double FluidFractionRate;
1308 this->EvaluateTimeDerivativeInPoint(FluidFractionRate, FLUID_FRACTION_RATE, rShapeFunc, DeltaTime, TimeSchemeWeights);
1313 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode){
1315 for (
unsigned int d = 0;
d < TDim; ++
d){
1316 F[LocalIndex++] -= FluidFractionRate;
1328 const double Density,
1329 const double TauOne,
1330 const double TauTwo,
1333 const double Weight,
1334 const double DeltaTime = 1.0)
1336 const unsigned int BlockSize = TDim + 1;
1339 this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv);
1341 for (
int i = 0;
i != TNumNodes; ++
i){
1346 this->EvaluateInPoint(
sigma,PERMEABILITY_1_DAY,rShapeFunc);
1349 double DivProj = 0.0;
1350 this->EvaluateInPoint(MomProj,ADVPROJ,rShapeFunc);
1351 this->EvaluateInPoint(DivProj,DIVPROJ,rShapeFunc);
1356 unsigned int FirstRow = 0;
1358 for (
unsigned int i = 0;
i < TNumNodes;
i++)
1361 double FluidFraction = this->GetGeometry()[
i].FastGetSolutionStepValue(FLUID_FRACTION);
1363 FluidFractionGradient[0] += rShapeDeriv(
i, 0) * FluidFraction;
1364 FluidFractionGradient[1] += rShapeDeriv(
i, 1) * FluidFraction;
1365 FluidFractionGradient[2] += rShapeDeriv(
i, 2) * FluidFraction;
1368 for (
unsigned int d = 0;
d < TDim;
d++)
1374 RHS[FirstRow+
d] -= Weight * ((Density * AGradN[
i] -
sigma * rShapeFunc[
i]) * MomProj[
d] + (FluidFraction * rShapeDeriv(
i,
d) + FluidFractionGradient[
d] * rShapeFunc[
i]) * DivProj);
1377 RHS[FirstRow+TDim] -= Weight * rShapeDeriv(
i,
d) * MomProj[
d];
1379 FirstRow += BlockSize;
1393 unsigned int DofIndex = 0;
1394 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
1396 for (
unsigned int d = 0;
d < TDim; ++
d)
1398 rLHSMatrix(DofIndex, DofIndex) += Mass;
1407 const double Density,
1408 const double Weight)
1410 const unsigned int BlockSize = TDim + 1;
1412 double Coef = Density * Weight;
1413 unsigned int FirstRow(0), FirstCol(0);
1417 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1420 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1423 K = Coef * rShapeFunc[
i] * rShapeFunc[
j];
1425 for (
unsigned int d = 0;
d < TDim; ++
d)
1427 rLHSMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1430 FirstCol += BlockSize;
1433 FirstRow += BlockSize;
1453 const double Density,
1455 const double TauOne,
1458 const double Weight)
1460 const unsigned int BlockSize = TDim + 1;
1462 double Coef = Weight * TauOne;
1463 unsigned int FirstRow(0), FirstCol(0);
1468 this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv);
1470 double FluidFraction;
1472 this->EvaluateInPoint(FluidFraction, FLUID_FRACTION, rShapeFunc);
1473 this->EvaluateGradientOfScalarInPoint(FluidFractionGradient, FLUID_FRACTION, rShapeDeriv);
1475 for (
unsigned int i = 0;
i < TNumNodes; ++
i) {
1476 this->GetGeometry()[
i].FastGetSolutionStepValue(FLUID_FRACTION_GRADIENT) = FluidFractionGradient;
1479 for (
int i = 0;
i != TNumNodes; ++
i){
1483 this->EvaluateInPoint(
sigma,PERMEABILITY_1_DAY,rShapeFunc);
1488 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1491 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1494 K = Coef * Density * AGradN[
i] * Density * rShapeFunc[
j];
1497 for (
unsigned int d = 0;
d < TDim; ++
d)
1499 rLHSMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1503 rLHSMatrix(FirstRow + TDim, FirstCol +
d) += Coef * Density * (FluidFraction * rShapeDeriv(
i,
d) + FluidFractionGradient[
d] * rShapeFunc[
i]) * rShapeFunc[
j];
1507 FirstCol += BlockSize;
1510 FirstRow += BlockSize;
1518 const double Density,
1519 const double Viscosity,
1521 const double TauOne,
1522 const double TauTwo,
1525 const double Weight)
1527 const unsigned int BlockSize = TDim + 1;
1531 this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv);
1533 for (
int i = 0;
i != TNumNodes; ++
i){
1537 this->EvaluateInPoint(
sigma,PERMEABILITY_1_DAY,rShapeFunc);
1540 unsigned int FirstRow(0), FirstCol(0);
1541 double K, G, PDivV,
L, qF;
1544 this->EvaluateInPoint(BodyForce,BODY_FORCE,rShapeFunc);
1545 BodyForce *= Density;
1547 double DivPEpsilon, GEps, FluidFraction;
1549 this->EvaluateInPoint(FluidFraction, FLUID_FRACTION, rShapeFunc);
1550 this->EvaluateGradientOfScalarInPoint(FluidFractionGradient, FLUID_FRACTION, rShapeDeriv);
1566 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1568 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1573 K = Density * rShapeFunc[
i] * AGradN[
j];
1576 K += TauOne * Density * AGradN[
i] * Density * AGradN[
j];
1584 for (
unsigned int m = 0;
m < TDim; ++
m)
1591 G = TauOne * Density * AGradN[
i] * rShapeDeriv(
j,
m);
1593 G -= TauOne *
sigma * rShapeFunc[
i] * rShapeDeriv(
j,
m);
1596 GEps = TauOne * Density * AGradN[
i] * (FluidFraction * rShapeDeriv(
j,
m) + FluidFractionGradient[
m] * rShapeFunc[
j]);
1598 GEps += TauOne *
sigma * rShapeFunc[
i] * (FluidFraction * rShapeDeriv(
j,
m) + FluidFractionGradient[
m] * rShapeFunc[
j]);
1600 DivPEpsilon = (FluidFraction * rShapeDeriv(
i,
m) + FluidFractionGradient[
m] * rShapeFunc[
i]) * rShapeFunc[
j];
1602 PDivV = rShapeDeriv(
i,
m) * rShapeFunc[
j];
1605 rDampingMatrix(FirstRow +
m, FirstCol + TDim) += Weight * (G - PDivV);
1609 rDampingMatrix(FirstCol + TDim, FirstRow +
m) += Weight * (GEps + DivPEpsilon);
1613 L += (FluidFraction * rShapeDeriv(
i,
m) + FluidFractionGradient[
m] * rShapeFunc[
i]) * rShapeDeriv(
j,
m);
1615 for (
unsigned int n = 0;
n < TDim; ++
n)
1620 rDampingMatrix(FirstRow +
m, FirstCol +
n) += Weight * TauTwo * rShapeDeriv(
i,
m) * (FluidFraction * rShapeDeriv(
j,
n) + FluidFractionGradient[
n] * rShapeFunc[
j]);
1627 for (
unsigned int d = 0;
d < TDim; ++
d)
1628 rDampingMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1631 rDampingMatrix(FirstRow + TDim, FirstCol + TDim) += Weight * TauOne *
L;
1635 FirstCol += BlockSize;
1640 for (
unsigned int d = 0;
d < TDim; ++
d)
1645 rDampRHS[FirstRow +
d] += Weight * TauOne * (Density * AGradN[
i] -
sigma * rShapeFunc[
i]) * BodyForce[
d];
1648 qF += (FluidFraction * rShapeDeriv(
i,
d) + FluidFractionGradient[
d] * rShapeFunc[
i]) * BodyForce[
d];
1653 rDampRHS[FirstRow + TDim] += Weight * TauOne * qF;
1656 FirstRow += BlockSize;
1662 this->AddViscousTerm(rDampingMatrix,rShapeDeriv,Viscosity*Density*Weight);
1774 const double Density,
1776 double& rElementalMassRes,
1779 const double Weight)
1783 this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv);
1785 for (
int i = 0;
i != TNumNodes; ++
i){
1789 this->EvaluateInPoint(
sigma,PERMEABILITY_1_DAY,rShapeFunc);
1792 double FluidFraction;
1794 this->EvaluateInPoint(FluidFraction, FLUID_FRACTION, rShapeFunc);
1795 this->EvaluateGradientOfScalarInPoint(FluidFractionGradient, FLUID_FRACTION, rShapeDeriv);
1798 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1804 const double& rPressure = this->GetGeometry()[
i].FastGetSolutionStepValue(PRESSURE);
1807 for (
unsigned int d = 0;
d < TDim; ++
d)
1811 rElementalMomRes[
d] += Weight * (Density * (rShapeFunc[
i] * rBodyForce[
d] - AGradN[
i] * rVelocity[
d]) -
sigma * rShapeFunc[
i] * rVelocity[
d] - rShapeDeriv(
i,
d) * rPressure);
1815 rElementalMassRes -= Weight * (FluidFraction * rShapeDeriv(
i,
d) * rVelocity[
d] + FluidFractionGradient[
d] * rVelocity[
d]);
1818 rElementalMassRes += Weight * this->GetGeometry()[
i].FastGetSolutionStepValue(FLUID_FRACTION_RATE);
1835 const double Density,
1839 const double Weight)
1843 this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv);
1845 for (
int i = 0;
i != TNumNodes; ++
i){
1849 this->EvaluateInPoint(
sigma,PERMEABILITY_1_DAY,rShapeFunc);
1852 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1857 const array_1d< double, 3 > & rAcceleration = this->GetGeometry()[
i].FastGetSolutionStepValue(ACCELERATION);
1859 const double& rPressure = this->GetGeometry()[
i].FastGetSolutionStepValue(PRESSURE);
1862 for (
unsigned int d = 0;
d < TDim; ++
d)
1866 rElementalMomRes[
d] += Weight * (Density * (rShapeFunc[
i] * (rBodyForce[
d] - rAcceleration[
d]) - AGradN[
i] * rVelocity[
d]) -
sigma * rShapeFunc[
i] * rVelocity[
d] - rShapeDeriv(
i,
d) * rPressure);
1883 const double Density,
1887 const double Weight)
1891 this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv);
1893 for (
int i = 0;
i != TNumNodes; ++
i){
1897 this->EvaluateInPoint(
sigma,PERMEABILITY_1_DAY,rShapeFunc);
1900 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1907 const double& rPressure = this->GetGeometry()[
i].FastGetSolutionStepValue(PRESSURE);
1910 for (
unsigned int d = 0;
d < TDim; ++
d)
1914 rElementalMomRes[
d] += Weight * (Density * (rShapeFunc[
i] * rBodyForce[
d] - AGradN[
i] * rVelocity[
d]) -
sigma * rShapeFunc[
i] * rVelocity[
d] - rShapeDeriv(
i,
d) * rPressure);
1916 rElementalMomRes[
d] -= Weight * rShapeFunc[
i] * rProjection[
d];
1933 const double MolecularViscosity,
1936 double& TotalViscosity,
1939 const double C = this->
GetValue(C_SMAGORINSKY);
1941 TotalViscosity = MolecularViscosity;
1945 const double FilterWidth = this->FilterWidth(rShapeDeriv);
1947 const double NormS = this->SymmetricGradientNorm(rShapeDeriv);
1950 TotalViscosity += 2.0 *
C *
C * FilterWidth * NormS;
1965 rAdvVel = rShapeFunc[0] * (this->GetGeometry()[0].FastGetSolutionStepValue(VELOCITY) - this->GetGeometry()[0].FastGetSolutionStepValue(MESH_VELOCITY));
1966 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
1967 rAdvVel += rShapeFunc[iNode] * (this->GetGeometry()[iNode].FastGetSolutionStepValue(VELOCITY) - this->GetGeometry()[iNode].FastGetSolutionStepValue(MESH_VELOCITY));
1980 const std::size_t Step)
1983 rAdvVel = rShapeFunc[0] * (this->GetGeometry()[0].FastGetSolutionStepValue(VELOCITY, Step) - this->GetGeometry()[0].FastGetSolutionStepValue(MESH_VELOCITY, Step));
1984 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
1985 rAdvVel += rShapeFunc[iNode] * (this->GetGeometry()[iNode].FastGetSolutionStepValue(VELOCITY, Step) - this->GetGeometry()[iNode].FastGetSolutionStepValue(MESH_VELOCITY, Step));
2001 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
2004 rResult[iNode] = rVelocity[0] * rShapeDeriv(iNode, 0);
2005 for (
unsigned int d = 1;
d < TDim; ++
d)
2006 rResult[iNode] += rVelocity[
d] * rShapeDeriv(iNode,
d);
2025 const double Weight = 1.0)
2028 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
2029 rResult += Weight * rShapeFunc[iNode] * this->GetGeometry()[iNode].FastGetSolutionStepValue(rVariable);
2047 rResult = rShapeFunc[0] * this->GetGeometry()[0].FastGetSolutionStepValue(rVariable);
2048 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
2049 rResult += rShapeFunc[iNode] * this->GetGeometry()[iNode].FastGetSolutionStepValue(rVariable);
2059 for (
unsigned int i = 0;
i < TNumNodes; ++
i) {
2060 double& scalar = this->GetGeometry()[
i].FastGetSolutionStepValue(rVariable);
2062 for (
unsigned int d = 0;
d < TDim; ++
d){
2063 rResult[
d] += rShapeDeriv(
i,
d) * scalar;
2071 const double& DeltaTime,
2072 const std::vector<double>& rSchemeWeigths)
2076 if (rVariable == FLUID_FRACTION_RATE){
2079 for (
unsigned int iWeight = 0; iWeight < rSchemeWeigths.size(); ++iWeight){
2081 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode){
2082 rResult += rSchemeWeigths[iWeight] * rShapeFunc[iNode] * this->GetGeometry()[iNode].FastGetSolutionStepValue(rVariable, iWeight);
2087 rResult /= DeltaTime;
2106 const double Weight = 1.0)
2109 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
2110 rResult += Weight * rShapeFunc[iNode] * this->GetGeometry()[iNode].FastGetSolutionStepValue(rVariable);
2127 rResult = rShapeFunc[0] * this->GetGeometry()[0].FastGetSolutionStepValue(rVariable);
2128 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
2129 rResult += rShapeFunc[iNode] * this->GetGeometry()[iNode].FastGetSolutionStepValue(rVariable);
2155 const unsigned int GradientSize = (TDim*(TDim+1))/2;
2160 for (
unsigned int k = 0;
k < TNumNodes; ++
k)
2164 for (
unsigned int i = 0;
i < TDim; ++
i)
2166 for (
unsigned int j = 0;
j <
i; ++
j)
2167 GradientVector[
Index++] += 0.5 * (rShapeDeriv(
k,
j) * rNodeVel[
i] + rShapeDeriv(
k,
i) * rNodeVel[
j]);
2168 GradientVector[
Index++] += rShapeDeriv(
k,
i) * rNodeVel[
i];
2175 for (
unsigned int i = 0;
i < TDim; ++
i)
2177 for (
unsigned int j = 0;
j <
i; ++
j)
2179 NormS += 2.0 * GradientVector[
Index] * GradientVector[
Index];
2182 NormS += GradientVector[
Index] * GradientVector[
Index];
2186 NormS = sqrt( 2.0 * NormS );
2199 const double Weight);
2214 const double Weight)
2219 this->CalculateC(
C,Weight);
2221 const unsigned int BlockSize = TDim + 1;
2222 const unsigned int StrainSize = (TDim*TNumNodes)/2;
2225 for(
unsigned int i=0;
i<TNumNodes;
i++)
2227 int base_index = TDim*
i;
2228 int aux_index = BlockSize*
i;
2229 for(
unsigned int j=0;
j<TDim;
j++)
2231 aux[base_index+
j] = aux_index+
j;
2235 for(
unsigned int k=0;
k< StrainSize;
k++)
2237 for(
unsigned int l=0;
l< StrainSize;
l++)
2239 const double Ckl =
C(
k,
l);
2240 for (
unsigned int i = 0;
i < TDim*TNumNodes; ++
i)
2242 const double Bki=
B(
k,
i);
2243 for (
unsigned int j = 0;
j < TDim*TNumNodes; ++
j)
2245 rDampingMatrix(aux[
i],aux[
j]) += Bki*Ckl*
B(
l,
j);
2256 const double Weight)
2262 for (
unsigned int n = 0;
n < TNumNodes;
n++)
2264 const array_1d<double,3>& rVel = this->GetGeometry()[
n].FastGetSolutionStepValue(VELOCITY);
2265 for (
unsigned int i = 0;
i < TDim;
i++)
2266 for (
unsigned int j = 0;
j < TDim;
j++)
2267 GradU(
i,
j) += rDN_DX(
n,
j)*rVel[
i];
2272 Delta[0] = fabs(rGeom[TNumNodes-1].
X()-rGeom[0].
X());
2273 Delta[1] = fabs(rGeom[TNumNodes-1].
Y()-rGeom[0].
Y());
2274 Delta[2] = fabs(rGeom[TNumNodes-1].
Z()-rGeom[0].
Z());
2276 for (
unsigned int n = 1;
n < TNumNodes;
n++)
2278 double hx = fabs(rGeom[
n].
X()-rGeom[
n-1].
X());
2279 if (hx > Delta[0]) Delta[0] = hx;
2280 double hy = fabs(rGeom[
n].
Y()-rGeom[
n-1].
Y());
2281 if (hy > Delta[1]) Delta[1] = hy;
2282 double hz = fabs(rGeom[
n].
Z()-rGeom[
n-1].
Z());
2283 if (hz > Delta[2]) Delta[2] = hz;
2286 double AvgDeltaSq = Delta[0];
2287 for (
unsigned int d = 1;
d < TDim;
d++)
2288 AvgDeltaSq *= Delta[
d];
2289 AvgDeltaSq = std::pow(AvgDeltaSq,2./TDim);
2291 Delta[0] = Delta[0]*Delta[0]/12.0;
2292 Delta[1] = Delta[1]*Delta[1]/12.0;
2293 Delta[2] = Delta[2]*Delta[2]/12.0;
2297 for (
unsigned int i = 0;
i < TDim;
i++)
2298 for (
unsigned int j = 0;
j < TDim;
j++)
2299 for (
unsigned int d = 0;
d < TDim;
d++)
2300 G(
i,
j) += Delta[
d]*GradU(
i,
d)*GradU(
j,
d);
2303 double GijSij = 0.0;
2304 for (
unsigned int i = 0;
i < TDim;
i++)
2305 for (
unsigned int j = 0;
j < TDim;
j++)
2306 GijSij += 0.5*G(
i,
j)*( GradU(
i,
j) + GradU(
j,
i) );
2311 double Gkk = G(0,0);
2312 for (
unsigned int d = 1;
d < TDim;
d++)
2316 const double Ce = 1.0;
2319 double ksgs = -4*AvgDeltaSq*GijSij/(Ce*Ce*Gkk);
2322 unsigned int RowIndex = 0;
2323 unsigned int ColIndex = 0;
2325 for (
unsigned int i = 0;
i < TNumNodes;
i++)
2327 for (
unsigned int j = 0;
j < TNumNodes;
j++)
2329 for (
unsigned int d = 0;
d < TDim;
d++)
2331 double Aux = rDN_DX(
i,
d) * Delta[0] * G(
d,0)*rDN_DX(
j,0);
2332 for (
unsigned int k = 1;
k < TDim;
k++)
2333 Aux += rDN_DX(
i,
d) *Delta[
k] * G(
d,
k)*rDN_DX(
j,
k);
2334 rDampingMatrix(RowIndex+
d,ColIndex+
d) += Weight * 2.0*ksgs * Aux;
2364 const double Viscosity);
2400 virtual void save(
Serializer& rSerializer)
const override
2435 MonolithicDEMCoupledWeak &
operator=(MonolithicDEMCoupledWeak
const& rOther);
2438 MonolithicDEMCoupledWeak(MonolithicDEMCoupledWeak
const& rOther);
2456 template<
unsigned int TDim,
2457 unsigned int TNumNodes >
2465 template<
unsigned int TDim,
2466 unsigned int TNumNodes >
2471 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
std::size_t SizeType
Definition: element.h:94
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
Geometry base class.
Definition: geometry.h:71
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 object defines an indexed object.
Definition: indexed_object.h:54
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
A stabilized element for the incompressible Navier-Stokes equations.
Definition: monolithic_dem_coupled_weak.h:138
MonolithicDEMCoupledWeak(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: monolithic_dem_coupled_weak.h:207
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: monolithic_dem_coupled_weak.h:176
virtual void EvaluateTimeDerivativeInPoint(double &rResult, const Variable< double > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc, const double &DeltaTime, const std::vector< double > &rSchemeWeigths)
Definition: monolithic_dem_coupled_weak.h:2068
Vector VectorType
Definition: monolithic_dem_coupled_weak.h:164
virtual void GetSecondDerivativesVector(Vector &Values, int Step=0) const override
Returns ACCELERATION_X, ACCELERATION_Y, (ACCELERATION_Z,) 0 for each node.
Matrix MatrixType
Definition: monolithic_dem_coupled_weak.h:166
std::size_t IndexType
Definition: monolithic_dem_coupled_weak.h:168
void CalculateLumpedMassMatrix(MatrixType &rLHSMatrix, const double Mass)
Add lumped mass matrix.
Definition: monolithic_dem_coupled_weak.h:1390
void ModulatedGradientDiffusion(MatrixType &rDampingMatrix, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX, const double Weight)
Definition: monolithic_dem_coupled_weak.h:2254
virtual void GetFirstDerivativesVector(Vector &Values, int Step=0) const override
Returns VELOCITY_X, VELOCITY_Y, (VELOCITY_Z,) PRESSURE for each node.
std::size_t SizeType
Definition: monolithic_dem_coupled_weak.h:170
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: monolithic_dem_coupled_weak.h:2122
MonolithicDEMCoupledWeak(IndexType NewId=0)
Default constuctor.
Definition: monolithic_dem_coupled_weak.h:198
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: monolithic_dem_coupled_weak.h:1452
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: monolithic_dem_coupled_weak.h:2042
virtual void CalculateOnIntegrationPoints(const Variable< array_1d< double, 6 > > &rVariable, std::vector< array_1d< double, 6 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: monolithic_dem_coupled_weak.h:1035
virtual void EvaluateGradientOfScalarInPoint(array_1d< double, 3 > &rResult, const Variable< double > &rVariable, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv)
Definition: monolithic_dem_coupled_weak.h:2054
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: monolithic_dem_coupled_weak.h:1978
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: monolithic_dem_coupled_weak.h:174
virtual void CalculateOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: monolithic_dem_coupled_weak.h:1045
virtual void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: monolithic_dem_coupled_weak.h:609
virtual void GetEffectiveViscosity(const double Density, const double MolecularViscosity, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, double &TotalViscosity, const ProcessInfo &rCurrentProcessInfo)
Add the contribution from Smagorinsky model to the (kinematic) viscosity.
Definition: monolithic_dem_coupled_weak.h:1932
virtual ~MonolithicDEMCoupledWeak()
Destructor.
Definition: monolithic_dem_coupled_weak.h:231
virtual void CalculateOnIntegrationPoints(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.
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: monolithic_dem_coupled_weak.h:162
std::vector< std::size_t > EquationIdVectorType
Definition: monolithic_dem_coupled_weak.h:172
void CalculateWeights(ShapeFunctionDerivativesArrayType &rDN_DX, Matrix &rNContainer, Vector &rGaussWeights)
Determine integration point weights and shape funcition derivatives from the element's geometry.
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MonolithicDEMCoupledWeak)
Pointer definition of MonolithicDEMCoupledWeak.
virtual void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Returns a list of the element's Dofs.
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: monolithic_dem_coupled_weak.h:1773
double FilterWidth(const BoundedMatrix< double, TNumNodes, TDim > &DN_DX)
Return the filter width for the smagorinsky model (Delta squared)
double ElementSize(const double)
Return an estimate for the element size h, used to calculate the stabilization parameters.
virtual void Calculate(const Variable< double > &rVariable, double &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Implementation of Calculate to compute an error estimate.
Definition: monolithic_dem_coupled_weak.h:667
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and OSS projection terms.
Definition: monolithic_dem_coupled_weak.h:270
MonolithicDEMCoupledWeak(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: monolithic_dem_coupled_weak.h:216
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.
double FilterWidth()
Return the filter width for the smagorinsky model (Delta squared)
Kratos::Vector ShapeFunctionsType
Type for shape function values container.
Definition: monolithic_dem_coupled_weak.h:180
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: monolithic_dem_coupled_weak.h:1882
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: monolithic_dem_coupled_weak.h:1996
MonolithicDEMCoupledWeak(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: monolithic_dem_coupled_weak.h:226
virtual void CalculateOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: monolithic_dem_coupled_weak.h:1040
virtual void AddPointContribution(array_1d< double, 3 > &rResult, const Variable< array_1d< double, 3 > > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc, const double Weight=1.0)
Add the weighted value of a variable at a point inside the element to a vector.
Definition: monolithic_dem_coupled_weak.h:2103
void AddBTransCB(MatrixType &rDampingMatrix, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Adds the contribution of the viscous term to the momentum equation (alternate).
Definition: monolithic_dem_coupled_weak.h:2212
virtual void CalculateTau(double &TauOne, double &TauTwo, const array_1d< double, 3 > &rAdvVel, const double Area, const double Density, const double KinViscosity, const ProcessInfo &rCurrentProcessInfo)
Calculate Stabilization parameters.
Definition: monolithic_dem_coupled_weak.h:1175
void AddConsistentMassMatrixContribution(MatrixType &rLHSMatrix, const array_1d< double, TNumNodes > &rShapeFunc, const double Density, const double Weight)
Definition: monolithic_dem_coupled_weak.h:1405
virtual void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Computes the local contribution associated to 'new' velocity and pressure values.
Definition: monolithic_dem_coupled_weak.h:525
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: monolithic_dem_coupled_weak.h:252
virtual 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: monolithic_dem_coupled_weak.h:754
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 CalculateStaticTau(double &TauOne, const array_1d< double, 3 > &rAdvVel, const double Area, const double Density, const double KinViscosity)
Calculate momentum stabilization parameter (without time term).
Definition: monolithic_dem_coupled_weak.h:1238
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: monolithic_dem_coupled_weak.h:159
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const override
Checks the input and that all required Kratos variables have been registered.
Definition: monolithic_dem_coupled_weak.h:1067
Node NodeType
definition of node type (default is: Node)
Definition: monolithic_dem_coupled_weak.h:150
void CalculateB(BoundedMatrix< double,(TDim *TNumNodes)/2, TDim *TNumNodes > &rB, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv)
Calculate the strain rate matrix.
double ConsistentMassCoef(const double Area)
double SymmetricGradientNorm(const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv)
Compute the norm of the symmetric gradient of velocity.
Definition: monolithic_dem_coupled_weak.h:2153
GeometryType::ShapeFunctionsGradientsType ShapeFunctionDerivativesArrayType
Type for an array of shape function gradient matrices.
Definition: monolithic_dem_coupled_weak.h:186
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and projections to the RHS.
Definition: monolithic_dem_coupled_weak.h:311
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: monolithic_dem_coupled_weak.h:1278
virtual void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Computes local contributions to the mass matrix.
Definition: monolithic_dem_coupled_weak.h:424
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: monolithic_dem_coupled_weak.h:1326
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: monolithic_dem_coupled_weak.h:1124
IndexedObject BaseType
base type: an IndexedObject that automatically has a unique number
Definition: monolithic_dem_coupled_weak.h:147
virtual 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: monolithic_dem_coupled_weak.h:1961
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: monolithic_dem_coupled_weak.h:1834
virtual void AddPointContribution(double &rResult, const Variable< double > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc, const double Weight=1.0)
Add the weighted value of a variable at a point inside the element to a double.
Definition: monolithic_dem_coupled_weak.h:2022
virtual void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Obtain a double elemental variable, evaluated on gauss points.
Definition: monolithic_dem_coupled_weak.h:920
virtual void AddOtherContributionsRHS(VectorType &F, const array_1d< double, TNumNodes > &rShapeFunc, const std::vector< double > &TimeSchemeWeights, const double &DeltaTime)
Definition: monolithic_dem_coupled_weak.h:1301
virtual void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Returns a zero matrix of appropiate size (provided for compatibility with scheme)
Definition: monolithic_dem_coupled_weak.h:291
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: monolithic_dem_coupled_weak.h:1516
Properties PropertiesType
Definition: monolithic_dem_coupled_weak.h:156
Kratos::Matrix ShapeFunctionDerivativesType
Type for a matrix containing the shape function gradients.
Definition: monolithic_dem_coupled_weak.h:183
virtual std::string Info() const override
Turn back information as a string.
Definition: monolithic_dem_coupled_weak.h:1116
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Provides the global indices for each one of this element's local rows.
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
#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_CHECK_DOF_IN_NODE(TheVariable, TheNode)
Definition: checks.h:176
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
Definition: checks.h:171
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
void CalculateB(const GeometricalObject &rElement, const TMatrixType1 &rDN_DX, TMatrixType2 &rB)
This method computes the deformation tensor B (for small deformation solid elements)
Definition: structural_mechanics_element_utilities.h:105
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::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
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
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
X2
Definition: generate_frictional_mortar_condition.py:120
X1
Definition: generate_frictional_mortar_condition.py:119
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
F
Definition: hinsberg_optimization.py:144
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 sigma
Definition: rotating_cone.py:79
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