MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
hminor.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/hydr/hminor.cc,v 1.39 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 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
38 
39 #include <cfloat>
40 #include <limits>
41 
42 #include "hminor.h"
43 
44 /* MinorLosses - begin */
45 
46 MinorLoss::MinorLoss(unsigned int uL, const DofOwner* pDO,
47  HydraulicFluid* hf,
48  const PressureNode* p1, const PressureNode* p2,
49  doublereal dK12, doublereal dK21, doublereal A,
50  flag fOut)
51 : Elem(uL, fOut),
52 HydraulicElem(uL, pDO, hf, fOut),
53 m_pNode1(p1), m_pNode2(p2),
54 m_dKappa12(dK12), m_dKappa21(dK21), m_Area(A),
55 flow(0.),
56 vel(0.),
57 m_dKappa(0.)
58 {
59  ASSERT(m_pNode1 != NULL);
61  ASSERT(m_pNode2 != NULL);
63  ASSERT(m_dKappa12 >= 0.);
64  ASSERT(m_dKappa21 >= 0.);
65  ASSERT(A > std::numeric_limits<doublereal>::epsilon());
66 }
67 
69 {
70  NO_OP;
71 }
72 
73 /* Tipo di elemento idraulico (usato solo per debug ecc.) */
76 {
78 }
79 
80 /* Contributo al file di restart */
81 std::ostream&
82 MinorLoss::Restart(std::ostream& out) const
83 {
84  return out << "MinorLoss not implemented yet!" << std::endl;
85 }
86 
87 unsigned int
89 {
90  return 0;
91 }
92 
94 MinorLoss::GetDofType(unsigned int i) const
95 {
96  silent_cerr("MinorLoss has no dofs!" << std::endl);
98 }
99 
100 void
101 MinorLoss::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
102 {
103  *piNumRows = 2;
104  *piNumCols = 2;
105 }
106 
109  doublereal dCoef,
110  const VectorHandler& XCurr,
111  const VectorHandler& XPrimeCurr)
112 {
113  DEBUGCOUT("Entering MinorLoss::AssJac()" << std::endl);
114 
115  FullSubMatrixHandler& WM = WorkMat.SetFull();
116  WM.Resize(2, 2);
117 
118  integer iNode1RowIndex = m_pNode1->iGetFirstRowIndex() + 1;
119  integer iNode2RowIndex = m_pNode2->iGetFirstRowIndex() + 1;
120  integer iNode1ColIndex = m_pNode1->iGetFirstColIndex() + 1;
121  integer iNode2ColIndex = m_pNode2->iGetFirstColIndex() + 1;
122 
123  WM.PutRowIndex(1, iNode1RowIndex);
124  WM.PutRowIndex(2, iNode2RowIndex);
125  WM.PutColIndex(1, iNode1ColIndex);
126  WM.PutColIndex(2, iNode2ColIndex);
127 
128  doublereal p1 = m_pNode1->dGetX();
129  doublereal p2 = m_pNode2->dGetX();
130 
131  doublereal jumpPres = fabs(p1-p2);
132 
133  /* evito di dividere per un numero troppo piccolo */
134  if (jumpPres < 1.e8*std::numeric_limits<doublereal>::epsilon()) {
135  jumpPres = 1.e8*std::numeric_limits<doublereal>::epsilon();
136  }
137 
138  /*
139  * se voglio usare un fluido comprimibile, metto la pressione
140  * media nel condotto:
141  */
142 
143  doublereal density = HF->dGetDensity((p1 + p2)/2.);
144 
145  /* altrimenti lascio la densita' di riferimento
146  * doublereal density = HF->dGetDensity();
147  */
148 
149  doublereal Jac = -density*.5*m_Area*sqrt(2./(m_dKappa*density*jumpPres));
150 
151  WM.PutCoef(1, 1, Jac);
152  WM.PutCoef(1, 2, -Jac);
153  WM.PutCoef(2, 1, -Jac);
154  WM.PutCoef(2, 2, Jac);
155 
156  return WorkMat;
157 }
158 
161  doublereal dCoef,
162  const VectorHandler& XCurr,
163  const VectorHandler& XPrimeCurr)
164 {
165  DEBUGCOUT("Entering MinorLoss::AssRes()" << std::endl);
166 
167  WorkVec.Resize(2);
168 
169  integer iNode1RowIndex = m_pNode1->iGetFirstRowIndex() + 1;
170  integer iNode2RowIndex = m_pNode2->iGetFirstRowIndex() + 1;
171 
172  doublereal p1 = m_pNode1->dGetX();
173  doublereal p2 = m_pNode2->dGetX();
174 
175  doublereal jumpPres = fabs(p1-p2);
176 
177  if (p1 > p2) {
178  m_dKappa = m_dKappa12; /* flusso diretto da 1 a 2 */
179  } else {
180  m_dKappa = m_dKappa21; /* flusso diretto da 2 a 1 */
181  }
182 
183  doublereal density = HF->dGetDensity((p1 + p2)/2.);
184  flow = density*m_Area*sqrt(2./(m_dKappa*density))*copysign(sqrt(jumpPres), p1 - p2);
185  vel = flow/(density*m_Area);
186 
187 #ifdef HYDR_DEVEL
188  DEBUGCOUT("RES area : " << m_Area << std::endl);
189  DEBUGCOUT("RES flow: " << flow << std::endl);
190  DEBUGCOUT("RES p1: " << p1 << std::endl);
191  DEBUGCOUT("RES p2: " << p2 << std::endl);
192  DEBUGCOUT("RES dKappa: " << m_dKappa << std::endl);
193  DEBUGCOUT("****************************************************" << std::endl);
194  DEBUGCOUT("RES velocita': " << vel << std::endl);
195  DEBUGCOUT(" se positiva il fluido va dal nodo 1 al nodo 2 " << std::endl);
196  DEBUGCOUT("RES portata (nodo2): " << flow << std::endl);
197  DEBUGCOUT("****************************************************" << std::endl);
198 #endif
199 
200  WorkVec.PutItem(1, iNode1RowIndex, flow);
201  WorkVec.PutItem(2, iNode2RowIndex, -flow);
202 
203  return WorkVec;
204 }
205 
206 void
208 {
209  if (bToBeOutput()) {
210  std::ostream& out = OH.Hydraulic();
211  out << std::setw(8) << GetLabel()
212  << " " << vel << " " << flow << std::endl;
213  }
214 }
215 
216 /* MinorLoss - end */
217 
218 
219 /* ThreeWayMinorLoss - begin */
220 
222  unsigned int uL, const DofOwner* pDO,
223  HydraulicFluid* hf, const PressureNode* p0,
224  const PressureNode* p1, const PressureNode* p2,
225  doublereal dK12, doublereal dK21,
226  doublereal A1, doublereal A2, flag fOut)
227 : Elem(uL, fOut),
228 HydraulicElem(uL, pDO, hf, fOut),
229 m_pNode0(p0), m_pNode1(p1), m_pNode2(p2), m_pNodeN(0),
230 m_dKappa12(dK12), m_dKappa21(dK21), m_Area1(A1), m_Area2(A2),
231 m_Area(0.),
232 flow(0.),
233 vel(0.),
234 m_dKappa(0.)
235 {
236  ASSERT(m_pNode0 != NULL);
238  ASSERT(m_pNode1 != NULL);
240  ASSERT(m_pNode2 != NULL);
242  ASSERT(m_dKappa12 >= 0.);
243  ASSERT(m_dKappa21 >= 0.);
244  ASSERT(A1 > std::numeric_limits<doublereal>::epsilon());
245  ASSERT(A2 > std::numeric_limits<doublereal>::epsilon());
246 }
247 
249 {
250  NO_OP;
251 }
252 
253 /* Tipo di elemento idraulico (usato solo per debug ecc.) */
256 {
258 }
259 
260 /* Contributo al file di restart */
261 std::ostream&
262 ThreeWayMinorLoss::Restart(std::ostream& out) const
263 {
264  return out << "ThreeWayMinorLoss not implemented yet!" << std::endl;
265 }
266 
267 unsigned int
269 {
270  return 0;
271 }
272 
274 ThreeWayMinorLoss::GetDofType(unsigned int i) const
275 {
276  silent_cerr("MinorLoss has no dofs!" << std::endl);
278 }
279 
280 void
281 ThreeWayMinorLoss::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
282 {
283  *piNumRows = 2;
284  *piNumCols = 2;
285 }
286 
289  doublereal dCoef,
290  const VectorHandler& XCurr,
291  const VectorHandler& XPrimeCurr)
292 {
293  DEBUGCOUT("Entering ThreeWayMinorLoss::AssJac()" << std::endl);
294 
295  ASSERT(m_pNodeN != NULL);
296 
297  FullSubMatrixHandler& WM = WorkMat.SetFull();
298  WM.Resize(2, 2);
299 
300  integer iNode0RowIndex = m_pNode0->iGetFirstRowIndex() + 1;
301  integer iNodeNRowIndex = m_pNodeN->iGetFirstRowIndex() + 1;
302  integer iNode0ColIndex = m_pNode0->iGetFirstColIndex() + 1;
303  integer iNodeNColIndex = m_pNodeN->iGetFirstColIndex() + 1;
304 
305  WM.PutRowIndex(1, iNode0RowIndex);
306  WM.PutRowIndex(2, iNodeNRowIndex);
307  WM.PutColIndex(1, iNode0ColIndex);
308  WM.PutColIndex(2, iNodeNColIndex);
309 
311  doublereal p = m_pNodeN->dGetX();
312 
313  doublereal jumpPres = fabs(p0-p);
314 
315  /* evito di dividere per un numero troppo piccolo */
316  if (jumpPres < 1.e8*std::numeric_limits<doublereal>::epsilon()) {
317  jumpPres = 1.e8*std::numeric_limits<doublereal>::epsilon();
318  }
319 
320  /*
321  * se voglio usare un fluido comprimibile, metto la pressione
322  * media nel condotto:
323  */
324 
325  doublereal density = HF->dGetDensity((p0 + p)/2.);
326 
327  /*
328  * altrimenti lascio la densita' di riferimento
329  * doublereal density = HF->dGetDensity();
330  */
331  doublereal Jac = -density*.5*m_Area*sqrt(2./(m_dKappa*density*jumpPres));
332 
333  WM.PutCoef(1, 1, Jac);
334  WM.PutCoef(1, 2, -Jac);
335  WM.PutCoef(2, 1, -Jac);
336  WM.PutCoef(2, 2, Jac);
337 
338  return WorkMat;
339 }
340 
343  doublereal dCoef,
344  const VectorHandler& XCurr,
345  const VectorHandler& XPrimeCurr)
346 {
347  DEBUGCOUT("Entering ThreeWayMinorLoss::AssRes()" << std::endl);
348 
349  WorkVec.Resize(2);
350 
352  doublereal p1 = m_pNode1->dGetX();
353  doublereal p2 = m_pNode2->dGetX();
354  doublereal p;
355 
356  m_pNodeN = NULL;
357 
358  if (p1 > p2) {
359  m_pNodeN = m_pNode1;
360  p = p1;
361  m_Area = m_Area1;
362  } else {
363  m_pNodeN = m_pNode2;
364  p = p2;
365  m_Area = m_Area2;
366  }
367 
368  doublereal jumpPres = fabs(p0-p);
369 
370  if (p0 > p) {
371  m_dKappa = m_dKappa12; /* flusso diretto da 0 a n */
372  } else {
373  m_dKappa = m_dKappa21; /* flusso diretto da n a 0 */
374  }
375 
376  doublereal density = HF->dGetDensity((p0 + p)/2.);
377  flow = density*m_Area*sqrt(2./(m_dKappa*density))*copysign(sqrt(jumpPres), p0 - p);
378  vel = flow/(density*m_Area);
379 
380 #ifdef HYDR_DEVEL
381  DEBUGCOUT("RES area : " << m_Area << std::endl);
382  DEBUGCOUT("RES flow: " << flow << std::endl);
383  DEBUGCOUT("RES p0: " << p0 << std::endl);
384  DEBUGCOUT("RES p: " << p << std::endl);
385  DEBUGCOUT("RES dKappa: " << m_dKappa << std::endl);
386  DEBUGCOUT("****************************************************" << std::endl);
387  DEBUGCOUT("RES velocita': " << vel << std::endl);
388  DEBUGCOUT(" se positiva il fluido va dal nodo 0 al nodo n " << std::endl);
389  DEBUGCOUT("RES portata (nodo n):" << flow << std::endl);
390  DEBUGCOUT("****************************************************" << std::endl);
391 #endif
392 
393  integer iNode0RowIndex = m_pNode0->iGetFirstRowIndex() + 1;
394  integer iNodeNRowIndex = m_pNodeN->iGetFirstRowIndex() + 1;
395 
396  WorkVec.PutItem(1, iNode0RowIndex, flow);
397  WorkVec.PutItem(2, iNodeNRowIndex, -flow);
398 
399  return WorkVec;
400 }
401 
402 void
404 {
405  if (bToBeOutput()) {
406  std::ostream& out = OH.Hydraulic();
407  out << std::setw(8) << GetLabel()
408  << " " << vel << " " << flow << std::endl;
409  }
410 }
411 
412 /* ThreeWayMinorLoss - end */
413 
414 
415 /* Orifice - begin */
416 
417 /* se Re < Rec avrò sicuramente moto laminare
418  * se invece Re > Rec avrò sicuramente moto turbolento */
419 
420 Orifice::Orifice(unsigned int uL, const DofOwner* pDO,
421  HydraulicFluid* hf,
422  const PressureNode* p1, const PressureNode* p2,
423  doublereal Dh, doublereal A_diaf, doublereal A_pipe,
424  doublereal ReCr, flag fOut)
425 : Elem(uL, fOut),
426 HydraulicElem(uL, pDO, hf, fOut),
427 m_pNode1(p1), m_pNode2(p2),
428 diameter(Dh), m_Area_diaf(A_diaf),
429 m_Area_pipe(A_pipe), ReCr(ReCr),
430 flow(0.),
431 vel(0.),
432 Re(0.),
433 turbulent(false)
434 {
435  ASSERT(m_pNode1 != NULL);
437  ASSERT(m_pNode2 != NULL);
439  ASSERT(Dh > std::numeric_limits<doublereal>::epsilon());
440  ASSERT(A_diaf > std::numeric_limits<doublereal>::epsilon());
441  ASSERT(A_pipe > std::numeric_limits<doublereal>::epsilon());
442 
443  /* se |p1-p2| < CriticJump avrò sicuramente moto laminare se no turbolento */
444 
446  /*
447  * Merritt, pp. 43-45:
448  *
449  * delta = 0.2 for a sharp-edged round orifice
450  * delta = 0.157 for a sharp-edged slit orifice
451  */
452  delta = 0.2;
453  // ReCr = pow(0.611/delta, 2);
454  doublereal density = HF->dGetDensity((m_pNode2->dGetX() + m_pNode1->dGetX())/2.);
455  CriticJump = m_Area_pipe*ReCr*pow(viscosity/(diameter*delta), 2.)/(2.*density*m_Area_diaf);
456 
457  /* calcolo del Cd */
458 
459  /* Cc = funzione delle due aree; */
461  /* parametro adimensionale in funzione del rapporto m_Area_diaf/m_Area_pipe */
462  doublereal Cc = (((.4855*rapp - .4971)*rapp + .158)*rapp + .1707)*rapp + .6005;
463 
464  doublereal base = Cc*rapp;
465  doublereal rad = 1. - base*base;
466  if (rad < 1.e3*std::numeric_limits<doublereal>::epsilon()) {
467  silent_cerr("Orifice(" << GetLabel() << "): error computing Cd" << std::endl);
469  }
470 
471  doublereal Cv = .98; /* costante adimensionale */
472  Cd = Cv*Cc/sqrt(rad);
473 }
474 
476 {
477  NO_OP;
478 }
479 
480 /* Tipo di elemento idraulico (usato solo per debug ecc.) */
483 {
484  return HydraulicElem::ORIFICE;
485 }
486 
487 /* Contributo al file di restart */
488 std::ostream&
489 Orifice::Restart(std::ostream& out) const
490 {
491  return out << "Orifice not implemented yet!" << std::endl;
492 }
493 
494 unsigned int
496 {
497  return 0;
498 }
499 
501 Orifice::GetDofType(unsigned int i) const
502 {
503  silent_cerr("Orifice has no dofs!" << std::endl);
505 }
506 
507 void
508 Orifice::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
509 {
510  *piNumRows = 2;
511  *piNumCols = 2;
512 }
513 
516  doublereal dCoef,
517  const VectorHandler& XCurr,
518  const VectorHandler& XPrimeCurr)
519 {
520  DEBUGCOUT("Entering Orifice::AssJac()" << std::endl);
521 
522  FullSubMatrixHandler& WM = WorkMat.SetFull();
523  WM.Resize(2, 2);
524 
525  integer iNode1RowIndex = m_pNode1->iGetFirstRowIndex() + 1;
526  integer iNode2RowIndex = m_pNode2->iGetFirstRowIndex() + 1;
527  integer iNode1ColIndex = m_pNode1->iGetFirstColIndex() + 1;
528  integer iNode2ColIndex = m_pNode2->iGetFirstColIndex() + 1;
529 
530  WM.PutRowIndex(1, iNode1RowIndex);
531  WM.PutRowIndex(2, iNode2RowIndex);
532  WM.PutColIndex(1, iNode1ColIndex);
533  WM.PutColIndex(2, iNode2ColIndex);
534 
535  doublereal p1 = m_pNode1->dGetX();
536  doublereal p2 = m_pNode2->dGetX();
537  doublereal jumpPres = fabs(p1-p2);
538 
539  doublereal Jac = 0.;
540  doublereal density = HF->dGetDensity((p1 + p2)/2.);
541 
542  if (jumpPres < CriticJump) {
543  /* moto sicuramente laminare (jacobiano) */
544  Jac = -density*2.*(delta*delta)*diameter*m_Area_diaf/viscosity;
545 
546  } else {
547  /* moto sicuramente turbolento (jacobiano) */
548  Jac = -Cd*m_Area_diaf/sqrt(2.*jumpPres/density);
549  }
550 
551  /* Jac *= dCoef; */
552 
553  WM.PutCoef(1, 1, Jac);
554  WM.PutCoef(1, 2, -Jac);
555  WM.PutCoef(2, 1, -Jac);
556  WM.PutCoef(2, 2, Jac);
557 
558  return WorkMat;
559 }
560 
563  doublereal dCoef,
564  const VectorHandler& XCurr,
565  const VectorHandler& XPrimeCurr)
566 {
567  DEBUGCOUT("Entering Orifice::AssRes()" << std::endl);
568 
569  WorkVec.Resize(2);
570 
571  integer iNode1RowIndex = m_pNode1->iGetFirstRowIndex() + 1;
572  integer iNode2RowIndex = m_pNode2->iGetFirstRowIndex() + 1;
573 
574  doublereal p1 = m_pNode1->dGetX();
575  doublereal p2 = m_pNode2->dGetX();
576 
577  doublereal jumpPres = fabs(p1 - p2);
578 
579  doublereal density = HF->dGetDensity((p1 + p2)/2.);
580 
581  if (jumpPres < CriticJump) {
582  /* moto sicuramente laminare (residuo) */
583 #ifdef HYDR_DEVEL
584  DEBUGCOUT("we are in orifice laminar" << std::endl);
585 #endif
586  flow = density*2.*(delta*delta)*diameter*m_Area_diaf*(p1 - p2)/viscosity;
587  turbulent = false;
588 
589  } else {
590  /* moto sicuramente turbolento (residuo) */
591 #ifdef HYDR_DEVEL
592  DEBUGCOUT("we are in orifice turbulent:" << std::endl);
593 #endif
594  flow = density*Cd*m_Area_diaf*copysign(sqrt(2.*jumpPres/density), p1 - p2);
595  turbulent = true;
596  }
597 
598  vel = flow/(density*m_Area_pipe);
599  Re = fabs(density*vel*diameter/viscosity);
600 
601 #ifdef HYDR_DEVEL
602  DEBUGCOUT("jumpPres: " << jumpPres << std::endl);
603  DEBUGCOUT("density: " << density << std::endl);
604  DEBUGCOUT("Cd: " << Cd << std::endl);
605  DEBUGCOUT("p1: " << p1 << std::endl);
606  DEBUGCOUT("p2: " << p2 << std::endl);
607  DEBUGCOUT("Cc: " << Cc << std::endl);
608  DEBUGCOUT("CriticJump: " << CriticJump << std::endl);
609  DEBUGCOUT("delta: " << delta << std::endl);
610  DEBUGCOUT("viscosity: " << viscosity << std::endl);
611  DEBUGCOUT("rad: " << rad << std::endl);
612  DEBUGCOUT("area_pipe: " << m_Area_pipe << std::endl);
613  DEBUGCOUT("area_diaf: " << m_Area_diaf << std::endl);
614  DEBUGCOUT("RES area_pipe : " << m_Area_pipe << std::endl);
615  DEBUGCOUT("RES flow: " << flow << std::endl);
616  DEBUGCOUT("RES Reynolds: " << Re << std::endl);
617  DEBUGCOUT("******************************************" << std::endl);
618  DEBUGCOUT("RES velocita': " << vel << std::endl);
619  DEBUGCOUT(" se positiva il fluido va dal nodo 1 al nodo 2" << std::endl);
620  DEBUGCOUT("*********************************************" << std::endl);
621 #endif
622 
623  WorkVec.PutItem(1, iNode1RowIndex, flow);
624  WorkVec.PutItem(2, iNode2RowIndex, -flow);
625 
626  return WorkVec;
627 }
628 
629 void
631 {
632  if (bToBeOutput()) {
633  std::ostream& out = OH.Hydraulic();
634  out << std::setw(8) << GetLabel() /* 1 */
635  << " " << vel /* 2 */
636  << " " << flow /* 3 */
637  << " " << Re /* 4 */
638  << " " << turbulent /* 5 */
639  << std::endl;
640  }
641 }
642 
643 /* Orifice - end */
644 
doublereal m_dKappa
Definition: hminor.h:119
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hminor.cc:342
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
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 bool bToBeOutput(void) const
Definition: output.cc:890
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: hminor.cc:501
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
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
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
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
void Resize(integer iNewRow, integer iNewCol)
Definition: submat.cc:138
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
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
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
#define NO_OP
Definition: myassert.h:74
doublereal m_dKappa21
Definition: hminor.h:112
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
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
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
Definition: submat.h:1445
doublereal Re
Definition: hminor.h:185
doublereal m_dKappa
Definition: hminor.h:55
virtual unsigned int iGetNumDof(void) const
Definition: hminor.cc:268
doublereal m_dKappa12
Definition: hminor.h:111
virtual unsigned int iGetNumDof(void) const
Definition: hminor.cc:88
bool turbulent
Definition: hminor.h:186
virtual doublereal dGetDensity(void) const =0
doublereal m_Area
Definition: hminor.h:51
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: hminor.cc:94
virtual const doublereal & dGetX(void) const
Definition: node.h:492
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
HydraulicFluid * HF
Definition: preselem.h:79
virtual void Output(OutputHandler &OH) const
Definition: hminor.cc:207
Definition: mbdyn.h:76
virtual std::ostream & Restart(std::ostream &out) const
Definition: hminor.cc:489
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
virtual std::ostream & Restart(std::ostream &out) const
Definition: hminor.cc:82
const PressureNode * m_pNode1
Definition: hminor.h:46
#define DEBUGCOUT(msg)
Definition: myassert.h:232
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
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
~MinorLoss(void)
Definition: hminor.cc:68
#define ASSERT(expression)
Definition: colamd.c:977
virtual doublereal dGetViscosity(void) const =0
doublereal diameter
Definition: hminor.h:174
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
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
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual void Output(OutputHandler &OH) const
Definition: hminor.cc:403
doublereal Cd
Definition: hminor.h:182
virtual Node::Type GetNodeType(void) const
Definition: presnode.h:54
doublereal m_Area
Definition: hminor.h:115
doublereal vel
Definition: hminor.h:118
std::ostream & Hydraulic(void) const
Definition: output.h:492
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
unsigned int GetLabel(void) const
Definition: withlab.cc:62
doublereal m_Area_diaf
Definition: hminor.h:176
virtual void Resize(integer iNewSize)=0
doublereal flow
Definition: hminor.h:183
const PressureNode * m_pNode2
Definition: hminor.h:173
doublereal vel
Definition: hminor.h:54
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88