File: TurbulenceNeptuneView.py

package info (click to toggle)
code-saturne 6.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 63,340 kB
  • sloc: ansic: 354,724; f90: 119,812; python: 87,716; makefile: 4,653; cpp: 4,272; xml: 2,839; sh: 1,228; lex: 170; yacc: 100
file content (598 lines) | stat: -rw-r--r-- 23,923 bytes parent folder | download
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
# -*- coding: utf-8 -*-

#-------------------------------------------------------------------------------

# This file is part of Code_Saturne, a general-purpose CFD tool.
#
# Copyright (C) 1998-2019 EDF S.A.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.

#-------------------------------------------------------------------------------

"""
This module defines the 'Turbulence' page.

This module contains the following classes:
- TurbulenceDelegate
- CouplingDelegate
- StandardItemModelTurbulence
- TurbulenceView
"""

#-------------------------------------------------------------------------------
# Library modules import
#-------------------------------------------------------------------------------

import os, sys, string, types
import logging

#-------------------------------------------------------------------------------
# Third-party modules
#-------------------------------------------------------------------------------

from code_saturne.Base.QtCore    import *
from code_saturne.Base.QtGui     import *
from code_saturne.Base.QtWidgets import *

#-------------------------------------------------------------------------------
# Application modules import
#-------------------------------------------------------------------------------

from code_saturne.model.Common import GuiParam
from code_saturne.Base.QtPage import ComboModel, DoubleValidator
from code_saturne.Base.QtPage import to_qvariant, from_qvariant, to_text_string
from TurbulenceNeptune import Ui_Turbulence
from code_saturne.model.TurbulenceNeptuneModel import TurbulenceModel, TurbulenceModelsDescription

#-------------------------------------------------------------------------------
# log config
#-------------------------------------------------------------------------------

logging.basicConfig()
log = logging.getLogger("TurbulenceView")
log.setLevel(GuiParam.DEBUG)


#-------------------------------------------------------------------------------
# Combo box delegate for the turbulence
#-------------------------------------------------------------------------------


class TurbulenceDelegate(QItemDelegate):
    """
    Use of a combo box in the table.
    """
    def __init__(self, parent, mdl, dicoM2V, dicoV2M):
        super(TurbulenceDelegate, self).__init__(parent)
        self.parent   = parent
        self.mdl      = mdl
        self.dicoM2V  = dicoM2V
        self.dicoV2M  = dicoV2M

    def createEditor(self, parent, option, index):
        editor = QComboBox(parent)
        self.modelCombo = ComboModel(editor, 1, 1)
        fieldId = index.row() + 1
        if self.mdl.getCriterion(fieldId) == "continuous" :
           for turb in TurbulenceModelsDescription.continuousTurbulenceModels :
               self.modelCombo.addItem(self.tr(self.dicoM2V[turb]), turb)
        else:
           carrier = self.mdl.getCarrierField(fieldId)
           if self.mdl.getTurbulenceModel(carrier) != "none" or \
              self.mdl.getFieldNature(fieldId) == "solid":
               for turb in TurbulenceModelsDescription.dispersedTurbulenceModels :
                   self.modelCombo.addItem(self.tr(self.dicoM2V[turb]), turb)
           else:
               self.modelCombo.addItem(self.tr(self.dicoM2V["none"]), "none")
        editor.setMinimumSize(editor.sizeHint())
        editor.installEventFilter(self)
        return editor


    def setEditorData(self, comboBox, index):
        row = index.row()
        col = index.column()
        string = index.model().getData(index)[col]
        self.modelCombo.setItem(str_view=string)


    def setModelData(self, comboBox, model, index):
        txt = str(comboBox.currentText())
        value = self.modelCombo.dicoV2M[txt]
        log.debug("TurbulenceDelegate value = %s"%value)

        selectionModel = self.parent.selectionModel()
        for idx in selectionModel.selectedIndexes():
            if idx.column() == index.column():
                model.setData(idx, to_qvariant(self.dicoM2V[value]), Qt.DisplayRole)


    def tr(self, text):
        return text


#-------------------------------------------------------------------------------
# Combo box delegate for the two way coupling
#-------------------------------------------------------------------------------


class CouplingDelegate(QItemDelegate):
    """
    Use of a combo box in the table.
    """
    def __init__(self, parent, mdl, dicoM2V, dicoV2M):
        super(CouplingDelegate, self).__init__(parent)
        self.parent   = parent
        self.mdl      = mdl
        self.dicoM2V  = dicoM2V
        self.dicoV2M  = dicoV2M

    def createEditor(self, parent, option, index):
        editor = QComboBox(parent)
        self.modelCombo = ComboModel(editor, 1, 1)
        fieldId = index.row() + 1

        if self.mdl.getCriterion(fieldId) == "continuous" :
               self.modelCombo.addItem(self.tr(self.dicoM2V["none"]), "none")
               self.modelCombo.disableItem(str_model="none")
        else :
               self.modelCombo.addItem(self.tr(self.dicoM2V["none"]), "none")
               carrier = self.mdl.getCarrierField(fieldId)
               if self.mdl.getTurbulenceModel(carrier) == "k-epsilon" or \
                  self.mdl.getTurbulenceModel(carrier) == "k-epsilon_linear_production" or \
                  self.mdl.getTurbulenceModel(carrier) == "rij-epsilon_ssg" or \
                  self.mdl.getTurbulenceModel(carrier) == "rij-epsilon_ebrsm":
                   if self.mdl.getFieldNature(fieldId) == "gas" :
                       # bulles
                       self.modelCombo.addItem(self.tr(self.dicoM2V["large_inclusions"]), "large_inclusions")
                   else :
                       # gouttes et solide
                       self.modelCombo.addItem(self.tr(self.dicoM2V["small_inclusions"]), "small_inclusions")

        editor.setMinimumSize(editor.sizeHint())
        editor.installEventFilter(self)
        return editor


    def setEditorData(self, comboBox, index):
        row = index.row()
        col = index.column()
        string = index.model().getData(index)[col]
        self.modelCombo.setItem(str_view=string)


    def setModelData(self, comboBox, model, index):
        txt = str(comboBox.currentText())
        value = self.modelCombo.dicoV2M[txt]
        log.debug("CouplingDelegate value = %s"%value)

        selectionModel = self.parent.selectionModel()
        for idx in selectionModel.selectedIndexes():
            if idx.column() == index.column():
                model.setData(idx, to_qvariant(self.dicoM2V[value]), Qt.DisplayRole)


    def tr(self, text):
        return text

#-------------------------------------------------------------------------------
# Combo box delegate for the thermal turbulent fluxes
#-------------------------------------------------------------------------------

class TurbFluxDelegate(QItemDelegate):
    """
    Use of a combobox in the table.
    """

    def __init__(self, parent, mdl, dicoM2V, dicoV2M):
        super(TurbFluxDelegate, self).__init__(parent)
        self.parent   = parent
        self.mdl      = mdl
        self.dicoM2V  = dicoM2V
        self.dicoV2M  = dicoV2M

    def createEditor(self, parent, option, index):
        editor = QComboBox(parent)
        self.modelCombo = ComboModel(editor, 1, 1)
        fieldId = index.row() + 1

        if self.mdl.getEnergyResolution(fieldId) == 'on':
            if self.mdl.useAdvancedThermalFluxes(fieldId) == True:
                for turbFlux in TurbulenceModelsDescription.ThermalTurbFluxModels:
                    self.modelCombo.addItem(self.tr(self.dicoM2V[turbFlux]), turbFlux)

            else:
                turb_flux = TurbulenceModelsDescription.ThermalTurbFluxModels[0]
                self.modelCombo.addItem(self.tr(self.dicoM2V[turbFlux]), turbFlux)
                self.modelCombo.disableItem(index=0)
        else:
            self.modelCombo.addItem(self.tr(self.dicoM2V['none']), 'none')
            self.modelCombo.setItem(str_view='none')

        editor.setMinimumSize(editor.sizeHint())
        editor.installEventFilter(self)
        return editor

    def setEditorData(self, comboBox, index):
        row = index.row()
        col = index.column()
        string = index.model().getData(index)[col]
        self.modelCombo.setItem(str_view=string)

    def setModelData(self, comboBox, model, index):
        txt = str(comboBox.currentText())
        value = self.modelCombo.dicoV2M[txt]
        log.debug("TurbFluxDelegate value = %s"%value)

        selectionModel = self.parent.selectionModel()
        for idx in selectionModel.selectedIndexes():
            if idx.column() == index.column():
                model.setData(idx, to_qvariant(self.dicoM2V[value]), Qt.DisplayRole)


    def tr(self, text):
        return text


#-------------------------------------------------------------------------------
# StandarItemModelMainFields class
#-------------------------------------------------------------------------------

class StandardItemModelTurbulence(QStandardItemModel):

    def __init__(self, mdl, case, dicoM2V, dicoV2M):
        """
        """
        QStandardItemModel.__init__(self)

        self.headers = [ self.tr("Field label"),
                         self.tr("Carrier field"),
                         self.tr("Turbulence model"),
                         self.tr("Thermal turbulent flux"),
                         self.tr("Reverse coupling")]

        self.setColumnCount(len(self.headers))

        self.tooltip = []

        self._data = []
        self.mdl      = mdl
        self.case     = case
        self.dicoM2V  = dicoM2V
        self.dicoV2M  = dicoV2M


    def data(self, index, role):
        if not index.isValid():
            return to_qvariant()

        if role == Qt.ToolTipRole:
            return to_qvariant()

        elif role == Qt.DisplayRole:
            data = self._data[index.row()][index.column()]
            if data:
                return to_qvariant(data)
            else:
                return to_qvariant()

        elif role == Qt.TextAlignmentRole:
            return to_qvariant(Qt.AlignCenter)

        return to_qvariant()


    def flags(self, index):

        # NoItemsFlags is used to have a grayed out option

        if not index.isValid():
            return Qt.ItemIsEnabled
        if index.column() == 2 :
            return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
        if index.column() == 3 :
            if self.mdl.useAdvancedThermalFluxes(index.row()+1) == True \
                and self.mdl.getEnergyResolution(index.row()+1) == 'on':
                return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
            else:
                return Qt.NoItemFlags
        elif index.column() == 1 or index.column() == 4 :
            if self.mdl.getCriterion(index.row()+1) == "continuous" :
                return Qt.NoItemFlags
            else :
                return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
        else:
            return Qt.ItemIsEnabled | Qt.ItemIsSelectable


    def headerData(self, section, orientation, role):
        if orientation == Qt.Horizontal and role == Qt.DisplayRole:
            return to_qvariant(self.headers[section])
        return to_qvariant()


    def setData(self, index, value, role):
        if not index.isValid():
            return Qt.ItemIsEnabled

        row = index.row()
        col = index.column()
        FieldId = row + 1

        # turbulence model
        if col == 2:
            new_pmodel = from_qvariant(value, to_text_string)
            self._data[row][col] = new_pmodel
            self.mdl.setTurbulenceModel(FieldId, self.dicoV2M[new_pmodel])

            # Security check for mixing length, which cannot have a formula on inlet!
            if new_pmodel == 'mixing length':
                from code_saturne.model.LocalizationModel import LocalizationModel
                from code_saturne.model.BoundaryNeptune import Boundary

                blm = LocalizationModel('BoundaryZone', self.case)

                for zone in blm.getZones():
                    if "inlet" in zone.getNature():
                        boundary = Boundary(zone.getNature(),
                                            zone.getLabel(),
                                            self.case,
                                            FieldId)

                        tc = boundary.getTurbulenceChoice(FieldId)
                        if tc == "formula":
                            boundary.setTurbulenceChoice(FieldId, "hydraulic_diameter")

            self.updateItem()

        # Turbulent thermal fluxes (for continuous phases)
        elif col == 3:
            new_pmodel = from_qvariant(value, to_text_string)
            self._data[row][col] = new_pmodel
            self.mdl.setThermalTurbulentFlux(FieldId, self.dicoV2M[new_pmodel])
            self.updateItem()

        # two way coupling
        elif col == 4:
            new_pmodel = from_qvariant(value, to_text_string)
            self._data[row][col] = new_pmodel
            self.mdl.setTwoWayCouplingModel(FieldId, self.dicoV2M[new_pmodel])
            self.updateItem()

        self.dataChanged.emit(index, index)
        return True


    def getData(self, index):
        row = index.row()
        return self._data[row]


    def newItem(self, fieldId):
        """
        Add/load a field in the model.
        """
        row = self.rowCount()

        label        = self.mdl.getLabel(fieldId)
        carrier      = self.mdl.getCarrierField(fieldId)
        carrierLabel = ""
        if carrier != "off" :
            carrierLabel = self.mdl.getLabel(carrier)
        else :
            carrierLabel = carrier
        turbulence = self.dicoM2V[self.mdl.getTurbulenceModel(fieldId)]
        turb_flux  = self.dicoM2V[self.mdl.getThermalTurbulentFlux(fieldId)]
        twoway     = self.dicoM2V[self.mdl.getTwoWayCouplingModel(fieldId)]

        field = [label, carrierLabel, turbulence, turb_flux, twoway]

        self._data.append(field)
        self.setRowCount(row+1)


    def updateItem(self):
        """
        update item
        """
        for id in self.mdl.getFieldIdList() :
            self._data[int(id)-1][2] = self.dicoM2V[self.mdl.getTurbulenceModel(id)]
            self._data[int(id)-1][3] = self.dicoM2V[self.mdl.getThermalTurbulentFlux(id)]
            self._data[int(id)-1][4] = self.dicoM2V[self.mdl.getTwoWayCouplingModel(id)]


#-------------------------------------------------------------------------------
# turbulence class
#-------------------------------------------------------------------------------

class TurbulenceView(QWidget, Ui_Turbulence):
    """
    Main fields layout.
    """
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_Turbulence.__init__(self)
        self.setupUi(self)

        self.case = case
        self.case.undoStopGlobal()
        self.mdl = TurbulenceModel(self.case)

        # Dico
        self.dicoM2V= {"none"                        : 'none',
                       "mixing_length"               : 'mixing length',
                       "k-epsilon"                   : 'k-epsilon',
                       "rij-epsilon_ssg"             : 'Rij-epsilon SSG',
                       "rij-epsilon_ebrsm"           : 'Rij-epsilon EBRSM',
                       "k-epsilon_linear_production" : 'k-epsilon linear production',
                       "les_smagorinsky"             : 'LES (Smagorinsky)',
                       "les_wale"                    : 'LES (WALE)',
                       "tchen"                       : 'Tchen',
                       "q2-q12"                      : 'Q2-Q12',
                       "r2-q12"                      : 'R2-Q12',
                       "r2-r12-tchen"                : 'R2-R12 Tchen',
                       "separate_phase"              : 'separate phase',
                       "separate_phase_cond"         : 'separate phase cond',
                       "small_inclusions"            : 'small inclusions',
                       "large_inclusions"            : 'large inclusions',
                       "sgdh"                        : 'SGDH',
                       "ggdh"                        : 'GGDH'}

        self.dicoV2M= {"none"                        : 'none',
                       "mixing length"               : 'mixing_length',
                       "k-epsilon"                   : 'k-epsilon',
                       "Rij-epsilon SSG"             : 'rij-epsilon_ssg',
                       "Rij-epsilon EBRSM"           : 'rij-epsilon_ebrsm',
                       "k-epsilon linear production" : 'k-epsilon_linear_production',
                       "LES (Smagorinsky)"           : 'les_smagorinsky',
                       "LES (WALE)"                  : 'les_wale',
                       "Tchen"                       : 'tchen',
                       "Q2-Q12"                      : 'q2-q12',
                       "R2-Q12"                      : 'r2-q12',
                       "R2-R12 Tchen"                : 'r2-r12-tchen',
                       "separate phase"              : 'separate_phase',
                       "separate phase cond"         : 'separate_phase_cond',
                       "small inclusions"            : 'small_inclusions',
                       "large inclusions"            : 'large_inclusions',
                       "SGDH"                        : 'sgdh',
                       "GGDH"                        : 'ggdh'}


        # Validators
        validatorMix = DoubleValidator(self.lineEditMixingLength, min = 0.0)
        validatorMix.setExclusiveMin(False)
        self.lineEditMixingLength.setValidator(validatorMix)

        self.tableModelTurbulence = StandardItemModelTurbulence(self.mdl, self.case,
                                                                self.dicoM2V, self.dicoV2M)
        self.tableViewTurbulence.setModel(self.tableModelTurbulence)
        self.tableViewTurbulence.resizeColumnsToContents()
        self.tableViewTurbulence.resizeRowsToContents()
        if QT_API == "PYQT4":
            self.tableViewTurbulence.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
            self.tableViewTurbulence.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
            self.tableViewTurbulence.horizontalHeader().setResizeMode(0,QHeaderView.Stretch)
        elif QT_API == "PYQT5":
            self.tableViewTurbulence.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
            self.tableViewTurbulence.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
            self.tableViewTurbulence.horizontalHeader().setSectionResizeMode(0,QHeaderView.Stretch)
        self.tableViewTurbulence.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableViewTurbulence.setSelectionMode(QAbstractItemView.SingleSelection)

        delegateTurbulence = TurbulenceDelegate(self.tableViewTurbulence, self.mdl, self.dicoM2V, self.dicoV2M)
        delegateTurbFlux   = TurbFluxDelegate(self.tableViewTurbulence, self.mdl, self.dicoM2V, self.dicoV2M)
        delegateCoupling   = CouplingDelegate(self.tableViewTurbulence, self.mdl, self.dicoM2V, self.dicoV2M)
        self.tableViewTurbulence.setItemDelegateForColumn(2, delegateTurbulence)
        self.tableViewTurbulence.setItemDelegateForColumn(3, delegateTurbFlux)
        self.tableViewTurbulence.setItemDelegateForColumn(4, delegateCoupling)

        # Combo models
        self.modelContinuousCoupling = ComboModel(self.comboBoxContinuousCoupling, 3, 1)
        self.modelContinuousCoupling.addItem(self.tr('none'), 'none')
        self.modelContinuousCoupling.addItem(self.tr("separate phases"), "separate_phase")
        self.modelContinuousCoupling.addItem(self.tr("separate phases + cond"), "separate_phase_cond")

        # hide groupBoxMixingLength
        self.groupBoxMixingLength.hide()

        # Connect signals to slots
        self.tableModelTurbulence.dataChanged.connect(self.dataChanged)
        self.lineEditMixingLength.textChanged[str].connect(self.slotMixingLength)
        self.tableViewTurbulence.clicked.connect(self.slotChangeSelection)
        self.comboBoxContinuousCoupling.activated[str].connect(self.slotContinuousCoupling)

        # hide/show groupBoxContinuousCoupling
        if len(self.mdl.getContinuousFieldList()) >=2 :
            self.groupBoxContinuousCoupling.show()
            model = self.mdl.getContinuousCouplingModel()
            self.modelContinuousCoupling.setItem(str_model=model)
        else :
            self.groupBoxContinuousCoupling.hide()

        for fieldId in self.mdl.getFieldIdList():
            self.tableModelTurbulence.newItem(fieldId)

        self.case.undoStartGlobal()


    def slotChangeSelection(self, text=None):
        """
        detect change selection to update
        """
        row = self.tableViewTurbulence.currentIndex().row()
        self.update(row)


    def dataChanged(self, topLeft, bottomRight):
        self.tableViewTurbulence.resizeColumnsToContents()
        self.tableViewTurbulence.resizeRowsToContents()
        if QT_API == "PYQT4":
            self.tableViewTurbulence.horizontalHeader().setResizeMode(0,QHeaderView.Stretch)
        elif QT_API == "PYQT5":
            self.tableViewTurbulence.horizontalHeader().setSectionResizeMode(0,QHeaderView.Stretch)

        row = self.tableViewTurbulence.currentIndex().row()
        self.update(row)


    def update(self, row):
        """
        show groupBoxMixingLength if necessary
        """
        fieldId = row + 1
        if fieldId != 0:
            turbModel = self.mdl.getTurbulenceModel(fieldId)
            if turbModel == "mixing_length" :
                self.groupBoxMixingLength.show()
                self.lineEditMixingLength.setText(str(self.mdl.getMixingLength(fieldId)))
            else :
                self.groupBoxMixingLength.hide()
                # If the user chose GGDH for a RSM turbulence model, we set
                # the thermal fluxes model back to SGDH for consistency
                if 'rij-epsilon' not in turbModel and \
                        self.mdl.getThermalTurbulentFlux(fieldId) == 'ggdh':
                    self.mdl.setThermalTurbulentFlux(fieldId, 'sgdh')


    @pyqtSlot(str)
    def slotMixingLength(self, text):
        """
        Update the mixing length
        """
        fieldId = self.tableViewTurbulence.currentIndex().row() + 1
        if self.lineEditMixingLength.validator().state == QValidator.Acceptable:
            mix = from_qvariant(text, float)
            self.mdl.setMixingLength(fieldId, mix)


    @pyqtSlot(str)
    def slotContinuousCoupling(self, text):
        """
        define continuous/continuous coupling modele
        """
        value = self.modelContinuousCoupling.dicoV2M[text]
        log.debug("slotContinuousCoupling -> %s" % value)
        self.mdl.setContinuousCouplingModel(value)



#-------------------------------------------------------------------------------
# End
#-------------------------------------------------------------------------------