]> SALOME platform Git repositories - modules/hydrosolver.git/blob - doc/advanced.rst
Salome HOME
Forcing True in eficas validation pending telemac corrections
[modules/hydrosolver.git] / doc / advanced.rst
1 ..
2    Copyright (C) 2012-2013 EDF
3
4    This file is part of SALOME HYDRO module.
5
6    SALOME HYDRO module is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10
11    SALOME HYDRO module is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
18
19
20 ####################
21 Advanced usage guide
22 ####################
23
24 Code coupling
25 =============
26
27 .. |run_coupling_button| image:: /_static/create_case_couplage.png
28    :align: middle
29
30 Salome-Hydro offers a service to run coupled Mascaret - Telemac2D cases. First,
31 you need to create a Mascaret case and a Telemac2D API case. Then, to set up
32 the coupling, click on the button |run_coupling_button|. A new dialog appears
33 (the *Eficas* interface) that let you choose the Mascaret and Telemac2D cases,
34 an output file for the coupling log and another one in CSV format for graph
35 generation. You must also specify a file to describe the coupling itself. This
36 file must be a Python file declaring several variables. Here is an example of
37 such a file::
38
39    # Time data
40    # Note that Telemac2D API can't use those values for now, so T2D case must be adapted manually
41    starttime = 0.0
42    endtime = 270300.0
43    timestep = 10.0
44    
45    # Tolerances for convergence iterations
46    eps_Q = 1.0
47    eps_Z = 0.01
48    
49    # Maximum number of convergence iterations
50    maxiter = 5
51    
52    # Border descriptions
53    upstream_border_mascaret = {"code": "MASCARET",
54                                "position": "upstream",
55                                "section_id": 40,
56                                "loi_id": 2}
57    
58    upstream_border_telemac = {"code": "TELEMAC2D",
59                               "position": "downstream",
60                               "points_id": (1, 30), # First point included, last point excluded
61                               "border_id": 1}
62    
63    downstream_border_telemac = {"code": "TELEMAC2D",
64                                 "position": "upstream",
65                                 "points_id": (139, 154), # First point included, last point excluded
66                                 "border_id": 3}
67    
68    downstream_border_mascaret = {"code": "MASCARET",
69                                  "position": "downstream",
70                                  "section_id": 41,
71                                  "loi_id": 3}
72    
73    barrage_border_telemac = {"code": "TELEMAC2D",
74                              "position": "upstream",
75                              "points_id": (82, 101), # First point included, last point excluded
76                              "border_id": 2}
77    
78    source_mascaret = {"code": "MASCARET",
79                       "position": "downstream",
80                       "section_id": 1,
81                       "loi_id": 1}
82    
83    aval_mascaret = {"code": "MASCARET",
84                     "position": "upstream",
85                     "section_id": 79,
86                     "loi_id": 4}
87    
88    borders = [{"name": "amont",
89                "model1": upstream_border_mascaret,
90                "model2": upstream_border_telemac},
91               {"name": "ecluse",
92                "model1": downstream_border_telemac,
93                "model2": downstream_border_mascaret},
94               {"name": "barrage",
95                "model1": barrage_border_telemac,
96                "model2": None},
97               {"name": "source",
98                "model1": source_mascaret,
99                "model2": None},
100               {"name": "aval",
101                "model1": aval_mascaret,
102                "model2": None}]
103
104 In this file, the coupling points (borders) are described by their two adjacent
105 models, represented by a Python dictionary. In this description, the parameter
106 "code" indicates which code is used on this side of the border (MASCARET or
107 TELEMAC2D). The parameter "position" indicates if it is on the upstream or
108 downstream side of the border.
109
110 The parameter "section_id" for MASCARET indicates the section identifiant of the
111 coupled point. The parameter "loi_id" for MASCARET indicates the identifiant of
112 the law used to set values on that point.
113
114 The parameter "points_id" for TELEMAC2D indicates the first and last point of
115 the border. The parameter "border_id" identifies the liquid boundary.
116
117 When all the desired files are selected, save this coupling description file. It
118 will appear in Salome object browser. Right-click on the item in the object
119 browser and select "Open schema in YACS" in the popup menu. YACS interface will
120 open and show the coupling schema. You can then launch the schema execution
121 directly in YACS (see YACS documentation for more information about launching
122 or editing the schema directly).
123
124 **Note**: In case of a crash or errors, check your */tmp* directory to find log
125 files.