LifeV
OneDFSISourceLinear.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 class for the linear source term \f$\mathbf S\f$ of the 1D hyperbolic problem
30  *
31  * @version 1.0
32  * @author Vincent Martin
33  *
34  * @version 2.0
35  * @date 15-04-2010
36  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
37  *
38  * @contributor Simone Rossi <simone.rossi@epfl.ch>
39  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
40  */
41 
42 #ifndef OneDFSISourceLinear_H
43 #define OneDFSISourceLinear_H
44 
45 #include <lifev/one_d_fsi/solver/OneDFSISource.hpp>
46 
47 namespace LifeV
48 {
49 
50 //! OneDFSISourceLinear - Class for the linear source function S of the 1D hyperbolic problem.
51 /*!
52  * @author Vincent Martin, Cristiano Malossi
53  * @see Equations and networks of 1-D models \cite FormaggiaLamponi2003
54  * @see Geometrical multiscale coupling of 1-D models \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite BonnemainMalossi2012LVAD
55  *
56  * The conservative form of the generic hyperbolic problem is
57  *
58  * \f[
59  * \frac{\partial \mathbf U}{\partial t} + \frac{\partial \mathbf F(\mathbf U)}{\partial z} + \mathbf S(\mathbf U) = 0,
60  * \f]
61  *
62  * where \f$\mathbf U\f$ are the conservative variables, \f$\mathbf F\f$ the corresponding fluxes,
63  * and \f$\mathbf S\f$ represents the source terms.
64  *
65  * In the present implementation we have:
66  *
67  * \f[
68  * \mathbf F(\mathbf U) =
69  * \left[\begin{array}{c}
70  * \dots \\[2ex]
71  * \dots
72  * \end{array}\right], \quad
73  * \mathbf S(\mathbf U) = \mathbf B(\mathbf U) -
74  * \left[\begin{array}{c}
75  * \dots \\[2ex]
76  * \dots
77  * \end{array}\right]
78  * \f]
79  *
80  *
81  * The assumed wall-law is
82  *
83  * \f[
84  * P-P_\mathrm{ext} = \psi(A,A^0,\beta_0, \beta_1, \gamma) = \dots
85  * \f]
86  *
87  * This class implements all the interfaces required for the computation of \f$\mathbf S\f$ and its derivatives.
88  */
90 {
91 
92 public:
93 
94  //! @name Type definitions and Enumerators
95  //@{
96 
98 
99  //@}
100 
101 
102  //! @name Constructors & Destructor
103  //@{
104 
105  //! Empty constructor
106  explicit OneDFSISourceLinear() : super() {}
107 
108  //! Constructor
109  /*!
110  * @param physicsPtr pointer to the physics of the problem
111  */
112  explicit OneDFSISourceLinear ( const physicsPtr_Type physicsPtr ) : super ( physicsPtr ) {}
113 
114  //! Do nothing destructor
115  virtual ~OneDFSISourceLinear() {}
116 
117  //@}
118 
119 
120  //! @name Methods
121  //@{
122 
123  //! Evaluate the source term
124  /*!
125  * \f[
126  * \begin{array}{rcl}
127  * \mathbf S(\mathbf U)_1 & = & S_{10} + S_{11} U_1 + S_{12} Ustd::placeholders::_2,\\
128  * \mathbf S(\mathbf U)_2 & = & S_{20} + S_{21} U_1 + S_{22} U_2
129  * \end{array}
130  * \f]
131  *
132  * @param U1 first unknown
133  * @param U2 second unknown
134  * @param row row of the source term
135  * @param iNode node of the mesh
136  */
137  Real source ( const Real& U1, const Real& U2, const ID& row, const UInt& iNode ) const ;
138 
139  //! Evaluate the derivative of the source term
140  /*!
141  * @param U1 first unknown
142  * @param U2 second unknown
143  * @param row row of the derivative of the source term
144  * @param column column of the derivative of the source term
145  * @param iNode node of the mesh
146  */
147  Real dSdU ( const Real& U1, const Real& U2, const ID& row, const ID& colum, const UInt& iNode ) const;
148 
149  //! Evaluate the non-conservative form of the source term at the foot of the outgoing characteristic.
150  /*!
151  * This method is used for imposing the compatibility equations at the boundaries.
152  * It interpolates the value between to nodes.
153  *
154  * @param U1 first unknown
155  * @param U2 second unknown
156  * @param row row of the source term
157  * @param bcNodes list of boundary nodes
158  * @param cfl cfl used to identify the foot of the characteristic
159  */
160  Real interpolatedNonConservativeSource ( const Real& U1, const Real& U2,
161  const ID& row, const container2D_Type& bcNodes, const Real& cfl ) const ;
162 
163  //@}
164 private:
165 
166  //! @name Unimplemented Methods
167  //@{
168 
169  explicit OneDFSISourceLinear ( const OneDFSISourceLinear& source );
170 
172 
173  //@}
174 
175 };
176 
177 //! Factory create function
179 {
180  return new OneDFSISourceLinear();
181 }
182 
183 }
184 
185 #endif // OneDFSISourceLinear_H
Real source(const Real &U1, const Real &U2, const ID &row, const UInt &iNode) const
Evaluate the source term.
OneDFSISource - Base class for the source term of the 1D hyperbolic problem.
OneDFSISourceLinear - Class for the linear source function S of the 1D hyperbolic problem...
OneDFSISource(const physicsPtr_Type physicsPtr)
Constructor.
void updateInverseJacobian(const UInt &iQuadPt)
OneDFSISource * createOneDFSISourceLinear()
Factory create function.
OneDFSISourceLinear(const physicsPtr_Type physicsPtr)
Constructor.
OneDFSISource()
Empty constructor.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real interpolatedNonConservativeSource(const Real &U1, const Real &U2, const ID &row, const container2D_Type &bcNodes, const Real &cfl) const
Evaluate the non-conservative form of the source term at the foot of the outgoing characteristic...
Real dSdU(const Real &U1, const Real &U2, const ID &row, const ID &colum, const UInt &iNode) const
Evaluate the derivative of the source term.
double Real
Generic real data.
Definition: LifeV.hpp:175
OneDFSISourceLinear(const OneDFSISourceLinear &source)
OneDFSISourceLinear & operator=(const OneDFSISourceLinear &source)
OneDFSISourceLinear()
Empty constructor.
virtual ~OneDFSISourceLinear()
Do nothing destructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
std::shared_ptr< physics_Type > physicsPtr_Type