13 #ifndef KRATOS_FLOW_RATE_SLIP_UTILITY_H_INCLUDED
14 #define KRATOS_FLOW_RATE_SLIP_UTILITY_H_INCLUDED
52 template<
class TLocalMatrixType,
class TLocalVectorType,
class TValueType>
100 TLocalMatrixType& rLocalMatrix,
101 TLocalVectorType& rLocalVector,
104 const SizeType LocalSize = rLocalVector.size();
110 if (this->
IsSlip(rGeometry[it_node]))
121 rLocalMatrix(
i,
j) = 0.0;
122 rLocalMatrix(
j,
i) = 0.0;
126 rLocalMatrix(
i,
j) = 0.0;
127 rLocalMatrix(
j,
i) = 0.0;
131 rLocalMatrix(
j,
j) = 1.0;
143 TLocalVectorType& rLocalVector,
146 if (rLocalVector.size() > 0)
150 if (this->
IsSlip(rGeometry[it_node]))
173 TLocalVectorType
vel;
174 TLocalVectorType
tmp;
181 if (this->IsSlip(rNode))
184 BoundedMatrix<double,2,2> rot;
185 BaseType::LocalRotationOperatorPure(rot, rNode);
187 array_1d<double,3>& r_velocity = rNode.FastGetSolutionStepValue(MOMENTUM);
188 for(SizeType i = 0; i < 2; i++) {
189 rTLS.vel[i] = r_velocity[i];
191 noalias(rTLS.tmp) = prod(rot, rTLS.vel);
192 for(SizeType i = 0; i < 2; i++) {
193 r_velocity[i] = rTLS.tmp[i];
207 TLocalVectorType
vel;
208 TLocalVectorType
tmp;
215 if( this->IsSlip(rNode) )
218 BoundedMatrix<double,2,2> rot;
219 BaseType::LocalRotationOperatorPure(rot, rNode);
221 array_1d<double,3>& r_velocity = rNode.FastGetSolutionStepValue(MOMENTUM);
222 for(SizeType i = 0; i < 2; i++) {
223 rTLS.vel[i] = r_velocity[i];
225 noalias(rTLS.tmp) = prod(trans(rot), rTLS.vel);
226 for(SizeType i = 0; i < 2; i++) {
227 r_velocity[i] = rTLS.tmp[i];
248 virtual std::string
Info()
const override
250 std::stringstream buffer;
251 buffer <<
"FlowRateSlipUtility";
258 virtual void PrintInfo(std::ostream& rOStream)
const override
260 rOStream <<
"FlowRateSlipUtility";
294 template<
class TLocalMatrixType,
class TLocalVectorType,
class TValueType>
296 std::istream& rIStream,
303 template<
class TLocalMatrixType,
class TLocalVectorType,
class TValueType>
305 std::ostream& rOStream,
309 rOStream << std::endl;
Tools to apply slip conditions @detail A utility to rotate the local contributions of certain nodes t...
Definition: flow_rate_slip_utility.h:55
FlowRateSlipUtility()
Default constructor.
Definition: flow_rate_slip_utility.h:76
virtual ~FlowRateSlipUtility()
Destructor.
Definition: flow_rate_slip_utility.h:79
virtual void RotateVelocities(ModelPart &rModelPart) const override
Transform nodal velocities to the rotated coordinates (aligned with each node's normal)
Definition: flow_rate_slip_utility.h:170
Geometry< NodeType > GeometryType
Definition: flow_rate_slip_utility.h:69
virtual std::string Info() const override
Definition: flow_rate_slip_utility.h:248
virtual void ApplySlipCondition(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
RHS only version of ApplySlipCondition.
Definition: flow_rate_slip_utility.h:142
Node NodeType
Definition: flow_rate_slip_utility.h:67
virtual void PrintInfo(std::ostream &rOStream) const override
Definition: flow_rate_slip_utility.h:258
std::size_t SizeType
Definition: flow_rate_slip_utility.h:65
virtual void ApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
Apply slip boundary conditions to the rotated local contributions. @detail This function takes the lo...
Definition: flow_rate_slip_utility.h:99
KRATOS_CLASS_POINTER_DEFINITION(FlowRateSlipUtility)
Pointer definition of FlowRateSlipUtility.
CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType > BaseType
Definition: flow_rate_slip_utility.h:63
virtual void RecoverVelocities(ModelPart &rModelPart) const override
Definition: flow_rate_slip_utility.h:204
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
std::istream & operator>>(std::istream &rIStream, FlowRateSlipUtility< TLocalMatrixType, TLocalVectorType, TValueType > &rThis)
input stream function
Definition: flow_rate_slip_utility.h:295
std::ostream & operator<<(std::ostream &rOStream, const FlowRateSlipUtility< TLocalMatrixType, TLocalVectorType, TValueType > &rThis)
output stream function
Definition: flow_rate_slip_utility.h:304
double GetDomainSize(const EntityPoint< TEntityType > &rPoint, Expression const *const pExpression)
Definition: explicit_filter.cpp:89
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
vel
Definition: pure_conduction.py:76
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17