LifeV
OneDFSIFluxLinear.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 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  * @contributor Simone Rossi <simone.rossi@epfl.ch>
39  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
40  */
41 
42 #ifndef OneDFSIFluxLinear_H
43 #define OneDFSIFluxLinear_H
44 
45 #include <lifev/one_d_fsi/solver/OneDFSIFlux.hpp>
46 
47 namespace LifeV
48 {
49 
50 //! OneDFSIFluxLinear - Class containing the 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  * \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 F\f$ and its derivatives.
88  */
90 {
91 
92 public:
93 
94  //! @name Type definitions and Enumerators
95  //@{
96 
97  typedef OneDFSIFlux super;
98 
99  //@}
100 
101 
102  //! @name Constructors & Destructor
103  //@{
104 
105  //! Empty constructor
106  explicit OneDFSIFluxLinear() : super() {};
107 
108  //! Constructor
109  /*!
110  * @param physicsPtr pointer to the physics of the problem
111  */
112  explicit OneDFSIFluxLinear ( const physicsPtr_Type physicsPtr ) : super ( physicsPtr ) {};
113 
114  //! Do nothing destructor
115  virtual ~OneDFSIFluxLinear() {}
116 
117  //@}
118 
119 
120  //! @name Methods
121  //@{
122 
123  //! Evaluate the source term
124  /*!
125  * \f[
126  * \begin{array}{rcl}
127  * \mathbf F(\mathbf U)_1 & = & F_{11} U_1 + F_{12} Ustd::placeholders::_2,\\
128  * \mathbf F(\mathbf U)_2 & = & F_{21} U_1 + F_{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 flux ( const Real& U1, const Real& U2, const ID& row, const UInt& iNode ) const ;
138 
139  //! Evaluate the derivative of the flux term
140  /*!
141  * @param A area
142  * @param Q flow rate
143  * @param row row of the derivative of the flux term
144  * @param column column of the derivative of the flux term
145  * @param iNode node of the mesh
146  */
147  Real dFdU ( const Real& U1, const Real& U2, const ID& row, const ID& column, const UInt& iNode ) const;
148 
149 
150  //! Eigenvalues and eigenvectors of the Jacobian matrix
151  /*!
152  * @param A area
153  * @param Q flow rate
154  * @param eigenvalues eigenvalues of the Jacobian matrix
155  * @param leftEigenvector1 first row of the left eigenvector matrix
156  * @param leftEigenvector2 second row of the left eigenvector matrix
157  * @param iNode node of the mesh
158  */
159  void eigenValuesEigenVectors ( const Real& U1, const Real& U2,
160  container2D_Type& eigenvalues,
161  container2D_Type& leftEigenvector1,
162  container2D_Type& leftEigenvector2,
163  const UInt& iNode ) const;
164 
165  //! Derivatives of the eigenvalues and eigenvectors of the derivative of the Jacobian matrix
166  /*!
167  * @param A area
168  * @param Q flow rate
169  * @param deltaEigenvalues derivative of the eigenvalues of the derivative of the Jacobian matrix
170  * @param deltaLeftEigenvector1 derivative of the first row of the left eigenvector matrix
171  * @param deltaLeftEigenvector2 derivative of the second row of the left eigenvector matrix
172  * @param iNode node of the mesh
173  */
174  void deltaEigenValuesEigenVectors ( const Real& A, const Real& Q,
175  container2D_Type& deltaEigenvalues,
176  container2D_Type& deltaLeftEigenvector1,
177  container2D_Type& deltaLeftEigenvector2,
178  const UInt& iNode ) const;
179 
180  //@}
181 
182 private:
183 
184  //! @name Unimplemented Methods
185  //@{
186 
187  explicit OneDFSIFluxLinear ( const OneDFSIFluxLinear& flux );
188 
189  OneDFSIFluxLinear& operator= ( const OneDFSIFluxLinear& flux );
190 
191  //@}
192 
193 };
194 
195 //! Factory create function
197 {
198  return new OneDFSIFluxLinear();
199 }
200 
201 }
202 
203 #endif // OneDFSIFluxLinear_H
OneDFSIFluxLinear - Class containing the linear flux term of the 1D hyperbolic problem.
OneDFSIFlux * createOneDFSIFluxLinear()
Factory create function.
OneDFSIFluxLinear(const physicsPtr_Type physicsPtr)
Constructor.
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
OneDFSIFluxLinear()
Empty constructor.
virtual ~OneDFSIFluxLinear()
Do nothing destructor.
void updateInverseJacobian(const UInt &iQuadPt)
OneDFSIFlux(const physicsPtr_Type physicsPtr)
Constructor.
Definition: OneDFSIFlux.hpp:91
OneDFSIFluxLinear(const OneDFSIFluxLinear &flux)
Real dFdU(const Real &U1, const Real &U2, const ID &row, const ID &column, const UInt &iNode) const
Evaluate the derivative of the flux term.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real flux(const Real &U1, const Real &U2, const ID &row, const UInt &iNode) const
Evaluate the source term.
void eigenValuesEigenVectors(const Real &U1, const Real &U2, container2D_Type &eigenvalues, container2D_Type &leftEigenvector1, container2D_Type &leftEigenvector2, const UInt &iNode) const
Eigenvalues and eigenvectors of the Jacobian matrix.
double Real
Generic real data.
Definition: LifeV.hpp:175
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...
OneDFSIFluxLinear & operator=(const OneDFSIFluxLinear &flux)
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191