MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
pipe.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/hydr/pipe.h,v 1.29 2017/01/12 14:46:32 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /*
33  * Copyright 1999-2000 Lamberto Puggelli <puggelli@tiscalinet.it>
34  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
35  */
36 
37 #ifndef PIPE_H
38 #define PIPE_H
39 
40 #include "preselem.h"
41 // #include "hfluid.h"
42 
43 /* Pipe - begin */
44 
45 class Pipe : virtual public Elem, public HydraulicElem {
46  private:
50  doublereal viscosity; /* e' globale perche' non dipende dalla pressione */
55 
59  doublereal ktrb; /* coefficiente per il moto turbolento */
60  doublereal klam; /* coefficiente per il moto laminare */
61  doublereal ktra; /* coefficiente per il moto di transizione */
62 
63 
64  public:
65  Pipe(unsigned int uL, const DofOwner* pD,
66  HydraulicFluid* hf,const PressureNode* p1, const PressureNode* p2,
67  doublereal Dh, doublereal A,
68  doublereal L, flag transition, doublereal q0, flag fOut);
69 
70  ~Pipe(void);
71 
72  /* Tipo di elemento idraulico (usato solo per debug ecc.) */
73  virtual HydraulicElem::Type GetHydraulicType(void) const;
74 
75  /* Contributo al file di restart */
76  virtual std::ostream& Restart(std::ostream& out) const;
77 
78  virtual unsigned int iGetNumDof(void) const;
79  virtual DofOrder::Order GetDofType(unsigned int i) const;
80 
81  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
82 
84  doublereal dCoef,
85  const VectorHandler& XCurr,
86  const VectorHandler& XPrimeCurr);
87 
89  doublereal dCoef,
90  const VectorHandler& XCurr,
91  const VectorHandler& XPrimeCurr);
92 
93  virtual void AfterConvergence(const VectorHandler& X,
94  const VectorHandler& XP);
95  virtual void Output(OutputHandler& OH) const;
96 
97  virtual void SetValue(DataManager *pDM,
99  SimulationEntity::Hints *ph = 0);
100 
101  /* *******PER IL SOLUTORE PARALLELO******** */
102  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
103  utile per l'assemblaggio della matrice di connessione fra i dofs */
104  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
105  connectedNodes.resize(2);
106  connectedNodes[0] = pNode1;
107  connectedNodes[1] = pNode2;
108  };
109  /* ************************************************ */
110 };
111 
112 /* Pipe - end */
113 
114 
115 /* Dynamic_pipe Tubo ad elementi finiti - begin */
116 
117 class Dynamic_pipe : virtual public Elem, public HydraulicElem {
118  private:
125  doublereal q0; /* portata iniziale */
126 
127  doublereal flow1; /* portata nodo 1 utilizzata per l'output */
128  doublereal flow2; /* portata nodo 2 utilizzata per l'output */
129  doublereal Re; /* numero di Reynolds medio */
130  doublereal ktrb; /* coefficiente per il moto turbolento */
131  doublereal klam; /* coefficiente per il moto laminare */
132  doublereal ktra; /* coefficiente per il moto di transizione */
133  doublereal densitySt; /* densita' dipendente dalla pressione inizio per l'output */
134  doublereal densityMe; /* densita' dipendente dalla pressione meta' per l'output*/
135  doublereal densityEn; /* densita' dipendente dalla pressione fine per l'output */
136  doublereal densityDPres; /* densita' diviso beta */
137 
138  doublereal viscosity; /* viscosita' */
139 
140  doublereal VelS; /* velocita' all'inizio del tubo */
141  doublereal VelM; /* velocita' a meta' del tubo */
142  doublereal VelE; /* velocita' alla fine del tubo */
143  doublereal fa; /* coefficiente di attrito */
144 
145  doublereal pp; /* output */
146 
147  public:
148  Dynamic_pipe(unsigned int uL, const DofOwner* pD, HydraulicFluid* hf,
149  const PressureNode* p1, const PressureNode* p2,
150  doublereal Dh,
151  doublereal A, doublereal L,
152  flag transition, doublereal q0, flag fOut);
153 
154  ~Dynamic_pipe(void);
155 
156  /* Tipo di elemento idraulico (usato solo per debug ecc.) */
157  virtual HydraulicElem::Type GetHydraulicType(void) const;
158 
159  /* Contributo al file di restart */
160  virtual std::ostream& Restart(std::ostream& out) const;
161 
162  virtual unsigned int iGetNumDof(void) const;
163  virtual DofOrder::Order GetDofType(unsigned int i) const;
164 
165  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
166 
168  doublereal dCoef,
169  const VectorHandler& XCurr,
170  const VectorHandler& XPrimeCurr);
171 
173  doublereal dCoef,
174  const VectorHandler& XCurr,
175  const VectorHandler& XPrimeCurr);
176 
177  virtual void AfterConvergence(const VectorHandler& X,
178  const VectorHandler& XP);
179  virtual void Output(OutputHandler& OH) const;
180 
181  virtual void SetValue(DataManager *pDM,
183  SimulationEntity::Hints *ph = 0);
184 
185  /* *******PER IL SOLUTORE PARALLELO******** */
186  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
187  utile per l'assemblaggio della matrice di connessione fra i dofs */
188  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
189  connectedNodes.resize(2);
190  connectedNodes[0] = pNode1;
191  connectedNodes[1] = pNode2;
192  };
193  /* ************************************************ */
194 };
195 
196 /* Dynamic_pipe - end */
197 
198 
199 /* DynamicPipe (tubo ad elementi finiti) - begin */
200 
201 class DynamicPipe : virtual public Elem, public HydraulicElem {
202  private:
205 
209 
211  doublereal q0; /* portata iniziale */
212 
213  doublereal Re; /* numero di Reynolds medio */
214 
219 
224 
225  doublereal density1; /* densita' dipendente dalla pressione inizio per l'output */
226  doublereal density0; /* densita' dipendente dalla pressione meta' per l'output*/
227  doublereal density2; /* densita' dipendente dalla pressione fine per l'output */
228  doublereal densityDPres1; /* densita' diviso beta */
229  doublereal densityDPres2; /* densita' diviso beta */
230 
231  doublereal viscosity; /* viscosita' */
232 
236 
237  public:
238  DynamicPipe(unsigned int uL, const DofOwner* pD, HydraulicFluid* hf,
239  const PressureNode* p1, const PressureNode* p2,
240  doublereal Dh,
241  doublereal A, doublereal L,
242  flag transition, doublereal q0, flag fOut);
243 
244  ~DynamicPipe(void);
245 
246  /* Tipo di elemento idraulico (usato solo per debug ecc.) */
247  virtual HydraulicElem::Type GetHydraulicType(void) const;
248 
249  /* Contributo al file di restart */
250  virtual std::ostream& Restart(std::ostream& out) const;
251 
252  virtual unsigned int iGetNumDof(void) const;
253  virtual DofOrder::Order GetDofType(unsigned int i) const;
254  virtual DofOrder::Order GetEqType(unsigned int i) const;
255 
256  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
257 
259  doublereal dCoef,
260  const VectorHandler& XCurr,
261  const VectorHandler& XPrimeCurr);
262 
264  doublereal dCoef,
265  const VectorHandler& XCurr,
266  const VectorHandler& XPrimeCurr);
267 
268  virtual void AfterConvergence(const VectorHandler& X,
269  const VectorHandler& XP);
270  virtual void Output(OutputHandler& OH) const;
271 
272  virtual void SetValue(DataManager *pDM,
274  SimulationEntity::Hints *ph = 0);
275 
276  /* *******PER IL SOLUTORE PARALLELO******** */
277  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
278  utile per l'assemblaggio della matrice di connessione fra i dofs */
279  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
280  connectedNodes.resize(2);
281  connectedNodes[0] = pNode1;
282  connectedNodes[1] = pNode2;
283  };
284  /* ************************************************ */
285 };
286 
287 /* Dynamic_pipe - end */
288 
289 #endif
doublereal length
Definition: pipe.h:123
const PressureNode * pNode1
Definition: pipe.h:119
const PressureNode * pNode1
Definition: pipe.h:47
const PressureNode * pNode1
Definition: pipe.h:203
doublereal p2p
Definition: pipe.h:218
doublereal q2
Definition: pipe.h:221
doublereal q2p
Definition: pipe.h:223
doublereal VelE
Definition: pipe.h:142
doublereal dKtrb
Definition: pipe.h:234
long int flag
Definition: mbdyn.h:43
doublereal vel
Definition: pipe.h:56
flag turbulent
Definition: pipe.h:53
Dynamic_pipe(unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p1, const PressureNode *p2, doublereal Dh, doublereal A, doublereal L, flag transition, doublereal q0, flag fOut)
Definition: pipe.cc:469
doublereal densityEn
Definition: pipe.h:135
~Dynamic_pipe(void)
Definition: pipe.cc:496
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: pipe.cc:954
doublereal diameter
Definition: pipe.h:121
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: pipe.h:188
virtual void Output(OutputHandler &OH) const
Definition: pipe.cc:446
doublereal fa
Definition: pipe.h:143
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: pipe.h:104
doublereal p1p
Definition: pipe.h:217
virtual void Output(OutputHandler &OH) const
Definition: pipe.cc:968
doublereal q0
Definition: pipe.h:211
virtual unsigned int iGetNumDof(void) const
Definition: pipe.cc:512
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: pipe.cc:983
doublereal q1
Definition: pipe.h:220
doublereal density1
Definition: pipe.h:225
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: pipe.h:279
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: pipe.cc:275
doublereal area
Definition: pipe.h:51
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: pipe.cc:456
virtual std::ostream & Restart(std::ostream &out) const
Definition: pipe.cc:1052
doublereal length
Definition: pipe.h:208
DynamicPipe(unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p1, const PressureNode *p2, doublereal Dh, doublereal A, doublereal L, flag transition, doublereal q0, flag fOut)
Definition: pipe.cc:1006
doublereal diameter
Definition: pipe.h:206
virtual DofOrder::Order GetEqType(unsigned int i) const
Definition: pipe.cc:1070
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: pipe.cc:1077
doublereal densityDPres1
Definition: pipe.h:228
doublereal ktra
Definition: pipe.h:61
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: pipe.cc:100
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: pipe.cc:1393
doublereal Re
Definition: pipe.h:213
doublereal q0
Definition: pipe.h:54
Pipe(unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p1, const PressureNode *p2, doublereal Dh, doublereal A, doublereal L, flag transition, doublereal q0, flag fOut)
Definition: pipe.cc:46
doublereal area
Definition: pipe.h:122
doublereal q1p
Definition: pipe.h:222
doublereal dKtra
Definition: pipe.h:235
virtual HydraulicElem::Type GetHydraulicType(void) const
Definition: pipe.cc:86
doublereal dKlam
Definition: pipe.h:233
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: pipe.cc:106
~Pipe(void)
Definition: pipe.cc:80
const PressureNode * pNode2
Definition: pipe.h:204
doublereal densityDPres2
Definition: pipe.h:229
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: pipe.cc:525
virtual unsigned int iGetNumDof(void) const
Definition: pipe.cc:1057
doublereal VelM
Definition: pipe.h:141
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: pipe.cc:743
virtual HydraulicElem::Type GetHydraulicType(void) const
Definition: pipe.cc:1047
virtual std::ostream & Restart(std::ostream &out) const
Definition: pipe.cc:507
doublereal length
Definition: pipe.h:52
doublereal klam
Definition: pipe.h:131
flag turbulent
Definition: pipe.h:124
doublereal Re
Definition: pipe.h:129
doublereal densitySt
Definition: pipe.h:133
doublereal ktrb
Definition: pipe.h:59
doublereal viscosity
Definition: pipe.h:138
const PressureNode * pNode2
Definition: pipe.h:48
const PressureNode * pNode2
Definition: pipe.h:120
doublereal diameter
Definition: pipe.h:49
virtual std::ostream & Restart(std::ostream &out) const
Definition: pipe.cc:91
doublereal flow
Definition: pipe.h:57
~DynamicPipe(void)
Definition: pipe.cc:1041
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: pipe.cc:1233
doublereal viscosity
Definition: pipe.h:50
doublereal pp
Definition: pipe.h:145
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: pipe.cc:426
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: pipe.cc:112
doublereal flow1
Definition: pipe.h:127
doublereal viscosity
Definition: pipe.h:231
flag turbulent
Definition: pipe.h:210
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: pipe.cc:518
Definition: elem.h:75
virtual HydraulicElem::Type GetHydraulicType(void) const
Definition: pipe.cc:502
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: pipe.cc:1353
doublereal q0
Definition: pipe.h:125
doublereal densityDPres
Definition: pipe.h:136
doublereal densityMe
Definition: pipe.h:134
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: pipe.cc:1084
doublereal density2
Definition: pipe.h:227
doublereal area
Definition: pipe.h:207
doublereal Re
Definition: pipe.h:58
doublereal density0
Definition: pipe.h:226
doublereal flow2
Definition: pipe.h:128
doublereal ktra
Definition: pipe.h:132
doublereal p2
Definition: pipe.h:216
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: pipe.cc:532
doublereal VelS
Definition: pipe.h:140
double doublereal
Definition: colamd.c:52
doublereal klam
Definition: pipe.h:60
long int integer
Definition: colamd.c:51
doublereal ktrb
Definition: pipe.h:130
virtual unsigned int iGetNumDof(void) const
Definition: pipe.cc:96
doublereal p1
Definition: pipe.h:215
Definition: pipe.h:45
virtual void Output(OutputHandler &OH) const
Definition: pipe.cc:1367
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: pipe.cc:1063