LifeV
OneDFSIFluxNonLinear.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 non linear 1D model flux function.
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  * @contributors Simone Rossi <simone.rossi@epfl.ch>, Ricardo Ruiz-Baier <ricardo.ruiz@epfl.ch>
39  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
40  */
41 
42 #ifndef OneDFSIFluxNonLinear_H
43 #define OneDFSIFluxNonLinear_H
44 
45 #include <lifev/one_d_fsi/solver/OneDFSIFlux.hpp>
46 
47 namespace LifeV
48 {
49 
50 //! OneDFSIFluxNonLinear - Class containing the non-linear flux term \f$\mathbf F\f$ 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
77  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} dA \displaystyle\frac{\partial A^0}{\partial z} +
78  * \displaystyle\frac{\partial}{\partial \beta_0}\displaystyle\int_{0}^A
79  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} dA \displaystyle\frac{\partial \beta_0}{\partial z} +
80  * \displaystyle\frac{\partial}{\partial \beta_1}\displaystyle\int_{0}^A
81  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} dA \displaystyle\frac{\partial \beta_1}{\partial z}
82  * \end{array}\right]
83  * \f]
84  *
85  * where
86  *
87  * \f[
88  * \mathbf B(\mathbf U) =
89  * \left[\begin{array}{c}
90  * 0 \\[2ex]
91  * K_r \displaystyle\frac{Q}{A} + \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 F\f$ and its derivatives.
107  */
109 {
110 
111 public:
112 
113  //! @name Type definitions and Enumerators
114  //@{
115 
117 
118  //@}
119 
120 
121  //! @name Constructors & Destructor
122  //@{
123 
124  //! Empty constructor
125  explicit OneDFSIFluxNonLinear() : super() {};
126 
127  //! Constructor
128  /*!
129  * @param physicsPtr pointer to the physics of the problem
130  */
131  explicit OneDFSIFluxNonLinear ( const physicsPtr_Type physicsPtr ) : super ( physicsPtr ) {};
132 
133  //! Do nothing destructor
134  virtual ~OneDFSIFluxNonLinear() {}
135 
136  //@}
137 
138 
139  //! @name Methods
140  //@{
141 
142  //! Evaluate the flux term
143  /*!
144  * \f[
145  * \mathbf F(\mathbf U) =
146  * \left[\begin{array}{c}
147  * Q \\[2ex]
148  * \alpha \displaystyle \frac{Q^2}{A} + \displaystyle\frac{\beta_0 \beta_1 A^0}{\rho(\beta_1+1)}\left(\displaystyle\frac{A}{A^0}\right)^{\beta_1+1}
149  * \end{array}\right]
150  * \f]
151  *
152  * @param A area
153  * @param Q flow rate
154  * @param row row of the flux term
155  * @param iNode node of the mesh
156  */
157  Real flux ( const Real& A, const Real& Q, const ID& row, const UInt& iNode ) const;
158 
159 
160  //! Evaluate the derivative of the flux term
161  /*!
162  * \f[
163  * \displaystyle\frac{\partial \mathbf F}{\partial \mathbf U} =
164  * \left[\begin{array}{cc}
165  * 0 & 1 \\[2ex]
166  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A} - \alpha \displaystyle\frac{Q^2}{A^2} & 2 \alpha \displaystyle\frac{Q}{A}
167  * \end{array}\right]
168  * \f]
169  *
170  * @param A area
171  * @param Q flow rate
172  * @param row row of the derivative of the flux term
173  * @param column column of the derivative of the flux term
174  * @param iNode node of the mesh
175  */
176  Real dFdU ( const Real& A, const Real& Q, const ID& row, const ID& column, const UInt& iNode ) const;
177 
178  //! Eigenvalues and eigenvectors of the Jacobian matrix
179  /*!
180  * \f[
181  * \lambda_{1,2} = \alpha \displaystyle\frac{Q}{A} \pm \sqrt{\alpha (\alpha - 1)\left(\displaystyle\frac{Q}{A}\right)^2+
182  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A}},
183  * \f]
184  *
185  * \f[
186  * \displaystyle L =
187  * \varsigma
188  * \left[\begin{array}{cc}
189  * -\lambda_2 & 1\\
190  * -\lambda_1 & 1
191  * \end{array}\right]
192  * \f]
193  *
194  * @param A area
195  * @param Q flow rate
196  * @param eigenvalues eigenvalues of the Jacobian matrix
197  * @param leftEigenvector1 first row of the left eigenvector matrix
198  * @param leftEigenvector2 second row of the left eigenvector matrix
199  * @param iNode node of the mesh
200  */
201  void eigenValuesEigenVectors ( const Real& A, const Real& Q,
202  container2D_Type& eigenvalues,
203  container2D_Type& leftEigenvector1,
204  container2D_Type& leftEigenvector2,
205  const UInt& iNode ) const;
206 
207  //! Derivatives of the eigenvalues and eigenvectors of the derivative of the Jacobian matrix
208  /*!
209  *
210  * \f[
211  * \begin{array}{@{}r@{}c@{}l}
212  * \displaystyle\frac{\partial \lambda_{1,2}}{\partial z} & = & \displaystyle\frac{\partial \lambda_{1,2}}{\partial A^0}\displaystyle\frac{\partial A^0}{\partial z}
213  * + \displaystyle\frac{\partial \lambda_{1,2}}{\partial \beta_0}\displaystyle\frac{\partial \beta_0}{\partial z}
214  * + \displaystyle\frac{\partial \lambda_{1,2}}{\partial \beta_1}\displaystyle\frac{\partial \beta_1}{\partial z}
215  * + \displaystyle\frac{\partial \lambda_{1,2}}{\partial \alpha}\displaystyle\frac{\partial \alpha}{\partial z}\\[4ex]
216  * & = & \displaystyle\frac{Q}{A}\displaystyle\frac{\partial \alpha}{\partial z}
217  * \pm \displaystyle\frac{1}{2}\left(\alpha (\alpha - 1)\left(\displaystyle\frac{Q}{A}\right)^2+
218  * \displaystyle\frac{A}{\rho}\displaystyle\frac{\partial \psi}{\partial A}\right)^{-1/2}\left(\displaystyle\frac{A}{\rho}
219  * \left(\displaystyle\frac{\partial^2 \psi}{\partial A \partial A^0}\displaystyle\frac{\partial A^0}{\partial z}
220  * + \displaystyle\frac{\partial^2 \psi}{\partial A \partial \beta_0}\displaystyle\frac{\partial \beta_0}{\partial z}
221  * + \displaystyle\frac{\partial^2 \psi}{\partial A \partial \beta_1}\displaystyle\frac{\partial \beta_1}{\partial z}\right)
222  * + (2\alpha - 1)\left(\displaystyle\frac{Q}{A}\right)^2 \displaystyle\frac{\partial \alpha}{\partial z}\right).
223  * \end{array}
224  * \f]
225  *
226  * \f[
227  * \displaystyle\frac{\partial L}{\partial z} =
228  * \varsigma
229  * \left[\begin{array}{cc}
230  * -\displaystyle\frac{\partial \lambda_2}{\partial z} & 0\\[4ex]
231  * -\displaystyle\frac{\partial \lambda_1}{\partial z} & 0
232  * \end{array}\right]
233  * \f]
234  *
235  * @param A area
236  * @param Q flow rate
237  * @param deltaEigenvalues derivative of the eigenvalues of the derivative of the Jacobian matrix
238  * @param deltaLeftEigenvector1 derivative of the first row of the left eigenvector matrix
239  * @param deltaLeftEigenvector2 derivative of the second row of the left eigenvector matrix
240  * @param iNode node of the mesh
241  */
242  void deltaEigenValuesEigenVectors ( const Real& A, const Real& Q,
243  container2D_Type& deltaEigenvalues,
244  container2D_Type& deltaLeftEigenvector1,
245  container2D_Type& deltaLeftEigenvector2,
246  const UInt& iNode ) const;
247 
248  //@}
249 
250 private:
251 
252  //! @name Unimplemented Methods
253  //@{
254 
255  explicit OneDFSIFluxNonLinear ( const OneDFSIFluxNonLinear& flux );
256 
258 
259  //@}
260 };
261 
262 //! Factory create function
264 {
265  return new OneDFSIFluxNonLinear();
266 }
267 
268 }
269 
270 #endif // OneDFSIFluxNonLinear_H
void eigenValuesEigenVectors(const Real &A, const Real &Q, container2D_Type &eigenvalues, container2D_Type &leftEigenvector1, container2D_Type &leftEigenvector2, const UInt &iNode) const
Eigenvalues and eigenvectors of the Jacobian matrix.
Real dFdU(const Real &A, const Real &Q, const ID &row, const ID &column, const UInt &iNode) const
Evaluate the derivative of the flux term.
virtual ~OneDFSIFluxNonLinear()
Do nothing destructor.
std::shared_ptr< physics_Type > physicsPtr_Type
Definition: OneDFSIFlux.hpp:74
OneDFSIFlux()
Empty constructor.
Definition: OneDFSIFlux.hpp:85
OneDFSIFlux - Base class for the flux term of the 1D hyperbolic problem.
Definition: OneDFSIFlux.hpp:63
OneDFSIFluxNonLinear & operator=(const OneDFSIFluxNonLinear &flux)
void updateInverseJacobian(const UInt &iQuadPt)
void deltaEigenValuesEigenVectors(const Real &A, const Real &Q, container2D_Type &deltaEigenvalues, container2D_Type &deltaLeftEigenvector1, container2D_Type &deltaLeftEigenvector2, const UInt &iNode) const
Derivatives of the eigenvalues and eigenvectors of the derivative of the Jacobian matrix...
OneDFSIFlux(const physicsPtr_Type physicsPtr)
Constructor.
Definition: OneDFSIFlux.hpp:91
uint32_type ID
IDs.
Definition: LifeV.hpp:194
OneDFSIFluxNonLinear - Class containing the non-linear flux term of the 1D hyperbolic problem...
OneDFSIFlux * createOneDFSIFluxNonLinear()
Factory create function.
OneDFSIFluxNonLinear(const OneDFSIFluxNonLinear &flux)
double Real
Generic real data.
Definition: LifeV.hpp:175
Real flux(const Real &A, const Real &Q, const ID &row, const UInt &iNode) const
Evaluate the flux term.
OneDFSIFluxNonLinear()
Empty constructor.
OneDFSIFluxNonLinear(const physicsPtr_Type physicsPtr)
Constructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191