NavierStokesProblem.hpp 4.08 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//@HEADER
/*
*******************************************************************************

    Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
    Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University

    This file is part of LifeV.

    LifeV is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    LifeV is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with LifeV.  If not, see <http://www.gnu.org/licenses/>.

*******************************************************************************
*/
//@HEADER

/*!
    @file NavierStokesProblem abstract class
    @brief This class contains all the informations necessary to generate a Navier-Stokes problem

    @author Gwenol Grandperrin <gwenol.grandperrin@epfl.ch>
    @date 23-10-2011
 */

#ifndef NAVIERSTOKESPROBLEM_HPP
#define NAVIERSTOKESPROBLEM_HPP

#include <string>
#include <iostream>
#include <lifev/core/LifeV.hpp>
#include <lifev/core/fem/BCHandler.hpp>
#include <lifev/core/mesh/MeshPartitioner.hpp>
#include <lifev/core/fem/BCBase.hpp>

namespace LifeV
{

grandper's avatar
grandper committed
48
template< class mesh_Type >
49
50
51
52
53
54
55
class NavierStokesProblem
{
public:

    typedef Real (*function_Type) ( const Real&, const Real&, const Real&,
                                    const Real&, const ID& );

56
57
58
    static Real nullFunction( const Real&, const Real&, const Real&,
                              const Real&, const ID& );

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    //! @name  Constructors, destructor
    //@{

    NavierStokesProblem();

    virtual ~NavierStokesProblem();

    //@}

    //! @name  Methods
    //@{

    //! Returns true if the problem has an exact solution
    virtual bool hasExactSolution() const;

    //! Returns the value of the exact solution
    virtual function_Type xexact();

    //! Returns the value of the exact solution (velocity components only)
    virtual function_Type uexact();

    //! Returns the value of the derivative of the exact solution with respect to the time (velocity components only)
    virtual function_Type uderexact();

    //! Returns the value of the exact solution (pressure component only)
    virtual function_Type pexact();

    //! Display general information about the problem
    /*!
        @param output specify the output stream (std::cout by default)
     */
    virtual void showMe ( std::ostream& output = std::cout ) const = 0;

    //@}

    //! @name  Set Methods
    //@{

    //! Setup the problem mesh
    void setMesh ( const UInt& refinement,
                   const std::string& ressourcesPath = "./Ressources/" );

    //! Set the viscosity of the fluid
    /*!
        @param viscosity viscosity of the fluid
     */
    virtual void setViscosity ( const Real& viscosity );

    //! Set the density of the fluid
    /*!
        @param density density of the fluid
     */
    virtual void setDensity ( const Real& density );

    //@}

    //! @name  Get Methods
    //@{

    //! Getter for the problem mesh
grandper's avatar
grandper committed
119
    virtual void mesh ( boost::shared_ptr<mesh_Type>& mesh ) const = 0;
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

    //! Getter for the boundary conditions in the provided BCHandler
    /*!
        @param bcHandler shared pointer on a BCHandler object
     */
    virtual void boundaryConditions ( boost::shared_ptr<BCHandler> bcHandler ) const = 0;

    //! Returns the name of the problem
    virtual std::string name() const = 0;

    //! Returns the viscosity
    Real viscosity() const;

    //! Returns the density
    Real density() const;

136
137
138
    //! Returns the value of the forces
    virtual function_Type force();

139
140
141
142
143
144
145
146
147
148
149
150
151
152
    //@}

protected:

    UInt        M_refinement;
    std::string M_resourcesPath;
    Real        M_viscosity;
    Real        M_density;

};

} // namespace LifeV

#endif /* NAVIERSTOKESPROBLEM_HPP */