LifeV
OneDFSISourceNonLinear.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 non 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 OneDFSISourceNonLinear_H
43 #define OneDFSISourceNonLinear_H
44 
45 #include <lifev/one_d_fsi/solver/OneDFSISource.hpp>
46 
47 namespace LifeV
48 {
49 
50 //! OneDFSISourceNonLinear - Class for the non-linear source function B 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  * Q \\[2ex]
71  * \alpha \displaystyle \frac{Q^2}{A} + \displaystyle \displaystyle\int_{0}^A \frac{A}{\rho}\frac{\partial \psi}{\partial A} dA
72  * \end{array}\right], \quad
73  * \mathbf S(\mathbf U) = \mathbf B(\mathbf U) -
74  * \left[\begin{array}{c}
75  * 0 \\[2ex]
76  * \displaystyle\frac{\partial}{\partial A^0}\displaystyle\int_{0}^A \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} dA
77  * \displaystyle\frac{\partial A^0}{\partial z} + \displaystyle\frac{\partial}{\partial \beta_0}\displaystyle\int_{0}^A
78  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} dA \displaystyle\frac{\partial \beta_0}{\partial z} +
79  * \displaystyle\frac{\partial}{\partial \beta_1}\displaystyle\int_{0}^A \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} dA
80  * \displaystyle\frac{\partial \beta_1}{\partial z}
81  * \end{array}\right]
82  * \f]
83  *
84  * where
85  *
86  * \f[
87  * \mathbf B(\mathbf U) =
88  * \left[\begin{array}{c}
89  * 0 \\[2ex]
90  * K_r \displaystyle\frac{Q}{A} +
91  * \displaystyle\frac{A}{\rho}\left(\displaystyle\frac{\partial \psi}{\partial A^0}\displaystyle\frac{\partial A^0}{\partial z} +
92  * \displaystyle\frac{\partial \psi}{\partial \beta_0}\displaystyle\frac{\partial \beta_0}{\partial z} +
93  * \displaystyle\frac{\partial \psi}{\partial \beta_1}\displaystyle\frac{\partial \beta_1}{\partial z}\right) +
94  * \displaystyle\frac{Q^2}{A}\displaystyle\frac{\partial \alpha}{\partial z}
95  * \end{array}\right]
96  * \f]
97  *
98  * The assumed wall-law is
99  *
100  * \f[
101  * P-P_\mathrm{ext} = \psi(A,A^0,\beta_0, \beta_1, \gamma) =
102  * \underbrace{\sqrt{\frac{\pi}{A^0}}\frac{h E}{1-\nu^2}}_{\beta_0} \left(\left(\frac{A}{A^0}\right)^{\beta_1}-1\right) +
103  * \underbrace{\frac{T \tan\phi}{4 \sqrt{\pi}}\frac{h E}{1-\nu^2}}_{\displaystyle\gamma} \frac{1}{A\sqrt{A}} \frac{\partial A}{\partial t}.
104  * \f]
105  *
106  * This class implements all the interfaces required for the computation of \f$\mathbf S\f$ and its derivatives.
107  */
109 {
110 public:
111 
112  //! @name Type definitions and Enumerators
113  //@{
114 
116 
117  //@}
118 
119 
120  //! @name Constructors & Destructor
121  //@{
122 
123  //! Empty constructor
125 
126  //! Constructor
127  /*!
128  * @param physicsPtr pointer to the physics of the problem
129  */
130  explicit OneDFSISourceNonLinear ( const physicsPtr_Type physicsPtr ) : super ( physicsPtr ) {}
131 
132  //! Do nothing destructor
134 
135  //@}
136 
137 
138  //! @name Methods
139  //@{
140 
141  //! Evaluate the source term
142  /*!
143  * \f[
144  * \begin{array}{rcl}
145  * \mathbf S(\mathbf U)_1 & = & 0,\\
146  * \mathbf S(\mathbf U)_2 & = &
147  * K_r\displaystyle\frac{Q}{A} -\displaystyle\frac{\beta_0 \beta_1}{\rho(\beta_1+1)}
148  * \left(\displaystyle\frac{A}{A^0}\right)^{\beta_1+1}\displaystyle\frac{\partial A^0}{\partial z}
149  * + \displaystyle\frac{1}{\rho}\left(\displaystyle\frac{A^0}{(\beta_1+1)}
150  * \left(\displaystyle\frac{A}{A^0}\right)^{\beta_1+1}-A\right)\displaystyle\frac{\partial \beta_0}{\partial z}\\[4ex]
151  * &+& \displaystyle\frac{A^0 \beta_0}{\rho(\beta_1+1)}\left(\ln\left(\displaystyle\frac{A}{A^0}\right)-
152  * \displaystyle\frac{1}{(\beta_1+1)}\right)\left(\displaystyle\frac{A}{A^0}\right)^{\beta_1+1}
153  * \displaystyle\frac{\partial \beta_1}{\partial z}+\displaystyle\frac{Q^2}{A}\displaystyle\frac{\partial \alpha}{\partial z},
154  * \end{array}
155  * \f]
156  *
157  * @param A area
158  * @param Q flow rate
159  * @param row row of the source term
160  * @param iNode node of the mesh
161  */
162  Real source ( const Real& A, const Real& Q, const ID& row, const UInt& iNode ) const ;
163 
164  //! Evaluate the derivative of the source term
165  /*!
166  * \f[
167  * \displaystyle\frac{\partial \mathbf S}{\partial A} =
168  * \left[\begin{array}{c}
169  * 0 \\[2ex]
170  * -K_r\displaystyle\frac{Q}{A^2}+\displaystyle\frac{1}{\rho}\left(\displaystyle\frac{\partial \psi}{\partial A^0}
171  * \displaystyle\frac{\partial A^0}{\partial z}
172  * + \displaystyle\frac{\partial \psi}{\partial \beta_0}\displaystyle\frac{\partial \beta_0}{\partial z}
173  * + \displaystyle\frac{\partial \psi}{\partial \beta_1}\displaystyle\frac{\partial \beta_1}{\partial z} \right)
174  * -\left(\displaystyle\frac{Q}{A}\right)^2\displaystyle\frac{\partial \alpha}{\partial z}
175  * \end{array}\right],
176  * \quad
177  * \displaystyle\frac{\partial \mathbf S}{\partial Q} =
178  * \left[\begin{array}{c}
179  * 0 \\[2ex]
180  * \displaystyle\frac{K_r}{A} + 2 \displaystyle\frac{Q}{A} \displaystyle\frac{\partial \alpha}{\partial z}
181  * \end{array}\right].
182  * \f]
183  *
184  * @param A area
185  * @param Q flow rate
186  * @param row row of the derivative of the source term
187  * @param column column of the derivative of the source term
188  * @param iNode node of the mesh
189  */
190  Real dSdU ( const Real& A, const Real& Q, const ID& row, const ID& column, const UInt& iNode ) const;
191 
192  //! Evaluate the non-conservative form of the source term at the foot of the outgoing characteristic.
193  /*!
194  * This method is used for imposing the compatibility equations at the boundaries. It interpolates the value between to nodes.
195  *
196  * @param A area
197  * @param Q flow rate
198  * @param row row of the source term
199  * @param bcNodes list of boundary nodes
200  * @param cfl cfl used to identify the foot of the characteristic
201  */
202  Real interpolatedNonConservativeSource ( const Real& A, const Real& Q,
203  const ID& row, const container2D_Type &bcNodes, const Real& cfl ) const ;
204 
205  //@}
206 
207 private:
208 
209  //! @name Unimplemented Methods
210  //@{
211 
212  explicit OneDFSISourceNonLinear ( const OneDFSISourceNonLinear& source );
213 
215 
216  //@}
217 };
218 
219 //! Factory create function
221 {
222  return new OneDFSISourceNonLinear();
223 }
224 
225 }
226 
227 #endif // OneDFSISourceNonLinear_H
OneDFSISourceNonLinear & operator=(const OneDFSISourceNonLinear &source)
OneDFSISource * createOneDFSISourceNonLinear()
Factory create function.
OneDFSISourceNonLinear(const physicsPtr_Type physicsPtr)
Constructor.
OneDFSISource - Base class for the source term of the 1D hyperbolic problem.
OneDFSISource(const physicsPtr_Type physicsPtr)
Constructor.
virtual ~OneDFSISourceNonLinear()
Do nothing destructor.
void updateInverseJacobian(const UInt &iQuadPt)
OneDFSISource()
Empty constructor.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real source(const Real &A, const Real &Q, const ID &row, const UInt &iNode) const
Evaluate the source term.
OneDFSISourceNonLinear - Class for the non-linear source function B of the 1D hyperbolic problem...
double Real
Generic real data.
Definition: LifeV.hpp:175
Real dSdU(const Real &A, const Real &Q, const ID &row, const ID &column, const UInt &iNode) const
Evaluate the derivative of the source term.
Real interpolatedNonConservativeSource(const Real &A, const Real &Q, 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...
OneDFSISourceNonLinear(const OneDFSISourceNonLinear &source)
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
std::shared_ptr< physics_Type > physicsPtr_Type