mbsimhydraulics  4.0.0
MBSim Hydraulics Module
controlvalve43.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 _CONTROLVALVE43_H_
21#define _CONTROLVALVE43_H_
22
23#include "mbsim/group.h"
24#include <mbsim/functions/function.h>
25
26namespace MBSimHydraulics {
27
28 class ClosableRigidLine;
29 class RigidNode;
30 class HLine;
31
34 public:
35 Controlvalve43(const std::string& name="");
36
37 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
38 void initializeUsingXML(xercesc::DOMElement * element) override;
39
40 void setLength(double l_);
41 void setDiameter(double d_);
42 void setAlpha(double alpha_, double alphaBack_=0);
43 void setPARelativeAlphaFunction(MBSim::Function<double(double)> * relAlphaPA_) {
44 relAlphaPA=std::shared_ptr<MBSim::Function<double(double)>>(relAlphaPA_);
45 relAlphaPA->setParent(this);
46 relAlphaPA->setName("PARealtvieAlpha");
47 }
48 void setMinimalRelativeAlpha(double minRelAlpha_);
49 void setOffset(double off) {offset=off; }
50 void setRelativePositionFunction(MBSim::Function<double(double)> * s) {
51 position = std::shared_ptr<MBSim::Function<double(double)>>(s);
52 position->setParent(this);
53 position->setName("Position");
54 }
55 void setSetValued(bool setValued=true);
56 void setPInflow(HLine * hl);
57 void setAOutflow(HLine * hl);
58 void setBOutflow(HLine * hl);
59 void setTOutflow(HLine * hl);
60 void printRelativeAlphaCharacteristikCurve(bool print=true) {pRACC=print; }
61
62 protected:
63 ClosableRigidLine * lPA, * lPB, * lAT, * lBT;
64 RigidNode * nP, * nA, * nB, * nT;
65 double offset;
66 std::shared_ptr<MBSim::Function<double(double)>> relAlphaPA, position;
67 MBSim::Function<double(double)> * checkSizeFunctionPA, * checkSizeFunctionPB, * checkSizeFunctionAT, * checkSizeFunctionBT;
68
69 private:
70 std::string nPInflowString, nAOutflowString, nBOutflowString, nTOutflowString;
71 bool pRACC;
72 };
73}
74
75#endif /* ----- #ifndef _CONTROLVALVE43_H_ ----- */
76
Definition: rigid_line.h:54
Definition: controlvalve43.h:33
Definition: hline.h:40
Definition: hnode.h:179
std::string name