All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
dimensionless_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 _DIMENSIONLESS_LINE_H_
21 #define _DIMENSIONLESS_LINE_H_
22 
23 #include "mbsimHydraulics/hline.h"
24 
25 namespace MBSimHydraulics {
26 
28  class DimensionlessLine : public HLine {
29  public:
30  DimensionlessLine(const std::string &name) : HLine(name), length(0) {}
31  virtual std::string getType() const { return "DimensionlessLine"; }
32 
33  void setLength(double length_) {length=length_; }
34  double getLength() const {return length; }
35 
36  virtual fmatvec::VecV getInflowFactor() {return fmatvec::VecV(1, fmatvec::INIT, -1.); }
37  virtual fmatvec::VecV getOutflowFactor() {return fmatvec::VecV(1, fmatvec::INIT, 1.); }
38  void calcqSize() {qSize=0; }
39  void calcuSize(int j) {uSize[j]=0; }
40 
41  void initializeUsingXML(xercesc::DOMElement *element);
42  void init(InitStage stage);
43  void plot();
44  protected:
45  double length;
46  };
47 
48  class LeakagePressureLoss;
51 
52  class Leakage0DOF : public DimensionlessLine {
53  public:
54  Leakage0DOF(const std::string &name) : DimensionlessLine(name), lpl(NULL), s1vFunction(NULL), s2vFunction(NULL), glFunction(NULL) {}
55  ~Leakage0DOF();
56  virtual std::string getType() const { return "Leakage0DOF"; }
57 
58  void setGapLengthFunction(MBSim::Function<double(double)> * s) {
59  glFunction=s;
60  glFunction->setParent(this);
61  }
62  double evalGapLength() const;
63  void setSurface1VelocityFunction(MBSim::Function<double(double)> * s) {
64  s1vFunction=s;
65  s1vFunction->setParent(this);
66  }
67  double evalSurface1Velocity() const;
68  void setSurface2VelocityFunction(MBSim::Function<double(double)> * s) {
69  s2vFunction=s;
70  s2vFunction->setParent(this);
71  }
72  double evalSurface2Velocity() const;
73 
74  void init(InitStage stage);
75 
76  void updateQ();
77 
78  void initializeUsingXML(xercesc::DOMElement * element);
79  protected:
80  LeakagePressureLoss * lpl;
81  private:
82  MBSim::Function<double(double)> *s1vFunction, *s2vFunction, *glFunction;
83  };
84 
85  class PlaneLeakage0DOF : public Leakage0DOF {
86  public:
87  PlaneLeakage0DOF(const std::string &name="") : Leakage0DOF(name), hGap(0), wGap(0) {}
88  virtual std::string getType() const { return "PlaneLeakage0DOF"; }
89 
90  void setGapWidth(double wGap_) {wGap=wGap_; }
91  double getGapWidth() const {return wGap; }
92  void setGapHeight(double hGap_) {hGap=hGap_; }
93  double getGapHeight() const {return hGap; }
94  void setPlaneLeakagePressureLoss(PlaneLeakagePressureLoss * plpl);
95 
96  void initializeUsingXML(xercesc::DOMElement * element);
97  private:
98  double hGap, wGap;
99  };
100 
102  public:
103  CircularLeakage0DOF(const std::string &name="") : Leakage0DOF(name), rI(0), rO(0), hGap(0) {}
104  virtual std::string getType() const { return "CircularLeakage0DOF"; }
105 
106  void setInnerRadius(double rI_) {rI=rI_; }
107  double getInnerRadius() const {return rI; }
108  void setGapHeight(double hGap_) {hGap=hGap_; }
109  double getGapHeight() const {return hGap; }
110  double getOuterRadius() const {return rO; }
111  void setCircularLeakagePressureLoss(CircularLeakagePressureLoss * clpl);
112 
113  void init(InitStage stage);
114 
115  void initializeUsingXML(xercesc::DOMElement * element);
116  private:
117  double rI, rO, hGap;
118  };
119 
120 }
121 
122 #endif /* ----- #ifndef _DIMENSIONLESS_LINE_H_ ----- */
123 
Definition: hline.h:37
Definition: dimensionless_line.h:101
Definition: pressure_loss.h:273
Definition: pressure_loss.h:282
Definition: dimensionless_line.h:85
Definition: dimensionless_line.h:52
Definition: dimensionless_line.h:28
Definition: pressure_loss.h:293

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML