LifeV
OneDFSIPhysicsLinear.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 providing linear physical operations for the 1D model data.
30  *
31  * @version 1.0
32  * @date 01-07-2004
33  * @author Vincent Martin
34  *
35  * @version 2.0
36  * @date 13-04-2010
37  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
38  *
39  * @contributor Simone Rossi <simone.rossi@epfl.ch>
40  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
41  */
42 
43 #ifndef OneDFSIPhysicsLinear_H
44 #define OneDFSIPhysicsLinear_H
45 
46 #include <lifev/one_d_fsi/solver/OneDFSIPhysics.hpp>
47 
48 namespace LifeV
49 {
50 
51 //! OneDFSIPhysicsLinear - Class providing linear physical operations for the 1D model data.
52 /*!
53  * @author Vincent Martin, Cristiano Malossi
54  * @see Equations and networks of 1-D models \cite FormaggiaLamponi2003
55  * @see Geometrical multiscale coupling of 1-D models \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite BonnemainMalossi2012LVAD
56  *
57  * It contains the following methods:
58  * <ol>
59  * <li> utilities for converting Riemann variables to physical quantities (and viceversa);
60  * <li> utilities to compute the different pressure components (and derivatives).
61  * </ol>
62  */
64 {
65 public:
66 
67  //! @name Type definitions and Enumerators
68  //@{
69 
71 
72  //@}
73 
74 
75  //! @name Constructors & Destructor
76  //@{
77 
78  //! Empty constructor
79  explicit OneDFSIPhysicsLinear() : super() {}
80 
81  //! Constructor
82  /*!
83  * @param dataPtr pointer to the data container of the problem
84  */
85  explicit OneDFSIPhysicsLinear ( const dataPtr_Type dataPtr ) : super ( dataPtr ) {}
86 
87  //! Destructor
88  virtual ~OneDFSIPhysicsLinear() {}
89 
90  //@}
91 
92 
93  //! @name Conversion methods
94  //@{
95 
96  //! Compute \f$\mathbf U\f$ from \f$\mathbf W\f$
97  /*!
98  * \cond \TODO improve doxygen description with latex equation and other features \endcond
99  *
100  * Physical variables corresponding to (W1, W2) at node iNode
101  * A = A0 + (W1 - W2) / (2 * celerity)
102  * Q = (W1 + W2) / 2
103  *
104  * @param U1 first physical variable
105  * @param U2 second physical variable
106  * @param W1 first Riemann variable
107  * @param W2 second Riemann variable
108  * @param iNode node of the mesh
109  */
110  void fromWToU ( Real& U1, Real& U2, const Real& W1, const Real& W2, const UInt& iNode ) const;
111 
112  //! Compute \f$\mathbf W\f$ from \f$\mathbf U\f$
113  /*!
114  * \cond \TODO improve doxygen description with latex equation and other features \endcond
115  *
116  * Riemann Invariants corresponding to data (Q, A) at node iNode
117  * W1,2 = Q +- celerity * ( A - A0 )
118  *
119  * @param W1 first Riemann variable
120  * @param W2 second Riemann variable
121  * @param U1 first physical variable
122  * @param U2 second physical variable
123  * @param iNode node of the mesh
124  */
125  void fromUToW ( Real& W1, Real& W2, const Real& U1, const Real& U2, const UInt& iNode ) const;
126 
127  //! Compute \f$P\f$ from \f$\mathbf W\f$
128  /*!
129  * \cond \TODO improve doxygen description with latex equation and other features \endcond
130  *
131  * @param W1 first Riemann variable
132  * @param W2 second Riemann variable
133  * @param iNode node of the mesh
134  * @return pressure P = beta0 * ( ( 1 / Area0 )^(beta1) * ( (W1 - W2) / (2 * celerity0) + Area0 )^(beta1) - 1 )
135  */
136  Real fromWToP ( const Real& W1, const Real& W2, const UInt& iNode ) const;
137 
138  //! Compute \f$W_1\f$ or \f$W_2\f$ from \f$P\f$
139  /*!
140  * \cond \TODO improve doxygen description with latex equation and other features \endcond
141  *
142  * W1 - W2 = (2 * celerity * A0) * ( ( P / beta0 + 1 )^(1/beta1) - 1 )
143  * W1 - W2 = 4 * sqrt( beta0 / (beta1 * rho ) ) * ( sqrt( P / beta0 + 1 ) - 1
144  *
145  * @param P pressure
146  * @param W Riemann variable
147  * @param iW Riemann variable ID (0 for \f$W_1\f$, 1 or \f$W_2\f$)
148  * @param iNode node of the mesh
149  * @return the other Riemann variable
150  */
151  Real fromPToW ( const Real& P, const Real& W, const ID& iW, const UInt& iNode ) const;
152 
153  //! Compute \f$W_1\f$ or \f$W_2\f$ from \f$Q\f$
154  /*!
155  * \cond \TODO improve doxygen description with latex equation and other features \endcond
156  *
157  * W1 + W2 = 2 * Q
158  *
159  * @param Q pressure
160  * @param W_tn Riemann variable at time \f$t^n\f$
161  * @param W Riemann variable
162  * @param iW Riemann variable ID (0 for \f$W_1\f$, 1 or \f$W_2\f$)
163  * @param iNode node of the mesh
164  * @return the other Riemann variable
165  */
166  Real fromQToW ( const Real& Q, const Real& W_tn, const Real& W, const ID& iW, const UInt& iNode ) const;
167 
168  //@}
169 
170 
171  //! @name Derivatives methods
172  //@{
173 
174  //! Compute the derivative of pressure with respect to \f$ \mathbf W\f$
175  /*!
176  * \cond \TODO improve doxygen description with latex equation and other features \endcond
177  *
178  * dP(W1,W2)/dW_1 = beta0 * beta1 / ( 2 * celerity0 * Area0^(beta1) ) * ( (W1 - W2) / ( 2 * celerity0 ) + Area0 )^(beta1-1)
179  * dP(W1,W2)/dW_2 = - dP(W1,W2)/dW_1
180  *
181  * @param W1 first Riemann variable
182  * @param W2 second Riemann variable
183  * @param iW Riemann derivative ID (0 for \f$\displaystyle\frac{dP}{dW_1}\f$, 1 or \f$\displaystyle\frac{dP}{dW_2}\f$)
184  * @param iNode node of the mesh
185  * @return \f$\displaystyle\frac{dP}{dW_1}\f$ or \f$\displaystyle\frac{dP}{dW_2}\f$
186  */
187  Real dPdW ( const Real& W1, const Real& W2, const ID& iW, const UInt& iNode ) const;
188 
189  //@}
190 
191 private:
192 
193  //! @name Unimplemented Methods
194  //@{
195 
196  explicit OneDFSIPhysicsLinear ( const OneDFSIPhysicsLinear& physics );
197 
199 
200  //@}
201 };
202 
203 //! Factory create function
205 {
206  return new OneDFSIPhysicsLinear();
207 }
208 
209 }
210 
211 #endif //OneDFSIPhysicsLinear_H
void fromWToU(Real &U1, Real &U2, const Real &W1, const Real &W2, const UInt &iNode) const
Compute from .
OneDFSIPhysics - Base class providing physical operations for the 1D model data.
OneDFSIPhysicsLinear(const OneDFSIPhysicsLinear &physics)
OneDFSIPhysics()
Empty constructor.
OneDFSIPhysics(const dataPtr_Type dataPtr)
Constructor.
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< data_Type > dataPtr_Type
OneDFSIPhysics * createOneDFSIPhysicsLinear()
Factory create function.
Real fromPToW(const Real &P, const Real &W, const ID &iW, const UInt &iNode) const
Compute or from .
Real dPdW(const Real &W1, const Real &W2, const ID &iW, const UInt &iNode) const
Compute the derivative of pressure with respect to .
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real fromQToW(const Real &Q, const Real &W_tn, const Real &W, const ID &iW, const UInt &iNode) const
Compute or from .
OneDFSIPhysicsLinear()
Empty constructor.
OneDFSIPhysicsLinear - Class providing linear physical operations for the 1D model data...
double Real
Generic real data.
Definition: LifeV.hpp:175
OneDFSIPhysicsLinear(const dataPtr_Type dataPtr)
Constructor.
OneDFSIPhysicsLinear & operator=(const OneDFSIPhysicsLinear &physics)
virtual ~OneDFSIPhysicsLinear()
Destructor.
Real fromWToP(const Real &W1, const Real &W2, const UInt &iNode) const
Compute from .
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
void fromUToW(Real &W1, Real &W2, const Real &U1, const Real &U2, const UInt &iNode) const
Compute from .