All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
leakage_line.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: markus.ms.schneider@gmail.com
18  */
19 
20 #ifndef _LEAKAGE_LINE_H_
21 #define _LEAKAGE_LINE_H_
22 
23 #include "mbsimHydraulics/hline.h"
24 #include <mbsim/functions/function.h>
25 
26 namespace MBSimHydraulics {
27 
28  class LeakagePressureLoss;
29  class PlaneLeakagePressureLoss;
30  class CircularLeakagePressureLoss;
31 
33  class LeakageLine : public RigidHLine {
34  public:
35  LeakageLine(const std::string &name) : RigidHLine(name), lpl(NULL), s1vFunction(NULL), s2vFunction(NULL), glFunction(NULL) {}
36  ~LeakageLine();
37  virtual std::string getType() const { return "LeakageLine"; }
38 
39  void setGapLengthFunction(MBSim::Function<double(double)> * s) {
40  glFunction=s;
41  glFunction->setParent(this);
42  glFunction->setName("glFunction");
43  }
44  double evalGapLength() const;
45  void setSurface1VelocityFunction(MBSim::Function<double(double)> * s) {
46  s1vFunction=s;
47  s1vFunction->setParent(this);
48  s1vFunction->setName("s1vFunction");
49  }
50  double evalSurface1Velocity() const;
51  void setSurface2VelocityFunction(MBSim::Function<double(double)> * s) {
52  s2vFunction=s;
53  s2vFunction->setParent(this);
54  s2vFunction->setName("s2vFunction");
55  }
56  double evalSurface2Velocity() const;
57 
58  void init(InitStage stage);
59 
60  void initializeUsingXML(xercesc::DOMElement * element);
61  protected:
62  LeakagePressureLoss * lpl;
63  private:
64  MBSim::Function<double(double)> *s1vFunction, *s2vFunction, *glFunction;
65  };
66 
68  class PlaneLeakageLine : public LeakageLine {
69  public:
70  PlaneLeakageLine(const std::string &name="") : LeakageLine(name), hGap(0), wGap(0) {};
71  virtual std::string getType() const { return "PlaneLeakageLine"; }
72 
73  void setGapWidth(double wGap_) {wGap=wGap_; }
74  double getGapWidth() const {return wGap; }
75  void setGapHeight(double hGap_) {hGap=hGap_; }
76  double getGapHeight() const {return hGap; }
77  void setPlaneLeakagePressureLoss(PlaneLeakagePressureLoss * plpl);
78 
79  void init(InitStage stage);
80 
81  void initializeUsingXML(xercesc::DOMElement * element);
82  private:
83  double hGap, wGap;
84  };
85 
88  public:
89  CircularLeakageLine(const std::string &name="") : LeakageLine(name), rI(0), rO(0), hGap(0) {}
90  virtual std::string getType() const { return "CircularLeakageLine"; }
91 
92  void setInnerRadius(double rI_) {rI=rI_; }
93  double getInnerRadius() const {return rI; }
94  void setGapHeight(double hGap_) {hGap=hGap_; }
95  double getGapHeight() const {return hGap; }
96  double getOuterRadius() const {return rO; }
97  void setCircularLeakagePressureLoss(CircularLeakagePressureLoss * clpl);
98 
99  void init(InitStage stage);
100 
101  void initializeUsingXML(xercesc::DOMElement * element);
102  private:
103  double rI, rO, hGap;
104  };
105 
106 }
107 
108 #endif /* ----- #ifndef _LEAKAGE_H_ ----- */
109 
Definition: leakage_line.h:33
Definition: hline.h:91
Definition: pressure_loss.h:273
Definition: pressure_loss.h:282
Definition: leakage_line.h:87
Definition: leakage_line.h:68
Definition: pressure_loss.h:293

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML