LifeV
NavierStokesSolverBlocks.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Navier Stokes solver.
30  @author Davide Forti <davide.forti@epfl.ch>
31  @maintainer Davide Forti <davide.forti@epfl.ch>
32  @date 03-02-2015
33 
34  This class implements a Navier-Stokes solver. This solver allows to solve this kind of problems:
35  - Steady NS equations (using P2-P1 or P1Bubble-P1 finite elements)
36  - Unsteady NS equations using a fully-implicit time discretization (SUPG-VMS stabilization available)
37  - Unsteady NS equations using a semi-implicit time discretization (SUPG-VMS and VMS-LES stabilizations available)
38 
39  In the testsuite and example folders, several examples which show how to properly use the solver are present.
40 
41  If you are using this solver to generate results for publication, please <b>cite</b>:
42  - D. Forti, L. Dede'. <i> Semi-implicit BDF time discretization of the Navier–Stokes equations with VMS-LES modeling in a High Performance Computing framework</i>.
43  Comput. Fluids. 197(1):168-182.
44  */
45 
46 #ifndef NAVIERSTOKESSOLVERBLOCKS_H
47 #define NAVIERSTOKESSOLVERBLOCKS_H
48 
49 #include <lifev/core/LifeV.hpp>
50 
51 // includes for matrices and vector
52 #include <lifev/core/array/MatrixEpetra.hpp>
53 #include <lifev/core/array/VectorEpetra.hpp>
54 
55 // includes for building the matrix graph
56 #include <Epetra_FECrsGraph.h>
57 #include <lifev/eta/expression/Integrate.hpp>
58 #include <lifev/eta/expression/BuildGraph.hpp>
59 
60 // classical FE space
61 #include <lifev/core/fem/FESpace.hpp>
62 
63 // boundary conditions
64 #include <lifev/core/fem/BCManage.hpp>
65 
66 // expression template finite element space
67 #include <lifev/eta/fem/ETFESpace.hpp>
68 
69 // includes for the linear solver
70 #include <lifev/navier_stokes_blocks/solver/NavierStokesOperator.hpp>
71 #include <lifev/core/linear_algebra/ApproximatedInvertibleRowMatrix.hpp>
72 
73 #include <lifev/navier_stokes_blocks/solver/NavierStokesPreconditionerOperator.hpp>
74 #include <lifev/navier_stokes_blocks/solver/aSIMPLEOperator.hpp>
75 
76 // utilities
77 #include <lifev/core/util/LifeChrono.hpp>
78 #include <lifev/core/util/Displayer.hpp>
79 
80 #include <Teuchos_ParameterList.hpp>
81 #include <Teuchos_XMLParameterListHelpers.hpp>
82 
83 #include <lifev/core/algorithm/NonLinearRichardson.hpp>
84 
85 #include <lifev/core/filter/GetPot.hpp>
86 
87 #include <lifev/navier_stokes_blocks/solver/Stabilization.hpp>
88 #include <lifev/navier_stokes_blocks/solver/StabilizationSUPG.hpp>
89 #include <lifev/navier_stokes_blocks/solver/StabilizationSUPG_semi_implicit.hpp>
90 #include <lifev/navier_stokes_blocks/solver/StabilizationSUPGALE.hpp>
91 #include <lifev/navier_stokes_blocks/solver/StabilizationSUPG_semi_implicit_ale.hpp>
92 
93 #include <Teuchos_ParameterList.hpp>
94 #include <Teuchos_XMLParameterListHelpers.hpp>
95 #include <Teuchos_RCP.hpp>
96 #include <lifev/core/algorithm/LinearSolver.hpp>
97 #include <lifev/core/algorithm/Preconditioner.hpp>
98 #include <lifev/core/algorithm/PreconditionerIfpack.hpp>
99 #include <lifev/core/algorithm/PreconditionerML.hpp>
100 #include <lifev/core/filter/ExporterHDF5.hpp>
101 
102 #include <lifev/core/fem/PostProcessingBoundary.hpp>
103 #include <lifev/navier_stokes_blocks/solver/FastAssemblerNS.hpp>
104 
105 namespace LifeV
106 {
107 
109 {
110 
111 public:
112 
113  //@name Public Types
114  //@{
115 
118 
121 
124 
125  typedef VectorEpetra vector_Type;
127 
130 
133 
136 
139 
141 
144 
146 
147  typedef LifeV::Preconditioner basePrec_Type;
149  typedef LifeV::PreconditionerIfpack prec_Type;
152 
153  //@}
154 
155  //! @name Constructor and Destructor
156  //@{
157 
158  // Constructor
159  NavierStokesSolverBlocks(const dataFile_Type dataFile, const commPtr_Type& communicator);
160 
161  // Destructor
163 
164  //@}
165 
166  //! @name Methods
167  //@{
168 
169  //! Setup for the solver
170  /*!
171  * @param mesh mesh used
172  * @param id_domain used just in case of multiple fluids
173  */
174  void setup(const meshPtr_Type& mesh, const int& id_domain = 36);
175 
176  //! Assemble constant terms
177  void buildSystem();
178 
179  //! Update the convective term and the right hand side
180  /*!
181  * @param u_star extrapolate velocity
182  * @param rhs_velocity right hand side, velocity block
183  */
184  void updateSystem( const vectorPtr_Type& u_star, const vectorPtr_Type& rhs_velocity );
185 
186  //! Solve the current timestep, provided the BC
187  /*!
188  * @param bc boundary conditions
189  * @param time current time
190  */
191  void iterate( bcPtr_Type & bc, const Real& time );
192 
193  //! Solve the current timestep, provided the BC and a vector of velocities (used only for for aorta example)
194  /*!
195  * @param bc boundary conditions
196  * @param time current time
197  * @param velocities vector of velocity (used for imposing velocity on noncircular inflows)
198  */
199  void iterate( bcPtr_Type & bc, const Real& time, const vectorPtr_Type& velocities );
200 
201  //! Solve the steady Navier-Stokes equations
202  void iterate_steady( );
203 
204  //! Solve the Navier-Stokes equations at a certain time
205  /*!
206  * @param time current time
207  */
208  void iterate_nonlinear( const Real& time );
209 
210  //! Evaluate the residual of the NS problem
211  /*!
212  * @param residual residual vector
213  * @param solution solution vector
214  * @param iter_newton current newton iteration
215  */
216  void evalResidual(vector_Type& residual, const vector_Type& solution, const UInt iter_newton);
217 
218  //! Evaluate the residual of the NS problem
219  /*!
220  * @param increment increment vector
221  * @param residual residual vector
222  * @param linearRelTol tolerance of the linar solver
223  */
224  void solveJac( vector_Type& increment, const vector_Type& residual, const Real linearRelTol );
225 
226  //! Update the Jacobian matrix, only the term associated with the linearization of the convective term
227  /*!
228  * @param u_k velocity previous newton step
229  */
230  void updateJacobian( const vector_Type& u_k );
231 
232  //! Apply the BCs semi-implicit case
233  /*!
234  * @param bc boundary conditions of the problem
235  * @param time current time
236  */
237  void applyBoundaryConditions ( bcPtr_Type & bc, const Real& time );
238 
239  //! Apply the BCs semi-implicit case (example aorta)
240  /*!
241  * @param bc boundary conditions of the problem
242  * @param time current time
243  * @param velocities vector of velocities to be imposed
244  */
245  void applyBoundaryConditions ( bcPtr_Type & bc, const Real& time, const vectorPtr_Type& velocities );
246 
247  //! Apply the BCs on the Jacobian matrix
248  /*!
249  * @param bc boundary conditions of the problem
250  */
252 
253  //! Apply the BCs to the solution
254  /*!
255  * @param time current time
256  */
257  void applyBoundaryConditionsSolution ( const Real& time );
258 
259  //! Update the convective term
260  /*!
261  * @param velocity velocity vector
262  */
263  void updateConvectiveTerm ( const vectorPtr_Type& velocity);
264 
265  //! Compute Aerodynamic Forces
266  /*!
267  * @param bcHandlerDrag bc to be used for drag computation
268  * @param bcHandlerLift bc to be used for lift computation
269  */
270  VectorSmall<2> computeForces( BCHandler& bcHandlerDrag, BCHandler& bcHandlerLift);
271 
272  //! Solve a time step
273  void solveTimeStep();
274 
275  //! Compute Aerodynamic Forces - nonlinear case
276  /*!
277  * @param force vector containing the forces
278  * @param solution vector with the solution
279  */
280  void computeForcesNonLinear(vectorPtr_Type& force, const vectorPtr_Type& solution);
281 
282  //! Evaluates the fluid residual in FSI simulations
283  /*!
284  * @param convective_velocity difference between fluid velocity and mesh velocity at previous Newton iteration
285  * @param velocity_km1 fluid velocity at previous Newton iteration
286  * @param pressure_km1 fluid pressure at previous Newton iteration
287  * @param pressure_km1 terms of bdf associated to the rhs
288  * @param residual residual that will be assembled
289  */
290  void evaluateResidual( const vectorPtr_Type& convective_velocity,
291  const vectorPtr_Type& velocity_km1,
292  const vectorPtr_Type& pressure_km1,
293  const vectorPtr_Type& rhs_velocity,
294  vectorPtr_Type& residual);
295 
296  //! Evaluates the fluid residual in FSI simulations
297  /*!
298  * @param convective_velocity difference between fluid velocity and mesh velocity at previous Newton iteration
299  * @param velocity_km1 fluid velocity at previous Newton iteration
300  * @param pressure_km1 fluid pressure at previous Newton iteration
301  * @param pressure_km1 terms of bdf associated to the rhs
302  * @param residualVelocity residual associated to the fluid momentum equation
303  * @param residualPressure residual associated to the fluid continuity equation
304  */
305  void evaluateResidual( const vectorPtr_Type& convective_velocity,
306  const vectorPtr_Type& velocity_km1,
307  const vectorPtr_Type& pressure_km1,
308  const vectorPtr_Type& rhs_velocity,
309  vectorPtr_Type& residualVelocity,
310  vectorPtr_Type& residualPressure);
311 
312  //! Update stabilization terms
313  /*!
314  * @param convective_velocity_previous_newton_step difference between fluid velocity and mesh velocity at previous Newton iteration
315  * @param velocity_previous_newton_step fluid velocity at previous Newton iteration
316  * @param pressure_previous_newton_step fluid pressure at previous Newton iteration
317  * @param velocity_rhs block of the velocity of the rhs
318  */
319  void updateStabilization( const vector_Type& convective_velocity_previous_newton_step,
320  const vector_Type& velocity_previous_newton_step,
321  const vector_Type& pressure_previous_newton_step,
322  const vector_Type& velocity_rhs );
323 
324  //! Computation of forces
325  /*!
326  * @param velocity velocity vector
327  * @param pressure pressure vector
328  */
329  void integrateForces ( const vectorPtr_Type & velocity, const vectorPtr_Type & pressure);
330 
331  //! Additional method used for pre-processing on non-circular boundaries (used only in example aorta)
332  /*!
333  * @param nx x component normal vector to an outflow face
334  * @param ny y component normal vector to an outflow face
335  * @param nz z component normal vector to an outflow face
336  * @param bc boundary conditions
337  * @param Q_hat reference flowrate to be imposed
338  * @param Phi_h solution laplacian
339  * @param flag flag outflow
340  * @param Phi_h_flag solution laplacian on the outflow flag
341  * @param V_hat_x reference velocity, x component
342  * @param V_hat_y reference velocity, y component
343  * @param V_hat_z reference velocity, z component
344  */
345  void preprocessBoundary(const Real& nx, const Real& ny, const Real& nz, BCHandler& bc, Real& Q_hat, const vectorPtr_Type& Phi_h, const UInt flag,
346  vectorPtr_Type& Phi_h_flag, vectorPtr_Type& V_hat_x, vectorPtr_Type& V_hat_y, vectorPtr_Type& V_hat_z);
347 
348  //! Additional method used for pre-processing on non-circular boundaries (used only in example aorta)
349  /*!
350  * @param flag flag of the outflow face
351  * @param bc_laplacian boundary conditions laplacian
352  * @param laplacianSolution solution laplacian
353  */
354  void solveLaplacian( const UInt& flag, bcPtr_Type& bc_laplacian, vectorPtr_Type& laplacianSolution );
355 
356  //! Additional setup for postprocessing on boundaries
357  void setupPostProc( );
358 
359  //! Compute flux through a boundary face of the domain
360  /*!
361  * @param flag flag of the face
362  * @param velocity velocity vector
363  */
364  Real flux ( const markerID_Type& flag, const vector_Type& velocity );
365 
366  //! Compute area of a boundary face of the domain
367  /*!
368  * @param flag flag of the outflow face
369  */
370  Real area ( const markerID_Type& flag );
371 
372  //! Compute mean pressure at a boundary face of the domain
373  /*!
374  * @param flag flag of the outflow face
375  * @param pressure pressure vector
376  */
377  Real pres ( const markerID_Type& flag, const vector_Type& pressure );
378 
379  //! Compute center of a boundary face of the domain
380  /*!
381  * @param flag flag of the face
382  */
383  Vector geometricCenter ( const markerID_Type& flag );
384 
385  //! Compute normal of a boundary face of the domain
386  /*!
387  * @param flag flag of the face
388  */
389  Vector normal ( const markerID_Type& flag );
390 
391  //@}
392 
393  //! @name Set methods
394  //@{
395 
396  //! Set coefficient associated to the time discretization scheme
397  /*!
398  * @param alpha coefficient BDF scheme in front of u^{n+1}
399  */
400  void setAlpha(const Real& alpha)
401  {
402  M_alpha = alpha;
403  if ( M_useStabilization )
404  {
405  M_stabilization->setAlpha( M_alpha );
406  }
407  }
408 
409  //! Set the rhs vector, velocity component
410  /*!
411  * @param vel_rhs rhs vector, velocity component
412  */
413  void setRhsVelocity ( const vectorPtr_Type& vel_rhs)
414  {
415  M_velocityRhs.reset( new vector_Type ( *vel_rhs ) );
416  }
417 
418  //! Set the extrapolated pressure vector (used by semi-implicit VMS-LES stabilization)
419  /*!
420  * @param pressure_extrapolated pressure extrapolated vector
421  */
422  void setExtrapolatedPressure( const vectorPtr_Type& pressure_extrapolated ) { M_pressure_extrapolated = pressure_extrapolated; }
423 
424  //! Set if one needs to export the fine scale component (when using LES models)
425  /*!
426  * @param exporter exporter
427  * @param numElementsTotal number of total elements (tetrahedral elements)
428  */
429  void setExportFineScaleVelocity(ExporterHDF5<mesh_Type>& exporter, const int& numElementsTotal);
430 
431  //! Set parameters of the solver
432  void setParameters( );
433 
434  //! Set time step
435  /*!
436  * @param dt time step size
437  */
438  void setTimeStep(const Real& dt)
439  {
440  M_timeStep = dt;
441  }
442 
443  //! Set time step
444  /*!
445  * @param bc boundary conditions of the problem
446  */
447  void setBoundaryConditions ( const bcPtr_Type& bc );
448 
449  //@}
450 
451  //! @name Get methods
452  //@{
453 
454  //! Get the velocity FE space
456  {
457  return M_velocityFESpace;
458  }
459 
460  //! Get the velocity FE space
462  {
463  return M_pressureFESpace;
464  }
465 
466  //! Get the velocity FE space
468  {
469  return M_velocityFESpaceScalar;
470  }
471 
472  //! Get the velocity vector
474  {
475  *velocity = *M_velocity;
476  }
477 
478  //! Get the pressure vector
480  {
481  *pressure = *M_pressure;
482  }
483 
484  //! Get the F block
485  matrixPtr_Type const& getF() const
486  {
487  return M_F;
488  }
489 
490  //! Get the jacobian block
492  {
493  return M_Jacobian;
494  }
495 
496  //! Get the Btranspose block
498  {
499  return M_Btranspose;
500  }
501 
502  //! Get the B block
503  matrixPtr_Type const& getB() const
504  {
505  return M_B;
506  }
507 
508  //! Get the rhs
509  vectorPtr_Type const& getRhs() const
510  {
511  return M_rhs;
512  }
513 
514  //! Get the rhs vector (pressure part)
516  {
517  return M_rhs_pressure;
518  }
519 
520  matrixPtr_Type const& Mu() const
521  {
522  return M_Mu;
523  }
524 
525  Real density ( ) const
526  {
527  return M_density;
528  }
529 
530  Real viscosity ( ) const
531  {
532  return M_viscosity;
533  }
534 
535  //! Get the (0,0) block
536  matrixPtr_Type const& block00() const
537  {
538  return M_block00;
539  }
540 
541  //! Get the (0,1) block
542  matrixPtr_Type const& block01() const
543  {
544  return M_block01;
545  }
546 
547  //! Get the (1,0) block
548  matrixPtr_Type const& block10() const
549  {
550  return M_block10;
551  }
552 
553  //! Get the (1,1)
554  matrixPtr_Type const& block11() const
555  {
556  return M_block11;
557  }
558 
559  //! Get if using a stabilization
560  bool useStabilization() const
561  {
562  return M_useStabilization;
563  }
564 
565  void assembleInterfaceMass( matrixPtr_Type& mass_interface, const mapPtr_Type& interface_map,
566  markerID_Type interfaceFlag, const vectorPtr_Type& numerationInterface, const UInt& offset );
567 
568  //! Get the displayer
569  Displayer const& getDisplayer ( ) const { return M_displayer; }
570 
571  //! Get the (0,0) block without BCs
573  {
574  return M_block00_noBC;
575  }
576 
577  //! Get the (0,1) block without BCs
579  {
580  return M_block01_noBC;
581  }
582 
583  //! Get the rhs without bcs applied
585  {
586  return M_rhs_noBC;
587  }
588 
589  //! Get the forces
591  {
592  return M_forces;
593  }
594 
595  //@}
596 
597 private:
598 
599  //! Build the graphs
600  void buildGraphs();
601 
602  //! Update the bc handler
603  void updateBCHandler( bcPtr_Type & bc );
604 
605  //! Set options preconditioner
606  void setSolversOptions(const Teuchos::ParameterList& solversOptions);
607 
608  //! Apply Bc to the residual vector
609  void applyBoundaryConditionsResidual ( vector_Type& r_u, const Real& time = 0.0);
610 
611  // communicator
613 
614  // getpot object
616 
617  // Order FE spaces
620 
621  // FE spaces
625 
626  // ET FE Spaces
630 
631  // stiff-strain check
633 
634  // graphs for the matrices
642 
645 
646  // matrices
654 
657 
658  // Navier-Stokes block matrices
663 
664  // Navier-Stokes block matrices without boundary conditions applied
665  // used for estimation of drag and lift coefficients when needed
673 
674  // vectors
682 
685 
688 
691 
693 
694  //! Displayer to print in parallel (only PID 0 will print)
695  Displayer M_displayer;
696 
697  //! Reals
701 
702  //! Booleans
706 
707  // Navoer Stokes operator
709 
710  // Preconditioner
712 
713  // Epetra Operator needed to solve the linear system
715 
716  // Parameter list solver
718 
719  // Check if the convective term is fully implicit
721 
722  // BC for the pcd preconditioner
724 
725  // Check if we want to compute the steady state
726  bool M_steady;
727 
732 
733  // BC handler
738 
741 
743 
745 
747 
749 
750  // Members for imposition of weak boundary conditions
754 
755  // Members for computation of aerodynamic loads
759 
762 
764 
765  //! Postprocessing class
767 
772 
775 
776 }; // class NavierStokesSolverBlocks
777 
778 } // namespace LifeV
779 
780 #endif // NAVIERSTOKESSOLVERBLOCK_H
std::shared_ptr< dataFile_Type > dataFilePtr_Type
std::shared_ptr< vector_Type > vectorPtr_Type
void setAlpha(const Real &alpha)
Set coefficient associated to the time discretization scheme.
std::shared_ptr< FESpace< mesh_Type, map_Type > > M_velocityFESpaceScalar
void setup(const meshPtr_Type &mesh, const int &id_domain=36)
Setup for the solver.
std::shared_ptr< matrix_Type > matrixPtr_Type
vectorPtr_Type const & getRhsPressure() const
Get the rhs vector (pressure part)
void iterate_steady()
Solve the steady Navier-Stokes equations.
void updateSystem(const vectorPtr_Type &u_star, const vectorPtr_Type &rhs_velocity)
Update the convective term and the right hand side.
std::shared_ptr< ETFESpace_velocity > M_fespaceUETA
void applyBoundaryConditionsResidual(vector_Type &r_u, const Real &time=0.0)
Apply Bc to the residual vector.
std::shared_ptr< Epetra_FECrsGraph > graphPtr_Type
vectorPtr_Type const & getRhs() const
Get the rhs.
std::shared_ptr< Epetra_Operator > invOpPtr_Type
matrixPtr_Type const & getF() const
Get the F block.
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
void solveJac(vector_Type &increment, const vector_Type &residual, const Real linearRelTol)
Evaluate the residual of the NS problem.
std::shared_ptr< parameterList_Type > parameterListPtr_Type
ETFESpace< mesh_Type, map_Type, 3, 1 > ETFESpace_pressure
NavierStokesSolverBlocks(const dataFile_Type dataFile, const commPtr_Type &communicator)
int32_type Int
Generic integer data.
Definition: LifeV.hpp:188
std::shared_ptr< map_Type > M_monolithicMap
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
Definition: Marker.hpp:81
void evaluateResidual(const vectorPtr_Type &convective_velocity, const vectorPtr_Type &velocity_km1, const vectorPtr_Type &pressure_km1, const vectorPtr_Type &rhs_velocity, vectorPtr_Type &residual)
Evaluates the fluid residual in FSI simulations.
std::shared_ptr< map_Type > mapPtr_Type
std::shared_ptr< Operators::InvertibleOperator > M_invOper
void preprocessBoundary(const Real &nx, const Real &ny, const Real &nz, BCHandler &bc, Real &Q_hat, const vectorPtr_Type &Phi_h, const UInt flag, vectorPtr_Type &Phi_h_flag, vectorPtr_Type &V_hat_x, vectorPtr_Type &V_hat_y, vectorPtr_Type &V_hat_z)
Additional method used for pre-processing on non-circular boundaries (used only in example aorta) ...
std::shared_ptr< PostProcessingBoundary< mesh_Type > > M_postProcessing
Postprocessing class.
Displayer M_displayer
Displayer to print in parallel (only PID 0 will print)
Teuchos::RCP< Teuchos::ParameterList > parameterListRCP_Type
std::shared_ptr< FastAssemblerNS > M_fastAssembler
std::shared_ptr< ETFESpace_pressure > M_fespacePETA
void updateStabilization(const vector_Type &convective_velocity_previous_newton_step, const vector_Type &velocity_previous_newton_step, const vector_Type &pressure_previous_newton_step, const vector_Type &velocity_rhs)
Update stabilization terms.
matrixPtr_Type const & getJacobian() const
Get the jacobian block.
void evaluateResidual(const vectorPtr_Type &convective_velocity, const vectorPtr_Type &velocity_km1, const vectorPtr_Type &pressure_km1, const vectorPtr_Type &rhs_velocity, vectorPtr_Type &residualVelocity, vectorPtr_Type &residualPressure)
Evaluates the fluid residual in FSI simulations.
matrixPtr_Type const & getBtranspose() const
Get the Btranspose block.
Displayer const & getDisplayer() const
Get the displayer.
matrixPtr_Type const & block00() const
Get the (0,0) block.
Epetra_Import const & importer()
Getter for the Epetra_Import.
Definition: MapEpetra.cpp:394
void updateJacobian(const vector_Type &u_k)
Update the Jacobian matrix, only the term associated with the linearization of the convective term...
std::shared_ptr< ETFESpace_pressure > M_fespaceUETA_scalar
void iterate(bcPtr_Type &bc, const Real &time, const vectorPtr_Type &velocities)
Solve the current timestep, provided the BC and a vector of velocities (used only for for aorta examp...
ETFESpace< mesh_Type, map_Type, 3, 3 > ETFESpace_velocity
void setRhsVelocity(const vectorPtr_Type &vel_rhs)
Set the rhs vector, velocity component.
std::shared_ptr< BCHandler > bcPtr_Type
void assembleInterfaceMass(matrixPtr_Type &mass_interface, const mapPtr_Type &interface_map, markerID_Type interfaceFlag, const vectorPtr_Type &numerationInterface, const UInt &offset)
void setupPostProc()
Additional setup for postprocessing on boundaries.
void setSolversOptions(const Teuchos::ParameterList &solversOptions)
Set options preconditioner.
std::shared_ptr< Stabilization > M_stabilization
void solveLaplacian(const UInt &flag, bcPtr_Type &bc_laplacian, vectorPtr_Type &laplacianSolution)
Additional method used for pre-processing on non-circular boundaries (used only in example aorta) ...
const std::shared_ptr< FESpace< mesh_Type, map_Type > > & uFESpace() const
Get the velocity FE space.
matrixPtr_Type const & block10() const
Get the (1,0) block.
std::shared_ptr< LifeV::Operators::NavierStokesOperator > M_oper
void setExportFineScaleVelocity(ExporterHDF5< mesh_Type > &exporter, const int &numElementsTotal)
Set if one needs to export the fine scale component (when using LES models)
std::shared_ptr< comm_Type > commPtr_Type
matrixPtr_Type const & getB() const
Get the B block.
void applyBoundaryConditionsSolution(const Real &time)
Apply the BCs to the solution.
Real pres(const markerID_Type &flag, const vector_Type &pressure)
Compute mean pressure at a boundary face of the domain.
void applyBoundaryConditionsJacobian(bcPtr_Type &bc)
Apply the BCs on the Jacobian matrix.
const std::shared_ptr< FESpace< mesh_Type, map_Type > > & uFESpace_scalar() const
Get the velocity FE space.
bool useStabilization() const
Get if using a stabilization.
void setExtrapolatedPressure(const vectorPtr_Type &pressure_extrapolated)
Set the extrapolated pressure vector (used by semi-implicit VMS-LES stabilization) ...
void applyBoundaryConditions(bcPtr_Type &bc, const Real &time, const vectorPtr_Type &velocities)
Apply the BCs semi-implicit case (example aorta)
std::shared_ptr< FESpace< mesh_Type, map_Type > > M_velocityFESpace
void setParameters()
Set parameters of the solver.
matrixPtr_Type const & Mu() const
std::shared_ptr< LifeV::Operators::NavierStokesPreconditionerOperator > M_prec
void applyBoundaryConditions(bcPtr_Type &bc, const Real &time)
Apply the BCs semi-implicit case.
std::shared_ptr< prec_Type > precPtr_Type
void computeForcesNonLinear(vectorPtr_Type &force, const vectorPtr_Type &solution)
Compute Aerodynamic Forces - nonlinear case.
double Real
Generic real data.
Definition: LifeV.hpp:175
matrixPtr_Type block00_noBC() const
Get the (0,0) block without BCs.
std::shared_ptr< LifeV::Operators::NavierStokesOperator > M_operLoads
void updateVelocity(vectorPtr_Type &velocity)
Get the velocity vector.
Real area(const markerID_Type &flag)
Compute area of a boundary face of the domain.
void iterate(bcPtr_Type &bc, const Real &time)
Solve the current timestep, provided the BC.
void iterate_nonlinear(const Real &time)
Solve the Navier-Stokes equations at a certain time.
void updatePressure(vectorPtr_Type &pressure)
Get the pressure vector.
void setTimeStep(const Real &dt)
Set time step.
matrixPtr_Type const & block01() const
Get the (0,1) block.
VectorSmall< 2 > computeForces(BCHandler &bcHandlerDrag, BCHandler &bcHandlerLift)
Compute Aerodynamic Forces.
matrixPtr_Type const & block11() const
Get the (1,1)
void buildSystem()
Assemble constant terms.
vectorPtr_Type rhs_noBC() const
Get the rhs without bcs applied.
Vector geometricCenter(const markerID_Type &flag)
Compute center of a boundary face of the domain.
const std::shared_ptr< FESpace< mesh_Type, map_Type > > & pFESpace() const
Get the velocity FE space.
std::shared_ptr< mesh_Type > meshPtr_Type
void evalResidual(vector_Type &residual, const vector_Type &solution, const UInt iter_newton)
Evaluate the residual of the NS problem.
void updateConvectiveTerm(const vectorPtr_Type &velocity)
Update the convective term.
matrixPtr_Type block01_noBC() const
Get the (0,1) block without BCs.
class ETFESpace A light, templated version of the FESpace
Definition: ETFESpace.hpp:93
void setBoundaryConditions(const bcPtr_Type &bc)
Set time step.
std::shared_ptr< basePrec_Type > basePrecPtr_Type
Vector normal(const markerID_Type &flag)
Compute normal of a boundary face of the domain.
vectorPtr_Type getForces() const
Get the forces.
Real flux(const markerID_Type &flag, const vector_Type &velocity)
Compute flux through a boundary face of the domain.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
std::shared_ptr< FESpace< mesh_Type, map_Type > > M_pressureFESpace
void updateBCHandler(bcPtr_Type &bc)
Update the bc handler.
void integrateForces(const vectorPtr_Type &velocity, const vectorPtr_Type &pressure)
Computation of forces.