qin
2025-03-31 aba54db41e3a70db9f24645968f964229d290fb7
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
<template>
    <!-- <div class="detail-container">{{ Math.pow(Math.log(60), 2) }}
    </div> -->
    <div class="container mx-auto px-4 py-8 bg-white industrial-soft-style" style="margin-top: 20px; padding-top: 15px">
        <div class="w-100 h-100" style="background-color: #fff">
            <!-- 顶部分类菜单 -->
            <div class="rounded-lg shadow" style="background-color: #f6f7f9; margin-bottom: 10px">
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <span class="text-gray-500">离心泵类型:</span>
                        <div class="flex flex-1">
                            <span v-for="item in pumptype" class="ant-tag !px-2"
                                :class="pumpSelect === item.id ? 'ant-tag-checked' : ''" :key="item.id"
                                @click="changeSelectPumpType(item.id)"
                                :type="pumpSelect === item.id ? 'primary' : 'default'" size="small">
                                {{ item.name }}
                            </span>
                        </div>
                    </div>
                </div>
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <span class="text-gray-500">水泵类型:</span>
                        <div class="flex flex-1">
                            <span v-for="item in type.filter((c) => { return c.pumpid == pumpSelect })"
                                class="ant-tag !px-2" :class="typeSelect === item.tag ? 'ant-tag-checked' : ''"
                                :key="item.tag" @click="changeSelectType(item.tag)"
                                :type="typeSelect === item.tag ? 'primary' : 'default'" size="small">
                                {{ item.name }}
                            </span>
                        </div>
                    </div>
                </div>
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <span class="text-gray-500">最高效率点流量(m³/h):</span>
                        <div class="flex flex-1">
                            <el-input v-model="MaxFlow" placeholder="请输入最高效率点流量" class="!w-[300px]" clearable>
                            </el-input>
                        </div>
                    </div>
                </div>
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <span class="text-gray-500">最高效率点扬程(m):</span>
                        <div class="flex flex-1">
                            <el-input v-model="MaxHead" placeholder="请输入最高效率点扬程" class="!w-[300px]" clearable>
                            </el-input>
                        </div>
                    </div>
                </div>
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <span class="text-gray-500">水泵转速(r/min):</span>
                        <div class="flex flex-1">
                            <el-input v-model="Speed" placeholder="请输入水泵转速" class="!w-[300px]" clearable>
                            </el-input>
                        </div>
                    </div>
                </div>
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <span class="text-gray-500" style="color:blue">水泵效率(%):</span>
                        <div class="flex flex-1">
                            <el-input v-model="Efficiency" placeholder="请输入效率" class="!w-[300px]" clearable>
                            </el-input>
                        </div>
                    </div>
                </div>
                <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px">
                    <div class="flex items-center">
                        <el-button type="primary" @click="Calc">计算</el-button>
                        <el-button @click="clear" type="info">清空</el-button>
                        <span style="margin-left: 85px;">参考国标文件:</span>
                        <span style="color:dodgerblue;cursor: pointer;font-weight: bold;">
                            <a :href="`${SERVE_URL}files/pdf/GB19762-2025.pdf`" target="_blank">
                                离心泵能效限定值及能效等级 GB+19762-2025</a>
                        </span>
                    </div>
                </div>
            </div>
 
            <div class="grid grid-cols-4 gap-4" style="padding: 15px 10px; min-height: 30px">
                <img style="width:78px;height: 30px;" v-if="calcResult != null" :src="getImgUrl()">
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { onMounted, ref, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { ElMessage } from 'element-plus';
import { SERVE_URL } from '@/constants';
 
const router = useRouter();
const route = useRoute();
 
const pumptype = [
    { name: '清水离心泵', id: 1 },
    { name: '石油化工离心泵', id: 2 },
]
 
const type = [
    {
        name: '单级单吸清水离心泵', isdouble: false, issingle: true, pumpid: 1, tag: 1, contant: [
            { minFlow: 5, maxFlow: 300, c1: 162.33, c2: 163.33, c3: 168.33 },
            { minFlow: 300, maxFlow: 10000, c1: 161.33, c2: 163.33, c3: 168.33 },
        ]
    },
    {
        name: '单级双吸清水离心泵', isdouble: true, issingle: true, pumpid: 1, tag: 2, contant: [
            { minFlow: 50, maxFlow: 600, c1: 162.33, c2: 163.33, c3: 168.33 },
            { minFlow: 600, maxFlow: 20000, c1: 161.33, c2: 163.33, c3: 168.33 },
        ]
    },
    {
        name: '管道清水离心泵', isdouble: false, issingle: true, pumpid: 1, tag: 3, contant: [
            { minFlow: 5, maxFlow: 300, c1: 164.33, c2: 165.33, c3: 171.33 },
            { minFlow: 300, maxFlow: 3000, c1: 163.33, c2: 165.33, c3: 171.33 },
        ]
    },
    {
        name: '多级清水离心泵', isdouble: false, issingle: false, pumpid: 1, tag: 4, contant: [
            { minFlow: 5, maxFlow: 100, c1: 140.33, c2: 142.33, c3: 150.33 },
            { minFlow: 100, maxFlow: 3000, c1: 139.33, c2: 142.33, c3: 150.33 },
        ]
    },
    {
        name: '轻型多级清水离心泵(立式)', isdouble: false, issingle: false, pumpid: 1, tag: 5, contant: [
            { minFlow: 5, maxFlow: 300, c1: 137.33, c2: 139.33, c3: 144.33 },
        ]
    },
    {
        name: '轻型多级清水离心泵(卧式)', isdouble: false, issingle: false, pumpid: 1, tag: 6, contant: [
            { minFlow: 5, maxFlow: 300, c1: 140.33, c2: 142.33, c3: 147.33 },
        ]
    },
    {
        name: '单级单吸石油化工离心泵', isdouble: false, issingle: true, pumpid: 2, tag: 7, contant: [
            {
                minFlow: 6, maxFlow: 300, speed: [
                    { min: 20, max: 59, c1: 10, c2: 5, c3: -4 },
                    { min: 60, max: 119, c1: 4, c2: 1, c3: -6 },
                    { min: 120, max: 210, c1: 3, c2: 1, c3: -6 },
                    { min: 211, max: 300, c1: 3, c2: 1, c3: -6 },
                ]
            },
            {
                minFlow: 301, maxFlow: 30000, speed: [
                    { min: 20, max: 59, c1: 11, c2: 5, c3: -5 },
                    { min: 60, max: 119, c1: 5, c2: 1, c3: -5 },
                    { min: 120, max: 210, c1: 3, c2: 2, c3: -5 },
                    { min: 211, max: 300, c1: 3, c2: 2, c3: -5 },
                ]
            },
        ]
    },
    {
        name: '单级双吸石油化工离心泵', isdouble: true, issingle: true, pumpid: 2, tag: 8, contant: [
            {
                minFlow: 6, maxFlow: 300, speed: [
                    { min: 20, max: 59, c1: 10, c2: 5, c3: -4 },
                    { min: 60, max: 119, c1: 4, c2: 1, c3: -6 },
                    { min: 120, max: 210, c1: 3, c2: 1, c3: -6 },
                    { min: 211, max: 300, c1: 3, c2: 1, c3: -6 },
                ]
            },
            {
                minFlow: 301, maxFlow: 30000, speed: [
                    { min: 20, max: 59, c1: 11, c2: 5, c3: -5 },
                    { min: 60, max: 119, c1: 5, c2: 1, c3: -5 },
                    { min: 120, max: 210, c1: 3, c2: 2, c3: -5 },
                    { min: 211, max: 300, c1: 3, c2: 2, c3: -5 },
                ]
            },
        ]
    },
    {
        name: '多级石油化工离心泵', isdouble: false, issingle: false, pumpid: 2, tag: 9, contant: [
            {
                minFlow: 6, maxFlow: 300, speed: [
                    { min: 20, max: 59, c1: 5, c2: 3, c3: -5 },
                    { min: 60, max: 119, c1: 6, c2: 4, c3: -4 },
                    { min: 120, max: 210, c1: 1, c2: -1, c3: -5 },
                    { min: 211, max: 300, c1: 1, c2: -1, c3: -5 },
                ]
            },
            {
                minFlow: 301, maxFlow: 30000, speed: [
                    { min: 20, max: 59, c1: 3, c2: 1, c3: -4 },
                    { min: 60, max: 119, c1: 3, c2: 1, c3: -4 },
                    { min: 120, max: 210, c1: 1, c2: -1, c3: -5 },
                    { min: 211, max: 300, c1: 1, c2: -1, c3: -5 },
                ]
            },
        ]
    },
];
const clear = () => {
    MaxFlow.value = '';
    MaxHead.value = '';
    Speed.value = '';
    Efficiency.value = '';
    typeSelect.value = 1;
    calcResult.value = null;
}
 
const getImgUrl = () => {
    return `${SERVE_URL}static/img/calc-icons/${calcResult.value}.png`;
}
// 计算
const Calc = () => {
 
    if (MaxFlow.value == null)
    {
        ElMessage.error("请输入有效流量数据!");
        return;
    }
    if (MaxHead.value == null)
    {
        ElMessage.error("请输入有效扬程数据!");
        return;
    }
    if (Speed.value == null)
    {
        ElMessage.error("请输入有效转速数据!");
        return;
    }
    if (Efficiency.value == null)
    {
        ElMessage.error("请输入有效效率数据!");
        return;
    }
 
    let pump = type.filter((c) => { return c.tag == typeSelect.value })
    if (pump[0].pumpid == 1)
        CalcClearWaterPump(pump[0])
    else
        CalcPetrochemicalPump(pump[0])
}
//清水离心泵计算
const CalcClearWaterPump = (pump) => {
    let speedrate = SpeedRate(Speed.value, MaxFlow.value, MaxHead.value, pump.issingle, pump.isdouble)
    let c1V, c2V, c3V = 0;
    let cv = pump.contant.filter((c) => { return c.minFlow <= MaxFlow.value && c.maxFlow >= MaxFlow.value });
    if (pump.issingle) {
        c1V = -8.44 * Math.pow(Math.log(speedrate), 2) - 0.48 * Math.pow(Math.log(MaxFlow.value), 2) + 0.09 * Math.log(speedrate) * Math.log(MaxFlow.value) +
            84.63 * Math.log(speedrate) + 8.5 * Math.log(MaxFlow.value) - cv[0].c1;
 
        c2V = -8.44 * Math.pow(Math.log(speedrate), 2) - 0.48 * Math.pow(Math.log(MaxFlow.value), 2) + 0.09 * Math.log(speedrate) * Math.log(MaxFlow.value) +
            84.63 * Math.log(speedrate) + 8.5 * Math.log(MaxFlow.value) - cv[0].c2;
 
        c3V = -8.44 * Math.pow(Math.log(speedrate), 2) - 0.48 * Math.pow(Math.log(MaxFlow.value), 2) + 0.09 * Math.log(speedrate) * Math.log(MaxFlow.value) +
            84.63 * Math.log(speedrate) + 8.5 * Math.log(MaxFlow.value) - cv[0].c3;
    }
    else {
        c1V = -6.93 * Math.pow(Math.log(speedrate), 2) - 0.19 * Math.pow(Math.log(MaxFlow.value), 2) - 0.4 * Math.log(speedrate) * Math.log(MaxFlow.value) +
            72.67 * Math.log(speedrate) + 8.73 * Math.log(MaxFlow.value) - cv[0].c1;
 
        c2V = -6.93 * Math.pow(Math.log(speedrate), 2) - 0.19 * Math.pow(Math.log(MaxFlow.value), 2) - 0.4 * Math.log(speedrate) * Math.log(MaxFlow.value) +
            72.67 * Math.log(speedrate) + 8.73 * Math.log(MaxFlow.value) - cv[0].c2;
 
        c3V = -6.93 * Math.pow(Math.log(speedrate), 2) - 0.19 * Math.pow(Math.log(MaxFlow.value), 2) - 0.4 * Math.log(speedrate) * Math.log(MaxFlow.value) +
            72.67 * Math.log(speedrate) + 8.73 * Math.log(MaxFlow.value) - cv[0].c3;
 
    }
    let level = GetEnergyLevel(c1V, c2V, c3V);
    calcResult.value = level;
}
 
const GetEnergyLevel = (c1V: number, c2V: number, c3V: number) => {
    let levelDic = [
        { level: 1, min: c1V, max: 100 },
        { level: 2, min: c2V, max: c1V },
        { level: 3, min: c3V, max: c2V }
    ]
    let level = 5;
    for (const range of levelDic) {
        if (Efficiency.value >= range.min && Efficiency.value <= range.max) {
            level = range.level;
        }
    }
    return level;
}
 
//石油化工离心泵计算
const CalcPetrochemicalPump = (pump) => {
    let speedrate = SpeedRate(Speed.value, MaxFlow.value, MaxHead.value, pump.issingle, pump.isdouble)
    console.log(speedrate)
 
    let jzV = 0;
    let jzFlow = MaxFlow.value;
    if (MaxFlow.value > 3000)
        jzFlow = 3000
    if (pump.issingle) {
        jzV = 4.7057338 * Math.pow(10, -5) * Math.pow(Math.log(jzFlow), 6) - 6.6320555 * Math.pow(10, -3) * Math.pow(Math.log(jzFlow), 5) +
            1.5115754 * Math.pow(10, -1) * Math.pow(Math.log(jzFlow), 4) - 1.4023278 * Math.pow(Math.log(jzFlow), 3) +
            5.5234828 * Math.pow(Math.log(jzFlow), 2) - 8.3298912 * Math.pow(10, -1) * Math.log(jzFlow) +
            4.1951745 * 10;
    } else {
        jzV = 5.5836234 * Math.pow(10, -4) * Math.pow(Math.log(jzFlow), 6) - 1.2499816 * Math.pow(10, -2) * Math.pow(Math.log(jzFlow), 5) +
            9.9576618 * Math.pow(10, -2) * Math.pow(Math.log(jzFlow), 4) - 4.6811292 * Math.pow(10, -1) * Math.pow(Math.log(jzFlow), 3) +
            1.9459872 * Math.pow(Math.log(jzFlow), 2) + 1.4371144 * Math.log(jzFlow) +
            4.1467097 * 10;
    }
 
    let xzV = 0;
    if (speedrate > 210 && speedrate <= 300) {
        xzV = -1.1111111 * Math.pow(10, -10) * Math.pow(speedrate, 6) + 1.6769231 * Math.pow(10, -7) * Math.pow(speedrate, 5) -
            1.0507265 * Math.pow(10, -4) * Math.pow(speedrate, 4) + 3.4987040 * Math.pow(10, -2) * Math.pow(speedrate, 3) -
            6.5298720 * Math.pow(speedrate, 2) + 6.4773909 * Math.pow(10, 2) * speedrate -
            2.6684155 * Math.pow(10, 4);
    } else if (speedrate >= 20 && speedrate < 120) {
        xzV = 3.7873403 * Math.pow(10, -10) * Math.pow(speedrate, 6) - 1.7898913 * Math.pow(10, -7) * Math.pow(speedrate, 5) +
            3.4269717 * Math.pow(10, -5) * Math.pow(speedrate, 4) - 3.4148047 * Math.pow(10, -3) * Math.pow(speedrate, 3) +
            1.9050630 * Math.pow(speedrate, 2) * Math.pow(10, -1) - 6.0391904 * speedrate +
            9.8970658 * 10;
    } else xzV = 0;
 
    let oV = 0;
    if (speedrate >= 120 && speedrate <= 210)
        oV = jzV
    else oV = jzV - xzV
 
    let conV = pump.contant.filter((c) => { return c.minFlow <= MaxFlow.value && c.maxFlow >= MaxFlow.value });
    let cv = conV[0].speed.filter((c) => {
        return c.min <= speedrate && c.max >= speedrate
    })
    let c1V, c2V, c3V = 0;
    c1V = oV + cv[0].c1;
    c2V = oV + cv[0].c2;
    c3V = oV + cv[0].c3;
    let level = GetEnergyLevel(c1V, c2V, c3V);
    calcResult.value = level;
}
 
//issingle: 是否单级,isdouble: 是否双吸
const SpeedRate = (speed: number, q: number, h: number, issingle: boolean, isdouble: boolean) => {
    let singleV = 1;
    let doubleV = 1;
    if (!issingle)
        singleV = 5;
    if (isdouble)
        doubleV = 2;
    return 3.65 * speed * Math.pow(q / 3600 / doubleV, 0.5) / Math.pow(h / singleV, 0.75)
}
// 选中状态
const typeSelect = ref(1);
const pumpSelect = ref(1);
const MaxFlow = ref(null);
const MaxHead = ref(null)
const Speed = ref(null);
const Efficiency = ref(null);
const calcResult = ref(null);
//监听类型选择筛选
const changeSelectType = (tag: number) => {
    typeSelect.value = tag;
    MaxFlow.value = '';
    MaxHead.value = '';
    Speed.value = '';
    Efficiency.value = '';
};
const changeSelectPumpType = (tag: number) => {
    pumpSelect.value = tag;
    typeSelect.value = type.filter((c) => { return c.pumpid == tag })[0].tag;
    MaxFlow.value = '';
    MaxHead.value = '';
    Speed.value = '';
    Efficiency.value = '';
};
</script>
<style lang="scss" scoped>
.w-100 {
    width: 100%;
}
 
.text-gray-500 {
    display: inline-block;
    width: 150px;
}
 
.h-100 {
    height: 100%;
}
 
.industrial-soft-style {
    position: relative;
}
 
.border-bottom-dashed-1 {
    // border-bottom: 1px dashed #e2e8f0;
}
 
.box-border {
    box-sizing: border-box;
}
 
.industrial-soft-style::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #38ca94;
    background-image: linear-gradient(90deg, #9bc864, #40cb8f 21%, #00c7c4 47%, #00bcef 74%, #0af);
}
 
.ant-tag {
    box-sizing: border-box;
    color: rgba(0, 0, 0, 0.65);
    font-variant: tabular-nums;
    line-height: 1.5;
    list-style: none;
    font-feature-settings: 'tnum';
    display: inline-block;
    height: auto;
    margin: 0 4px 0 0;
    padding: 2px 2px;
    line-height: 20px;
    white-space: nowrap;
    cursor: default;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
    margin-right: 5px;
    font-size: 14px;
}
 
.ant-tag:hover {
    color: #1c97b7;
    cursor: pointer;
}
 
.ant-tag-checked {
    background-color: #1c97b7;
    color: #fff;
}
 
.ant-tag-checked:hover {
    color: #fff;
}
 
 
:deep(.el-button--default) {
    --el-button-bg-color: transparent;
    --el-button-border-color: transparent;
    --el-button-hover-bg-color: var(--el-color-primary-light-9);
    --el-button-hover-border-color: transparent;
}
</style>