KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
updated_lagrangian_segregated_fluid_element.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosSolidMechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_UPDATED_LAGRANGIAN_SEGREGATED_FLUID_ELEMENT_H_INCLUDED)
11 #define KRATOS_UPDATED_LAGRANGIAN_SEGREGATED_FLUID_ELEMENT_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
19 
20 
21 namespace Kratos
22 {
37 
39 
45 class KRATOS_API(PFEM_APPLICATION) UpdatedLagrangianSegregatedFluidElement : public FluidElement
46 {
47 public:
48 
54  typedef ConstitutiveLawType::Pointer ConstitutiveLawPointerType;
61 
63 
67 
68  enum StepType{VELOCITY_STEP = 0, PRESSURE_STEP = 1};
69 
72 
75 
77  UpdatedLagrangianSegregatedFluidElement(IndexType NewId, GeometryType::Pointer pGeometry);
78 
79  UpdatedLagrangianSegregatedFluidElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
80 
83 
84 
87 
91 
94 
98 
109  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
110 
118  Element::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override;
119 
120  //************* STARTING - ENDING METHODS
121 
125  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
126 
130  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
131 
135  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
136 
140  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
141 
142  //************* GETTING METHODS
143 
147  void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
148 
152  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
153 
157  void GetValuesVector(Vector& rValues, int Step = 0) const override;
158 
162  void GetFirstDerivativesVector(Vector& rValues, int Step = 0) const override;
163 
167  void GetSecondDerivativesVector(Vector& rValues, int Step = 0) const override;
168 
169 
176  void CalculateMassMatrix(MatrixType& rMassMatrix,
177  const ProcessInfo& rCurrentProcessInfo) override;
178 
185  void CalculateDampingMatrix(MatrixType& rDampingMatrix,
186  const ProcessInfo& rCurrentProcessInfo) override;
187 
188 
189 
190  //************************************************************************************
191  //************************************************************************************
199  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
200 
204 
212  std::string Info() const override
213  {
214  std::stringstream buffer;
215  buffer << "Updated Lagrangian Fluid Element #" << Id();
216  return buffer.str();
217  }
218 
220  void PrintInfo(std::ostream& rOStream) const override
221  {
222  rOStream << "Updated Lagrangian Fluid Element #" << Id();
223  }
224 
226  void PrintData(std::ostream& rOStream) const override
227  {
228  GetGeometry().PrintData(rOStream);
229  }
234 
235 protected:
241 
243 
250 
254  void SetProcessInformation(const ProcessInfo& rCurrentProcessInfo) override;
255 
259  void InitializeElementData(ElementDataType & rVariables,
260  const ProcessInfo& rCurrentProcessInfo) override;
261 
265  void GetStepAlpha(double& rAlpha);
266 
270  void CalculateKinematics(ElementDataType& rVariables,
271  const double& rPointNumber) override;
272 
276  void CalculateAndAddLHS(LocalSystemComponents& rLocalSystem,
277  ElementDataType& rVariables) override;
278 
282  void CalculateAndAddRHS(LocalSystemComponents& rLocalSystem,
283  ElementDataType& rVariables) override;
284 
285 
289  void CalculateAndAddDynamicLHS(MatrixType& rLeftHandSideMatrix,
290  ElementDataType& rVariables) override;
291 
295  void CalculateAndAddDynamicRHS(VectorType& rRightHandSideVector,
296  ElementDataType& rVariables) override;
297 
301  unsigned int GetDofsSize() const override;
302 
306  void CalculateAndAddKvvm(MatrixType& rLeftHandSideMatrix,
307  ElementDataType& rVariables) override;
308 
312  void CalculateAndAddKvvg(MatrixType& rLeftHandSideMatrix,
313  ElementDataType& rVariables) override;
314 
315 
319  void CalculateAndAddKpp(MatrixType& rLeftHandSideMatrix,
320  ElementDataType& rVariables);
321 
325  void CalculateAndAddInternalForces(VectorType& rRightHandSideVector,
326  ElementDataType & rVariables) override;
327 
331  void CalculateAndAddPressureForces(VectorType& rRightHandSideVector,
332  ElementDataType & rVariables);
333 
337  void AddVolumetricPart(Vector& rStressVector, const double& rMeanPressure);
338 
342  void RemoveVolumetricPart(Vector& rStressVector, const double& rMeanPressure);
343 
347  void AddVolumetricPart(Matrix& rConstitutiveMatrix, const double& rBulkFactor);
348 
352  void RemoveVolumetricPart(Matrix& rConstitutiveMatrix, const double& rBulkFactor);
353 
357  void CalculateDenseMatrixMeanValue(MatrixType& rMatrix, double& rMeanValue);
358 
362  void CalculateLumpedMatrixMeanValue(MatrixType& rMatrix, double& rMeanValue);
363 
367  void CalculateStiffnessFactor(MatrixType& rLeftHandSideMatrix,
368  ElementDataType& rVariables,
369  const double& rBulkFactor,
370  double& rStiffnessFactor);
374  void SetElementData(ElementDataType& rVariables,
376  const int & rPointNumber) override;
377 
381  void CalculateMaterialResponse(ElementDataType& rVariables,
383  const int & rPointNumber) override;
384 
388  void CalculateStabilizationTau(ElementDataType& rVariables);
389 
393  void GetFreeSurfaceFaces(std::vector<std::vector<SizeType> >& Faces);
394 
398  void GetFaceNormal(const std::vector<SizeType>& rFace, const ElementDataType & rVariables, Vector& rNormal);
399 
403  void GetFaceWeight(const std::vector<SizeType>& rFace, const ElementDataType & rVariables, double& rWeight, double& rNormalSize);
404 
408  void GetFaceNormal(const std::vector<SizeType>& rFace, Vector& rNormal);
409 
410 
414  double& CalculateVolumeChange(double& rVolumeChange, ElementDataType& rVariables) override;
415 
416 
427 
428 private:
429 
448  friend class Serializer;
449 
450  // A private default constructor necessary for serialization
451 
452  void save(Serializer& rSerializer) const override;
453 
454  void load(Serializer& rSerializer) override;
455 
456 
463 
464 }; // Class UpdatedLagrangianSegregatedFluidElement
465 
473 
474 } // namespace Kratos.
475 #endif // KRATOS_UPDATED_LAGRANGIAN_SEGREGATED_FLUID_ELEMENT_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: constitutive_law.h:47
StressMeasure
Definition: constitutive_law.h:69
Large Displacement Lagrangian Element for 3D and 2D geometries. (base class)
Definition: fluid_element.h:61
IntegrationMethod
Definition: geometry_data.h:76
std::size_t SizeType
Definition: geometry_data.h:173
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Updated Lagrangian Segregated Fluid Element for 3D and 2D geometries.
Definition: updated_lagrangian_segregated_fluid_element.hpp:46
ConstitutiveLawType::Pointer ConstitutiveLawPointerType
Pointer type for constitutive laws.
Definition: updated_lagrangian_segregated_fluid_element.hpp:54
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(UpdatedLagrangianSegregatedFluidElement)
Counted pointer of UpdatedLagrangianSegregatedFluidElement.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: updated_lagrangian_segregated_fluid_element.hpp:220
std::string Info() const override
Turn back information as a string.
Definition: updated_lagrangian_segregated_fluid_element.hpp:212
StepType
Definition: updated_lagrangian_segregated_fluid_element.hpp:68
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: updated_lagrangian_segregated_fluid_element.hpp:226
StepType mStepVariable
Definition: updated_lagrangian_segregated_fluid_element.hpp:242
GeometryData::IntegrationMethod IntegrationMethod
Type definition for integration methods.
Definition: updated_lagrangian_segregated_fluid_element.hpp:58
ConstitutiveLawType::StressMeasure StressMeasureType
StressMeasure from constitutive laws.
Definition: updated_lagrangian_segregated_fluid_element.hpp:56
GeometryData::SizeType SizeType
Type for size.
Definition: updated_lagrangian_segregated_fluid_element.hpp:60
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: updated_lagrangian_segregated_fluid_element.hpp:62
ConstitutiveLaw ConstitutiveLawType
Definition: updated_lagrangian_segregated_fluid_element.hpp:52
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
void CalculateStabilizationTau(double &rTau, double &rElementLength, const array_1d< double, TDim > &rVelocity, const Matrix &rContravariantMetricTensor, const double Reaction, const double EffectiveKinematicViscosity, const double Alpha, const double Gamma, const double DeltaTime, const double DynamicTau)
Definition: convection_diffusion_reaction_stabilization_utilities.h:52
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:189
Definition: fluid_element.hpp:82
Definition: fluid_element.hpp:228