MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
hfluid.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/hydr/hfluid.h,v 1.25 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 HFLUID_H
38 #define HFLUID_H
39 
40 #include "ac/f2c.h"
41 
42 #include "withlab.h"
43 
44 /* HydraulicFluid - begin */
45 
46 class HydraulicFluid : public WithLabel {
47 protected:
50 
51 public:
52  HydraulicFluid(unsigned int Label,
53  const doublereal dPres0 = -1.,
54  const doublereal dTemp0 = -1.);
55  HydraulicFluid(const HydraulicFluid& HF);
56 
57  virtual ~HydraulicFluid();
58 
59  /* crea una copia dell'HF */
60  virtual HydraulicFluid* pCopy(void) const = 0;
61 
62  /* funzioni relative alla densita'; possono essere usate senza argomenti
63  * (fluido incomprimibile), con un argomento, o con due (effetto di T) */
64  virtual doublereal dGetDensity(void) const = 0;
65  virtual doublereal dGetDensity(const doublereal& dPres) const = 0;
66  virtual doublereal dGetDensity(const doublereal& dPres,
67  const doublereal& dTemp) const = 0;
68  virtual doublereal dGetDensityDPres(void) const = 0;
69  virtual doublereal dGetDensityDPres(const doublereal& dPres) const = 0;
70  virtual doublereal dGetDensityDPres(const doublereal& dPres,
71  const doublereal& dTemp) const = 0;
72  virtual doublereal dGetDensityDTemp(void) const = 0;
73  virtual doublereal dGetDensityDTemp(const doublereal& dPres) const = 0;
74  virtual doublereal dGetDensityDTemp(const doublereal& dPres,
75  const doublereal& dTemp) const = 0;
76  virtual doublereal dGetViscosity(void) const = 0;
77  virtual doublereal dGetViscosity(const doublereal& dPres) const = 0;
78  virtual doublereal dGetViscosity(const doublereal& dPres,
79  const doublereal& dTemp) const = 0;
80 
81  enum Re { UPPER, LOWER };
82  virtual inline doublereal dGetRe(Re which);
83 
84 #if 0
85  virtual doublereal dGetRe(Re which, const doublereal& dPres) = 0;
86  virtual doublereal dGetRe(Re which, const doublereal& dPres,
87  const doublereal& dTemp) = 0;
88 #endif
89 
90  virtual doublereal dGetPres0(void) const;
91  virtual doublereal dGetTemp0(void) const;
92 };
93 
94 inline doublereal
96 {
97  switch (which) {
99  return 2000.;
100 
102  return 4000.;
103 
104  default:
106  }
107 }
108 
109 /* legge un fluido idraulico; non va usata direttamente, viene invece
110  * gestita dal parser specializzato di MBDyn, MBDynParser (mbpar.h) */
111 class MBDynParser;
112 extern HydraulicFluid * ReadHydraulicFluid(MBDynParser& HP, unsigned int uLabel);
113 
114 /* HydraulicFluid - end */
115 
116 #endif /* HFLUID_H */
117 
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual doublereal dGetRe(Re which)
Definition: hfluid.h:95
virtual doublereal dGetDensityDPres(void) const =0
HydraulicFluid * ReadHydraulicFluid(MBDynParser &HP, unsigned int uLabel)
Definition: hfluid.cc:85
HydraulicFluid(unsigned int Label, const doublereal dPres0=-1., const doublereal dTemp0=-1.)
Definition: hfluid.cc:48
virtual doublereal dGetDensity(void) const =0
virtual HydraulicFluid * pCopy(void) const =0
virtual doublereal dGetTemp0(void) const
Definition: hfluid.cc:75
const doublereal dPres0
Definition: hfluid.h:48
virtual ~HydraulicFluid()
Definition: hfluid.cc:62
virtual doublereal dGetViscosity(void) const =0
virtual doublereal dGetDensityDTemp(void) const =0
virtual doublereal dGetPres0(void) const
Definition: hfluid.cc:68
const doublereal dTemp0
Definition: hfluid.h:49
double doublereal
Definition: colamd.c:52