LifeV
OneDFSIPhysicsNonLinear.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 non 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 OneDFSIPhysicsNonLinear_H
44 #define OneDFSIPhysicsNonLinear_H
45 
46 #include <lifev/one_d_fsi/solver/OneDFSIPhysics.hpp>
47 
48 namespace LifeV
49 {
50 
51 //! OneDFSIPhysicsNonLinear - Class providing non 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
80 
81  //! Constructor
82  /*!
83  * @param dataPtr pointer to the data container of the problem
84  */
85  explicit OneDFSIPhysicsNonLinear ( const dataPtr_Type dataPtr ) : super ( dataPtr ) {}
86 
87  //! Destructor
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  * Riemann Invariants corresponding to data (Q, A) at node iNode
101  * W1,2 = (Q / A) +- (2 / beta1) * sqrt(chi) * (celerity - celerity0)
102  * being chi the correction coefficient proposed by A. Robertson and H. Zakaria
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 fromUToW ( Real& W1, Real& W2, const Real& U1, const Real& U2, 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  * Physical variables corresponding to (W1, W2) at node iNode
117  * A = A0 * ( rho / (beta0 * beta1) )^(1/beta1)
118  * * ( beta1 / (4 * sqrt(chi) ) * (W1 - W2) + celerity0 )^(2/beta1)
119  *
120  * Q = A (W1 + W2) / 2
121  *
122  * @param W1 first Riemann variable
123  * @param W2 second Riemann variable
124  * @param U1 first physical variable
125  * @param U2 second physical variable
126  * @param iNode node of the mesh
127  */
128  void fromWToU ( Real& U1, Real& U2, const Real& W1, const Real& W2, const UInt& iNode ) const;
129 
130  //! Compute \f$P\f$ from \f$\mathbf W\f$
131  /*!
132  * \cond \TODO improve doxygen description with latex equation and other features \endcond
133  *
134  * @param W1 first Riemann variable
135  * @param W2 second Riemann variable
136  * @param iNode node of the mesh
137  * @return P = beta0 * ( rho / (beta0 * beta1) * ( beta1 / (4 * sqrt(chi)) * (W1 - W2) + celerity0 )^2 - 1 )
138  */
139  Real fromWToP ( const Real& W1, const Real& W2, const UInt& iNode ) const;
140 
141  //! Compute \f$W_1\f$ or \f$W_2\f$ from \f$P\f$
142  /*!
143  * \cond \TODO improve doxygen description with latex equation and other features \endcond
144  *
145  * W1 - W2 = (4 * sqrt(chi) / beta1) * sqrt( beta0 * beta1 / rho ) ) * ( sqrt( P / beta0 + 1 ) - 1 )
146  * W1 - W2 = 4 * sqrt( beta0 / (beta1 * rho ) ) * ( sqrt( P / beta0 + 1 ) - 1 )
147  *
148  * @param P pressure
149  * @param W Riemann variable
150  * @param iW Riemann variable ID (0 for \f$W_1\f$, 1 or \f$W_2\f$)
151  * @param iNode node of the mesh
152  * @return the other Riemann variable
153  */
154  Real fromPToW ( const Real& P, const Real& W, const ID& iW, const UInt& iNode ) const;
155 
156  //! Compute \f$W_1\f$ or \f$W_2\f$ from \f$Q\f$
157  /*!
158  * \cond \TODO improve doxygen description with latex equation and other features \endcond
159  *
160  * ( W1 - W2 + celerity0/K0 )^(2/beta1) * ( W1 + W2 ) = Q / K1
161  *
162  * where
163  *
164  * K0 = beta1 / ( 4 * sqrt(chi) )
165  * K1 = A0 / 2 * ( rho / (beta0*beta1) )^(1/beta1) * K0^(2/beta1)
166  *
167  * @param Q pressure
168  * @param W_tn Riemann variable at time \f$t^n\f$
169  * @param W Riemann variable
170  * @param iW Riemann variable ID (0 for \f$W_1\f$, 1 or \f$W_2\f$)
171  * @param iNode node of the mesh
172  * @return the other Riemann variable
173  */
174  Real fromQToW ( const Real& Q, const Real& W_tn, const Real& W, const ID& iW, const UInt& iNode ) const;
175 
176  //@}
177 
178 
179  //! @name Derivatives methods
180  //@{
181 
182  //! Compute the derivative of pressure with respect to \f$ \mathbf W\f$
183  /*!
184  * \cond \TODO improve doxygen description with latex equation and other features \endcond
185  *
186  * dP(W1,W2)/dW_1 = rho / (2 * sqrt(chi)) * ( beta1 / (4 * sqrt(chi)) * (W1 - W2) + celerity0 )
187  * dP(W1,W2)/dW_2 = - rho / (2 * sqrt(chi)) * ( beta1 / (4 * sqrt(chi)) * (W1 - W2) + celerity0 )
188  *
189  * @param W1 first Riemann variable
190  * @param W2 second Riemann variable
191  * @param iW Riemann derivative ID (0 for \f$\displaystyle\frac{dP}{dW_1}\f$, 1 or \f$\displaystyle\frac{dP}{dW_2}\f$)
192  * @param iNode node of the mesh
193  * @return \f$\displaystyle\frac{dP}{dW_1}\f$ or \f$\displaystyle\frac{dP}{dW_2}\f$
194  */
195  Real dPdW ( const Real& W1, const Real& W2, const ID& iW, const UInt& iNode ) const;
196 
197  //@}
198 
199 private:
200 
201  //! @name Unimplemented Methods
202  //@{
203 
204  explicit OneDFSIPhysicsNonLinear ( const OneDFSIPhysicsNonLinear& physics );
205 
207 
208  //@}
209 
210 };
211 
212 //! Factory create function
214 {
215  return new OneDFSIPhysicsNonLinear();
216 }
217 
218 }
219 
220 #endif // OneDFSIPhysicsNonLinear_H
Real fromPToW(const Real &P, const Real &W, const ID &iW, const UInt &iNode) const
Compute or from .
OneDFSIPhysics - Base class providing physical operations for the 1D model data.
OneDFSIPhysics()
Empty constructor.
Real fromQToW(const Real &Q, const Real &W_tn, const Real &W, const ID &iW, const UInt &iNode) const
Compute or from .
OneDFSIPhysics * createOneDFSIPhysicsNonLinear()
Factory create function.
OneDFSIPhysics(const dataPtr_Type dataPtr)
Constructor.
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< data_Type > dataPtr_Type
Real fromWToP(const Real &W1, const Real &W2, const UInt &iNode) const
Compute from .
void fromWToU(Real &U1, Real &U2, const Real &W1, const Real &W2, const UInt &iNode) const
Compute from .
uint32_type ID
IDs.
Definition: LifeV.hpp:194
OneDFSIPhysicsNonLinear(const dataPtr_Type dataPtr)
Constructor.
virtual ~OneDFSIPhysicsNonLinear()
Destructor.
double Real
Generic real data.
Definition: LifeV.hpp:175
OneDFSIPhysicsNonLinear & operator=(const OneDFSIPhysicsNonLinear &physics)
OneDFSIPhysicsNonLinear - Class providing non linear physical operations for the 1D model data...
OneDFSIPhysicsNonLinear(const OneDFSIPhysicsNonLinear &physics)
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 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 .