-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWATEframeCustom.int
More file actions
825 lines (718 loc) · 23.2 KB
/
WATEframeCustom.int
File metadata and controls
825 lines (718 loc) · 23.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
#ifndef _WATEFRAMECUSTOM_H_
#define _WATEFRAMECUSTOM_H_
//
// LAST INSPECTION DATE: *not inspected*
//
// EXTERNAL DEPENDENCIES
//
// parent.parent.parent.list()
// parent.parent.hasInterface()
// VCInterface* frontBearingRef
// VCInterface* outermostShaft
// VCInterface* rearBearingRef
// WATEelement* passThruComp
// WATEframeBase* passThruFrame
// WATEshaft* wateShafts
// inPort.axialPosition
// numStages
// stg1BladeAR
extern int parent.parent.parent.hasInterface(string);
extern int numStages;
extern real S_TowerShaft.weight;
/*
*
*********************************************************************/
class WATEframeCustom extends WATEframeBase
{
//FRVAL(2)
real solidity {
value = 1.0 ; IOstatus = "input"; units = "none" ;
description = "Frame solidity" ;
}
//FRVAL(3)
real volumeFactor {
value = 0.1 ; IOstatus = "input"; units = "none" ;
description = "Frame volume factor" ;
}
//FRVAL(4)
real aspectRatio_in {
IOstatus = "input"; units = "none" ;
description = "Aspect ratio of the frame 'blades'." ;
}
real aspectRatio {
IOstatus = "output"; units = "none" ;
description = "Aspect ratio of the frame 'blades'." ;
}
//FRVAL(5)
int numBlades_in {
IOstatus = "input"; units = "none" ;
description = "specifies the value of numBlades" ;
}
int numBlades {
IOstatus = "output"; units = "none" ;
description = "Number of frame 'blades'. Calculated from solidity and aspectRatio unless numBlades_in is set";
}
//FRVAL(7)
real supportThickness {
value = 0.15 ; IOstatus = "input"; units = "in" ;
description = "Frame support material thickness" ;
}
//FRVAL(11)
real gapFrameLengthRatio {
value = 0.1 ; IOstatus = "input"; units = "none" ;
description = "Ratio of the frame gap length to frame length. Default=0.1, but = 0.0 on rear frame of high bypass fan" ;
}
//FRVAL(12)
int isStator {
value = FALSE ; IOstatus = "input"; units = "none" ;
description = "Indicates if frame functions as a stator. FALSE if not a stator, and TRUE if it is a stator" ;
}
//FRVAL(13)
string passThruComp {
IOstatus = "input"; units = "none" ;
description = "Component name of parent of connection pass through frame." ;
ptrType = "WATEelement";
}
string passThruFrame {
ptrType = "WATEframeBase";
}
passThruFrame.hide(2);
Option connectPoint {
trigger = FALSE;
allowedValues = { "FRONT", "REAR"}
IOstatus = "input"; units = "none" ;
description = "Specifies whether a connecting pass through frame is a front or rear frame" ;
}
string outermostShaft {
description = "name of outermost shaft";
hide(2);
}
real gap;
real height;
real supportWt;
real caseWt;
real upperSupportWt;
real lowerSupportWt;
real frameWt;
real hubWt;
real lengthWithGap;
string frontBearingRef;
string rearBearingRef;
string wateShafts[];
wateShafts.ptrType = "WATEshaftBase";
defaultHideLevel = 2;
string portptrs[];
portptrs {
ptrType = "Port";
}
int inBypassStream;
defaultHideLevel = 0;
int isVariable {
description = "if TRUE, this frame is variable";
}
real rhof {
hide(1);
}
int plotFrameSupports = 0;
#ifdef WATE_LEGACY
WATEmaterial material;
#else
WATEmaterial material { type = "_17_4PH"; }
#endif
WATEmaterial supportMaterial;
Socket S_TowerShaft {
description = "Socket for a tower shaft";
socketType = "WATEtowerShaft";
}
/**
* custom frame
*********************************************************/
void calculate()
{
real h1;
real h2;
real h3;
real h4;
real rmin;
real stglen=0.;
real frontBearingRadius;
real rearBearingRadius;
real rfanhf;
real rfanhb;
real webar1;
real webar2;
real clff=0.;
real cligv=0.;
real tmp;
string tmpstr;
int i;
string passThruFrameSock {
ptrType = "Socket";
}
if(frontBearingRef != "") {
if(frontBearingRef->axialPosition == 0.) {
frontBearingRef->axialPosition = inPort.axialPosition;
}
}
if(rearBearingRef != "") {
if(rearBearingRef->axialPosition == 0.) {
rearBearingRef->axialPosition = outPort.axialPosition;
}
}
if(passThruComp != "") {
if(passThruComp->hasInterface("WATEductBase")) {
passThruFrameSock = passThruComp + ".S_Frame";
}
else if(passThruComp->hasInterface("WATEcompressorBase") ||
passThruComp->hasInterface("WATEturbineBase")) {
if(connectPoint=="FRONT") {
passThruFrameSock = passThruComp + ".S_FrontFrame";
}
else { // REAR
passThruFrameSock = passThruComp + ".S_RearFrame";
}
}
else {
passThruFrameSock = "";
}
if(passThruFrameSock != "") {
if(passThruFrameSock->isEmpty()) {
tmpstr = "passThruComp is set but Socket ";
tmpstr += passThruFrameSock;
tmpstr += " is empty";
throwError(tmpstr);
}
passThruFrame = passThruFrameSock + ".child";
}
else {
passThruFrame = "";
}
}
else {
passThruFrame = "";
}
height = 0.0;
gap = 0.0;
supportWt = 0.0;
upperSupportWt = 0.0;
if(aspectRatio_in == 0.) {
if(parent.parent.parent.hasInterface("WATEductBase")) {
aspectRatio = 1.0;
}
else {
aspectRatio = stg1BladeAR;
}
}
else {
aspectRatio = aspectRatio_in;
}
height = tipRadius-hubRadius;
if(numBlades_in == 0) {
numBlades = 2.*PI*tipRadius*solidity*aspectRatio/height;
}
else {
numBlades = numBlades_in;
}
if(material.type=="") {
rhof = 0.12;
}
else {
rhof = material.rho(500);
}
if(!isFrontFrame && parent.parent.parent.hasInterface("WATEhiBypassFan")) {
gapFrameLengthRatio = 0.0;
}
real volume = volumeFactor*height*height*height/(aspectRatio*aspectRatio);
weight = volume*rhof*numBlades;
// get weight of tower shaft if present in frame
//
if(!S_TowerShaft.isEmpty()) {
S_TowerShaft.child.execute();
}
//
//jjc calculate frame related lengths
//
length = height/aspectRatio;
if(isStator) {
gap = 0.0;
}
else {
gap = length*gapFrameLengthRatio;
}
//
//jjc add 20% to frame weight if variable and include weight of flap
//jjc account for variable frames (add weight for actuators & ring)
//
real ha;
lengthWithGap = length + gap;
if(isVariable) {
weight *= 2.0;
ha = 0.5 * lengthWithGap;
if(ha < 1.0) {
ha = 1.0;
}
else if(ha > 3.0) {
ha = 3.0;
}
weight += ((numBlades*(PI*.25*.3*.3*lengthWithGap*lengthWithGap*ha+
.1*.25*.75*lengthWithGap)+
(.5*.5-.3*.3)*2.*PI*(tipRadius+ha))*rhof);
}
//
//jjc get lengths and radii of bearings if present
//
//??? h1 appears to be the distance between the front of the
// component and the front bearing?
//??? h2 is the distance between the rear bearing and the back end
// of the component?
real tmp2;
if(isFrontFrame) {
if(frontBearingRef != "") {
tmp = frontBearingRef->axialPosition;
tmp2 = inPort.axialPosition;
h1 = abs(tmp2-tmp);
}
else {
h1 = 0.0;
}
if(rearBearingRef != "") {
tmp = rearBearingRef->axialPosition;
tmp2 = inPort.axialPosition;
h2 = abs(tmp2+length-tmp);
}
else {
h2 = 0.0;
}
//
//jjc store values of x & r for frames for later use in calculating
//jjc support weight and for plotting.
//
frontAxialPosition = inPort.axialPosition;
backAxialPosition = frontAxialPosition+length;
if(parent.parent.parent.hasInterface("WATEhiBypassFan") || inBypassStream) {
frontOuterRadius = hubRadius;
backOuterRadius = hubRadius;
}
else {
frontOuterRadius = tipRadius;
backOuterRadius = tipRadius;
}
}
else { // we're a rear frame
stglen = 0.0;
if(parent.parent.parent.hasInterface("WATEhiBypassFan")) {
stglen = bypassLen_stg[numStages-1];
if(isStator) {
tmp = statorLen_stg[numStages-1];
stglen -= tmp;
}
}
else if(parent.parent.parent.hasInterface("WATEaxialTurbine")) {
for(i=0; i<numStages; ++i) {
tmp = length_stg[i];
stglen += tmp;
}
}
else if(parent.parent.parent.hasInterface("WATEaxialCompressor")) {
for(i=0; i<numStages; ++i) {
tmp = length_stg[i];
stglen += tmp;
}
cligv = parent.parent.parent.igvLength;
clff = parent.parent.parent.frontFrameLength;
}
tmp = 0.;
if(frontBearingRef != "") {
tmp = frontBearingRef->axialPosition;
h1 = abs(inPort.axialPosition+clff+cligv+stglen+gap-tmp);
}
else {
h1 = 0.0;
}
if(rearBearingRef != "") {
h2 = abs(inPort.axialPosition+clff+cligv+stglen+gap+length-tmp);
}
else {
h2 = 0.0;
}
//
//jjc store values of x & r for frames for later use in calculating
//jjc support weight and for plotting.
//
frontAxialPosition = inPort.axialPosition+clff+cligv+stglen+gap;
backAxialPosition = frontAxialPosition+length;
if(parent.parent.parent.hasInterface("WATEhiBypassFan") || inBypassStream) {
frontOuterRadius = hubRadius;
backOuterRadius = hubRadius;
}
else {
frontOuterRadius = tipRadius;
backOuterRadius = tipRadius;
}
}
real dshmax = outermostShaft->outerDiameter;
rmin=1.2*dshmax*0.5;
if(frontBearingRef != "") {
frontBearingRadius = frontBearingRef->bearingCenterRadius;
}
else {
if(passThruFrame != "") {
frontBearingRadius = passThruFrame->frontOuterRadius;
}
else {
frontBearingRadius = rmin;
}
}
if(rearBearingRef != "") {
rearBearingRadius = rearBearingRef->bearingCenterRadius;
}
else {
if(passThruFrame != "") {
rearBearingRadius = passThruFrame->backOuterRadius;
}
else {
rearBearingRadius = rmin;
}
}
//
//jjc calculate weight of frame supports
//
//jjc no upper supports if frame is in front of main fan
//jjc no upper supports if frame is in front of fanh component
//jjc no upper supports if frame is connected to another frame
real supportDensity;
if(supportMaterial.type=="") {
supportDensity = rhof;
}
else {
supportDensity = supportMaterial.rho(500);
}
real passThruFrontAxialPos;
real passThruBackAxialPos;
if(passThruComp != "") {
rfanhf = 0.;
rfanhb = 0.;
passThruFrontAxialPos = 0.;
passThruBackAxialPos = 0.;
if(passThruComp->hasInterface("WATEhiBypassFan") ||
(!(parent.parent.parent.hasInterface("WATEhiBypassFan")) && ! inBypassStream)) {
if(passThruFrame != "") {
rfanhf = passThruFrame->frontOuterRadius;
rfanhb = passThruFrame->backOuterRadius;
passThruFrontAxialPos = passThruFrame->frontAxialPosition;
passThruBackAxialPos = passThruFrame->backAxialPosition;
}
if(isFrontFrame) {
h3 = abs(inPort.axialPosition-passThruFrontAxialPos);
h4 = abs(inPort.axialPosition+length-passThruBackAxialPos);
}
else { // we're a rear frame
h3=abs(inPort.axialPosition+clff+cligv+stglen+gap-passThruFrontAxialPos);
h4=abs(inPort.axialPosition+clff+cligv+stglen+gap+length-passThruBackAxialPos);
}
webar1 = PI*sqrt((rfanhf-tipRadius)**2+h3*h3)*(tipRadius+rfanhf);
webar2 = PI*sqrt((rfanhb-tipRadius)**2+h4*h4)*(tipRadius+rfanhb);
upperSupportWt = (webar1+webar2)*supportThickness*supportDensity;
}
else {
upperSupportWt = 0.0;
}
}
webar1 = PI*sqrt((hubRadius-frontBearingRadius)**2+h1*h1)*
(hubRadius+frontBearingRadius);
if(parent.parent.parent.hasInterface("WATEaxialLPT") || parent.parent.parent.hasInterface("WATEaxialHPT")) {
webar1 = webar1*0.5;
}
webar2 = PI*sqrt((hubRadius-rearBearingRadius)**2+h2*h2)*(hubRadius+rearBearingRadius);
//
//jjc no lower supports if frame is in a fanh component
//jjc that is connected to another frame. the weight will be calculated
//jjc in the connecting frame support weight. this was done because
//jjc the fanh component is calculated ahead of any connecting components
//
if(passThruFrame != "" && parent.parent.parent.hasInterface("WATEhiBypassFan")) {
lowerSupportWt = 0.0;
}
else {
lowerSupportWt = (webar1+webar2)*supportThickness*supportDensity;
}
caseWt = 2.*PI*tipRadius*length*supportDensity*supportThickness;
hubWt = 2.*PI*hubRadius*length*supportDensity*supportThickness;
supportWt = upperSupportWt+lowerSupportWt+caseWt+hubWt;
frameWt = weight;
weight += supportWt;
if(!S_TowerShaft.isEmpty()) {
weight += S_TowerShaft.weight;
}
} // end calculate
/**
* perform any setup steps that require the entire model to
* be in place, e.g., setting up MaxSavers for all Shaft
* speeds and finding the outermost shaft
*********************************************************/
void doSetup()
{
int i,itmp;
if(wateShafts.entries() == 0) {
wateShafts = parent.parent.parent.parent.list("WATEshaftBase",1);
}
for(i=0; i<wateShafts.entries(); ++i) {
itmp = wateShafts[i]->isOuterShaft;
if(itmp != 0) {
outermostShaft = wateShafts[i];
}
}
if(outermostShaft == "") {
error("outermostShaft is blank. One WATEshaftBase in the model must have isOuterShaft set to TRUE");
}
}
/**
*
*********************************************************/
void calcGeometry()
{
if(parent.parent.parent.hasInterface("WATEcompressorBase") ||
parent.parent.parent.hasInterface("WATEturbineBase")) {
if(isFrontFrame) {
calcFrontFrameGeometry();
}
else {
calcRearFrameGeometry();
}
}
}
/**
*
*********************************************************/
void calcFrontFrameGeometry() {
real x[4],y[4],xaray[4],yaray[4];
real xaray2[4],yaray2[4];
real xx[4],yy[4];
int ii;
string ref;
real xm1,xm2,b1,b2;
real sx0 = inPort.axialPosition; // tleng(idn1) - aleng(i);
real sy0 = inPort.innerRadius; //ri(1,iup1);
real parLen = parent.parent.length;
real sy1 = inPort.outerRadius; //ro(1,iup1);
real sy2 = outPort.outerRadius; //ro(2,idn1);
real sy6 = outPort.innerRadiusDwn; //ri(2,idn1);
// shade front frame.
if(length > 0.) {
xm1 = (sy6-sy0)/parLen;
b1 = sy0-xm1*sx0;
xm2 = (sy2-sy1)/parLen;
b2 = sy1-xm2*sx0;
//??? I've modified this because it seems to me that the frame
// should be drawn according to it's frontAxialPosition and its
// length. If the frame has a gap, that should not affect the drawing
// of the frame itself, but rather the drawing of objects that come
// after the frame
xaray[0] = frontAxialPosition;
xaray[1] = xaray[0];
xaray[2] = frontAxialPosition+length;
xaray[3] = xaray[2];
yaray[0] = sy0;
yaray[1] = sy1;
yaray[2] = xm2*length + sy1;//xm2 * xaray[2] + (sy1-xm2*sx0); //b2;
yaray[3] = sy0;
setStyle("fill: yellow;");
addPolygon(xaray,yaray,drawDepth,1);
setStyle("");
//
// draw lines representing frame supports from frame to bearing
// location if present, otherwise from frame to shaft radii
//
if(passThruComp=="") {
if (plotFrameSupports) {
drawFrameSupports(xaray,yaray);
}
}
//
// the following lines added to variable flaps for variable
// front frames only
//
if(isVariable) {
xaray2[0] = xaray[3]+0.025*length;
xaray2[1] = xaray[2]+0.025*length;
xaray2[3] = xaray2[0];
yaray2[3] = xm1 * xaray2[3] + b1;
if(gap> 0) {
xaray2[2] = xaray2[1]+0.5*(length-gap);
}
else {
xaray2[2] = xaray2[1]+0.5*(length - spacerLen_stg[0]);
}
yaray2[2] = xm2 * xaray2[2] + b2;
setStyle("fill: yellow;");
addPolygon(xaray2,yaray2,drawDepth,1);
setStyle("");
//
//jjc the following lines added to draw actuators for variable
//jjc front frames only
//
real hite = 1.9;
real ringThk = contRingRadialThickness;
int numContained = numContainedStages;
if(hite<ringThk && numContained>0) {
hite = ringThk + 1.0;
}
xx[0] = xaray2[0];
yy[0] = xm2 * xx[0] + b2;
xx[1] = xx[0];
yy[1] = yy[0] + hite;
xx[2] = xx[0] + 1.0;
yy[2] = yy[1];
xx[3] = xx[2];
yy[3] = yy[2] - 0.25;
xx[4] = xx[3] + 0.5;
yy[4] = yy[3];
xx[5] = xx[4];
yy[5] = yy[4] + 0.5;
xx[6] = xx[5] - 0.5;
yy[6] = yy[5];
xx[7] = xx[2];
yy[7] = yy[2];
addPolyLine(xx,yy,drawDepth,1);
}
}
}
/**
*
*********************************************************/
void calcRearFrameGeometry() {
real xaray[4],yaray[4];
if(parent.parent.parent.hasInterface("WATEhiBypassFan")) {
real parLen = parent.parent.parent.length;
real sx2 = inPort.axialPosition + parLen;
real sy2 = outPort.outerRadius; //ro(2,idn1);
string ref = splitterRef+".outPortSecondary";
real sy3 = ref->outerRadiusDwn;
real xm2 = (sy3-sy2)/(bypassLength-parLen);
real b2 = sy2-xm2*sx2;
xaray[0] = frontAxialPosition+gap;
xaray[1] = xaray[0];
xaray[2] = xaray[0]+length;
xaray[3] = xaray[2];
yaray[0] = ref->innerRadiusDwn;
yaray[1] = xm2 * xaray[1] + b2;
yaray[2] = sy3;
yaray[3] = yaray[0];
}
else {
xaray[0] = outPort.axialPosition-length;//frontAxialPosition+gap;
xaray[1] = xaray[0];
xaray[2] = xaray[0]+length;
xaray[3] = xaray[2];
yaray[0] = outPort.innerRadius; //hubRadius_stg[numStages-1]; //ristage(nstag(i)+1,i);
yaray[1] = outPort.outerRadius; //tipRadius_stg[numStages-1]; //sy(2);
yaray[2] = outPort.outerRadiusDwn; //ro(2,idn1);
yaray[3] = outPort.innerRadiusDwn; //ri(2,idn1);
}
setStyle("fill: yellow;");
addPolygon(xaray,yaray,drawDepth,1);
setStyle("");
//
// draw lines representing frame supports from frame to bearing
// location if present, otherwise from frame to shaft radii
//
if(plotFrameSupports) {
drawFrameSupports(xaray,yaray);
}
}
/**
*
*********************************************************/
void calcDuctFrameGeometry(real xdf[], real ydf[])
{
int i;
real x[] = xdf;
real y[] = ydf;
setStyle("fill: yellow;");
addPolygon(x,y,drawDepth,1);
setStyle("");
//
// draw lines representing frame supports from frame to WATEhiBypassFan or WATEductBase
// component (special case - upper supports drawn here)
//
real xx,yy;
if(passThruFrame != "") {
if(passThruFrame->hubRadius > hubRadius) {
xx = passThruFrame->frontAxialPosition;
yy = passThruFrame->hubRadius;
addLine(xdf[1],ydf[1],xx,yy,drawDepth,1);
xx = passThruFrame->backAxialPosition;
addLine(xdf[2],ydf[2],xx,yy,drawDepth,1);
}
}
}
void drawFrameSupports(real xaray[],real yaray[]) {
real x[4],y[4];
string ref;
real shrad=0.;
int ii;
x[0] = xaray[0];
y[0] = yaray[0];
x[2] = xaray[3];
y[2] = yaray[3];
if(frontBearingRef != "") {
x[1] = frontBearingRef->axialPosition;
y[1] = frontBearingRef->diameter/2.0;
}
else {
ref = parent.parent.parent.S_Disk.child.shaftRef;
shrad = ref->outerDiameter/2.0; // dshaf(iwmec[2,nsh])/2.0;
x[1] = x[0];
y[1] = 1.2*shrad;
}
if(rearBearingRef != "") {
x[3] = rearBearingRef->axialPosition;
y[3] = rearBearingRef->diameter/2.0;
}
else {
ref = parent.parent.parent.S_Disk.child.shaftRef;
shrad = ref->outerDiameter/2.0; // dshaf(iwmec[2,nsh])/2.0;
x[3] = x[2];
y[3] = 1.2*shrad;
}
addLine(x[0],y[0],x[1],y[1],drawDepth,1);
addLine(x[2],y[2],x[3],y[3],drawDepth,1);
}
/**
*
***********************************************************/
int verify() {
// look upstream for a Splitter and figure out if we're in the
// bypass stream
string old;
string wateEptr = parent.parent.parent.getPathName();
string visited[] = { };
string pnames[];
inBypassStream = 0;
while(1) {
old = wateEptr;
if(wateEptr->hasInterface("WATEelement")) {
if(wateEptr->hasInterface("WATEmixerBase")) {
// we're downstream of Mixer, so not in bypass stream
break;
}
pnames = wateEptr->getVal("wateInPortNames");
if(pnames.entries()==0) { break; }
portptrs = pnames[0]->getLinkedPortName();
if(portptrs.entries()==0) { break; }
wateEptr = portptrs[0]->getParentName();
if(wateEptr->hasInterface("WATEsplitter")) {
if(portptrs[0]->getName() == "outPortSecondary") {
inBypassStream = 1;
}
break;
}
}
else { break; }
if(visited.contains(wateEptr)) { break; }
else { visited.append(wateEptr); }
}
return 1;
}
} // end class
#endif