mbsimhydraulics  3.2.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       virtual std::string getType() const { return "LeakageLine"; }
00040 
00041       void setGapLengthSignal(MBSimControl::Signal * s) {glSignal=s; }
00042       double getGapLength() const;
00043       void setSurface1VelocitySignal(MBSimControl::Signal * s) {s1vSignal=s; }
00044       double getSurface1Velocity() const;
00045       void setSurface2VelocitySignal(MBSimControl::Signal * s) {s2vSignal=s; }
00046       double getSurface2Velocity() const;
00047 
00048       void init(MBSim::InitStage stage);
00049 
00050       void initializeUsingXML(MBXMLUtils::TiXmlElement * element);
00051     protected:
00052       LeakagePressureLoss * lpl;
00053     private:
00054       MBSimControl::Signal *s1vSignal, *s2vSignal, *glSignal;
00055       std::string s1vPath, s2vPath, glPath;
00056   };
00057 
00059   class PlaneLeakageLine : public LeakageLine {
00060     public:
00061       PlaneLeakageLine(const std::string &name="") : LeakageLine(name), hGap(0), wGap(0) {};
00062       virtual std::string getType() const { return "PlaneLeakageLine"; }
00063 
00064       void setGapWidth(double wGap_) {wGap=wGap_; }
00065       double getGapWidth() const {return wGap; }
00066       void setGapHeight(double hGap_) {hGap=hGap_; }
00067       double getGapHeight() const {return hGap; }
00068       void setPlaneLeakagePressureLoss(PlaneLeakagePressureLoss * plpl);
00069 
00070       void init(MBSim::InitStage stage);
00071 
00072       void initializeUsingXML(MBXMLUtils::TiXmlElement * element);
00073     private:
00074       double hGap, wGap;
00075   };
00076 
00078   class CircularLeakageLine : public LeakageLine {
00079     public:
00080       CircularLeakageLine(const std::string &name="") : LeakageLine(name), rI(0), rO(0), hGap(0) {}
00081       virtual std::string getType() const { return "CircularLeakageLine"; }
00082 
00083       void setInnerRadius(double rI_) {rI=rI_; }
00084       double getInnerRadius() const {return rI; }
00085       void setGapHeight(double hGap_) {hGap=hGap_; }
00086       double getGapHeight() const {return hGap; }
00087       double getOuterRadius() const {return rO; }
00088       void setCircularLeakagePressureLoss(CircularLeakagePressureLoss * clpl);
00089 
00090       void init(MBSim::InitStage stage);
00091 
00092       void initializeUsingXML(MBXMLUtils::TiXmlElement * element);
00093     private:
00094       double rI, rO, hGap;
00095   };
00096 
00097 }
00098 
00099 #endif   /* ----- #ifndef _LEAKAGE_H_  ----- */
00100