100 const char* sKeyWords[] = {
102 "three" "way" "minor" "loss",
104 "control" "valve" "2",
105 "dynamic" "control" "valve",
106 "pressure" "flow" "control",
125 DYNAMIC_CONTROL_VALVE,
126 PRESSURE_FLOW_CONTROL_VALVE,
146 if (CurrKeyWord >= 0) {
147 std::cout <<
"hydraulic element type: "
148 << sKeyWords[CurrKeyWord] << std::endl;
154 switch (CurrKeyWord) {
170 DEBUGCOUT(
"Offset 1: " << f1 << std::endl);
176 DEBUGCOUT(
"Offset 2: " << f2 << std::endl);
179 Vec3 axis(0., 0., 1.);
184 silent_cerr(
"Actuator(" << uLabel <<
"): "
185 "need a definite direction, not "
186 << axis <<
"!" << std::endl);
193 if (area1 <= std::numeric_limits<doublereal>::epsilon()) {
194 silent_cerr(
"Actuator(" << uLabel <<
"): "
195 "null or negative area1 "
199 DEBUGCOUT(
"Area1: " << area1 << std::endl);
203 if (area2 <= std::numeric_limits<doublereal>::epsilon()) {
204 silent_cerr(
"Actuator(" << uLabel <<
"): "
205 "null or negative area2 "
209 DEBUGCOUT(
"Area2: " << area2 << std::endl);
213 if (dl <= std::numeric_limits<doublereal>::epsilon()) {
214 silent_cerr(
"Actuator(" << uLabel <<
"): "
215 "null or negative dl "
238 pNodeHyd1, pNodeHyd2,
239 pNodeStr1, pNodeStr2,
240 f1, f2, axis, hf1, hf2,
258 silent_cerr(
"MinorLoss(" << uLabel <<
"): "
259 "negative Kappa1 at line " << HP.
GetLineData() << std::endl);
262 DEBUGCOUT(
"Kappa1: " << dKappa1 << std::endl);
267 silent_cerr(
"MinorLoss(" << uLabel <<
"): "
268 "negative Kappa2 at line " << HP.
GetLineData() << std::endl);
271 DEBUGCOUT(
"Kappa2: " << dKappa2 << std::endl);
275 if (area <= std::numeric_limits<doublereal>::epsilon()) {
276 silent_cerr(
"MinorLoss(" << uLabel <<
"): "
277 "null or negative area "
281 DEBUGCOUT(
"Area: " << area << std::endl);
290 MinorLoss(uLabel, pDO, hf, pNode1, pNode2,
291 dKappa1, dKappa2, area, fOut));
296 case THREEWAYMINORLOSS: {
310 silent_cerr(
"ThreeWayMinorLoss(" << uLabel <<
"): "
311 "negative Kappa1 at line " << HP.
GetLineData() << std::endl);
314 DEBUGCOUT(
"Kappa1: " << dKappa1 << std::endl);
319 silent_cerr(
"ThreeWayMinorLoss(" << uLabel <<
"): "
320 "negative Kappa2 at line " << HP.
GetLineData() << std::endl);
323 DEBUGCOUT(
"Kappa2: " << dKappa2 << std::endl);
327 if (area1 <= std::numeric_limits<doublereal>::epsilon()) {
328 silent_cerr(
"ThreeWayMinorLoss(" << uLabel <<
"): "
329 "null or negative area1 "
333 DEBUGCOUT(
"Area: " << area1 << std::endl);
337 if (area1 <= std::numeric_limits<doublereal>::epsilon()) {
338 silent_cerr(
"ThreeWayMinorLoss(" << uLabel <<
"): "
339 "null or negative area2 "
343 DEBUGCOUT(
"Area: " << area2 << std::endl);
353 pNode0, pNode1, pNode2,
354 dKappa1, dKappa2, area1, area2, fOut));
360 case CONTROL_VALVE2: {
376 if (area_max <= 0.) {
377 silent_cerr(
"ControlValve(" << uLabel <<
"): "
378 "null or negative area_max "
382 DEBUGCOUT(
"Area_max: " << area_max << std::endl);
388 if (loss_area < 0.) {
389 silent_cerr(
"ControlValve(" << uLabel <<
"): "
390 "negative loss_area "
394 DEBUGCOUT(
"Loss_area in %= " << loss_area << std::endl);
405 switch (CurrKeyWord) {
410 pNode1, pNode2, pNode3, pNode4,
411 area_max, loss_area, pDC, fOut));
418 pNode1, pNode2, pNode3, pNode4,
419 area_max, loss_area, pDC, fOut));
429 case DYNAMIC_CONTROL_VALVE: {
448 DEBUGCOUT(
"Start: " << start << std::endl);
453 silent_cerr(
"DynamicControlValve(" << uLabel <<
"): "
454 "negative s_max at line " << HP.
GetLineData() << std::endl);
457 DEBUGCOUT(
"S_max: " << s_max << std::endl);
462 silent_cerr(
"DynamicControlValve(" << uLabel <<
"): "
463 "null or negative width "
467 DEBUGCOUT(
"Width: " << width << std::endl);
473 if (loss_area < 0.) {
474 silent_cerr(
"DynamicControlValve(" << uLabel <<
"): "
475 "negative loss_area "
479 DEBUGCOUT(
"Loss_area in %= " << loss_area << std::endl);
484 if (valve_diameter <= 0.) {
485 silent_cerr(
"DynamicControlValve(" << uLabel <<
"): "
486 "null or negative valve diameter "
490 DEBUGCOUT(
"Valve diameter: " << valve_diameter << std::endl);
494 if (valve_density <= 0.) {
495 silent_cerr(
"DynamicControlValve(" << uLabel <<
"): "
496 "null or negative valve density "
500 DEBUGCOUT(
"Valve density: " << valve_density << std::endl);
504 DEBUGCOUT(
"c_spost: " << c_spost << std::endl);
508 DEBUGCOUT(
"c_vel: " << c_vel << std::endl);
512 DEBUGCOUT(
"c_acc: " << c_acc << std::endl);
529 c_spost, c_vel, c_acc,
534 case PRESSURE_FLOW_CONTROL_VALVE: {
560 silent_cerr(
"PressureFlowControlValve(" << uLabel <<
"): "
565 DEBUGCOUT(
"Start: " << start << std::endl);
570 silent_cerr(
"PressureFlowControlValve(" << uLabel <<
"): "
575 DEBUGCOUT(
"S_max: " << s_max << std::endl);
580 silent_cerr(
"PressureFlowControlValve(" << uLabel <<
"): "
581 "null or negative width "
585 DEBUGCOUT(
"Width: " << width << std::endl);
591 if (loss_area < 0.) {
592 silent_cerr(
"PressureFlowControlValve(" << uLabel <<
"): "
593 "negative loss_area "
597 DEBUGCOUT(
"Loss_area in %= " << loss_area << std::endl);
602 if (valve_diameter <= 0.) {
603 silent_cerr(
"PressureFlowControlValve(" << uLabel <<
"): "
604 "null or negative valve diameter "
608 DEBUGCOUT(
"Valve diameter: " << valve_diameter << std::endl);
612 if (valve_density <= 0.) {
613 silent_cerr(
"PressureFlowControlValve(" << uLabel <<
"): "
614 "null or negative valve density "
618 DEBUGCOUT(
"Valve density: " << valve_density << std::endl);
622 DEBUGCOUT(
"c_spost: " << c_spost << std::endl);
626 DEBUGCOUT(
"c_vel: " << c_vel << std::endl);
630 DEBUGCOUT(
"c_acc: " << c_acc << std::endl);
648 c_spost, c_vel, c_acc,
654 case PRESSURE_VALVE: {
664 if (area_diaf <= 0.) {
665 silent_cerr(
"PressureValve(" << uLabel <<
"): "
666 "null or negative area_diaf "
670 DEBUGCOUT(
"Area_diaf: " << area_diaf << std::endl);
675 silent_cerr(
"PressureValve(" << uLabel <<
"): "
676 "null or negative valve mass "
680 DEBUGCOUT(
"Valve mass: " << mass << std::endl);
684 if (area_max <= 0.) {
685 silent_cerr(
"PressureValve(" << uLabel <<
"): "
686 "null or negative area_max "
690 DEBUGCOUT(
"Area_max: " << area_max << std::endl);
695 silent_cerr(
"PressureValve(" << uLabel <<
"): "
700 DEBUGCOUT(
"S_max: " << s_max << std::endl);
705 silent_cerr(
"PressureValve(" << uLabel <<
"): "
710 DEBUGCOUT(
"Kappa: " << Kappa << std::endl);
715 silent_cerr(
"PressureValve(" << uLabel <<
"): "
720 DEBUGCOUT(
"Force0: " << force0 << std::endl);
725 silent_cerr(
"PressureValve(" << uLabel <<
"): "
726 "null or negative width "
730 DEBUGCOUT(
"Width: " << width << std::endl);
734 DEBUGCOUT(
"c_spost: " << c_spost << std::endl);
738 DEBUGCOUT(
"c_vel: " << c_vel << std::endl);
742 DEBUGCOUT(
"c_acc: " << c_acc << std::endl);
752 area_diaf, mass, area_max,
753 s_max, Kappa, force0, width,
754 c_spost, c_vel, c_acc,
773 if (area_diaf <= 0.) {
774 silent_cerr(
"FlowValve(" << uLabel <<
"): "
775 "null or negative area_diaf "
779 DEBUGCOUT(
"Area_diaf: " << area_diaf << std::endl);
784 silent_cerr(
"FlowValve(" << uLabel <<
"): "
785 "null or negative valve mass "
789 DEBUGCOUT(
"Valve mass: " << mass << std::endl);
793 if (area_pipe <= 0.) {
794 silent_cerr(
"FlowValve(" << uLabel <<
"): "
795 "null or negative area_pipe "
799 DEBUGCOUT(
"Area_pipe: " << area_pipe << std::endl);
803 if (area_max <= 0.) {
804 silent_cerr(
"FlowValve(" << uLabel <<
"): "
805 "null or negative area_max "
809 DEBUGCOUT(
"Area_max: " << area_max << std::endl);
814 silent_cerr(
"FlowValve(" << uLabel <<
"): "
815 "null or negative Kappa "
819 DEBUGCOUT(
"Kappa: " << Kappa << std::endl);
824 silent_cerr(
"FlowValve(" << uLabel <<
"): "
829 DEBUGCOUT(
"Force0: " << force0 << std::endl);
834 silent_cerr(
"FlowValve(" << uLabel <<
"): "
835 "null or negative width "
839 DEBUGCOUT(
"Width: " << width << std::endl);
844 silent_cerr(
"FlowValve(" << uLabel <<
"): "
849 DEBUGCOUT(
"s_max: " << s_max << std::endl);
853 DEBUGCOUT(
"c_spost: " << c_spost << std::endl);
857 DEBUGCOUT(
"c_vel: " << c_vel << std::endl);
861 DEBUGCOUT(
"c_acc: " << c_acc << std::endl);
871 pNode1, pNode2, pNode3,
872 area_diaf, mass,area_pipe, area_max,
873 Kappa, force0, width, s_max,
874 c_spost, c_vel, c_acc,
890 if (diameter <= 0.) {
891 silent_cerr(
"Orifice(" << uLabel <<
"): "
892 "null or negative diameter "
896 DEBUGCOUT(
"Diameter: " << diameter << std::endl);
900 if (area_diaf <= 0.) {
901 silent_cerr(
"Orifice(" << uLabel <<
"): "
902 "null or negative area_diaf "
906 DEBUGCOUT(
"Area_diaf: " << area_diaf << std::endl);
909 doublereal area_pipe = diameter*diameter*0.785;
915 silent_cerr(
"Orifice(" << uLabel <<
"): "
916 "null or negative area_pipe "
921 DEBUGCOUT(
"Area_pipe: " << area_pipe << std::endl);
929 silent_cerr(
"Orifice(" << uLabel <<
"): "
930 "null or negative Reynold's number "
935 DEBUGCOUT(
"Reynold critico: " << ReCr << std::endl);
947 area_diaf, area_pipe, ReCr, fOut));
959 silent_cerr(
"Accumulator(" << uLabel <<
"): "
960 "null or negative stroke "
964 DEBUGCOUT(
"Stroke: " << stroke << std::endl);
972 silent_cerr(
"Accumulator(" << uLabel <<
"): "
973 "stroke less then initial position "
978 DEBUGCOUT(
"start: " << start << std::endl);
983 silent_cerr(
"Accumulator(" << uLabel <<
"): "
984 "null or negative area "
988 DEBUGCOUT(
"Area: " << area << std::endl);
992 if (area_pipe <= 0.) {
993 silent_cerr(
"Accumulator(" << uLabel <<
"): "
994 "null or negative area_pipe "
998 DEBUGCOUT(
"area_pipe: " << area_pipe << std::endl);
1003 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1004 "null or negative mass "
1008 DEBUGCOUT(
"Mass: " << mass << std::endl);
1016 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1022 DEBUGCOUT(
"Loss_in: " << h_in << std::endl);
1030 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1031 "negative loss_out "
1036 DEBUGCOUT(
"loss_out: " << h_out << std::endl);
1047 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1048 "null or negative pressure0 "
1052 DEBUGCOUT(
"press0: " << press0 << std::endl);
1056 if (press_max <= 0.) {
1057 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1058 "null or negative pressure max "
1062 DEBUGCOUT(
"Pressure max: " << press_max << std::endl);
1066 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1071 DEBUGCOUT(
"Kappa: " << Kappa << std::endl);
1078 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1079 "null or negative weight "
1083 DEBUGCOUT(
"weight: " << weight << std::endl);
1091 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1099 silent_cerr(
"Accumulator(" << uLabel <<
"): "
1104 DEBUGCOUT(
"spring: " << spring << std::endl);
1105 DEBUGCOUT(
"force0: " << force0 << std::endl);
1110 DEBUGCOUT(
"c_spost: " << c_spost << std::endl);
1114 DEBUGCOUT(
"c_vel: " << c_vel << std::endl);
1118 DEBUGCOUT(
"c_acc: " << c_acc << std::endl);
1128 stroke, start, area, area_pipe,
1131 Kappa, weight, spring, force0,
1132 c_spost, c_vel, c_acc, fOut));
1147 silent_cerr(
"Tank(" << uLabel <<
"): "
1148 "null or negative pressure "
1152 DEBUGCOUT(
"Pressure: " << press << std::endl);
1156 if (area_pipe <= 0.) {
1157 silent_cerr(
"Tank(" << uLabel <<
"): "
1158 "null or negative area_pipe "
1162 DEBUGCOUT(
"Area_pipe: " << area_pipe << std::endl);
1166 if (area_serb <= 0.) {
1167 silent_cerr(
"Tank(" << uLabel <<
"): "
1168 "null or negative area_serb "
1172 DEBUGCOUT(
"Area serbatoio: " << area_serb << std::endl);
1177 silent_cerr(
"Tank(" << uLabel <<
"): "
1182 DEBUGCOUT(
"Livello massimo dell'olio: " << s_max << std::endl);
1190 silent_cerr(
"Tank(" << uLabel <<
"): "
1195 DEBUGCOUT(
"Livello iniziale: " << level << std::endl);
1203 silent_cerr(
"Tank(" << uLabel <<
"): "
1208 DEBUGCOUT(
"Soglia di allarme: " << s_min << std::endl);
1213 DEBUGCOUT(
"c_spost: " << c_spost << std::endl);
1222 Tank (uLabel, pDO, hf, pNode1,pNode2, press,
1223 area_pipe, area_serb,
1224 level, s_max, s_min, c_spost, fOut));
1238 if (diameter <= 0.) {
1239 silent_cerr(
"Pipe(" << uLabel <<
"): "
1240 "null or negative diameter "
1244 DEBUGCOUT(
"Diameter: " << diameter << std::endl);
1253 silent_cerr(
"Pipe(" << uLabel <<
"): "
1254 "null or negative area "
1259 DEBUGCOUT(
"Area: " << area << std::endl);
1264 silent_cerr(
"Pipe(" << uLabel <<
"): "
1265 "null or negative lenght "
1269 DEBUGCOUT(
"Lenght: " << lenght << std::endl);
1280 DEBUGCOUT(
"Initial q = " << q0 << std::endl);
1290 Pipe(uLabel, pDO, hf, pNode1, pNode2,
1292 area, lenght, turbulent, q0, fOut));
1296 case DYNAMIC_PIPE: {
1305 if (diameter <= 0.) {
1306 silent_cerr(
"DynamicPipe(" << uLabel <<
"): "
1307 "null or negative diameter "
1311 DEBUGCOUT(
"Diameter: " << diameter << std::endl);
1319 silent_cerr(
"DynamicPipe(" << uLabel <<
"): "
1320 "null or negative area "
1325 DEBUGCOUT(
"Area: " << area << std::endl);
1330 silent_cerr(
"DynamicPipe(" << uLabel <<
"): "
1331 "null or negative lenght "
1335 DEBUGCOUT(
"Lenght: " << lenght << std::endl);
1346 DEBUGCOUT(
"Initial q = " << q0 << std::endl);
1357 pNode1, pNode2, diameter,
1358 area, lenght, turbulent, q0, fOut));
1365 silent_cerr(
"unknown hydraulic element type "
1366 "for hydraulic element " << uLabel
1374 silent_cerr(
"semicolon expected "
flag fReadOutput(MBDynParser &HP, const T &t) const
#define MBDYN_EXCEPT_ARGS
virtual HydraulicFluid * pCopy(void) const =0
Vec3 GetPosRel(const ReferenceFrame &rf)
virtual bool IsKeyWord(const char *sKeyWord)
#define ASSERT(expression)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual int GetWord(void)
HydraulicFluid * GetHydraulicFluid(void)
DriveCaller * GetDriveCaller(bool bDeferred=false)
Vec3 GetUnitVecRel(const ReferenceFrame &rf)
virtual HighParser::ErrOut GetLineData(void) const
Node * ReadNode(MBDynParser &HP, Node::Type type) const
virtual doublereal GetReal(const doublereal &dDefval=0.0)