~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to gui/Pages/ThermalScalarModel.py

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: iso-8859-1 -*-
2
 
#
3
 
#-------------------------------------------------------------------------------
4
 
#
5
 
#     This file is part of the Code_Saturne User Interface, element of the
6
 
#     Code_Saturne CFD tool.
7
 
#
8
 
#     Copyright (C) 1998-2009 EDF S.A., France
9
 
#
10
 
#     contact: saturne-support@edf.fr
11
 
#
12
 
#     The Code_Saturne User Interface is free software; you can redistribute it
13
 
#     and/or modify it under the terms of the GNU General Public License
14
 
#     as published by the Free Software Foundation; either version 2 of
15
 
#     the License, or (at your option) any later version.
16
 
#
17
 
#     The Code_Saturne User Interface is distributed in the hope that it will be
18
 
#     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
19
 
#     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
#     GNU General Public License for more details.
21
 
#
22
 
#     You should have received a copy of the GNU General Public License
23
 
#     along with the Code_Saturne Kernel; if not, write to the
24
 
#     Free Software Foundation, Inc.,
25
 
#     51 Franklin St, Fifth Floor,
26
 
#     Boston, MA  02110-1301  USA
27
 
#
28
 
#-------------------------------------------------------------------------------
29
 
 
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
#-------------------------------------------------------------------------------
 
4
 
 
5
# This file is part of Code_Saturne, a general-purpose CFD tool.
 
6
#
 
7
# Copyright (C) 1998-2011 EDF S.A.
 
8
#
 
9
# This program is free software; you can redistribute it and/or modify it under
 
10
# the terms of the GNU General Public License as published by the Free Software
 
11
# Foundation; either version 2 of the License, or (at your option) any later
 
12
# version.
 
13
#
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
 
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
16
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
17
# details.
 
18
#
 
19
# You should have received a copy of the GNU General Public License along with
 
20
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
21
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
22
 
 
23
#-------------------------------------------------------------------------------
30
24
 
31
25
"""
32
26
This module defines the thermal scalar management.
51
45
import Base.Toolbox as Tool
52
46
from Base.XMLmodel import ModelTest
53
47
from Base.XMLvariables import Variables, Model
54
 
from DefineUserScalarsModel import DefineUserScalarsModel
55
 
from ThermalRadiationModel import ThermalRadiationModel
56
 
from ConjugateHeatTransferModel import ConjugateHeatTransferModel
 
48
from Pages.DefineUserScalarsModel import DefineUserScalarsModel
 
49
from Pages.ThermalRadiationModel import ThermalRadiationModel
 
50
from Pages.ConjugateHeatTransferModel import ConjugateHeatTransferModel
57
51
 
58
52
#-------------------------------------------------------------------------------
59
53
# Thermal scalar model class
110
104
        else:
111
105
            lab_def = node['label']
112
106
 
113
 
        self.setScalarInitialValue(self.defaultScalarValues()['zone'],
 
107
        self.setScalarInitialValue(self.defaultScalarValues()['zone_id'],
114
108
                                   lab_def,
115
109
                                   self.defaultScalarValues()[thermal_scalar])
116
110
        self.setScalarMinValue(lab_def, self.defaultScalarValues()['min_value'])
125
119
        Private method : remove node 'thermal_time_step' in time_parameters
126
120
        we call function from TimeStepModel
127
121
        """
128
 
        from TimeStepModel import TimeStepModel
 
122
        from Pages.TimeStepModel import TimeStepModel
129
123
        TimeStepModel(self.case).RemoveThermalTimeStepNode()
130
124
        del TimeStepModel
131
125
 
221
215
        mdl.setThermalModel('temperature_kelvin')
222
216
        doc = '''<additional_scalars>
223
217
                    <scalar label="TempK" name="temperature_kelvin" type="thermal">
224
 
                        <initial_value zone="1">293.15</initial_value>
 
218
                        <initial_value zone_id="1">293.15</initial_value>
225
219
                        <min_value>-1e+12</min_value>
226
220
                        <max_value>1e+12</max_value>
227
221
                    </scalar>
239
233
 
240
234
 
241
235
def runTest():
242
 
    print "ThermalScalarTestCase"
 
236
    print("ThermalScalarTestCase")
243
237
    runner = unittest.TextTestRunner()
244
238
    runner.run(suite())
245
239