mbsimhydraulics  4.0.0
leakage_line.h
00001 /* Copyright (C) 2004-2009 MBSim Development Team
00002  *
00003  * This library is free software; you can redistribute it and/or 
00004  * modify it under the terms of the GNU Lesser General Public 
00005  * License as published by the Free Software Foundation; either 
00006  * version 2.1 of the License, or (at your option) any later version. 
00007  *  
00008  * This library is distributed in the hope that it will be useful, 
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011  * Lesser General Public License for more details. 
00012  *  
00013  * You should have received a copy of the GNU Lesser General Public 
00014  * License along with this library; if not, write to the Free Software 
00015  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
00016  *
00017  * Contact: markus.ms.schneider@gmail.com
00018  */
00019 
00020 #ifndef  _LEAKAGE_LINE_H_
00021 #define  _LEAKAGE_LINE_H_
00022 
00023 #include "mbsimHydraulics/hline.h"
00024 
00025 namespace MBSimControl {
00026   class Signal;
00027 }
00028 
00029 namespace MBSimHydraulics {
00030 
00031   class LeakagePressureLoss;
00032   class PlaneLeakagePressureLoss;
00033   class CircularLeakagePressureLoss;
00034 
00036   class LeakageLine : public RigidHLine {
00037     public:
00038       LeakageLine(const std::string &name) : RigidHLine(name), lpl(NULL), s1vSignal(NULL), s2vSignal(NULL), glSignal(NULL), s1vPath(""), s2vPath(""), glPath("") {}
00039       ~LeakageLine();
00040       virtual std::string getType() const { return "LeakageLine"; }
00041 
00042       void setGapLengthSignal(MBSimControl::Signal * s) {glSignal=s; }
00043       double getGapLength() const;
00044       void setSurface1VelocitySignal(MBSimControl::Signal * s) {s1vSignal=s; }
00045       double getSurface1Velocity() const;
00046       void setSurface2VelocitySignal(MBSimControl::Signal * s) {s2vSignal=s; }
00047       double getSurface2Velocity() const;
00048 
00049       void init(InitStage stage);
00050 
00051       void initializeUsingXML(xercesc::DOMElement * element);
00052     protected:
00053       LeakagePressureLoss * lpl;
00054     private:
00055       MBSimControl::Signal *s1vSignal, *s2vSignal, *glSignal;
00056       std::string s1vPath, s2vPath, glPath;
00057   };
00058 
00060   class PlaneLeakageLine : public LeakageLine {
00061     public:
00062       PlaneLeakageLine(const std::string &name="") : LeakageLine(name), hGap(0), wGap(0) {};
00063       virtual std::string getType() const { return "PlaneLeakageLine"; }
00064 
00065       void setGapWidth(double wGap_) {wGap=wGap_; }
00066       double getGapWidth() const {return wGap; }
00067       void setGapHeight(double hGap_) {hGap=hGap_; }
00068       double getGapHeight() const {return hGap; }
00069       void setPlaneLeakagePressureLoss(PlaneLeakagePressureLoss * plpl);
00070 
00071       void init(InitStage stage);
00072 
00073       void initializeUsingXML(xercesc::DOMElement * element);
00074     private:
00075       double hGap, wGap;
00076   };
00077 
00079   class CircularLeakageLine : public LeakageLine {
00080     public:
00081       CircularLeakageLine(const std::string &name="") : LeakageLine(name), rI(0), rO(0), hGap(0) {}
00082       virtual std::string getType() const { return "CircularLeakageLine"; }
00083 
00084       void setInnerRadius(double rI_) {rI=rI_; }
00085       double getInnerRadius() const {return rI; }
00086       void setGapHeight(double hGap_) {hGap=hGap_; }
00087       double getGapHeight() const {return hGap; }
00088       double getOuterRadius() const {return rO; }
00089       void setCircularLeakagePressureLoss(CircularLeakagePressureLoss * clpl);
00090 
00091       void init(InitStage stage);
00092 
00093       void initializeUsingXML(xercesc::DOMElement * element);
00094     private:
00095       double rI, rO, hGap;
00096   };
00097 
00098 }
00099 
00100 #endif   /* ----- #ifndef _LEAKAGE_H_  ----- */
00101