mbsimhydraulics  3.0.0
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 
25 namespace MBSimControl {
26  class Signal;
27 }
28 
29 namespace MBSimHydraulics {
30 
31  class LeakagePressureLoss;
32  class PlaneLeakagePressureLoss;
33  class CircularLeakagePressureLoss;
34 
36  class LeakageLine : public RigidHLine {
37  public:
38  LeakageLine(const std::string &name) : RigidHLine(name), lpl(NULL), s1vSignal(NULL), s2vSignal(NULL), glSignal(NULL), s1vPath(""), s2vPath(""), glPath("") {}
39  virtual std::string getType() const { return "LeakageLine"; }
40 
41  void setGapLengthSignal(MBSimControl::Signal * s) {glSignal=s; }
42  double getGapLength() const;
43  void setSurface1VelocitySignal(MBSimControl::Signal * s) {s1vSignal=s; }
44  double getSurface1Velocity() const;
45  void setSurface2VelocitySignal(MBSimControl::Signal * s) {s2vSignal=s; }
46  double getSurface2Velocity() const;
47 
48  void init(MBSim::InitStage stage);
49 
50  void initializeUsingXML(TiXmlElement * element);
51  protected:
52  LeakagePressureLoss * lpl;
53  private:
54  MBSimControl::Signal *s1vSignal, *s2vSignal, *glSignal;
55  std::string s1vPath, s2vPath, glPath;
56  };
57 
59  class PlaneLeakageLine : public LeakageLine {
60  public:
61  PlaneLeakageLine(const std::string &name) : LeakageLine(name), hGap(0), wGap(0) {};
62  virtual std::string getType() const { return "PlaneLeakageLine"; }
63 
64  void setGapWidth(double wGap_) {wGap=wGap_; }
65  double getGapWidth() const {return wGap; }
66  void setGapHeight(double hGap_) {hGap=hGap_; }
67  double getGapHeight() const {return hGap; }
68  void setPlaneLeakagePressureLoss(PlaneLeakagePressureLoss * plpl);
69 
70  void init(MBSim::InitStage stage);
71 
72  void initializeUsingXML(TiXmlElement * element);
73  private:
74  double hGap, wGap;
75  };
76 
79  public:
80  CircularLeakageLine(const std::string &name) : LeakageLine(name), rI(0), rO(0), hGap(0) {}
81  virtual std::string getType() const { return "CircularLeakageLine"; }
82 
83  void setInnerRadius(double rI_) {rI=rI_; }
84  double getInnerRadius() const {return rI; }
85  void setGapHeight(double hGap_) {hGap=hGap_; }
86  double getGapHeight() const {return hGap; }
87  double getOuterRadius() const {return rO; }
88  void setCircularLeakagePressureLoss(CircularLeakagePressureLoss * clpl);
89 
90  void init(MBSim::InitStage stage);
91 
92  void initializeUsingXML(TiXmlElement * element);
93  private:
94  double rI, rO, hGap;
95  };
96 
97 }
98 
99 #endif /* ----- #ifndef _LEAKAGE_H_ ----- */
100