14 #if !defined(KRATOS_WINDKESSEL_H_INCLUDED )
15 #define KRATOS_WINDKESSEL_H_INCLUDED
111 double Flow_total=0.0;
112 double Resistence = 5e9;
113 if ((Resistence <=0.0)){
114 KRATOS_THROW_ERROR(std::logic_error,
"Resistece must be higer than cero:", Resistence);
118 for(ModelPart::ConditionsContainerType::iterator
i = rConditions.begin();
i!=rConditions.end();
i++){
120 if(
i->GetProperties().Id() == 1001){
122 double Area =
i->GetGeometry().Area();
126 double total_velocity=0.0;
128 double Flow_total_node=0.0;
129 for (
unsigned int j = 0 ;
j <
i->GetGeometry().PointsNumber();
j++){
130 const double Velocity_node_X=
i->GetGeometry()[
j].FastGetSolutionStepValue(VELOCITY_X);
131 const double Velocity_node_Y=
i->GetGeometry()[
j].FastGetSolutionStepValue(VELOCITY_Y);
132 const double Velocity_node_Z=
i->GetGeometry()[
j].FastGetSolutionStepValue(VELOCITY_Z);
133 velocity=sqrt(pow(Velocity_node_X,2.0) + pow(Velocity_node_Y,2.0) + pow(Velocity_node_Z,2.0));
141 Flow_total_node=total_velocity/3;
142 Flow_total+= Flow_total_node*Area;
147 double Update_Pressure = Flow_total * Resistence;
151 for(ModelPart::NodesContainerType::iterator
i = rNodes.begin();
i!=rNodes.end();
i++)
153 const int Flag =
i->FastGetSolutionStepValue(FLAG_VARIABLE);
156 i->FastGetSolutionStepValue(PRESSURE) = Update_Pressure;
182 std::string
Info()
const override
184 std::stringstream buffer;
185 buffer <<
"WindkesselModel";
193 rOStream <<
"WindkesselModel";
331 rOStream << std::endl;
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
The base class for all processes in Kratos.
Definition: process.h:49
An impelementation of the Windkessel model for boundary condition of incompressible flows.
Definition: Boundary_Windkessel_model.h:63
std::string Info() const override
Turn back information as a string.
Definition: Boundary_Windkessel_model.h:182
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: Boundary_Windkessel_model.h:198
WindkesselModel(ModelPart &ThisModelPart)
Definition: Boundary_Windkessel_model.h:75
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: Boundary_Windkessel_model.h:191
~WindkesselModel() override
Destructor.
Definition: Boundary_Windkessel_model.h:93
void Execute() override
Solve an iteration of the turbulent viscosity.
Definition: Boundary_Windkessel_model.h:108
KRATOS_CLASS_POINTER_DEFINITION(WindkesselModel)
Pointer definition of WindkesselModel.
ModelPart & mr_model_part
Definition: Boundary_Windkessel_model.h:219
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
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
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
float velocity
Definition: PecletTest.py:54
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17