v0.14.0
NavierStokesElement.hpp
Go to the documentation of this file.
1 /**
2  * \file NavierStokesElement.hpp
3  * \example NavierStokesElement.hpp
4  *
5  * \brief Implementation of operators for fluid flow
6  *
7  * Implementation of operators for computations of the fluid flow, governed by
8  * for Stokes and Navier-Stokes equations, and computation of the drag force
9  */
10 
11 
12 
13 #ifndef __NAVIERSTOKESELEMENT_HPP__
14 #define __NAVIERSTOKESELEMENT_HPP__
15 
16 #ifndef __BASICFINITEELEMENTS_HPP__
17 #include <BasicFiniteElements.hpp>
18 #endif // __BASICFINITEELEMENTS_HPP__
19 
20 using namespace boost::numeric;
21 
22 /**
23  * @brief Element for simulating viscous fluid flow
24 */
26 
27  using PostProcVol =
29  using PostProcFace =
31 
32  using UserDataOperator =
34  using FaceUserDataOperator =
37 
38  struct BlockData {
39  int iD;
41  double fluidDensity;
42  double inertiaCoef;
43  double viscousCoef;
46  : iD(-1), fluidViscosity(-1), fluidDensity(-1), inertiaCoef(-1),
47  viscousCoef(-1) {}
48  };
49 
50  struct CommonData {
51 
52  boost::shared_ptr<MatrixDouble> gradVelPtr;
53  boost::shared_ptr<MatrixDouble> velPtr;
54  boost::shared_ptr<VectorDouble> pressPtr;
55 
56  boost::shared_ptr<MatrixDouble> pressureDragTract;
57  boost::shared_ptr<MatrixDouble> shearDragTract;
58  boost::shared_ptr<MatrixDouble> totalDragTract;
59 
63 
65 
66  std::map<int, BlockData> setOfBlocksData;
67  std::map<int, BlockData> setOfFacesData;
68 
70 
71  gradVelPtr = boost::shared_ptr<MatrixDouble>(new MatrixDouble());
72  velPtr = boost::shared_ptr<MatrixDouble>(new MatrixDouble());
73  pressPtr = boost::shared_ptr<VectorDouble>(new VectorDouble());
74 
75  pressureDragTract = boost::shared_ptr<MatrixDouble>(new MatrixDouble());
76  shearDragTract = boost::shared_ptr<MatrixDouble>(new MatrixDouble());
77  totalDragTract = boost::shared_ptr<MatrixDouble>(new MatrixDouble());
78 
79  int vec_size;
80  if (m_field.get_comm_rank() == 0)
81  vec_size = 3;
82  else
83  vec_size = 0;
84 
85  pressureDragForceVec = createVectorMPI(m_field.get_comm(), vec_size, 3);
86  shearDragForceVec = createVectorMPI(m_field.get_comm(), vec_size, 3);
87  totalDragForceVec = createVectorMPI(m_field.get_comm(), vec_size, 3);
88 
89  volumeFluxVec = createVectorMPI(m_field.get_comm(), vec_size, 3);
90  }
91 
94  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "Problem", "none");
95 
96  ierr = PetscOptionsEnd();
97  CHKERRQ(ierr);
99  }
100  };
101 
103 
104  static double lambda;
105 
108  nf *= lambda;
110  }
111  };
112 
113  /**
114  * @brief Setting up elements
115  *
116  * This functions adds element to the database, adds provided fields to rows
117  * and columns of the element, provides access of the element to the fields
118  * data and adds entities of particular dimension (or a given range of
119  * entities to the element)
120  *
121  * @param m_field MoFEM interface
122  * @param element_name Name of the element
123  * @param velocity_field_name Name of the velocity field
124  * @param pressure_field_name Name of the pressure field
125  * @param mesh_field_name Name for mesh node positions field
126  * @param ents Range of entities to be added to element
127  * @return Error code
128  */
130  const string element_name,
131  const string velocity_field_name,
132  const string pressure_field_name,
133  const string mesh_field_name,
134  const int dim = 3,
135  Range *ents = nullptr) {
137 
138  CHKERR m_field.add_finite_element(element_name);
139 
140  CHKERR m_field.modify_finite_element_add_field_row(element_name,
141  velocity_field_name);
142  CHKERR m_field.modify_finite_element_add_field_col(element_name,
143  velocity_field_name);
144  CHKERR m_field.modify_finite_element_add_field_data(element_name,
145  velocity_field_name);
146 
147  CHKERR m_field.modify_finite_element_add_field_row(element_name,
148  pressure_field_name);
149  CHKERR m_field.modify_finite_element_add_field_col(element_name,
150  pressure_field_name);
151  CHKERR m_field.modify_finite_element_add_field_data(element_name,
152  pressure_field_name);
153 
154  CHKERR m_field.modify_finite_element_add_field_data(element_name,
155  mesh_field_name);
156 
157  if (ents != nullptr) {
158  CHKERR m_field.add_ents_to_finite_element_by_dim(*ents, dim,
159  element_name);
160  } else {
161  CHKERR m_field.add_ents_to_finite_element_by_dim(0, dim, element_name);
162  }
163 
165  }
166 
167  /**
168  * @brief Setting up operators for solving Navier-Stokes equations
169  *
170  * Pushes operators for solving Navier-Stokes equations to pipelines of RHS
171  * and LHS element instances
172  *
173  * @param feRhs pointer to RHS element instance
174  * @param feLhs pointer to LHS element instance
175  * @param velocity_field name of the velocity field
176  * @param pressure_field name of the pressure field
177  * @param common_data pointer to common data object
178  * @param type type of entities in the domain
179  * @return Error code
180  */
181  static MoFEMErrorCode setNavierStokesOperators(
182  boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
183  boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
184  const std::string velocity_field, const std::string pressure_field,
185  boost::shared_ptr<CommonData> common_data, const EntityType type = MBTET);
186 
187  /**
188  * @brief Setting up operators for solving Stokes equations
189  *
190  * Pushes operators for solving Stokes equations to pipelines of RHS
191  * and LHS element instances
192  *
193  * @param feRhs pointer to RHS element instance
194  * @param feLhs pointer to LHS element instance
195  * @param velocity_field name of the velocity field
196  * @param pressure_field name of the pressure field
197  * @param common_data pointer to common data object
198  * @param type type of entities in the domain
199  * @return Error code
200  */
201  static MoFEMErrorCode setStokesOperators(
202  boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
203  boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
204  const std::string velocity_field, const std::string pressure_field,
205  boost::shared_ptr<CommonData> common_data, const EntityType type = MBTET);
206 
207  /**
208  * @brief Setting up operators for calculating drag force on the solid surface
209  *
210  * Pushes operators for caluclating drag force components on the fluid-solid
211  * interface
212  *
213  * @param dragFe pointer to face element instance
214  * @param sideDragFe pointer to volume on side element instance
215  * @param velocity_field name of the velocity field
216  * @param pressure_field name of the pressure field
217  * @param common_data pointer to common data object
218  * @return Error code
219  */
220  static MoFEMErrorCode setCalcDragOperators(
221  boost::shared_ptr<FaceElementForcesAndSourcesCore> dragFe,
222  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
223  std::string side_fe_name, const std::string velocity_field,
224  const std::string pressure_field,
225  boost::shared_ptr<CommonData> common_data);
226 
227  /**
228  * @brief Setting up operators for post processing output of drag traction
229  *
230  * Pushes operators for post processing ouput of drag traction components on
231  * the fluid-solid interface
232  *
233  * @param dragFe pointer to face element instance
234  * @param sideDragFe pointer to volume on side element instance
235  * @param velocity_field name of the velocity field
236  * @param pressure_field name of the pressure field
237  * @param common_data pointer to common data object
238  * @return Error code
239  */
240  static MoFEMErrorCode setPostProcDragOperators(
241  boost::shared_ptr<PostProcFace> postProcDragPtr,
242  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
243  std::string side_fe_name, const std::string velocity_field,
244  const std::string pressure_field,
245  boost::shared_ptr<CommonData> common_data);
246 
247  /**
248  * @brief Setting up operators for calculation of volume flux
249  */
250  static MoFEMErrorCode setCalcVolumeFluxOperators(
251  boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_flux_ptr,
252  const std::string velocity_field,
253  boost::shared_ptr<CommonData> common_data, const EntityType type = MBTET);
254 
255  /**
256  * \brief Set integration rule to volume elements
257  *
258  * Integration rule is order of polynomial which is calculated exactly.
259  * Finite element selects integration method based on return of this
260  * function.
261  *
262  */
263  struct VolRule {
264  int operator()(int order_row, int order_col, int order_data) const {
265  return 2 * order_data;
266  }
267  };
268 
269  struct FaceRule {
270  int operator()(int order_row, int order_col, int order_data) const {
271  return order_data + 2;
272  }
273  };
274 
275  /**
276  * \brief Base class for operators assembling LHS
277  */
278  struct OpAssembleLhs : public UserDataOperator {
279 
280  boost::shared_ptr<CommonData> commonData;
283 
285 
289 
291 
292  OpAssembleLhs(const string field_name_row, const string field_name_col,
293  boost::shared_ptr<CommonData> common_data,
294  BlockData &block_data)
295  : UserDataOperator(field_name_row, field_name_col,
296  UserDataOperator::OPROWCOL),
297  commonData(common_data), blockData(block_data) {
298  sYmm = false;
299  diagonalBlock = false;
300  };
301 
302  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
303  EntityType col_type, EntData &row_data,
304  EntData &col_data);
305 
306  virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data) {
309  };
310 
311  MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data);
312  };
313 
314  /**
315  * @brief Assemble off-diagonal block of the LHS
316  * Operator for assembling off-diagonal block of the LHS
317  */
319 
320  OpAssembleLhsOffDiag(const string field_name_row,
321  const string field_name_col,
322  boost::shared_ptr<CommonData> common_data,
323  BlockData &block_data)
324  : OpAssembleLhs(field_name_row, field_name_col, common_data,
325  block_data) {
326  sYmm = false;
327  diagonalBlock = false;
328  };
329 
330  MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
331  };
332 
333  /**
334  * @brief Assemble linear (symmetric) part of the diagonal block of the LHS
335  * Operator for assembling linear (symmetric) part of the diagonal block of
336  * the LHS
337  */
339 
341 
342  OpAssembleLhsDiagLin(const string field_name_row,
343  const string field_name_col,
344  boost::shared_ptr<CommonData> common_data,
345  BlockData &block_data)
346  : OpAssembleLhs(field_name_row, field_name_col, common_data,
347  block_data) {
348  sYmm = true;
349  diagonalBlock = true;
350  };
351 
352  MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
353  };
354 
355  /**
356  * @brief Assemble non-linear (non-symmetric) part of the diagonal block of
357  * the LHS Operator for assembling non-linear (non-symmetric) part of the
358  * diagonal block of the LHS
359  */
361 
363 
364  OpAssembleLhsDiagNonLin(const string field_name_row,
365  const string field_name_col,
366  boost::shared_ptr<CommonData> common_data,
367  BlockData &block_data)
368  : OpAssembleLhs(field_name_row, field_name_col, common_data,
369  block_data) {
370  sYmm = false;
371  diagonalBlock = true;
372  };
373 
374  MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
375  };
376 
377  /**
378  * \brief Base class for operators assembling RHS
379  */
380  struct OpAssembleRhs : public UserDataOperator {
381 
382  boost::shared_ptr<CommonData> commonData;
384  int nbRows; ///< number of dofs on row
386 
388 
389  OpAssembleRhs(const string field_name,
390  boost::shared_ptr<CommonData> common_data,
391  BlockData &block_data)
393  commonData(common_data), blockData(block_data){};
394 
395  MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data);
396 
400  };
401 
402  MoFEMErrorCode aSsemble(EntData &data);
403  };
404 
405  /**
406  * @brief Assemble linear part of the velocity component of the RHS vector
407  *
408  * Operator for assembling linear part of the velocity component of the RHS
409  * vector:
410  * \f[ \mathbf{R}^{\textrm{S}}_{\mathbf{u}} =
411  * C_\text{V}\int\limits_{\Omega}\nabla\mathbf{u}\mathbin{:}\nabla\mathbf{v}\,
412  * d\Omega
413  * \f]
414  * where \f$C_\text{V}\f$ is the viscosity
415  * coefficient: \f$C_\text{V}=\mu\f$ in the dimensional case and
416  * \f$C_\text{V}=1\f$ in the non-dimensional case.
417  */
419 
421  boost::shared_ptr<CommonData> common_data,
422  BlockData &block_data)
423  : OpAssembleRhs(field_name, common_data, block_data){};
424 
425  /**
426  * \brief Integrate local entity vector
427  * @param data entity data on element row
428  * @return error code
429  */
430  MoFEMErrorCode iNtegrate(EntData &data);
431  };
432 
433  /**
434  * @brief Assemble non-linear part of the velocity component of the RHS vector
435  *
436  * Operator for assembling non-linear part of the velocity component of the
437  * RHS vector:
438  * \f[
439  * \mathbf{R}^{\textrm{NS}}_{\mathbf{u}} =
440  * C_\text{I}\int\limits_\Omega \left(\mathbf{u}\cdot\nabla\right)\mathbf{u}
441  * \cdot\mathbf{v} \,d\Omega,
442  * \f]
443  * where \f$C_\text{I}\f$ is the inertia
444  * coefficient: \f$C_\text{V}=\rho\f$ in the dimensional case and
445  * \f$C_\text{V}=\mathcal{R}\f$ in the non-dimensional case.
446  */
448 
450  boost::shared_ptr<CommonData> common_data,
451  BlockData &block_data)
452  : OpAssembleRhs(field_name, common_data, block_data){};
453 
454  MoFEMErrorCode iNtegrate(EntData &data);
455  };
456 
457  /**
458  * @brief Assemble the pressure component of the RHS vector
459  *
460  * Operator for assembling pressure component of the RHS vector:
461  * \f[
462  * \mathbf{R}^{\textrm{S}}_{p} = -\int\limits_{\Omega}p\,
463  * \nabla\cdot\mathbf{v} \, d\Omega
464  * \f]
465  */
467 
469  boost::shared_ptr<CommonData> common_data,
470  BlockData &block_data)
471  : OpAssembleRhs(field_name, common_data, block_data){};
472 
473  /**
474  * \brief Integrate local constrains vector
475  */
476  MoFEMErrorCode iNtegrate(EntData &data);
477  };
478 
479  /**
480  * @brief Calculate drag force on the fluid-solid interface
481  *
482  * Operator fo calculating drag force components on the fluid-solid interface.
483  * Integrates components of the drag traction:
484  * \f[
485  * \mathbf{F}_{\textrm{D}} =
486  * -\int\limits_{\Gamma_{\textrm{S}}}\left(-p\mathbf{I} +
487  * \mu\left(\nabla\mathbf{u}+\mathbf{u}^{\intercal}\right)\right) \, d\Gamma
488  * \f]
489  */
491 
492  boost::shared_ptr<CommonData> commonData;
494 
496  boost::shared_ptr<CommonData> &common_data,
497  BlockData &block_data)
499  field_name, UserDataOperator::OPROW),
500  commonData(common_data), blockData(block_data) {
501  doVertices = true;
502  doEdges = false;
503  doQuads = false;
504  doTris = false;
505  doTets = false;
506  doPrisms = false;
507  };
508 
509  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
510  };
511 
512  /**
513  * @brief Calculate drag traction on the fluid-solid interface
514  *
515  * Operator fo calculating drag traction on the fluid-solid interface
516  * \f[
517  * \mathbf{t} = -p\mathbf{I} +
518  * \mu\left(\nabla\mathbf{u}+\mathbf{u}^{\intercal}\right)
519  * \f]
520  */
522 
523  boost::shared_ptr<CommonData> commonData;
525  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideFe;
526  std::string sideFeName;
527 
529  const string field_name,
530  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &side_fe,
531  std::string side_fe_name, boost::shared_ptr<CommonData> &common_data,
532  BlockData &block_data)
534  field_name, UserDataOperator::OPROW),
535  sideFe(side_fe), sideFeName(side_fe_name), commonData(common_data),
536  blockData(block_data) {
537  doVertices = true;
538  doEdges = false;
539  doQuads = false;
540  doTris = false;
541  doTets = false;
542  doPrisms = false;
543  };
544 
545  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
546  };
547 
548  /**
549  * @brief Post processing output of drag traction on the fluid-solid interface
550  *
551  */
553 
554  boost::shared_ptr<CommonData> commonData;
556  std::vector<EntityHandle> &mapGaussPts;
558 
559  OpPostProcDrag(const string field_name, moab::Interface &post_proc_mesh,
560  std::vector<EntityHandle> &map_gauss_pts,
561  boost::shared_ptr<CommonData> &common_data,
562  BlockData &block_data)
564  field_name, UserDataOperator::OPROW),
565  commonData(common_data), postProcMesh(post_proc_mesh),
566  mapGaussPts(map_gauss_pts), blockData(block_data) {
567  doVertices = true;
568  doEdges = false;
569  doQuads = false;
570  doTris = false;
571  doTets = false;
572  doPrisms = false;
573  };
574 
575  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
576  };
577 
578  /**
579  * @brief Post processing output of the vorticity criterion levels
580  *
581  */
583 
584  boost::shared_ptr<CommonData> commonData;
586  std::vector<EntityHandle> &mapGaussPts;
588 
590  std::vector<EntityHandle> &map_gauss_pts,
591  boost::shared_ptr<CommonData> &common_data,
592  BlockData &block_data)
593  : UserDataOperator("U", UserDataOperator::OPROW),
594  commonData(common_data), postProcMesh(post_proc_mesh),
595  mapGaussPts(map_gauss_pts), blockData(block_data) {
596  doVertices = true;
597  doEdges = false;
598  doQuads = false;
599  doTris = false;
600  doTets = false;
601  doPrisms = false;
602  };
603 
604  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
605  };
606 
607  /**
608  * @brief calculating volumetric flux
609  *
610  */
612 
613  boost::shared_ptr<CommonData> commonData;
615  int nbRows; ///< number of dofs on row
617 
619  boost::shared_ptr<CommonData> common_data,
620  BlockData &block_data)
622  commonData(common_data), blockData(block_data){};
623 
624  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
625  };
626 };
627 
628 #endif //__NAVIERSTOKESELEMENT_HPP__
NavierStokesElement::OpCalcVolumeFlux::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:614
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:127
NavierStokesElement::OpPostProcDrag::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:557
NavierStokesElement::OpPostProcDrag
Post processing output of drag traction on the fluid-solid interface.
Definition: NavierStokesElement.hpp:552
NavierStokesElement::OpCalcDragTraction
Calculate drag traction on the fluid-solid interface.
Definition: NavierStokesElement.hpp:521
NavierStokesElement::BlockData::iD
int iD
Definition: NavierStokesElement.hpp:39
NavierStokesElement::OpCalcDragForce::OpCalcDragForce
OpCalcDragForce(const string field_name, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:495
NavierStokesElement::OpAssembleLhs::col_nb_dofs
int col_nb_dofs
Definition: NavierStokesElement.hpp:287
NavierStokesElement::OpAssembleRhs::nbIntegrationPts
int nbIntegrationPts
Definition: NavierStokesElement.hpp:385
MoFEM::FEMethod
structure for User Loop Methods on finite elements
Definition: LoopMethods.hpp:369
NavierStokesElement::OpPostProcVorticity::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:587
NavierStokesElement::CommonData::totalDragForceVec
SmartPetscObj< Vec > totalDragForceVec
Definition: NavierStokesElement.hpp:62
NavierStokesElement::OpCalcDragTraction::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:523
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
MoFEM::CoreInterface::modify_finite_element_add_field_row
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
NavierStokesElement::OpAssembleRhs::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:382
NavierStokesElement::OpAssembleLhsDiagLin
Assemble linear (symmetric) part of the diagonal block of the LHS Operator for assembling linear (sym...
Definition: NavierStokesElement.hpp:338
NavierStokesElement::CommonData
Definition: NavierStokesElement.hpp:50
NavierStokesElement::OpAssembleLhsOffDiag
Assemble off-diagonal block of the LHS Operator for assembling off-diagonal block of the LHS.
Definition: NavierStokesElement.hpp:318
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
NavierStokesElement::OpPostProcVorticity
Post processing output of the vorticity criterion levels.
Definition: NavierStokesElement.hpp:582
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
NavierStokesElement::FaceRule
Definition: NavierStokesElement.hpp:269
NavierStokesElement::CommonData::volumeFluxVec
SmartPetscObj< Vec > volumeFluxVec
Definition: NavierStokesElement.hpp:64
BasicFiniteElements.hpp
NavierStokesElement::OpAssembleRhs::OpAssembleRhs
OpAssembleRhs(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:389
NavierStokesElement::FaceRule::operator()
int operator()(int order_row, int order_col, int order_data) const
Definition: NavierStokesElement.hpp:270
NavierStokesElement::OpAssembleRhsVelocityNonLin::OpAssembleRhsVelocityNonLin
OpAssembleRhsVelocityNonLin(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:449
NavierStokesElement::OpAssembleLhs::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:280
NavierStokesElement::CommonData::pressureDragTract
boost::shared_ptr< MatrixDouble > pressureDragTract
Definition: NavierStokesElement.hpp:56
FTensor::Tensor2< double, 3, 3 >
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
NavierStokesElement::OpAssembleLhsDiagNonLin::OpAssembleLhsDiagNonLin
OpAssembleLhsDiagNonLin(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:364
NavierStokesElement::VolRule
Set integration rule to volume elements.
Definition: NavierStokesElement.hpp:263
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
NavierStokesElement::OpAssembleLhs::row_nb_dofs
int row_nb_dofs
Definition: NavierStokesElement.hpp:286
NavierStokesElement::OpAssembleLhsDiagNonLin::diffDiff
FTensor::Tensor2< double, 3, 3 > diffDiff
Definition: NavierStokesElement.hpp:362
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator
friend class UserDataOperator
Definition: FaceElementForcesAndSourcesCore.hpp:86
MoFEM::CoreInterface::add_finite_element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
NavierStokesElement::OpCalcDragTraction::sideFe
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideFe
Definition: NavierStokesElement.hpp:525
NavierStokesElement::CommonData::setOfFacesData
std::map< int, BlockData > setOfFacesData
Definition: NavierStokesElement.hpp:67
NavierStokesElement::OpCalcVolumeFlux
calculating volumetric flux
Definition: NavierStokesElement.hpp:611
NavierStokesElement::OpCalcDragForce::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:493
NavierStokesElement::OpPostProcDrag::mapGaussPts
std::vector< EntityHandle > & mapGaussPts
Definition: NavierStokesElement.hpp:556
MoFEM::CoreInterface::modify_finite_element_add_field_col
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
NavierStokesElement::CommonData::pressureDragForceVec
SmartPetscObj< Vec > pressureDragForceVec
Definition: NavierStokesElement.hpp:60
NavierStokesElement::OpCalcVolumeFlux::nbRows
int nbRows
number of dofs on row
Definition: NavierStokesElement.hpp:615
NavierStokesElement::OpCalcVolumeFlux::nbIntegrationPts
int nbIntegrationPts
Definition: NavierStokesElement.hpp:616
NavierStokesElement::OpAssembleRhsVelocityLin::OpAssembleRhsVelocityLin
OpAssembleRhsVelocityLin(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:420
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator
default operator for TRI element
Definition: FaceElementForcesAndSourcesCore.hpp:94
NavierStokesElement::CommonData::setOfBlocksData
std::map< int, BlockData > setOfBlocksData
Definition: NavierStokesElement.hpp:66
NavierStokesElement::CommonData::CommonData
CommonData(MoFEM::Interface &m_field)
Definition: NavierStokesElement.hpp:69
convert.type
type
Definition: convert.py:64
NavierStokesElement::OpPostProcDrag::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:554
NavierStokesElement::OpCalcVolumeFlux::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:613
NavierStokesElement::OpPostProcDrag::OpPostProcDrag
OpPostProcDrag(const string field_name, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:559
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
friend class UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:105
NavierStokesElement::OpAssembleLhs::locMat
MatrixDouble locMat
Definition: NavierStokesElement.hpp:281
NavierStokesElement::OpCalcDragTraction::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:524
NavierStokesElement::OpCalcDragTraction::OpCalcDragTraction
OpCalcDragTraction(const string field_name, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > &side_fe, std::string side_fe_name, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:528
NavierStokesElement::BlockData::BlockData
BlockData()
Definition: NavierStokesElement.hpp:45
MoFEM::PostProcBrokenMeshInMoab< VolumeElementForcesAndSourcesCore >
Definition: PostProcBrokenMeshInMoabBase.hpp:670
MoFEM::FaceElementForcesAndSourcesCore
Face finite element.
Definition: FaceElementForcesAndSourcesCore.hpp:23
NavierStokesElement::BlockData::viscousCoef
double viscousCoef
Definition: NavierStokesElement.hpp:43
NavierStokesElement::LoadScale::scaleNf
MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &nf)
Definition: NavierStokesElement.hpp:106
MethodForForceScaling
Class used to scale loads, f.e. in arc-length control.
Definition: MethodForForceScaling.hpp:11
NavierStokesElement::OpAssembleLhs::isOnDiagonal
bool isOnDiagonal
Definition: NavierStokesElement.hpp:290
NavierStokesElement::CommonData::shearDragTract
boost::shared_ptr< MatrixDouble > shearDragTract
Definition: NavierStokesElement.hpp:57
MoFEM::CoreInterface::add_ents_to_finite_element_by_dim
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string &name, const bool recursive=true)=0
add entities to finite element
NavierStokesElement::LoadScale::lambda
static double lambda
Definition: NavierStokesElement.hpp:104
NavierStokesElement::CommonData::pressPtr
boost::shared_ptr< VectorDouble > pressPtr
Definition: NavierStokesElement.hpp:54
NavierStokesElement::OpAssembleLhs::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:282
NavierStokesElement::BlockData
Definition: NavierStokesElement.hpp:38
NavierStokesElement::OpCalcDragTraction::sideFeName
std::string sideFeName
Definition: NavierStokesElement.hpp:526
NavierStokesElement::OpAssembleRhs::locVec
VectorDouble locVec
Definition: NavierStokesElement.hpp:387
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:108
NavierStokesElement::OpAssembleLhsDiagLin::OpAssembleLhsDiagLin
OpAssembleLhsDiagLin(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:342
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
NavierStokesElement::OpAssembleLhs::row_nb_gauss_pts
int row_nb_gauss_pts
Definition: NavierStokesElement.hpp:288
NavierStokesElement::addElement
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const string element_name, const string velocity_field_name, const string pressure_field_name, const string mesh_field_name, const int dim=3, Range *ents=nullptr)
Setting up elements.
Definition: NavierStokesElement.hpp:129
NavierStokesElement::BlockData::fluidDensity
double fluidDensity
Definition: NavierStokesElement.hpp:41
NavierStokesElement::LoadScale
Definition: NavierStokesElement.hpp:102
NavierStokesElement::OpPostProcVorticity::mapGaussPts
std::vector< EntityHandle > & mapGaussPts
Definition: NavierStokesElement.hpp:586
Range
NavierStokesElement::OpCalcVolumeFlux::OpCalcVolumeFlux
OpCalcVolumeFlux(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:618
NavierStokesElement::BlockData::eNts
Range eNts
Definition: NavierStokesElement.hpp:44
NavierStokesElement::OpAssembleRhsPressure::OpAssembleRhsPressure
OpAssembleRhsPressure(const string field_name, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:468
NavierStokesElement::OpAssembleLhsDiagLin::diffDiff
FTensor::Tensor2< double, 3, 3 > diffDiff
Definition: NavierStokesElement.hpp:340
NavierStokesElement::CommonData::gradVelPtr
boost::shared_ptr< MatrixDouble > gradVelPtr
Definition: NavierStokesElement.hpp:52
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
NavierStokesElement
Element for simulating viscous fluid flow.
Definition: NavierStokesElement.hpp:25
NavierStokesElement::OpPostProcDrag::postProcMesh
moab::Interface & postProcMesh
Definition: NavierStokesElement.hpp:555
MoFEM::createVectorMPI
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
Definition: PetscSmartObj.hpp:198
NavierStokesElement::VolRule::operator()
int operator()(int order_row, int order_col, int order_data) const
Definition: NavierStokesElement.hpp:264
MoFEM::CoreInterface::modify_finite_element_add_field_data
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_filed)=0
set finite element field data
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
NavierStokesElement::CommonData::shearDragForceVec
SmartPetscObj< Vec > shearDragForceVec
Definition: NavierStokesElement.hpp:61
NavierStokesElement::OpAssembleRhsPressure
Assemble the pressure component of the RHS vector.
Definition: NavierStokesElement.hpp:466
NavierStokesElement::OpAssembleRhs::blockData
BlockData & blockData
Definition: NavierStokesElement.hpp:383
NavierStokesElement::OpCalcDragForce::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:492
NavierStokesElement::CommonData::velPtr
boost::shared_ptr< MatrixDouble > velPtr
Definition: NavierStokesElement.hpp:53
NavierStokesElement::OpAssembleLhs::OpAssembleLhs
OpAssembleLhs(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:292
NavierStokesElement::OpAssembleRhsVelocityNonLin
Assemble non-linear part of the velocity component of the RHS vector.
Definition: NavierStokesElement.hpp:447
MoFEM::SmartPetscObj< Vec >
NavierStokesElement::BlockData::fluidViscosity
double fluidViscosity
Definition: NavierStokesElement.hpp:40
NavierStokesElement::CommonData::getParameters
MoFEMErrorCode getParameters()
Definition: NavierStokesElement.hpp:92
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
NavierStokesElement::OpAssembleRhs
Base class for operators assembling RHS.
Definition: NavierStokesElement.hpp:380
NavierStokesElement::OpAssembleLhs
Base class for operators assembling LHS.
Definition: NavierStokesElement.hpp:278
NavierStokesElement::OpPostProcVorticity::postProcMesh
moab::Interface & postProcMesh
Definition: NavierStokesElement.hpp:585
NavierStokesElement::CommonData::totalDragTract
boost::shared_ptr< MatrixDouble > totalDragTract
Definition: NavierStokesElement.hpp:58
NavierStokesElement::OpAssembleLhsOffDiag::OpAssembleLhsOffDiag
OpAssembleLhsOffDiag(const string field_name_row, const string field_name_col, boost::shared_ptr< CommonData > common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:320
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
NavierStokesElement::OpAssembleRhs::iNtegrate
virtual MoFEMErrorCode iNtegrate(EntData &data)
Definition: NavierStokesElement.hpp:397
NavierStokesElement::OpCalcDragForce
Calculate drag force on the fluid-solid interface.
Definition: NavierStokesElement.hpp:490
NavierStokesElement::OpPostProcVorticity::commonData
boost::shared_ptr< CommonData > commonData
Definition: NavierStokesElement.hpp:584
NavierStokesElement::OpAssembleRhs::nbRows
int nbRows
number of dofs on row
Definition: NavierStokesElement.hpp:384
NavierStokesElement::OpAssembleLhs::diagonalBlock
bool diagonalBlock
Definition: NavierStokesElement.hpp:284
MoFEM::PostProcBrokenMeshInMoab< FaceElementForcesAndSourcesCore >
Definition: PostProcBrokenMeshInMoabBase.hpp:677
NavierStokesElement::BlockData::inertiaCoef
double inertiaCoef
Definition: NavierStokesElement.hpp:42
NavierStokesElement::OpPostProcVorticity::OpPostProcVorticity
OpPostProcVorticity(moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< CommonData > &common_data, BlockData &block_data)
Definition: NavierStokesElement.hpp:589
NavierStokesElement::OpAssembleRhsVelocityLin
Assemble linear part of the velocity component of the RHS vector.
Definition: NavierStokesElement.hpp:418
NavierStokesElement::OpAssembleLhsDiagNonLin
Assemble non-linear (non-symmetric) part of the diagonal block of the LHS Operator for assembling non...
Definition: NavierStokesElement.hpp:360
NavierStokesElement::OpAssembleLhs::iNtegrate
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Definition: NavierStokesElement.hpp:306