64 template<std::
size_t TDim, std::
size_t TNumNodes>
123 WallLawDataContainer wall_law_data;
124 wall_law_data.Initialize(*pCondition);
128 SetTangentialProjectionMatrix(wall_law_data.Normal, tang_proj_mat);
131 const SizeType n_gauss = wall_law_data.GaussPtsWeights.size();
132 for (
IndexType i_gauss = 0; i_gauss < n_gauss; ++i_gauss) {
134 const double w_gauss = wall_law_data.GaussPtsWeights[i_gauss];
135 const auto& N_gauss =
row(wall_law_data.ShapeFunctionsContainer, i_gauss);
138 double gp_slip_length = 0.0;
139 for (
IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
140 gp_slip_length += N_gauss[i_node] * wall_law_data.NodalSlipLength[i_node];
144 const double aux_val =
w_gauss * wall_law_data.DynamicViscosity / gp_slip_length;
145 for (
IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
146 for (
IndexType j_node = 0; j_node < TNumNodes; ++j_node) {
147 const auto& r_v_j = wall_law_data.NodalWallVelocities[j_node];
149 for (
IndexType d2 = 0; d2 < TDim; ++d2) {
150 rRightHandSideVector[i_node*
BlockSize + d2] += aux_val * N_gauss[i_node] * N_gauss[j_node] * tang_proj_mat(
d1,d2) * r_v_j[
d1];
151 rLeftHandSideMatrix(i_node*
BlockSize +
d1, j_node*
BlockSize + d2) -= aux_val * N_gauss[i_node] * N_gauss[j_node] * tang_proj_mat(
d1,d2);
172 WallLawDataContainer wall_law_data;
173 wall_law_data.Initialize(*pCondition);
177 SetTangentialProjectionMatrix(wall_law_data.Normal, tang_proj_mat);
180 const SizeType n_gauss = wall_law_data.GaussPtsWeights.size();
181 for (
IndexType i_gauss = 0; i_gauss < n_gauss; ++i_gauss) {
183 const double w_gauss = wall_law_data.GaussPtsWeights[i_gauss];
184 const auto& N_gauss =
row(wall_law_data.ShapeFunctionsContainer, i_gauss);
187 double gp_slip_length = 0.0;
188 for (
IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
189 gp_slip_length += N_gauss[i_node] * wall_law_data.NodalSlipLength[i_node];
193 const double aux_val =
w_gauss * wall_law_data.DynamicViscosity / gp_slip_length;
194 for (
IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
195 for (
IndexType j_node = 0; j_node < TNumNodes; ++j_node) {
197 for (
IndexType d2 = 0; d2 < TDim; ++d2) {
198 rLeftHandSideMatrix(i_node*
BlockSize +
d1, j_node*
BlockSize + d2) -= aux_val * N_gauss[i_node] * N_gauss[j_node] * tang_proj_mat(
d1,d2);
219 WallLawDataContainer wall_law_data;
220 wall_law_data.Initialize(*pCondition);
224 SetTangentialProjectionMatrix(wall_law_data.Normal, tang_proj_mat);
227 const SizeType n_gauss = wall_law_data.GaussPtsWeights.size();
228 for (
IndexType i_gauss = 0; i_gauss < n_gauss; ++i_gauss) {
230 const double w_gauss = wall_law_data.GaussPtsWeights[i_gauss];
231 const auto& N_gauss =
row(wall_law_data.ShapeFunctionsContainer, i_gauss);
234 double gp_slip_length = 0.0;
235 for (
IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
236 gp_slip_length += N_gauss[i_node] * wall_law_data.NodalSlipLength[i_node];
240 const double aux_val =
w_gauss * wall_law_data.DynamicViscosity / gp_slip_length;
241 for (
IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
242 for (
IndexType j_node = 0; j_node < TNumNodes; ++j_node) {
243 const auto& r_v_j = wall_law_data.NodalWallVelocities[j_node];
245 for (
IndexType d2 = 0; d2 < TDim; ++d2) {
246 rRightHandSideVector[i_node*
BlockSize + d2] += aux_val * N_gauss[i_node] * N_gauss[j_node] * tang_proj_mat(
d1,d2) * r_v_j[
d1];
285 std::stringstream buffer;
286 buffer <<
"NavierSlipWallLaw";
293 rOStream <<
"NavierSlipWallLaw";
313 struct WallLawDataContainer
315 double DynamicViscosity;
318 Matrix ShapeFunctionsContainer;
322 void Initialize(
const Condition& rCondition)
326 const auto& r_parent_element = rCondition.
GetValue(NEIGHBOUR_ELEMENTS)[0];
327 DynamicViscosity = r_parent_element.GetProperties().GetValue(DYNAMIC_VISCOSITY);
338 for (
IndexType i_gauss = 0; i_gauss < n_gauss; ++i_gauss) {
339 GaussPtsWeights[i_gauss] = GaussPtsWeights[i_gauss] * r_integration_pts[i_gauss].Weight();
344 for (std::size_t i_node = 0; i_node < TNumNodes; ++i_node) {
345 const auto& r_node = r_geom[i_node];
346 const double aux_slip_length = r_node.GetValue(SLIP_LENGTH);
347 KRATOS_ERROR_IF(aux_slip_length < 1.0e-12) <<
"Negative or zero 'SLIP_LENGTH' at node " << r_node.Id() <<
"." << std::endl;
348 NodalSlipLength[i_node] = aux_slip_length;
349 noalias(NodalWallVelocities[i_node]) = r_node.FastGetSolutionStepValue(VELOCITY) - r_node.FastGetSolutionStepValue(MESH_VELOCITY);
355 static void SetTangentialProjectionMatrix(
356 const array_1d<double,3>& rUnitNormal,
357 BoundedMatrix<double,TDim,TDim>& rTangProjMat)
360 for (std::size_t
d1 = 0;
d1 < TDim; ++
d1) {
361 for (std::size_t d2 = 0; d2 < TDim; ++d2) {
362 rTangProjMat(
d1,d2) -= rUnitNormal[
d1]*rUnitNormal[d2];
Base class for all Conditions.
Definition: condition.h:59
std::size_t SizeType
Definition: condition.h:94
std::size_t IndexType
Definition: condition.h:92
Matrix MatrixType
Definition: condition.h:90
Vector VectorType
Definition: condition.h:88
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometrical_object.h:248
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Navier-slip law LHS and RHS contribution implementation This class implements the LHS and RHS contrib...
Definition: navier_slip_wall_law.h:66
Condition::IndexType IndexType
Definition: navier_slip_wall_law.h:80
static constexpr std::size_t BlockSize
Definition: navier_slip_wall_law.h:74
KRATOS_CLASS_POINTER_DEFINITION(NavierSlipWallLaw)
Pointer definition of NavierSlipWallLaw.
NavierSlipWallLaw()=delete
Default constructor.
Condition::SizeType SizeType
Definition: navier_slip_wall_law.h:78
static void AddWallModelRightHandSide(VectorType &rRightHandSideVector, const Condition *pCondition, const ProcessInfo &rCurrentProcessInfo)
Add the RHS Navier-slip contribution This method adds the Navier-slip RHS contribution to the provide...
Definition: navier_slip_wall_law.h:213
static void AddWallModelLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const Condition *pCondition, const ProcessInfo &rCurrentProcessInfo)
Add the LHS and RHS Navier-slip contributions This method adds the Navier-slip LHS and RHS contributi...
Definition: navier_slip_wall_law.h:116
std::string Info() const
Turn back information as a string.
Definition: navier_slip_wall_law.h:283
static void AddWallModelLeftHandSide(MatrixType &rLeftHandSideMatrix, const Condition *pCondition, const ProcessInfo &rCurrentProcessInfo)
Add the LHS Navier-slip contribution This method adds the Navier-slip LHS contribution to the provide...
Definition: navier_slip_wall_law.h:166
~NavierSlipWallLaw()=default
Destructor.
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: navier_slip_wall_law.h:291
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: navier_slip_wall_law.h:297
NavierSlipWallLaw(NavierSlipWallLaw const &rOther)=delete
Copy constructor.
static int Check(const Condition *pCondition, const ProcessInfo &rCurrentProcessInfo)
Check function This function checks the current wall law input parameters.
Definition: navier_slip_wall_law.h:261
static constexpr std::size_t LocalSize
Definition: navier_slip_wall_law.h:76
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
BOOST_UBLAS_INLINE size_type size() const
Definition: array_1d.h:370
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
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
w_gauss
Definition: generate_convection_diffusion_explicit_element.py:136
subroutine d1(DSTRAN, D, dtime, NDI, NSHR, NTENS)
Definition: TensorModule.f:594