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

« back to all changes in this revision

Viewing changes to include/base/cs_syr4_coupling.h

  • 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
 
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
#ifndef __CS_SYR4_COUPLING_H__
29
 
#define __CS_SYR4_COUPLING_H__
30
 
 
31
 
/*============================================================================
32
 
 * Syrthes 4 coupling
33
 
 *============================================================================*/
34
 
 
35
 
/*----------------------------------------------------------------------------
36
 
 * Standard C library headers
37
 
 *----------------------------------------------------------------------------*/
38
 
 
39
 
/*----------------------------------------------------------------------------
40
 
 * BFT library headers
41
 
 *----------------------------------------------------------------------------*/
42
 
 
43
 
/*----------------------------------------------------------------------------
44
 
 * FVM library headers
45
 
 *----------------------------------------------------------------------------*/
46
 
 
47
 
/*----------------------------------------------------------------------------
48
 
 * Local headers
49
 
 *----------------------------------------------------------------------------*/
50
 
 
51
 
#include "cs_base.h"
52
 
 
53
 
/*----------------------------------------------------------------------------*/
54
 
 
55
 
BEGIN_C_DECLS
56
 
 
57
 
/*=============================================================================
58
 
 * Local Macro Definitions
59
 
 *============================================================================*/
60
 
 
61
 
/*============================================================================
62
 
 * Structure definition
63
 
 *============================================================================*/
64
 
 
65
 
/* Structure associated to Syrthes coupling */
66
 
 
67
 
typedef struct _cs_syr4_coupling_t  cs_syr4_coupling_t;
68
 
 
69
 
/*============================================================================
70
 
 *  Global variables definition
71
 
 *============================================================================*/
72
 
 
73
 
/*============================================================================
74
 
 *  Public function prototypes for Fortran API
75
 
 *============================================================================*/
76
 
 
77
 
/*============================================================================
78
 
 * Public function definitions
79
 
 *============================================================================*/
80
 
 
81
 
/*----------------------------------------------------------------------------
82
 
 * Get number of SYRTHES couplings.
83
 
 *
84
 
 * returns:
85
 
 *   number of SYRTHES couplings
86
 
 *----------------------------------------------------------------------------*/
87
 
 
88
 
int
89
 
cs_syr4_coupling_n_couplings(void);
90
 
 
91
 
/*----------------------------------------------------------------------------
92
 
 * Get pointer to SYRTHES coupling.
93
 
 *
94
 
 * parameters:
95
 
 *   coupling_id <-- Id (0 to n-1) of SYRTHES coupling
96
 
 *
97
 
 * returns:
98
 
 *   pointer to SYRTHES coupling structure
99
 
 *----------------------------------------------------------------------------*/
100
 
 
101
 
cs_syr4_coupling_t *
102
 
cs_syr4_coupling_by_id(cs_int_t coupling_id);
103
 
 
104
 
/*----------------------------------------------------------------------------
105
 
 * Create a syr4_coupling_t structure.
106
 
 *
107
 
 * parameters:
108
 
 *   dim                <-- spatial mesh dimension
109
 
 *   ref_axis           <-- reference axis
110
 
 *   face_sel_criterion <-- criterion for selection of boundary faces
111
 
 *   cell_sel_criterion <-- criterion for selection of cells
112
 
 *   app_num            <-- SYRTHES application number, or -1
113
 
 *   app_name           <-- SYRTHES application name, or NULL
114
 
 *   verbosity          <-- verbosity level
115
 
 *----------------------------------------------------------------------------*/
116
 
 
117
 
void
118
 
cs_syr4_coupling_add(fvm_lnum_t   dim,
119
 
                     fvm_lnum_t   ref_axis,
120
 
                     const char  *face_sel_criterion,
121
 
                     const char  *cell_sel_criterion,
122
 
                     int          app_num,
123
 
                     const char  *app_name,
124
 
                     int          verbosity);
125
 
 
126
 
/*----------------------------------------------------------------------------
127
 
 * Destroy cs_syr4_coupling_t structures
128
 
 *----------------------------------------------------------------------------*/
129
 
 
130
 
void
131
 
cs_syr4_coupling_all_destroy(void);
132
 
 
133
 
/*----------------------------------------------------------------------------
134
 
 * Initialize communicator for SYRTHES coupling
135
 
 *
136
 
 * parameters:
137
 
 *   syr_coupling  <-> Syrthes coupling structure
138
 
 *   coupling_id   <-- id of this coupling (for log file message)
139
 
 *   syr_root_rank <-- SYRTHES root rank
140
 
 *   n_syr_ranks   <-- Number of ranks associated with SYRTHES
141
 
 *----------------------------------------------------------------------------*/
142
 
 
143
 
void
144
 
cs_syr4_coupling_init_comm(cs_syr4_coupling_t *syr_coupling,
145
 
                           int                 coupling_id,
146
 
                           int                 syr_root_rank,
147
 
                           int                 n_syr_ranks);
148
 
 
149
 
/*----------------------------------------------------------------------------
150
 
 * Exchange new iteration or stop message with SYRTHES.
151
 
 *
152
 
 * If nt_cur_abs < nt_max_abs, a new iteration message is sent;
153
 
 * otherwise, a stop message is sent. A corresponding message
154
 
 * is received, and if it is a stop message, nt_max_abs is
155
 
 * set to nt_cur_abs.
156
 
 *
157
 
 * parameters:
158
 
 *   nt_cur_abs <-- current iteration number
159
 
 *   nt_max_abs <-> maximum iteration number
160
 
 *----------------------------------------------------------------------------*/
161
 
 
162
 
void
163
 
cs_syr4_coupling_sync_iter(int   nt_cur_abs,
164
 
                           int  *nt_max_abs);
165
 
 
166
 
/*----------------------------------------------------------------------------
167
 
 * Synchronize new time step
168
 
 *
169
 
 * parameters:
170
 
 *   nt_cur_abs <-- current iteration number
171
 
 *   nt_max_abs --> maximum iteration number
172
 
 *----------------------------------------------------------------------------*/
173
 
 
174
 
void
175
 
cs_syr4_coupling_new_time_step(int  nt_cur_abs,
176
 
                               int  nt_max_abs);
177
 
 
178
 
/*----------------------------------------------------------------------------
179
 
 * Define coupled mesh and send it to SYRTHES
180
 
 *
181
 
 * parameters:
182
 
 *   syr_coupling <-- SYRTHES coupling structure
183
 
 *----------------------------------------------------------------------------*/
184
 
 
185
 
void
186
 
cs_syr4_coupling_init_mesh(cs_syr4_coupling_t  *syr_coupling);
187
 
 
188
 
/*----------------------------------------------------------------------------
189
 
 * Get number of associated coupled faces in main mesh
190
 
 *
191
 
 * parameters:
192
 
 *   syr_coupling <-- SYRTHES coupling structure
193
 
 *
194
 
 * returns:
195
 
 *   number of vertices in coupled mesh
196
 
 *----------------------------------------------------------------------------*/
197
 
 
198
 
fvm_lnum_t
199
 
cs_syr4_coupling_get_n_faces(const cs_syr4_coupling_t  *syr_coupling);
200
 
 
201
 
/*----------------------------------------------------------------------------
202
 
 * Get local numbering of coupled faces
203
 
 *
204
 
 * parameters:
205
 
 *   syr_coupling    <-- SYRTHES coupling structure
206
 
 *   coupl_face_list --> List of coupled faces (1 to n)
207
 
 *----------------------------------------------------------------------------*/
208
 
 
209
 
void
210
 
cs_syr4_coupling_get_face_list(const cs_syr4_coupling_t  *syr_coupling,
211
 
                               cs_int_t                   coupl_face_list[]);
212
 
 
213
 
/*----------------------------------------------------------------------------
214
 
 * Receive coupling variables from SYRTHES
215
 
 *
216
 
 * parameters:
217
 
 *   syr_coupling <-- SYRTHES coupling structure
218
 
 *   twall        --> wall temperature
219
 
 *----------------------------------------------------------------------------*/
220
 
 
221
 
void
222
 
cs_syr4_coupling_recv_twall(cs_syr4_coupling_t *syr_coupling,
223
 
                            cs_real_t           twall[]);
224
 
 
225
 
/*----------------------------------------------------------------------------
226
 
 * Send coupling variables to SYRTHES
227
 
 *
228
 
 * parameters:
229
 
 *   syr_coupling <-- SYRTHES coupling structure
230
 
 *   tf           <-- fluid temperature
231
 
 *   hwall        <-- wall heat exchange coefficient (numerical, not physical)
232
 
 *----------------------------------------------------------------------------*/
233
 
 
234
 
void
235
 
cs_syr4_coupling_send_tf_hwall(cs_syr4_coupling_t *syr_coupling,
236
 
                               cs_real_t           tf[],
237
 
                               cs_real_t           hwall[]);
238
 
 
239
 
/*----------------------------------------------------------------------------
240
 
 * Initialize post-processing of a SYRTHES coupling
241
 
 *
242
 
 * parameters:
243
 
 *   coupling_id --> Id of SYRTHES coupling
244
 
 *   writer_id   --> Id of associated writer
245
 
 *----------------------------------------------------------------------------*/
246
 
 
247
 
void
248
 
cs_syr4_coupling_post_init(int       coupling_id,
249
 
                           cs_int_t  writer_id);
250
 
 
251
 
/*----------------------------------------------------------------------------*/
252
 
 
253
 
END_C_DECLS
254
 
 
255
 
#endif /* __CS_SYR4_COUPLING_H__ */