MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
hminor.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/hydr/hminor.h,v 1.28 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 HMINOR_H
38 #define HMINOR_H
39 
40 #include "preselem.h"
41 
42 /* MinorLoss - begin */
43 
44 class MinorLoss : virtual public Elem, public HydraulicElem {
45  private:
48 
52 
53  doublereal flow; /* utilizzato per l'output */
54  doublereal vel; /* utilizzato per l'output */
56 
57  public:
58  MinorLoss(unsigned int uL, const DofOwner* pD,
59  HydraulicFluid* hf,
60  const PressureNode* p1, const PressureNode* p2,
61  doublereal dK12, doublereal dK21, doublereal A, flag fOut);
62 
63  ~MinorLoss(void);
64 
65  /* Tipo di elemento idraulico (usato solo per debug ecc.) */
66  virtual HydraulicElem::Type GetHydraulicType(void) const;
67 
68  /* Contributo al file di restart */
69  virtual std::ostream& Restart(std::ostream& out) const;
70 
71  virtual unsigned int iGetNumDof(void) const;
72  virtual DofOrder::Order GetDofType(unsigned int i) const;
73 
74  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
75 
77  doublereal dCoef,
78  const VectorHandler& XCurr,
79  const VectorHandler& XPrimeCurr);
80 
82  doublereal dCoef,
83  const VectorHandler& XCurr,
84  const VectorHandler& XPrimeCurr);
85 
86  virtual void Output(OutputHandler& OH) const;
87 
88  /* *******PER IL SOLUTORE PARALLELO******** */
89  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
90  utile per l'assemblaggio della matrice di connessione fra i dofs */
91  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
92  connectedNodes.resize(2);
93  connectedNodes[0] = m_pNode1;
94  connectedNodes[1] = m_pNode2;
95  };
96  /* ************************************************ */
97 };
98 
99 /* MinorLoss - end */
100 
101 
102 /* ThreeWayMinorLoss - begin */
103 
104 class ThreeWayMinorLoss : virtual public Elem, public HydraulicElem {
105 private:
110 
116 
117  doublereal flow; /* utilizzato per l'output */
118  doublereal vel; /* utilizzato per l'output */
120 
121 public:
122  ThreeWayMinorLoss(unsigned int uL, const DofOwner* pD,
123  HydraulicFluid* hf, const PressureNode* p0,
124  const PressureNode* p1, const PressureNode* p2,
125  doublereal dK12, doublereal dK21,
126  doublereal A1, doublereal A2, flag fOut);
127 
128  ~ThreeWayMinorLoss(void);
129 
130  /* Tipo di elemento idraulico (usato solo per debug ecc.) */
131  virtual HydraulicElem::Type GetHydraulicType(void) const;
132 
133  /* Contributo al file di restart */
134  virtual std::ostream& Restart(std::ostream& out) const;
135 
136  virtual unsigned int iGetNumDof(void) const;
137  virtual DofOrder::Order GetDofType(unsigned int i) const;
138 
139  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
140 
142  doublereal dCoef,
143  const VectorHandler& XCurr,
144  const VectorHandler& XPrimeCurr);
145 
147  doublereal dCoef,
148  const VectorHandler& XCurr,
149  const VectorHandler& XPrimeCurr);
150 
151  virtual void Output(OutputHandler& OH) const;
152 
153  /* *******PER IL SOLUTORE PARALLELO******** */
154  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
155  * utile per l'assemblaggio della matrice di connessione fra i dofs */
156  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
157  connectedNodes.resize(3);
158  connectedNodes[0] = m_pNode0;
159  connectedNodes[1] = m_pNode1;
160  connectedNodes[2] = m_pNode2;
161  };
162  /* ************************************************ */
163 };
164 
165 /* ThreeWayMinorLoss - end */
166 
167 
168 /* Orifice - begin */
169 
170 class Orifice : virtual public Elem, public HydraulicElem {
171  private:
179 
183  doublereal flow; /* utilizzato per l'output */
184  doublereal vel; /* utilizzato per l'output */
185  doublereal Re; /* utilizzato per l'output */
186  bool turbulent;
187 
188  public:
189  Orifice(unsigned int uL, const DofOwner* pD,
190  HydraulicFluid* hf,
191  const PressureNode* p1, const PressureNode* p2,
192  doublereal Dh,
193  doublereal A_diaf, doublereal A_pipe, doublereal ReCR, flag fOut);
194 
195  ~Orifice(void);
196 
197  /* Tipo di elemento idraulico (usato solo per debug ecc.) */
198  virtual HydraulicElem::Type GetHydraulicType(void) const;
199 
200  /* Contributo al file di restart */
201  virtual std::ostream& Restart(std::ostream& out) const;
202 
203  virtual unsigned int iGetNumDof(void) const;
204  virtual DofOrder::Order GetDofType(unsigned int i) const;
205 
206  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
207 
209  doublereal dCoef,
210  const VectorHandler& XCurr,
211  const VectorHandler& XPrimeCurr);
212 
214  doublereal dCoef,
215  const VectorHandler& XCurr,
216  const VectorHandler& XPrimeCurr);
217 
218  virtual void Output(OutputHandler& OH) const;
219 
220  /* *******PER IL SOLUTORE PARALLELO******** */
221  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
222  utile per l'assemblaggio della matrice di connessione fra i dofs */
223  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
224  connectedNodes.resize(2);
225  connectedNodes[0] = m_pNode1;
226  connectedNodes[1] = m_pNode2;
227  };
228  /* ************************************************ */
229 };
230 
231 /* Orifice - end */
232 
233 #endif
doublereal m_dKappa
Definition: hminor.h:119
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:342
doublereal delta
Definition: hminor.h:181
const PressureNode * m_pNode0
Definition: hminor.h:106
const PressureNode * m_pNode2
Definition: hminor.h:47
long int flag
Definition: mbdyn.h:43
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: hminor.cc:501
MinorLoss(unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p1, const PressureNode *p2, doublereal dK12, doublereal dK21, doublereal A, flag fOut)
Definition: hminor.cc:46
const PressureNode * m_pNode1
Definition: hminor.h:107
virtual unsigned int iGetNumDof(void) const
Definition: hminor.cc:495
doublereal viscosity
Definition: hminor.h:175
doublereal CriticJump
Definition: hminor.h:180
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:108
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:562
doublereal flow
Definition: hminor.h:53
Orifice(unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p1, const PressureNode *p2, doublereal Dh, doublereal A_diaf, doublereal A_pipe, doublereal ReCR, flag fOut)
Definition: hminor.cc:420
const PressureNode * m_pNode2
Definition: hminor.h:108
doublereal m_dKappa21
Definition: hminor.h:50
virtual HydraulicElem::Type GetHydraulicType(void) const
Definition: hminor.cc:75
virtual HydraulicElem::Type GetHydraulicType(void) const
Definition: hminor.cc:255
static double * p0
ThreeWayMinorLoss(unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p0, const PressureNode *p1, const PressureNode *p2, doublereal dK12, doublereal dK21, doublereal A1, doublereal A2, flag fOut)
Definition: hminor.cc:221
virtual HydraulicElem::Type GetHydraulicType(void) const
Definition: hminor.cc:482
doublereal m_Area_pipe
Definition: hminor.h:177
doublereal vel
Definition: hminor.h:184
doublereal m_dKappa21
Definition: hminor.h:112
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:288
~ThreeWayMinorLoss(void)
Definition: hminor.cc:248
const PressureNode * m_pNodeN
Definition: hminor.h:109
doublereal m_dKappa12
Definition: hminor.h:49
doublereal Re
Definition: hminor.h:185
doublereal m_dKappa
Definition: hminor.h:55
virtual unsigned int iGetNumDof(void) const
Definition: hminor.cc:268
doublereal ReCr
Definition: hminor.h:178
doublereal m_dKappa12
Definition: hminor.h:111
virtual unsigned int iGetNumDof(void) const
Definition: hminor.cc:88
bool turbulent
Definition: hminor.h:186
doublereal m_Area
Definition: hminor.h:51
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: hminor.cc:94
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:160
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: hminor.cc:281
~Orifice(void)
Definition: hminor.cc:475
doublereal m_Area2
Definition: hminor.h:114
virtual void Output(OutputHandler &OH) const
Definition: hminor.cc:207
virtual std::ostream & Restart(std::ostream &out) const
Definition: hminor.cc:489
virtual std::ostream & Restart(std::ostream &out) const
Definition: hminor.cc:82
const PressureNode * m_pNode1
Definition: hminor.h:46
virtual std::ostream & Restart(std::ostream &out) const
Definition: hminor.cc:262
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:515
~MinorLoss(void)
Definition: hminor.cc:68
doublereal diameter
Definition: hminor.h:174
doublereal m_Area1
Definition: hminor.h:113
virtual void Output(OutputHandler &OH) const
Definition: hminor.cc:630
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: hminor.cc:508
Definition: elem.h:75
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: hminor.h:91
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: hminor.h:156
virtual void Output(OutputHandler &OH) const
Definition: hminor.cc:403
doublereal Cd
Definition: hminor.h:182
doublereal m_Area
Definition: hminor.h:115
doublereal vel
Definition: hminor.h:118
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: hminor.cc:101
const PressureNode * m_pNode1
Definition: hminor.h:172
double doublereal
Definition: colamd.c:52
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: hminor.cc:274
long int integer
Definition: colamd.c:51
doublereal flow
Definition: hminor.h:117
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: hminor.h:223
doublereal m_Area_diaf
Definition: hminor.h:176
doublereal flow
Definition: hminor.h:183
const PressureNode * m_pNode2
Definition: hminor.h:173
doublereal vel
Definition: hminor.h:54