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), Q(1), 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::Vec getQIn() {return Q; }
37  virtual fmatvec::Vec getQOut() {return -Q; }
38  virtual fmatvec::Vec getInflowFactor() {return fmatvec::Vec(1, fmatvec::INIT, -1.); }
39  virtual fmatvec::Vec getOutflowFactor() {return fmatvec::Vec(1, fmatvec::INIT, 1.); }
40  void calcqSize() {qSize=0; }
41  void calcuSize(int j) {uSize[j]=0; }
42 
43  void initializeUsingXML(xercesc::DOMElement *element);
44  void init(InitStage stage);
45  void plot(double t, double dt);
46  protected:
47  fmatvec::Vec Q;
48  double length;
49  };
50 
51  class LeakagePressureLoss;
54 
55  class Leakage0DOF : public DimensionlessLine {
56  public:
57  Leakage0DOF(const std::string &name) : DimensionlessLine(name), lpl(NULL), s1vSignal(NULL), s2vSignal(NULL), glSignal(NULL), s1vPath(""), s2vPath(""), glPath("") {}
58  ~Leakage0DOF();
59  virtual std::string getType() const { return "Leakage0DOF"; }
60 
61  void setGapLengthSignal(MBSimControl::Signal * s) {glSignal=s; }
62  double getGapLength() const;
63  void setSurface1VelocitySignal(MBSimControl::Signal * s) {s1vSignal=s; }
64  double getSurface1Velocity() const;
65  void setSurface2VelocitySignal(MBSimControl::Signal * s) {s2vSignal=s; }
66  double getSurface2Velocity() const;
67 
68  void init(InitStage stage);
69 
70  void updateStateDependentVariables(double t);
71 
72  void initializeUsingXML(xercesc::DOMElement * element);
73  protected:
74  LeakagePressureLoss * lpl;
75  private:
76  MBSimControl::Signal *s1vSignal, *s2vSignal, *glSignal;
77  std::string s1vPath, s2vPath, glPath;
78  };
79 
80  class PlaneLeakage0DOF : public Leakage0DOF {
81  public:
82  PlaneLeakage0DOF(const std::string &name="") : Leakage0DOF(name), hGap(0), wGap(0) {}
83  virtual std::string getType() const { return "PlaneLeakage0DOF"; }
84 
85  void setGapWidth(double wGap_) {wGap=wGap_; }
86  double getGapWidth() const {return wGap; }
87  void setGapHeight(double hGap_) {hGap=hGap_; }
88  double getGapHeight() const {return hGap; }
89  void setPlaneLeakagePressureLoss(PlaneLeakagePressureLoss * plpl);
90 
91  void initializeUsingXML(xercesc::DOMElement * element);
92  private:
93  double hGap, wGap;
94  };
95 
97  public:
98  CircularLeakage0DOF(const std::string &name="") : Leakage0DOF(name), rI(0), rO(0), hGap(0) {}
99  virtual std::string getType() const { return "CircularLeakage0DOF"; }
100 
101  void setInnerRadius(double rI_) {rI=rI_; }
102  double getInnerRadius() const {return rI; }
103  void setGapHeight(double hGap_) {hGap=hGap_; }
104  double getGapHeight() const {return hGap; }
105  double getOuterRadius() const {return rO; }
106  void setCircularLeakagePressureLoss(CircularLeakagePressureLoss * clpl);
107 
108  void init(InitStage stage);
109 
110  void initializeUsingXML(xercesc::DOMElement * element);
111  private:
112  double rI, rO, hGap;
113  };
114 
115 }
116 
117 #endif /* ----- #ifndef _DIMENSIONLESS_LINE_H_ ----- */
118 
Vector< Ref, double > Vec
Definition: hline.h:41
Definition: dimensionless_line.h:96
Definition: pressure_loss.h:273
Definition: pressure_loss.h:282
Definition: dimensionless_line.h:80
Definition: dimensionless_line.h:55
Definition: dimensionless_line.h:28
Definition: pressure_loss.h:293

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML