LifeV
NavierStokes< MeshType, Problem > Class Template Reference

NavierStokes Simulation class. More...

#include <navierStokes.hpp>

+ Collaboration diagram for NavierStokes< MeshType, Problem >:

Data Structures

struct  Private
 
struct  RESULT_CHANGED_EXCEPTION
 

Public Types

typedef MeshType mesh_Type
 
typedef Problem problem_Type
 
typedef LifeV::FESpace< mesh_Type, LifeV::MapEpetrafeSpace_Type
 
typedef std::shared_ptr< feSpace_TypefeSpacePtr_Type
 
typedef LifeV::OseenSolver< mesh_Typefluid_Type
 
typedef fluid_Type::vector_Type vector_Type
 
typedef std::shared_ptr< vector_TypevectorPtr_Type
 
typedef fluid_Type::matrix_Type matrix_Type
 
typedef RegionMesh< LinearTetramesh_Type
 
typedef boost::shared_ptr< mesh_TypemeshPtr_Type
 
typedef FESpace< mesh_Type, MapEpetrafeSpace_Type
 
typedef boost::shared_ptr< feSpace_TypefeSpacePtr_Type
 
typedef OseenSolver< mesh_Typefluid_Type
 
typedef VectorEpetra vector_Type
 
typedef boost::shared_ptr< vector_TypevectorPtr_Type
 
typedef boost::shared_ptr< Exporter< mesh_Type > > exporterPtr_Type
 

Public Member Functions

 NavierStokes (int argc, char **argv, boost::shared_ptr< Epetra_Comm > Comm, const std::string defaultDataName="data", const std::string outputName="result")
 
 ~NavierStokes ()
 
void run ()
 

Private Types

enum  TestType { None, Accuracy, SpaceConvergence }
 
enum  InitializationType { Projection, Interpolation }
 
enum  MeshSourceType { File, RegularMesh }
 

Private Member Functions

void computeErrors (const vector_Type &velocityAndPressureSolution, LifeV::Real &uL2Error, LifeV::Real &uRelError, feSpacePtr_Type &uFESpace, LifeV::Real &pL2Error, LifeV::Real &pRelError, feSpacePtr_Type &pFESpace, LifeV::Real time)
 Computes the L2 error and the relative L2 error with the exact solution. More...
 
bool checkConvergenceRate (const std::vector< std::string > &uFELabels, const std::vector< std::vector< LifeV::Real > > &uL2Error, const std::vector< LifeV::UInt > &uConvergenceOrder, const std::vector< std::string > &pFELabels, const std::vector< std::vector< LifeV::Real > > pL2Error, const std::vector< LifeV::UInt > &pConvergenceOrder, const std::vector< LifeV::UInt > &meshDiscretizations, LifeV::Real convTolerance)
 Method to check the convergence rate of the solution. More...
 

Private Attributes

std::shared_ptr< PrivateM_data
 
std::vector< LifeV::UIntM_meshDiscretization
 
std::vector< std::string > M_uFELabels
 
std::vector< std::string > M_pFELabels
 
std::vector< LifeV::UIntM_uConvergenceOrder
 
std::vector< LifeV::UIntM_pConvergenceOrder
 
TestType M_test
 
LifeV::Real M_convTol
 
LifeV::Real M_accuracyTol
 
bool M_exportNorms
 
std::ofstream M_outNorm
 
bool M_exportExactSolutions
 
InitializationType M_initMethod
 
MeshSourceType M_meshSource
 
std::string M_outputName
 
boost::shared_ptr< Epetra_Comm > M_comm
 
boost::shared_ptr< GetPotM_dataFile
 
std::string M_outputFilename
 

Constructors, destructor

 NavierStokes (int argc, char **argv, const std::string defaultDataName="data", const std::string outputName="navierStokes")
 Constructor. More...
 
 ~NavierStokes ()
 Destructor. More...
 

Methods

void run ()
 Launches the simulation. More...
 

Detailed Description

template<typename MeshType, typename Problem>
class NavierStokes< MeshType, Problem >

NavierStokes Simulation class.

Author
Christophe Prud'homme
Gwenol Grandperrin
See also
C.R. Ethier and D.A. Steinman. Exact fully 3D Navier-Stokes solutions for benchmarking. Int. J. Numer. Methods Fluids, 19(5):369-375, 1994

This class tests many settings, we propose here a list of the available options.

  • NavierStokes/test (none/accuracy/space_convergence)
  • NavierStokes/initialization (interpolation/projection)
  • NavierStokes/export_norms
  • NavierStokes/export_exact_solutions
  • NavierStokes/mesh_source (regular_mesh/file)
  • exporter/type (ensight/hdf5)
  • fluid/problem/Re
  • fluid/physics/viscosity
  • fluid/physics/density

In the case of a space convergence test the following options are available

  • NavierStokes/space_convergence_tolerance
  • fluid/space_discretization/mesh_number
  • fluid/space_discretization/mesh_size
  • fluid/space_discretization/FE_number
  • fluid/space_discretization/vel_order
  • fluid/space_discretization/vel_conv_order_order
  • fluid/space_discretization/press_order
  • fluid/space_discretization/press_conv_order

In the case of an accuracy test the following options are available

  • NavierStokes/accuracy_tolerance

If the mesh source is a file, the file must be specified in

  • fluid/space_discretization

Definition at line 100 of file navierStokes.hpp.

Member Typedef Documentation

◆ mesh_Type [1/2]

Definition at line 103 of file navierStokes.hpp.

◆ problem_Type

Definition at line 104 of file navierStokes.hpp.

◆ feSpace_Type [1/2]

Definition at line 105 of file navierStokes.hpp.

◆ feSpacePtr_Type [1/2]

typedef std::shared_ptr<feSpace_Type> feSpacePtr_Type

Definition at line 106 of file navierStokes.hpp.

◆ fluid_Type [1/2]

Definition at line 107 of file navierStokes.hpp.

◆ vector_Type [1/2]

Definition at line 108 of file navierStokes.hpp.

◆ vectorPtr_Type [1/2]

typedef std::shared_ptr<vector_Type> vectorPtr_Type

Definition at line 109 of file navierStokes.hpp.

◆ matrix_Type

Definition at line 110 of file navierStokes.hpp.

◆ mesh_Type [2/2]

Definition at line 58 of file navier_stokes.hpp.

◆ meshPtr_Type

typedef boost::shared_ptr<mesh_Type > meshPtr_Type

Definition at line 60 of file navier_stokes.hpp.

◆ feSpace_Type [2/2]

Definition at line 62 of file navier_stokes.hpp.

◆ feSpacePtr_Type [2/2]

typedef boost::shared_ptr<feSpace_Type> feSpacePtr_Type

Definition at line 64 of file navier_stokes.hpp.

◆ fluid_Type [2/2]

Definition at line 66 of file navier_stokes.hpp.

◆ vector_Type [2/2]

Definition at line 68 of file navier_stokes.hpp.

◆ vectorPtr_Type [2/2]

typedef boost::shared_ptr<vector_Type> vectorPtr_Type

Definition at line 70 of file navier_stokes.hpp.

◆ exporterPtr_Type

typedef boost::shared_ptr< Exporter<mesh_Type > > exporterPtr_Type

Definition at line 72 of file navier_stokes.hpp.

Member Enumeration Documentation

◆ TestType

enum TestType
private

Order of the BDF

Enumerator
None 
Accuracy 
SpaceConvergence 

Definition at line 146 of file navierStokes.hpp.

◆ InitializationType

enum InitializationType
private

Type of initialization. "Interpolation" just interpolates the value of the exact solution to the DoFs. "Projection" solves an Oseen problem where alpha=0, the convective term is linearized by using the exact solution for beta, and the time derivative is passed to the right hand side and computed from the exact solution.

Enumerator
Projection 
Interpolation 

Definition at line 153 of file navierStokes.hpp.

◆ MeshSourceType

enum MeshSourceType
private

Type of mesh source. It can be a "File" or a "RegularMesh" which is generated during the simulation

Enumerator
File 
RegularMesh 

Definition at line 158 of file navierStokes.hpp.

Constructor & Destructor Documentation

◆ NavierStokes() [1/2]

NavierStokes ( int  argc,
char **  argv,
const std::string  defaultDataName = "data",
const std::string  outputName = "navierStokes" 
)

Constructor.

Parameters
argcnumber of parameter passed through the command line
argvchar passed through the command line

Definition at line 310 of file navierStokes.hpp.

+ Here is the caller graph for this function:

◆ ~NavierStokes() [1/2]

~NavierStokes ( )
inline

Destructor.

Definition at line 127 of file navierStokes.hpp.

◆ NavierStokes() [2/2]

NavierStokes ( int  argc,
char **  argv,
boost::shared_ptr< Epetra_Comm >  Comm,
const std::string  defaultDataName = "data",
const std::string  outputName = "result" 
)

Definition at line 94 of file navier_stokes.hpp.

+ Here is the caller graph for this function:

◆ ~NavierStokes() [2/2]

~NavierStokes ( )
inline

Definition at line 80 of file navier_stokes.hpp.

Member Function Documentation

◆ run() [1/2]

void run ( )

Launches the simulation.

Definition at line 491 of file navierStokes.hpp.

◆ computeErrors()

void computeErrors ( const vector_Type velocityAndPressureSolution,
LifeV::Real uL2Error,
LifeV::Real uRelError,
feSpacePtr_Type uFESpace,
LifeV::Real pL2Error,
LifeV::Real pRelError,
feSpacePtr_Type pFESpace,
LifeV::Real  time 
)
private

Computes the L2 error and the relative L2 error with the exact solution.

Parameters
velocityAndPressureSolutionnumber of parameter passed through the command line
uL2ErrorVariable to store the L2 error for the veloctity
uRelErrorVariable to store the Relative L2 error for the velocity
uFESpaceVariable to store the FE space for the velocity
pL2ErrorVariable to store the L2 error the pressure
pRelErrorVariable to store the Relative L2 error for the pressure
pFESpaceVariable to store the FE space for the pressure
timeActual timestep of the simulation

Definition at line 408 of file navierStokes.hpp.

◆ checkConvergenceRate()

bool checkConvergenceRate ( const std::vector< std::string > &  uFELabels,
const std::vector< std::vector< LifeV::Real > > &  uL2Error,
const std::vector< LifeV::UInt > &  uConvergenceOrder,
const std::vector< std::string > &  pFELabels,
const std::vector< std::vector< LifeV::Real > >  pL2Error,
const std::vector< LifeV::UInt > &  pConvergenceOrder,
const std::vector< LifeV::UInt > &  meshDiscretizations,
LifeV::Real  convTolerance 
)
private

Method to check the convergence rate of the solution.

For each type of finite elements the method uses the computed errors obtained with the different meshes to check if the order of convergence follows the theory predictions

Parameters
uFELabelsVector containing the FE names for the velocity (e.g. P2, P1Bubble, P1)
uL2ErrorVector containing the computed errors for the velocity
uConvergenceOrderVector containing the convergence order corresponding to uFELabel
pFELabelsVector containing the FE names for the pressure (e.g. P2, P1Bubble, P1)
pL2ErrorVector containing the computed errors for the pressure
pConvergenceOrderVector containing the convergence order corresponding to pFELabel
meshDiscretizationVector containing the subdivisions values used to generate the meshes
convToleranceTolerance for the test. The test is passed if (observed convergence)>convTolerance*(theory error prediction)

Definition at line 428 of file navierStokes.hpp.

◆ run() [2/2]

void run ( )

Field Documentation

◆ M_data

std::shared_ptr<Private> M_data
private

Definition at line 208 of file navierStokes.hpp.

◆ M_meshDiscretization

std::vector<LifeV::UInt> M_meshDiscretization
private

Definition at line 211 of file navierStokes.hpp.

◆ M_uFELabels

std::vector<std::string> M_uFELabels
private

Definition at line 212 of file navierStokes.hpp.

◆ M_pFELabels

std::vector<std::string> M_pFELabels
private

Definition at line 213 of file navierStokes.hpp.

◆ M_uConvergenceOrder

std::vector<LifeV::UInt> M_uConvergenceOrder
private

Definition at line 214 of file navierStokes.hpp.

◆ M_pConvergenceOrder

std::vector<LifeV::UInt> M_pConvergenceOrder
private

Definition at line 215 of file navierStokes.hpp.

◆ M_test

TestType M_test
private

Definition at line 218 of file navierStokes.hpp.

◆ M_convTol

LifeV::Real M_convTol
private

Definition at line 219 of file navierStokes.hpp.

◆ M_accuracyTol

LifeV::Real M_accuracyTol
private

Definition at line 224 of file navierStokes.hpp.

◆ M_exportNorms

bool M_exportNorms
private

Definition at line 227 of file navierStokes.hpp.

◆ M_outNorm

std::ofstream M_outNorm
private

Definition at line 228 of file navierStokes.hpp.

◆ M_exportExactSolutions

bool M_exportExactSolutions
private

Definition at line 231 of file navierStokes.hpp.

◆ M_initMethod

InitializationType M_initMethod
private

Definition at line 234 of file navierStokes.hpp.

◆ M_meshSource

MeshSourceType M_meshSource
private

Definition at line 237 of file navierStokes.hpp.

◆ M_outputName

std::string M_outputName
private

Definition at line 240 of file navierStokes.hpp.

◆ M_comm

boost::shared_ptr<Epetra_Comm> M_comm
private

Definition at line 86 of file navier_stokes.hpp.

◆ M_dataFile

boost::shared_ptr<GetPot> M_dataFile
private

Definition at line 87 of file navier_stokes.hpp.

◆ M_outputFilename

std::string M_outputFilename
private

Definition at line 88 of file navier_stokes.hpp.


The documentation for this class was generated from the following files: