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.
navier_stokes.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Ruben Zorrilla
11 //
12 
13 #if !defined(KRATOS_NAVIER_STOKES)
14 #define KRATOS_NAVIER_STOKES
15 
16 // System includes
17 
18 // External includes
19 #include "boost/smart_ptr.hpp"
20 
21 // Project includes
22 #include "includes/define.h"
23 #include "includes/element.h"
24 #include "includes/variables.h"
25 #include "includes/serializer.h"
26 #include "utilities/geometry_utilities.h"
27 #include "includes/cfd_variables.h"
28 
29 // Application includes
31 
32 namespace Kratos
33 {
34 
37 
41 
45 
49 
53 
54 // TODO: UPDATE THIS INFORMATION
61 template< unsigned int TDim, unsigned int TNumNodes = TDim + 1 >
62 class NavierStokes : public Element
63 {
64 public:
67 
70 
72  {
75 
78 
82 
83  double bdf0;
84  double bdf1;
85  double bdf2;
86  double c; // Wave velocity (needed if artificial compressibility is considered)
87  double h; // Element size
88  double volume; // In 2D: element area. In 3D: element volume
89  double dt; // Time increment
90  double dyn_tau; // Dynamic tau considered in ASGS stabilization coefficients
91  double mu; // Dynamic viscosity
92  double rho; // Density
93  };
94 
98 
100 
101  NavierStokes(IndexType NewId, GeometryType::Pointer pGeometry)
102  : Element(NewId, pGeometry)
103  {}
104 
105  NavierStokes(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
106  : Element(NewId, pGeometry, pProperties)
107  {}
108 
110  ~NavierStokes() override {};
111 
112 
116 
117 
121 
122  Element::Pointer Create(IndexType NewId, NodesArrayType const& rThisNodes, PropertiesType::Pointer pProperties) const override
123  {
124  KRATOS_TRY
125  return Kratos::make_intrusive< NavierStokes < TDim, TNumNodes > >(NewId, this->GetGeometry().Create(rThisNodes), pProperties);
126  KRATOS_CATCH("");
127  }
128 
129  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
130  {
131  KRATOS_TRY
132  return Kratos::make_intrusive< NavierStokes < TDim, TNumNodes > >(NewId, pGeom, pProperties);
133  KRATOS_CATCH("");
134  }
135 
136 
137  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
138  VectorType& rRightHandSideVector,
139  const ProcessInfo& rCurrentProcessInfo) override
140  {
141  KRATOS_TRY
142 
143  constexpr unsigned int MatrixSize = TNumNodes*(TDim+1);
144 
145  if (rLeftHandSideMatrix.size1() != MatrixSize)
146  rLeftHandSideMatrix.resize(MatrixSize, MatrixSize, false); //false says not to preserve existing storage!!
147 
148  if (rRightHandSideVector.size() != MatrixSize)
149  rRightHandSideVector.resize(MatrixSize, false); //false says not to preserve existing storage!!
150 
151  // Struct to pass around the data
153  this->FillElementData(data, rCurrentProcessInfo);
154 
155  // Allocate memory needed
157  array_1d<double,MatrixSize> rhs_local;
158 
159  // Loop on gauss points
160  noalias(rLeftHandSideMatrix) = ZeroMatrix(MatrixSize,MatrixSize);
161  noalias(rRightHandSideVector) = ZeroVector(MatrixSize);
162 
163  // Gauss point position
165  GetShapeFunctionsOnGauss(Ncontainer);
166 
167  for(unsigned int igauss = 0; igauss<Ncontainer.size2(); igauss++)
168  {
169  noalias(data.N) = row(Ncontainer, igauss);
170 
171  ComputeConstitutiveResponse(data, rCurrentProcessInfo);
172 
175 
176  // here we assume that all the weights of the gauss points are the same so we multiply at the end by Volume/n_nodes
177  noalias(rLeftHandSideMatrix) += lhs_local;
178  noalias(rRightHandSideVector) += rhs_local;
179  }
180 
181  rLeftHandSideMatrix *= data.volume/static_cast<double>(TNumNodes);
182  rRightHandSideVector *= data.volume/static_cast<double>(TNumNodes);
183 
184  KRATOS_CATCH("Error in Stokes Element Symbolic")
185  }
186 
187 
188  void CalculateRightHandSide(VectorType& rRightHandSideVector,
189  const ProcessInfo& rCurrentProcessInfo) override
190  {
191  KRATOS_TRY
192 
193  constexpr unsigned int MatrixSize = TNumNodes*(TDim+1);
194 
195  if (rRightHandSideVector.size() != MatrixSize)
196  rRightHandSideVector.resize(MatrixSize, false); //false says not to preserve existing storage!!
197 
198  // Struct to pass around the data
200  this->FillElementData(data, rCurrentProcessInfo);
201 
202  // Allocate memory needed
203  array_1d<double,MatrixSize> rhs_local;
204 
205  // Gauss point position
207  GetShapeFunctionsOnGauss(Ncontainer);
208 
209  // Loop on gauss point
210  noalias(rRightHandSideVector) = ZeroVector(MatrixSize);
211  for(unsigned int igauss = 0; igauss<Ncontainer.size2(); igauss++)
212  {
213  noalias(data.N) = row(Ncontainer, igauss);
214 
215  ComputeConstitutiveResponse(data, rCurrentProcessInfo);
216 
218 
219  //here we assume that all the weights of the gauss points are the same so we multiply at the end by Volume/n_nodes
220  noalias(rRightHandSideVector) += rhs_local;
221  }
222 
223  // rRightHandSideVector *= Volume/static_cast<double>(TNumNodes);
224  rRightHandSideVector *= data.volume/static_cast<double>(TNumNodes);
225 
226  KRATOS_CATCH("")
227 
228  }
229 
231 
239  int Check(const ProcessInfo& rCurrentProcessInfo) const override
240  {
241  KRATOS_TRY
242 
243  // Perform basic element checks
244  int ErrorCode = Kratos::Element::Check(rCurrentProcessInfo);
245  if(ErrorCode != 0) return ErrorCode;
246 
247  // Check that the element's nodes contain all required SolutionStepData and Degrees of freedom
248  for(unsigned int i=0; i<this->GetGeometry().size(); ++i)
249  {
250  if(this->GetGeometry()[i].SolutionStepsDataHas(VELOCITY) == false)
251  KRATOS_THROW_ERROR(std::invalid_argument,"Missing VELOCITY variable on solution step data for node ",this->GetGeometry()[i].Id());
252  if(this->GetGeometry()[i].SolutionStepsDataHas(PRESSURE) == false)
253  KRATOS_THROW_ERROR(std::invalid_argument,"Missing PRESSURE variable on solution step data for node ",this->GetGeometry()[i].Id());
254 
255  if(this->GetGeometry()[i].HasDofFor(VELOCITY_X) == false ||
256  this->GetGeometry()[i].HasDofFor(VELOCITY_Y) == false ||
257  this->GetGeometry()[i].HasDofFor(VELOCITY_Z) == false)
258  KRATOS_THROW_ERROR(std::invalid_argument,"Missing VELOCITY component degree of freedom on node ",this->GetGeometry()[i].Id());
259  if(this->GetGeometry()[i].HasDofFor(PRESSURE) == false)
260  KRATOS_THROW_ERROR(std::invalid_argument,"Missing PRESSURE component degree of freedom on node ",this->GetGeometry()[i].Id());
261  }
262 
263  // Check constitutive law
264  if(mpConstitutiveLaw == nullptr)
265  KRATOS_ERROR << "The constitutive law was not set. Cannot proceed. Call the navier_stokes.h Initialize() method needs to be called.";
266 
267  mpConstitutiveLaw->Check(GetProperties(), this->GetGeometry(), rCurrentProcessInfo);
268 
269  return 0;
270 
271  KRATOS_CATCH("");
272  }
273 
274 
275  void Calculate(const Variable<double>& rVariable,
276  double& rOutput,
277  const ProcessInfo& rCurrentProcessInfo) override
278  {
279  KRATOS_TRY
280 
282  this->FillElementData(data, rCurrentProcessInfo);
283 
284  if (rVariable == ERROR_RATIO)
285  {
286  rOutput = this->SubscaleErrorEstimate(data);
287  this->SetValue(ERROR_RATIO, rOutput);
288  }
289 
290  KRATOS_CATCH("")
291  }
292 
296 
297 
301 
302 
306 
308  std::string Info() const override
309  {
310  return "NavierStokes #";
311  }
312 
314  void PrintInfo(std::ostream& rOStream) const override
315  {
316  rOStream << Info() << Id();
317  }
318 
320  // virtual void PrintData(std::ostream& rOStream) const override
321 
325 
326 
328 
329 protected:
332 
333 
337 
338  // Constitutive law pointer
339  ConstitutiveLaw::Pointer mpConstitutiveLaw = nullptr;
340 
341  // Symbolic function implementing the element
342  void GetDofList(DofsVectorType& ElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
343  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
344 
345  void ComputeGaussPointLHSContribution(BoundedMatrix<double,TNumNodes*(TDim+1),TNumNodes*(TDim+1)>& lhs, const ElementDataStruct& data);
346  void ComputeGaussPointRHSContribution(array_1d<double,TNumNodes*(TDim+1)>& rhs, const ElementDataStruct& data);
347 
349 
353 
355  {
356  }
357 
361 
362  // Element initialization (constitutive law)
363  void Initialize(const ProcessInfo &rCurrentProcessInfo) override
364  {
365  KRATOS_TRY
366 
367  mpConstitutiveLaw = GetProperties()[CONSTITUTIVE_LAW]->Clone();
368  mpConstitutiveLaw->InitializeMaterial( GetProperties(), this->GetGeometry(), row( this->GetGeometry().ShapeFunctionsValues(), 0 ) );
369 
370  KRATOS_CATCH( "" )
371  }
372 
373  // Auxiliar function to fill the element data structure
374  void FillElementData(ElementDataStruct& rData, const ProcessInfo& rCurrentProcessInfo)
375  {
376  // Getting data for the given geometry
377  // double Volume; // In 2D cases Volume variable contains the element area
378  GeometryUtils::CalculateGeometryData(this->GetGeometry(), rData.DN_DX, rData.N, rData.volume);
379 
380  // Compute element size
381  rData.h = ComputeH(rData.DN_DX);
382 
383  // Database access to all of the variables needed
384  const Vector& BDFVector = rCurrentProcessInfo[BDF_COEFFICIENTS];
385  rData.bdf0 = BDFVector[0];
386  rData.bdf1 = BDFVector[1];
387  rData.bdf2 = BDFVector[2];
388 
389  rData.dyn_tau = rCurrentProcessInfo[DYNAMIC_TAU]; // Only, needed if the temporal dependent term is considered in the subscales
390  rData.dt = rCurrentProcessInfo[DELTA_TIME]; // Only, needed if the temporal dependent term is considered in the subscales
391 
392  rData.c = rCurrentProcessInfo[SOUND_VELOCITY]; // Wave velocity
393 
394  // Material properties
395  const auto& r_prop = GetProperties();
396  rData.rho = r_prop.GetValue(DENSITY);
397  rData.mu = r_prop.GetValue(DYNAMIC_VISCOSITY);
398 
399  for (unsigned int i = 0; i < TNumNodes; i++)
400  {
401 
402  const array_1d<double,3>& body_force = this->GetGeometry()[i].FastGetSolutionStepValue(BODY_FORCE);
403  const array_1d<double,3>& vel = this->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
404  const array_1d<double,3>& vel_n = this->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY,1);
405  const array_1d<double,3>& vel_nn = this->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY,2);
406  const array_1d<double,3>& vel_mesh = this->GetGeometry()[i].FastGetSolutionStepValue(MESH_VELOCITY);
407 
408  for(unsigned int k=0; k<TDim; k++)
409  {
410  rData.v(i,k) = vel[k];
411  rData.vn(i,k) = vel_n[k];
412  rData.vnn(i,k) = vel_nn[k];
413  rData.vmesh(i,k) = vel_mesh[k];
414  rData.f(i,k) = body_force[k];
415  }
416 
417  rData.p[i] = this->GetGeometry()[i].FastGetSolutionStepValue(PRESSURE);
418  rData.pn[i] = this->GetGeometry()[i].FastGetSolutionStepValue(PRESSURE,1);
419  rData.pnn[i] = this->GetGeometry()[i].FastGetSolutionStepValue(PRESSURE,2);
420  }
421 
422  }
423 
424  //~ template< unsigned int TDim, unsigned int TNumNodes=TDim+1>
426  {
427  double h=0.0;
428  for(unsigned int i=0; i<TNumNodes; i++)
429  {
430  double h_inv = 0.0;
431  for(unsigned int k=0; k<TDim; k++)
432  {
433  h_inv += DN_DX(i,k)*DN_DX(i,k);
434  }
435  h += 1.0/h_inv;
436  }
437  h = sqrt(h)/static_cast<double>(TNumNodes);
438  return h;
439  }
440 
441  // 3D tetrahedra shape functions values at Gauss points
443  {
444  Ncontainer(0,0) = 0.58541020; Ncontainer(0,1) = 0.13819660; Ncontainer(0,2) = 0.13819660; Ncontainer(0,3) = 0.13819660;
445  Ncontainer(1,0) = 0.13819660; Ncontainer(1,1) = 0.58541020; Ncontainer(1,2) = 0.13819660; Ncontainer(1,3) = 0.13819660;
446  Ncontainer(2,0) = 0.13819660; Ncontainer(2,1) = 0.13819660; Ncontainer(2,2) = 0.58541020; Ncontainer(2,3) = 0.13819660;
447  Ncontainer(3,0) = 0.13819660; Ncontainer(3,1) = 0.13819660; Ncontainer(3,2) = 0.13819660; Ncontainer(3,3) = 0.58541020;
448  }
449 
450  // 2D triangle shape functions values at Gauss points
452  {
453  const double one_sixt = 1.0/6.0;
454  const double two_third = 2.0/3.0;
455  Ncontainer(0,0) = one_sixt; Ncontainer(0,1) = one_sixt; Ncontainer(0,2) = two_third;
456  Ncontainer(1,0) = one_sixt; Ncontainer(1,1) = two_third; Ncontainer(1,2) = one_sixt;
457  Ncontainer(2,0) = two_third; Ncontainer(2,1) = one_sixt; Ncontainer(2,2) = one_sixt;
458  }
459 
460  // 3D tetrahedra shape functions values at centered Gauss point
462  {
463  Ncontainer(0,0) = 0.25; Ncontainer(0,1) = 0.25; Ncontainer(0,2) = 0.25; Ncontainer(0,3) = 0.25;
464  }
465 
466  // 2D triangle shape functions values at centered Gauss point
468  {
469  Ncontainer(0,0) = 1.0/3.0; Ncontainer(0,1) = 1.0/3.0; Ncontainer(0,2) = 1.0/3.0;
470  }
471 
472  // Computes the strain rate in Voigt notation
473  void ComputeStrain(ElementDataStruct& rData, const unsigned int& strain_size)
474  {
477 
478  // Compute strain (B*v)
479  // 3D strain computation
480  if (strain_size == 6)
481  {
482  rData.strain[0] = DN(0,0)*v(0,0) + DN(1,0)*v(1,0) + DN(2,0)*v(2,0) + DN(3,0)*v(3,0);
483  rData.strain[1] = DN(0,1)*v(0,1) + DN(1,1)*v(1,1) + DN(2,1)*v(2,1) + DN(3,1)*v(3,1);
484  rData.strain[2] = DN(0,2)*v(0,2) + DN(1,2)*v(1,2) + DN(2,2)*v(2,2) + DN(3,2)*v(3,2);
485  rData.strain[3] = DN(0,0)*v(0,1) + DN(0,1)*v(0,0) + DN(1,0)*v(1,1) + DN(1,1)*v(1,0) + DN(2,0)*v(2,1) + DN(2,1)*v(2,0) + DN(3,0)*v(3,1) + DN(3,1)*v(3,0);
486  rData.strain[4] = DN(0,1)*v(0,2) + DN(0,2)*v(0,1) + DN(1,1)*v(1,2) + DN(1,2)*v(1,1) + DN(2,1)*v(2,2) + DN(2,2)*v(2,1) + DN(3,1)*v(3,2) + DN(3,2)*v(3,1);
487  rData.strain[5] = DN(0,0)*v(0,2) + DN(0,2)*v(0,0) + DN(1,0)*v(1,2) + DN(1,2)*v(1,0) + DN(2,0)*v(2,2) + DN(2,2)*v(2,0) + DN(3,0)*v(3,2) + DN(3,2)*v(3,0);
488  }
489  // 2D strain computation
490  else if (strain_size == 3)
491  {
492  rData.strain[0] = DN(0,0)*v(0,0) + DN(1,0)*v(1,0) + DN(2,0)*v(2,0);
493  rData.strain[1] = DN(0,1)*v(0,1) + DN(1,1)*v(1,1) + DN(2,1)*v(2,1);
494  rData.strain[2] = DN(0,1)*v(0,0) + DN(1,1)*v(1,0) + DN(2,1)*v(2,0) + DN(0,0)*v(0,1) + DN(1,0)*v(1,1) + DN(2,0)*v(2,1);
495  }
496  }
497 
498  // Call the constitutive law to get the stress value
499  virtual void ComputeConstitutiveResponse(ElementDataStruct& rData, const ProcessInfo& rCurrentProcessInfo)
500  {
501  const unsigned int strain_size = (TDim*3)-3;
502 
503  if(rData.C.size1() != strain_size)
504  rData.C.resize(strain_size,strain_size,false);
505  if(rData.stress.size() != strain_size)
506  rData.stress.resize(strain_size,false);
507  if(rData.strain.size() != strain_size)
508  rData.strain.resize(strain_size,false);
509 
510  ComputeStrain(rData, strain_size);
511 
512  // Create constitutive law parameters:
513  ConstitutiveLaw::Parameters Values(this->GetGeometry(), GetProperties(), rCurrentProcessInfo);
514 
515  const Vector Nvec(rData.N);
516  Values.SetShapeFunctionsValues(Nvec);
517 
518  // Set constitutive law flags:
519  Flags& ConstitutiveLawOptions=Values.GetOptions();
520  ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_STRESS);
521  ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR);
522 
523  Values.SetStrainVector(rData.strain); //this is the input parameter
524  Values.SetStressVector(rData.stress); //this is an ouput parameter
525  Values.SetConstitutiveMatrix(rData.C); //this is an ouput parameter
526 
527  //ATTENTION: here we assume that only one constitutive law is employed for all of the gauss points in the element.
528  //this is ok under the hypothesis that no history dependent behaviour is employed
529  mpConstitutiveLaw->CalculateMaterialResponseCauchy(Values);
530 
531  }
532 
533  virtual double ComputeEffectiveViscosity(const ElementDataStruct& rData)
534  {
535  // Computes effective viscosity as sigma = mu_eff*eps -> sigma*sigma = mu_eff*sigma*eps -> sigma*sigma = mu_eff*(mu_eff*eps)*eps
536  // return sqrt(inner_prod(rStress, rStress)/inner_prod(rStrain, rStrain)); // TODO: Might yield zero in some cases, think a more suitable manner
537 
538  // Computes the effective viscosity as the average of the lower diagonal constitutive tensor
539  double mu_eff = 0.0;
540  const unsigned int strain_size = (TDim-1)*3;
541  for (unsigned int i=TDim; i<strain_size; ++i){mu_eff += rData.C(i,i);}
542  mu_eff /= (strain_size - TDim);
543 
544  return mu_eff;
545  }
546 
550 
551 
555 
556 
560 
561 
563 private:
566 
570 
574  friend class Serializer;
575 
576  void save(Serializer& rSerializer) const override
577  {
579  }
580 
581  void load(Serializer& rSerializer) override
582  {
584  }
585 
587 
590 
591 
595 
596 
600 
601 
605 
607 
608 };
609 
611 
614 
615 
619 
620 
622 /* inline std::istream& operator >> (std::istream& rIStream,
623  Fluid2DASGS& rThis);
624  */
626 /* inline std::ostream& operator << (std::ostream& rOStream,
627  const Fluid2DASGS& rThis)
628  {
629  rThis.PrintInfo(rOStream);
630  rOStream << std::endl;
631  rThis.PrintData(rOStream);
632 
633  return rOStream;
634  }*/
636 
637 } // namespace Kratos.
638 
639 #endif // KRATOS_STOKES_ELEMENT_SYMBOLIC_3D_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
PropertiesType & GetProperties()
Definition: element.h:1024
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:904
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
Definition: flags.h:58
std::size_t IndexType
Definition: flags.h:74
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
void SetValue(const TVariableType &rThisVariable, typename TVariableType::Type const &rValue)
Definition: geometrical_object.h:238
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
IndexType Id() const
Definition: indexed_object.h:107
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
Definition: navier_stokes.h:63
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(NavierStokes)
Counted pointer of.
void GetShapeFunctionsOnGauss(BoundedMatrix< double, 4, 4 > &Ncontainer)
Definition: navier_stokes.h:442
void GetShapeFunctionsOnUniqueGauss(BoundedMatrix< double, 1, 4 > &Ncontainer)
Definition: navier_stokes.h:461
void GetShapeFunctionsOnUniqueGauss(BoundedMatrix< double, 1, 3 > &Ncontainer)
Definition: navier_stokes.h:467
void ComputeGaussPointLHSContribution(BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes *(TDim+1)> &lhs, const ElementDataStruct &data)
NavierStokes(IndexType NewId, GeometryType::Pointer pGeometry)
Default constructor.
Definition: navier_stokes.h:101
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: navier_stokes.h:314
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: navier_stokes.h:363
void FillElementData(ElementDataStruct &rData, const ProcessInfo &rCurrentProcessInfo)
Definition: navier_stokes.h:374
void ComputeStrain(ElementDataStruct &rData, const unsigned int &strain_size)
Definition: navier_stokes.h:473
ConstitutiveLaw::Pointer mpConstitutiveLaw
Definition: navier_stokes.h:339
double ComputeH(BoundedMatrix< double, TNumNodes, TDim > &DN_DX)
Definition: navier_stokes.h:425
void GetShapeFunctionsOnGauss(BoundedMatrix< double, 3, 3 > &Ncontainer)
Definition: navier_stokes.h:451
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: navier_stokes.h:188
NavierStokes()
Definition: navier_stokes.h:354
void ComputeGaussPointRHSContribution(array_1d< double, TNumNodes *(TDim+1)> &rhs, const ElementDataStruct &data)
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: navier_stokes.h:129
NavierStokes(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: navier_stokes.h:105
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
std::string Info() const override
Turn back information as a string.
Definition: navier_stokes.h:308
void Calculate(const Variable< double > &rVariable, double &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: navier_stokes.h:275
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Checks the input and that all required Kratos variables have been registered.
Definition: navier_stokes.h:239
~NavierStokes() override
Destructor.
Definition: navier_stokes.h:110
Element::Pointer Create(IndexType NewId, NodesArrayType const &rThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: navier_stokes.h:122
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: navier_stokes.h:137
double SubscaleErrorEstimate(const ElementDataStruct &data)
virtual double ComputeEffectiveViscosity(const ElementDataStruct &rData)
Definition: navier_stokes.h:533
virtual void ComputeConstitutiveResponse(ElementDataStruct &rData, const ProcessInfo &rCurrentProcessInfo)
Definition: navier_stokes.h:499
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
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
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
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
v
Definition: generate_convection_diffusion_explicit_element.py:114
DN
Definition: generate_convection_diffusion_explicit_element.py:98
h
Definition: generate_droplet_dynamics.py:91
rhs
Definition: generate_frictional_mortar_condition.py:297
lhs
Definition: generate_frictional_mortar_condition.py:297
int strain_size
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:16
data
Definition: mesh_to_mdpa_converter.py:59
def load(f)
Definition: ode_solve.py:307
vel
Definition: pure_conduction.py:76
int k
Definition: quadrature.py:595
body_force
Definition: script_ELASTIC.py:102
integer i
Definition: TensorModule.f:17
Definition: constitutive_law.h:189
void SetConstitutiveMatrix(VoigtSizeMatrixType &rConstitutiveMatrix)
Definition: constitutive_law.h:403
void SetStrainVector(StrainVectorType &rStrainVector)
Definition: constitutive_law.h:401
Flags & GetOptions()
Definition: constitutive_law.h:412
void SetStressVector(StressVectorType &rStressVector)
Definition: constitutive_law.h:402
void SetShapeFunctionsValues(const Vector &rShapeFunctionsValues)
Definition: constitutive_law.h:396
Definition: navier_stokes.h:72
double dyn_tau
Definition: navier_stokes.h:90
Vector stress
Definition: navier_stokes.h:80
double c
Definition: navier_stokes.h:86
array_1d< double, TNumNodes > pnn
Definition: navier_stokes.h:74
double rho
Definition: navier_stokes.h:92
BoundedMatrix< double, TNumNodes, TDim > v
Definition: navier_stokes.h:73
double bdf2
Definition: navier_stokes.h:85
BoundedMatrix< double, TNumNodes, TDim > vn
Definition: navier_stokes.h:73
BoundedMatrix< double, TNumNodes, TDim > f
Definition: navier_stokes.h:73
array_1d< double, TNumNodes > N
Definition: navier_stokes.h:77
double dt
Definition: navier_stokes.h:89
BoundedMatrix< double, TNumNodes, TDim > vmesh
Definition: navier_stokes.h:73
double bdf0
Definition: navier_stokes.h:83
Matrix C
Definition: navier_stokes.h:79
double volume
Definition: navier_stokes.h:88
double bdf1
Definition: navier_stokes.h:84
array_1d< double, TNumNodes > p
Definition: navier_stokes.h:74
Vector strain
Definition: navier_stokes.h:81
double mu
Definition: navier_stokes.h:91
double h
Definition: navier_stokes.h:87
array_1d< double, TNumNodes > pn
Definition: navier_stokes.h:74
BoundedMatrix< double, TNumNodes, TDim > vnn
Definition: navier_stokes.h:73
BoundedMatrix< double, TNumNodes, TDim > DN_DX
Definition: navier_stokes.h:76