LifeV
OneDFSISource.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 File containing a base class for the source function of the 1D hyperbolic problem.
30  *
31  * @date 15-04-2010
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @contributor Simone Rossi <simone.rossi@epfl.ch>
35  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
36  */
37 
38 #ifndef OneDFSISource_H
39 #define OneDFSISource_H
40 
41 #include <lifev/one_d_fsi/solver/OneDFSIPhysics.hpp>
42 
43 namespace LifeV
44 {
45 
46 //! OneDFSISource - Base class for the source term \f$\mathbf S\f$ of the 1D hyperbolic problem.
47 /*!
48  * @author Vincent Martin, Cristiano Malossi
49  * @see Equations and networks of 1-D models \cite FormaggiaLamponi2003
50  * @see Geometrical multiscale coupling of 1-D models \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite BonnemainMalossi2012LVAD
51  *
52  * The conservative form of the generic hyperbolic problem is
53  *
54  * \f[
55  * \frac{\partial \mathbf U}{\partial t} + \frac{\partial \mathbf F(\mathbf U)}{\partial z} + \mathbf S(\mathbf U) = 0,
56  * \f]
57  *
58  * where \f$\mathbf U\f$ are the conservative variables, \f$\mathbf F\f$ the corresponding fluxes,
59  * and \f$\mathbf S\f$ represents the source terms.
60  *
61  * This class implements all the interfaces required for the computation of \f$\mathbf S\f$ and its derivatives.
62  */
64 {
65 public:
66 
67  //! @name Type definitions and Enumerators
68  //@{
69 
71 
74 
75  typedef OneDFSIData::container2D_Type container2D_Type;
76 
77  //@}
78 
79 
80  //! @name Constructors & Destructor
81  //@{
82 
83  //! Empty constructor
84  explicit OneDFSISource() : M_physicsPtr() {}
85 
86  //! Constructor
87  /*!
88  * @param physicsPtr pointer to the physics of the problem
89  */
90  explicit OneDFSISource ( const physicsPtr_Type physicsPtr ) : M_physicsPtr ( physicsPtr ) {}
91 
92  //! Do nothing destructor
93  virtual ~OneDFSISource() {}
94 
95  //@}
96 
97 
98  //! @name Virtual methods
99  //@{
100 
101  //! Evaluate the source term
102  /*!
103  * @param A area
104  * @param Q flow rate
105  * @param row row of the source term
106  * @param iNode node of the mesh
107  */
108  virtual Real source ( const Real& A, const Real& Q, const ID& row, const UInt& iNode ) const = 0;
109 
110  //! Evaluate the derivative of the source term
111  /*!
112  * @param A area
113  * @param Q flow rate
114  * @param row row of the derivative of the source term
115  * @param column column of the derivative of the source term
116  * @param iNode node of the mesh
117  */
118  virtual Real dSdU ( const Real& A, const Real& Q, const ID& row, const ID& column, const UInt& iNode ) const = 0;
119 
120  //! Evaluate the non-conservative form of the source term at the foot of the outgoing characteristic.
121  /*!
122  * This method is used for imposing the compatibility equations at the boundaries.
123  * It interpolates the value between to nodes.
124  *
125  * @param A area
126  * @param Q flow rate
127  * @param row row of the source term
128  * @param bcNodes list of boundary nodes
129  * @param cfl cfl used to identify the foot of the characteristic
130  */
131  virtual Real interpolatedNonConservativeSource ( const Real& A, const Real& Q,
132  const ID& row, const container2D_Type& bcNodes, const Real& cfl ) const = 0;
133 
134  //@}
135 
136 
137  //! @name Set Methods
138  //@{
139 
140  //! Set the physics of the problem.
141  /*!
142  * @param physicsPtr pointer to physics of the problem
143  */
144  void setPhysics ( const physicsPtr_Type& physicsPtr )
145  {
146  M_physicsPtr = physicsPtr;
147  }
148 
149  //@}
150 
151 
152  //! @name Get Methods
153  //@{
154 
155  //! Get the physics of the problem.
156  /*!
157  * @return physics of the problem
158  */
160  {
161  return M_physicsPtr;
162  }
163 
164  //@}
165 
166 protected:
167 
169 
170 private:
171 
172  //! @name Unimplemented Methods
173  //@{
174 
175  explicit OneDFSISource ( const OneDFSISource& source );
176 
177  OneDFSISource& operator= ( const OneDFSISource& source );
178 
179  //@}
180 };
181 
182 }
183 
184 #endif // OneDFSISource_H
physicsPtr_Type physics() const
Get the physics of the problem.
OneDFSISource(const OneDFSISource &source)
OneDFSIPhysics - Base class providing physical operations for the 1D model data.
virtual Real interpolatedNonConservativeSource(const Real &A, const Real &Q, const ID &row, const container2D_Type &bcNodes, const Real &cfl) const =0
Evaluate the non-conservative form of the source term at the foot of the outgoing characteristic...
OneDFSIData - Class which read and holds all the data for the One Dimensional Model Solver...
OneDFSISource - Base class for the source term of the 1D hyperbolic problem.
OneDFSISource(const physicsPtr_Type physicsPtr)
Constructor.
void updateInverseJacobian(const UInt &iQuadPt)
virtual Real source(const Real &A, const Real &Q, const ID &row, const UInt &iNode) const =0
Evaluate the source term.
OneDFSIPhysics physics_Type
FactorySingleton< Factory< OneDFSISource, OneDFSI::sourceTerm_Type > > factorySource_Type
virtual ~OneDFSISource()
Do nothing destructor.
OneDFSISource()
Empty constructor.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
double Real
Generic real data.
Definition: LifeV.hpp:175
std::array< Real, 2 > container2D_Type
void setPhysics(const physicsPtr_Type &physicsPtr)
Set the physics of the problem.
OneDFSISource & operator=(const OneDFSISource &source)
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
physicsPtr_Type M_physicsPtr
std::shared_ptr< physics_Type > physicsPtr_Type
virtual Real dSdU(const Real &A, const Real &Q, const ID &row, const ID &column, const UInt &iNode) const =0
Evaluate the derivative of the source term.