40 #ifndef KRATOS_MONOLITHIC_AUTOSLIP_INLET_CONDITION_H
41 #define KRATOS_MONOLITHIC_AUTOSLIP_INLET_CONDITION_H
147 GeometryType::Pointer pGeometry):
159 GeometryType::Pointer pGeometry,
160 PropertiesType::Pointer pProperties):
227 const ProcessInfo& rCurrentProcessInfo)
const override;
236 const ProcessInfo& CurrentProcessInfo)
const override;
246 const SizeType LocalSize = (TDim + 1) * TNumNodes;
247 unsigned int LocalIndex = 0;
249 if (Values.size() != LocalSize)
250 Values.
resize(LocalSize,
false);
252 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
255 for (
unsigned int d = 0;
d < TDim; ++
d)
256 Values[LocalIndex++] = rVelocity[
d];
257 Values[LocalIndex++] = this->
GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE, Step);
269 const SizeType LocalSize = (TDim + 1) * TNumNodes;
270 unsigned int LocalIndex = 0;
272 if (Values.size() != LocalSize)
273 Values.
resize(LocalSize,
false);
275 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
278 for (
unsigned int d = 0;
d < TDim; ++
d)
279 Values[LocalIndex++] = rVelocity[
d];
280 Values[LocalIndex++] = 0.0;
292 std::vector<double>& rValues,
301 std::vector<Vector>& rValues,
306 std::vector<Matrix>& rValues,
325 virtual std::string
Info()
const override
327 std::stringstream buffer;
328 buffer <<
"MonolithicAutoSlipInlet3D" << TDim <<
"D";
333 virtual void PrintInfo(std::ostream& rOStream)
const override
335 rOStream <<
"MonolithicAutoSlipInlet3D";
339 virtual void PrintData(std::ostream& rOStream)
const override {}
378 const size_t BlockSize = TDim + 1;
379 const double NodalFactor = 1.0 /
double(TDim);
381 double area = NodalFactor * rGeometry.
DomainSize();
384 for(
size_t itNode = 0; itNode < rGeometry.
PointsNumber(); ++itNode)
386 const NodeType& rConstNode = rGeometry[itNode];
387 const double y = rConstNode.
GetValue(Y_WALL);
388 if(
y > 0.0 && rConstNode.
Is(SLIP) )
391 const array_1d<double,3>& VelMesh = rGeometry[itNode].FastGetSolutionStepValue(MESH_VELOCITY);
393 const double Ikappa = 1.0/0.41;
394 const double B = 5.2;
395 const double limit_yplus = 10.9931899;
397 const double rho = rGeometry[itNode].FastGetSolutionStepValue(DENSITY);
398 const double nu = rGeometry[itNode].FastGetSolutionStepValue(VISCOSITY);
400 double wall_vel = 0.0;
401 for (
size_t d = 0;
d < TDim;
d++)
403 wall_vel += Vel[
d]*Vel[
d];
405 wall_vel = sqrt(wall_vel);
407 if (wall_vel > 1
e-12)
411 double utau = sqrt(wall_vel *
nu /
y);
412 double yplus =
y * utau /
nu;
415 if (yplus > limit_yplus)
423 unsigned int iter = 0;
425 const double tol = 1
e-6;
426 double uplus = Ikappa * log(yplus) +
B;
428 while(iter < 100 && fabs(dx) >
tol * utau)
431 double f = utau * uplus - wall_vel;
432 double df = uplus + Ikappa;
437 yplus =
y * utau /
nu;
438 uplus = Ikappa * log(yplus) +
B;
443 std::cout <<
"Warning: wall condition Newton-Raphson did not converge. Residual is " << dx << std::endl;
446 const double Tmp = area * utau * utau *
rho / wall_vel;
447 for (
size_t d = 0;
d < TDim;
d++)
449 size_t k = itNode*BlockSize+
d;
450 rLocalVector[
k] -= Vel[
d] * Tmp;
451 rLocalMatrix(
k,
k) += Tmp;
498 virtual void save(
Serializer& rSerializer)
const
557 template<
unsigned int TDim,
unsigned int TNumNodes >
562 rOStream << std::endl;
Base class for all Conditions.
Definition: condition.h:59
std::size_t SizeType
Definition: condition.h:94
Condition & operator=(Condition const &rOther)
Assignment operator.
Definition: condition.h:181
std::size_t IndexType
Definition: flags.h:74
bool Is(Flags const &rOther) const
Definition: flags.h:274
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
virtual double DomainSize() const
This method calculate and return length, area or volume of this geometry depending to it's dimension.
Definition: geometry.h:1371
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
Implements a wall condition for the PFEM2 formulation.
Definition: autoslip_inlet.h:87
std::vector< std::size_t > EquationIdVectorType
Definition: autoslip_inlet.h:111
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: autoslip_inlet.h:339
std::size_t IndexType
Definition: autoslip_inlet.h:107
void ApplyNeumannCondition(MatrixType &rLocalMatrix, VectorType &rLocalVector)
virtual void GetValueOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rValues, const ProcessInfo &rCurrentProcessInfo) override
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: autoslip_inlet.h:115
virtual void GetValueOnIntegrationPoints(const Variable< array_1d< double, 6 > > &rVariable, std::vector< array_1d< double, 6 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
MonolithicAutoSlipInlet3D(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: autoslip_inlet.h:135
Geometry< NodeType > GeometryType
Definition: autoslip_inlet.h:99
virtual void ApplyWallLaw(MatrixType &rLocalMatrix, VectorType &rLocalVector, ProcessInfo &rCurrentProcessInfo)
Commpute the wall stress and add corresponding terms to the system contributions.
Definition: autoslip_inlet.h:373
MonolithicAutoSlipInlet3D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using Properties.
Definition: autoslip_inlet.h:158
Properties PropertiesType
Definition: autoslip_inlet.h:97
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: autoslip_inlet.h:113
virtual void GetValueOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Vector VectorType
Definition: autoslip_inlet.h:103
std::size_t SizeType
Definition: autoslip_inlet.h:109
MonolithicAutoSlipInlet3D & operator=(MonolithicAutoSlipInlet3D const &rOther)
Assignment operator.
Definition: autoslip_inlet.h:180
void CalculateNormal(array_1d< double, 3 > &An)
Definition: autoslip_inlet.cpp:81
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Provides the global indices for each one of this element's local rows.
Definition: autoslip_inlet_3d.cpp:63
virtual void GetFirstDerivativesVector(Vector &Values, int Step=0) override
Returns VELOCITY_X, VELOCITY_Y, (VELOCITY_Z,) PRESSURE for each node.
Definition: autoslip_inlet.h:244
Matrix MatrixType
Definition: autoslip_inlet.h:105
MonolithicAutoSlipInlet3D(MonolithicAutoSlipInlet3D const &rOther)
Copy constructor.
Definition: autoslip_inlet.h:166
KRATOS_CLASS_POINTER_DEFINITION(MonolithicAutoSlipInlet3D)
Pointer definition of MonolithicAutoSlipInlet3D.
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: autoslip_inlet.h:333
virtual ~MonolithicAutoSlipInlet3D() override
Destructor.
Definition: autoslip_inlet.h:172
Node NodeType
Definition: autoslip_inlet.h:95
MonolithicAutoSlipInlet3D(IndexType NewId=0)
Default constructor.
Definition: autoslip_inlet.h:125
MonolithicAutoSlipInlet3D(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: autoslip_inlet.h:146
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Return local contributions of the correct size, filled with zeros (for compatibility with time scheme...
Definition: autoslip_inlet_3d.cpp:9
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition: autoslip_inlet.h:101
virtual Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new MonolithicAutoSlipInlet3D object.
Definition: autoslip_inlet.h:197
virtual std::string Info() const override
Turn back information as a string.
Definition: autoslip_inlet.h:325
virtual void GetValueOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
virtual void GetDofList(DofsVectorType &ConditionDofList, const ProcessInfo &CurrentProcessInfo) const override
Returns a list of the element's Dofs.
Definition: autoslip_inlet_3d.cpp:82
virtual void GetSecondDerivativesVector(Vector &Values, int Step=0) override
Returns ACCELERATION_X, ACCELERATION_Y, (ACCELERATION_Z,) 0 for each node.
Definition: autoslip_inlet.h:267
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Return local right hand side of the correct size, filled with zeros (for compatibility with time sche...
Definition: autoslip_inlet_3d.cpp:49
virtual void GetValueOnIntegrationPoints(const Variable< array_1d< double, 3 > > &rVariable, std::vector< array_1d< double, 3 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
This class defines the node.
Definition: node.h:65
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: node.h:466
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
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
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
f
Definition: generate_convection_diffusion_explicit_element.py:112
rho
Definition: generate_droplet_dynamics.py:86
int tol
Definition: hinsberg_optimization.py:138
nu
Definition: isotropic_damage_automatic_differentiation.py:135
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
int k
Definition: quadrature.py:595
B
Definition: sensitivityMatrix.py:76
e
Definition: run_cpp_mpi_tests.py:31